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 


executing a chunk of auto assemble script

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

Joined: 24 Nov 2021
Posts: 1
Location: awd

PostPosted: Wed Nov 24, 2021 10:28 am    Post subject: executing a chunk of auto assemble script Reply with quote

So I'm very new to programming in cheat engine and have no idea how to do this.

I want a button that enables / disables this auto assemble script. Its supposed to be a speedhack.

But whenever i try to save it, it will give me an error saying;

[string "function CETrainer_CEImage1Click(sender).."]:2: unexpected symbol near '['



Screenshot_29.png
 Description:
Please note that I'm a beginner and have no idea how any of these things work.
 Filesize:  24.83 KB
 Viewed:  334 Time(s)

Screenshot_29.png



_________________
awd
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Csimbi
I post too much
Reputation: 82

Joined: 14 Jul 2007
Posts: 2834

PostPosted: Wed Nov 24, 2021 11:32 am    Post subject: Reply with quote

Look into memrec.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 419

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

PostPosted: Wed Nov 24, 2021 11:38 am    Post subject: Reply with quote

or autoAssemble()
_________________
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
ParkourPenguin
I post too much
Reputation: 97

Joined: 06 Jul 2014
Posts: 3129

PostPosted: Wed Nov 24, 2021 12:50 pm    Post subject: Reply with quote

Code:
local script = [[
{$lua}
if syntaxcheck then return end
[ENABLE]
print'enabled'
[DISABLE]
print'disabled'
]]
local disableinfo

function toggleScript()
  local success, enabled = false, disableinfo == nil
  success,disableinfo = autoAssemble(script, disableinfo)
  if not success then
    local msg = disableinfo
    disableinfo = nil
    error(msg or 'Could not toggle the script')
  end
  if not enabled then
    -- successfully disabled the script
    disableinfo = nil
  end
end

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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