View previous topic :: View next topic |
Author |
Message |
bknight2602 Grandmaster Cheater Reputation: 0
Joined: 08 Oct 2012 Posts: 577
|
Posted: Sat Oct 15, 2016 10:30 am Post subject: Changing the value of an address |
|
|
I'm attempting to learn the object language and I'm trying to set an addresses value.
Code: | local AL = getAddressList();
if tonumber(addresslist_getMemoryRecordByDescription(AL, "Battle Byte").Value) == 32 then
addresslist_getMemoryRecordByDescription(AL, "After Battle Non Kill XP").Value = 1000
addresslist_getMemoryRecordByDescription(AL, "After Battle AP").Value = 100
end |
The value of tonumber(addresslist_getMemoryRecordByDescription(AL, "Battle Byte").Value) is 32 as a print statement indicated.
But I get an error message when the other statements are executed.
Error:Invalid integer
What code changes do I need to the values?
EDIT: I was doing the checking with the debug window, now after commenting out the middles two statements I still get an invalid integer so the if statement is incorrect also.
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sat Oct 15, 2016 1:34 pm Post subject: |
|
|
I copied your code exactly how it is. Worked just fine. Your error is elsewhere.
|
|
Back to top |
|
|
bknight2602 Grandmaster Cheater Reputation: 0
Joined: 08 Oct 2012 Posts: 577
|
Posted: Sun Oct 16, 2016 4:19 am Post subject: |
|
|
Yes, there was an incorrect reference earlier in the code producing a nil. Fixed that and it works, thanks.
|
|
Back to top |
|
|
|