|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
federan How do I cheat? Reputation: 0
Joined: 25 Jan 2011 Posts: 3 Location: ARGENTINA
|
Posted: Mon Dec 17, 2012 12:34 am Post subject: Need help making a trainer with hotkeys and writeInteger |
|
|
Hello and first of all thanks!
This is my first attempt of making a trainer so I'm a newbie here.
Code: | function CEButton1Click(sender)
if tonumber(getProperty(CETrainer_MaxCapBox,"Text")) > 30 then
setProperty(CETrainer_MaxCapBox,"Text","30")
end
memoryrecord_setValue(memrec4, getProperty(CETrainer_MaxCapBox,"Text"))
end
createHotkey(book0, VK_1)
createHotkey(book1, VK_2)
createHotkey(book2, VK_3)
createHotkey(book3, VK_4)
createHotkey(book4, VK_5)
createHotkey(book5, VK_6)
createHotkey(book6, VK_7)
function book0()
writeInteger("00CE8D64",0)
end
function book1()
writeInteger("00CE8D64",1)
end
function book2()
writeInteger("00CE8D64",2)
end
function book3()
writeInteger("00CE8D64",3)
end
function book4()
writeInteger("00CE8D64",4)
end
function book5()
writeInteger("00CE8D64",5)
end
function book6()
writeInteger("00CE8D64",6)
end
function book7()
writeInteger("00CE8D64",7)
end |
The button and the self-generated code with hotkeys works awesome, but the hotkeys I added works only with CE opened and returns "Error:attempt to call a nil value". If I save the trainer as .exe, the hotkeys doesn't work and it returns "Error:attempt to call a nil value".
I made prints to track the error and the book functions seems to not be called.
Thank you so much again!
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Mon Dec 17, 2012 5:58 am Post subject: |
|
|
use this
Code: |
function book0()
writeInteger("00CE8D64",0)
end
createHotkey(book0, VK_1)
function book1()
writeInteger("00CE8D64",1)
end
createHotkey(book1, VK_2)
function book2()
writeInteger("00CE8D64",2)
end
createHotkey(book2, VK_3)
function book3()
writeInteger("00CE8D64",3)
end
createHotkey(book3, VK_4)
function book4()
writeInteger("00CE8D64",4)
end
createHotkey(book4, VK_5)
function book5()
writeInteger("00CE8D64",5)
end
createHotkey(book5, VK_6)
function book6()
writeInteger("00CE8D64",6)
end
createHotkey(book6, VK_7)
function book7()
writeInteger("00CE8D64",7)
end
createHotkey(book7, VK_8)
|
you also forgot to create hotkey for book 7 so I added it for you
_________________
|
|
Back to top |
|
|
federan How do I cheat? Reputation: 0
Joined: 25 Jan 2011 Posts: 3 Location: ARGENTINA
|
Posted: Mon Dec 17, 2012 9:33 am Post subject: |
|
|
Ah lol, that was because I was calling functions that were nil. I understand now thank you so much!
There was a problem also with writeInteger, but I changed the address to "game.exe+offset" and got it working.
Thank you so much again for the help!
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Mon Dec 17, 2012 9:41 am Post subject: |
|
|
no problem mate .
_________________
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|