| View previous topic :: View next topic |
| Author |
Message |
TheyCallMeTim13 Wiki Contributor
Reputation: 51
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Sat Feb 26, 2022 12:07 pm Post subject: |
|
|
The error is somewhere else, since "expvalue = tonumber(CheatPanel.CEEdit1.Text)" didn't throw an error the problem is somewhere else in your code.
_________________
|
|
| Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Sat Feb 26, 2022 12:35 pm Post subject: |
|
|
| TheyCallMeTim13 wrote: | | The error is somewhere else, since "expvalue = tonumber(CheatPanel.CEEdit1.Text)" didn't throw an error the problem is somewhere else in your code. |
You know that's one reason I opened the thread, but where?
I have been experimenting.
| Code: |
print("Before first function");
function FormShow(sender)
print("After first function");
--form_show(CheatPanel);
--
t = createTimer(nil, true);
timer_onTimer(t, MaxHP)
timer_setInterval(t, 500)--checks every 500 milliseconds
timer_setEnabled(t, false)
print("God Mode is not enabled"); |
With form_show(CheatPanel); within the first function the CheatPanel doesn't show, but when I put that line outside the first function Cheat panel shows up. In both cases "God Mode is not enabled" isn't printed. The Before first function is the only print output. In that case it seems like the "whole" code isn't run, but why?
|
|
| Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
|
| Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Sun Feb 27, 2022 7:25 am Post subject: |
|
|
Nice but no instructions on how to get the code to read and digest my code.
ETA: As posted in the linked thread, the code creates a button on the debug window. After pushing it, the code seems to be in an undefined loop and outputs no useful information to me. Nice try to help. Thanks
|
|
| Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Sun Feb 27, 2022 8:17 pm Post subject: |
|
|
Back to the first topic. I think you need declare or state the variables first.
i.e :
| Code: | local expvalue, value
local txt = 10 -- simulated edit box value
function CEButton1Click()
if tonumber(txt) ~= nil then
value = tonumber(txt);
print(value)
end
expvalue = value;
print("The experience entered " .. tostring(expvalue));
end
CEButton1Click() |
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
| Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Mon Feb 28, 2022 8:26 am Post subject: |
|
|
| Corroder wrote: | Back to the first topic. I think you need declare or state the variables first.
i.e :
| Code: | local expvalue, value
local txt = 10 -- simulated edit box value
function CEButton1Click()
if tonumber(txt) ~= nil then
value = tonumber(txt);
print(value)
end
expvalue = value;
print("The experience entered " .. tostring(expvalue));
end
CEButton1Click() |
|
That is a new one for me. I know you need to place a function prior to any call to/for that function. DB 101.
|
|
| Back to top |
|
 |
|