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 


How to make a auto assemble script activate when I togglebox

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
The Dab
Cheater
Reputation: 0

Joined: 22 May 2017
Posts: 33

PostPosted: Tue Jul 11, 2017 1:44 pm    Post subject: How to make a auto assemble script activate when I togglebox Reply with quote

Been having problems with this recently. The script works when I toggle it from the cheat table. However then when I use something like this it does not work,

Code:

form_show(UDF1)
getAutoAttachList().add("Pinball.exe")

function CloseClick()
  closeCE()
  return caFree
end

UDF1.OnClose = CloseClick

addresslist=getAddressList()

function CEToggleBox1Change(sender)
  if (checkbox_getState(UDF1.CEToggleBox1) == 1) then
autoAssemble([[
aobscan(ball,83 86 74 01 00 00 01) // should be unique
alloc(newmem,$1000,7FF9C417C783)

label(code)
label(return)

newmem:

code:
  //add dword ptr [rsi+00000174],01
  jmp return

ball:
  jmp newmem
  nop
  nop
return:
registersymbol(ball)
]])
  else
autoAssemble([[
ball:
  db 83 86 74 01 00 00 01

unregistersymbol(ball)
dealloc(newmem)

]])
  end
end


This script should make the value of "balls" to freeze, however it does not do that. Is there anything wrong with this script that I am missing?
Back to top
View user's profile Send private message
KalasDev
Master Cheater
Reputation: 1

Joined: 29 May 2016
Posts: 311

PostPosted: Tue Jul 11, 2017 3:00 pm    Post subject: Reply with quote

I use this actually:

local tag = sender.Tag;
if (tag == 0) then
sender.Tag = 1;
autoAssemble([[//enable script]])
else
sender.Tag = 0
autoAssemble([[//disable script]])
end

Code:
local tag = sender.Tag;
   if (tag == 0) then
      sender.Tag = 1;
      autoAssemble([[
         aobscan(ball,83 86 74 01 00 00 01) // should be unique
alloc(newmem,$1000,7FF9C417C783)

label(code)
label(return)

newmem:

code:
  //add dword ptr [rsi+00000174],01
  jmp return

ball:
  jmp newmem
  nop
  nop
return:
registersymbol(ball)
]])
   else
      sender.Tag = 0
      autoAssemble([[
         ball:
  db 83 86 74 01 00 00 01

unregistersymbol(ball)
dealloc(newmem)
]])
   end
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