Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help! Error executing Trainer

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
stalker12555
How do I cheat?
Reputation: 0

Joined: 13 Jul 2013
Posts: 2
Location: Russian

PostPosted: Sat Jul 13, 2013 3:16 am    Post subject: Help! Error executing Trainer Reply with quote

Help!
Error executing Trainer:
Error:[string "function CEButton1Click(sender)..."]:3: attempt to call global 'getProcessIDFormProcessName' (a nil value)
Here's the code:
function CEButton1Click(sender)
if (getProcessIDFromProcessName("GAME.exe")==nil) then
beep()
ShowMessage("NOT GAME!!!")
return end
showMessage("OK?")
game='GAME.exe'
openProcess(game)
results=AOBScan("?? 00 00 03 0E 00 E0 ?? 00 01","+W-C-X")
Count=stringlist_getCount(results)
for i=0, (Count-1), 1 do
adress=stringlist_getString(results,i)
writeInteger(adress,99999)
end
end

and error -
[ error ]access
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Sat Jul 13, 2013 4:32 am    Post subject: Reply with quote

Weird, getProcessIDFormProcessName is working in 6.3
Are you sure you didn't override that function yourself ?

Some tips about the rest of the code:

Code:

ShowMessage("NOT GAME!!!")

should be
Code:

showMessage("NOT GAME!!!")


AOBScan does not take a second parameter for protection, it scans everything (use a memscan object to be able tp specify specific stuff)
so instead of
Code:

results=AOBScan("?? 00 00 03 0E 00 E0 ?? 00 01","+W-C-X")

do
Code:

results=AOBScan("?? 00 00 03 0E 00 E0 ?? 00 01")

(and it returns nil if nothing found, so check that



Also a tip, do not generate trainers until the trainer is working. It saves a lot of time. So just execute the lua script in ce, (as a normal ct, not cetrainer or .exe) and then each time an error pops up, edit the lua script and press execute so the changes get applied
and another tip,

_________________
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
View user's profile Send private message MSN Messenger
stalker12555
How do I cheat?
Reputation: 0

Joined: 13 Jul 2013
Posts: 2
Location: Russian

PostPosted: Sat Jul 13, 2013 8:41 am    Post subject: Help! Error executing Trainer Reply with quote

[quote="Dark Byte"]
Thanks but there was one error:

Error:Access violation

[/quote]

_________________
My skype : stalker12555
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites