View previous topic :: View next topic |
Author |
Message |
empirebattles How do I cheat?
Reputation: 0
Joined: 13 May 2009 Posts: 7
|
Posted: Sat Sep 15, 2012 6:18 pm Post subject: Trainer Access Violation |
|
|
I'm working on a trainer (first one), and for some reason, when i'm using a button to call a hotkey (eg memrec5_hotkey0 ...but no keypress assigned), its giving me "Error:Access violation".
However, if i assign an actual key to it, and press that key, the modifications occur correctly.
What are the places i need to look in order to try and troubleshoot this? (I'm assuming it has to do with the button not properly calling the hotkey)
My current example is as such (button name is 'Freeze'):
Code: | function FreezeClick(sender)
memoryrecordhotkey_doHotkey(memrec0_hotkey0)
end |
If my understanding is correct, that should initiate the first hotkey in my list, as though a button were pressed... but, its giving access violation.
If i assign a key to the hotkey, the button performs correctly.
Yeah, i'm new to this, so bear with me
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25803 Location: The netherlands
|
Posted: Sat Sep 15, 2012 8:16 pm Post subject: |
|
|
At the time when FreezeClick is executed, has memrec0_hotkey0 been defined ? (it's not automatically defined, you need to initialize it yourself)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
empirebattles How do I cheat?
Reputation: 0
Joined: 13 May 2009 Posts: 7
|
Posted: Sun Sep 16, 2012 4:10 am Post subject: |
|
|
Yeah... i had thought that too, but somethin seemed to be off...
at the top of the lua scripit for the trainer, i have added:
Code: | addresslist=getAddressList()
memrec0=addresslist_getMemoryRecordByID(addresslist,0)
memrec0_hotkey0=memoryrecord_getHotkeyByID(memrec0,0) |
However, now, when i launch the trainer, it gives the "Error:Access violation
", error, and the process never visually launches (no window open), but the process is still displayed in Task Manager.
[/code]
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25803 Location: The netherlands
|
Posted: Sun Sep 16, 2012 4:31 am Post subject: |
|
|
Are you sure the id's are 0 ?
The id is a value that increases with each new entry and does not decrease when you delete an entry
Same for the hotkey id.
Easiest method to find out the id's is by copy/pasting the entry and check the <id></id> parts for the entry and hotkey.
Alternatively
use addresslist_getMemoryRecord(al,index) where index does count from 0+
or
addresslist_getMemoryRecordByDescription(al, description)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
empirebattles How do I cheat?
Reputation: 0
Joined: 13 May 2009 Posts: 7
|
Posted: Sun Sep 16, 2012 4:36 am Post subject: |
|
|
Yeah, when i'm lookin at the hotkey, in the bottom right corner, it shows 'ID=0' or 'ID=1'.
I'll go ahead and try the addresslist_getMemoryRecordByDescription(al, description)
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25803 Location: The netherlands
|
Posted: Sun Sep 16, 2012 4:37 am Post subject: |
|
|
Also, test by running the script in the lua engine window
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
empirebattles How do I cheat?
Reputation: 0
Joined: 13 May 2009 Posts: 7
|
Posted: Sun Sep 16, 2012 5:12 am Post subject: |
|
|
Alright, by process of elimination. i've found that by attempting to define memrec0_hotkey0, by one of the following methods, its giving me access errors.:
Code: | memrec0_hotkey0=memoryrecord_getHotkeyByID(memrec0,0) |
or
("00"is the description for the hotkey)
Code: | memrec0_hotkey0=addresslist_getMemoryRecordByDescription(memrec0,"00") |
So, in last attempt, i finally got the Memory record this way:
Code: | addresslist_getMemoryRecord(addresslist,index) |
An whala... it worked
so i was prolly looking at the index instead of the ID
Thanks for your help !
|
|
Back to top |
|
 |
|