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 


Problem with lua

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

Joined: 07 Oct 2016
Posts: 4

PostPosted: Fri Oct 07, 2016 6:53 am    Post subject: Problem with lua Reply with quote

Hello i have a problem with compile my .lua to .exe

It is the script it works fine but only when i execute this in cheat engine and when i open the process in the cheat engine.

I want to compile it to .exe but the problem is the .exe file not works and give me a massage "Error:Failure determinating what Game.exe means.
How can i fix it?? It just work in cheat engine if i show him a process but i want to it works singly in .exe file.

Code:

local baseAddress = getAddress("Game.exe")
local lightValue = { 0xFF, 0xD7 }
local creaturePtrAddress = baseAddress + 0x00579A68
local lightOffset = 0xA4
local torchAddress = baseAddress + 0xDF336
local floorChangeAddress = baseAddress + 0xE5B76
local opcode = { 0x66, 0xB8, 0xFF, 0xD7 }
writeBytes(torchAddress, opcode)
writeBytes(floorChangeAddress, opcode)
local creaturePtr = readInteger(creaturePtrAddress)
if (creaturePtr and creaturePtr ~= 0) then
   local lightAddress = creaturePtr + lightOffset
   writeBytes(lightAddress, lightValue)
end


Last edited by Kartagino on Fri Oct 07, 2016 2:37 pm; edited 1 time in total
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Oct 07, 2016 7:32 am    Post subject: Reply with quote

You can't execute the script until CE has attached to the process.
http://forum.cheatengine.org/viewtopic.php?p=5691420#5691420
Back to top
View user's profile Send private message
Kartagino
How do I cheat?
Reputation: 0

Joined: 07 Oct 2016
Posts: 4

PostPosted: Fri Oct 07, 2016 7:49 am    Post subject: Reply with quote

Sorry but i am a really newbie in lua. can you help me and edit my script to get works of course if it is possible. I don't know how i can attach process in script.
And don't understand post witch u send me to link. I mean i can see what u said to him buy don't know how can i edit this to attach my Game.exe
Please
Back to top
View user's profile Send private message
usernotfound
Expert Cheater
Reputation: 0

Joined: 21 Feb 2016
Posts: 115

PostPosted: Fri Oct 07, 2016 2:16 pm    Post subject: Reply with quote

Code:
getAutoAttachList().add("nameofyourgame.exe")
Back to top
View user's profile Send private message
Kartagino
How do I cheat?
Reputation: 0

Joined: 07 Oct 2016
Posts: 4

PostPosted: Fri Oct 07, 2016 2:36 pm    Post subject: Reply with quote

The same think.
"Error:Failure determinating what Game.exe means."
Even if i add
Code:
getAutoAttachList().add("nameofyourgame.exe")
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Oct 07, 2016 2:59 pm    Post subject: Reply with quote

Code:

openProcess("game.exe")
reinitializeSymbolhandler(true)

_________________
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
Kartagino
How do I cheat?
Reputation: 0

Joined: 07 Oct 2016
Posts: 4

PostPosted: Fri Oct 07, 2016 4:42 pm    Post subject: Reply with quote

There is the same error i tried both thing but nothing works thats why i ask to u for help. ;(

Wait it work now !!! Thanks a lot !!
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