View previous topic :: View next topic |
Author |
Message |
bknight2602 Grandmaster Cheater Reputation: 0
Joined: 08 Oct 2012 Posts: 577
|
Posted: Sat Jul 19, 2014 11:46 am Post subject: Timer issue |
|
|
Using a timer with 6.3 with the following code. Code: | tAP = createTimer(nil, true)
timer_onTimer(tAP, ConstAP)
timer_setInterval(tAP, 500)
timer_setEnabled(tAP, false) |
Further down in the code Code: | function ConstAP(sender)
local addresslist = getAddressList()
APvalue = tonumber(control_getCaption(CheatPanel_CEEdit1))
APaddress = addresslist_getMemoryRecordByDescription(addresslist, "AP Rec From Battle")
AP = memoryrecord_getValue(APaddress)
memoryrecord_setValue(APaddress, APvalue)
end
function CECheckbox3Click(sender)
boxstateAP = checkbox_getState(CheatPanel_CECheckbox3)
if boxstateAP == cbChecked then
timer_setEnabled(tAP, true)
print("The AP timer is enabled")
form_show(CheatPanel_CEPanel1)
form_show(CheatPanel_CEEdit1)
else
timer_setEnabled(tAP, false)
print("The AP timer is not enabled")
form_hide(CheatPanel_CEPanel1)
form_hide(CheatPanel_CEEdit1)
edit_clear(CheatPanel_CEEdit1)
end
end |
The process was to make an edit box visible then input a value and that value carried into the rest of the code. This used to work in 6.2, but now in 9.3, I get an error message Error:Invalid integer. I'm assuming that the error indicates that no entry is in the edit box.
What code steps do I need to add/edit to make the process work again?
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Sat Jul 19, 2014 12:32 pm Post subject: |
|
|
Code: | function ConstAP(sender)
APvalue = tonumber(CheatPanel_CEEdit1.Text);
if (APvalue) then
local entry = getAddressList().getMemoryRecordByDescription("AP Rec From Battle");
AP = entry.value;
entry.value = APvalue;
end
end |
_________________
|
|
Back to top |
|
|
bknight2602 Grandmaster Cheater Reputation: 0
Joined: 08 Oct 2012 Posts: 577
|
Posted: Sat Jul 19, 2014 1:49 pm Post subject: |
|
|
Code: | AP = entry.value;
entry.value = APvalue; |
Seems recursive to me, but it does work.
Thanks
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Sat Jul 19, 2014 2:29 pm Post subject: |
|
|
bknight2602 wrote: | Code: | AP = entry.value;
entry.value = APvalue; |
Seems recursive to me, but it does work.
Thanks |
You defined AP in your script as the entry value, so I added it incase you use it in the script.
_________________
|
|
Back to top |
|
|
|