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 


CT Script -> Trainer Checkbox

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Derpicus
Newbie cheater
Reputation: 1

Joined: 30 Mar 2016
Posts: 15

PostPosted: Wed Mar 30, 2016 8:49 pm    Post subject: CT Script -> Trainer Checkbox Reply with quote

I've manually designed a trainer and have working scripts; the question is how to assign the scripts to a checkbox OnChange event.

Code:

[Enable]
alloc(skill_id_hook,128)
label(skill_id_return)
alloc(delay,4)
define(skill_id, #142120030)

delay:
dw 0
016FE8B7:
db 90 90 90 90 90 90
016FE8C3:
db 90 90 90 90 90 90
016FE91B:
db 90 E9
016FEA10:
jmp skill_id_hook
nop
skill_id_return:
skill_id_hook:
inc [delay]
cmp dword ptr [delay], #1
jne skill_id_return
mov [delay], 0
mov edx,skill_id
jmp skill_id_return
016FEAAA:
db 90 90 90 90 90 90
016FEAB7:
jmp 016FEAEB
dw 9090

[Disable]
016FE8B7:
db 0F 84 DE 02 00 00
016FE8C3:
db 0F 88 D2 02 00 00
016FE91B:
db 0F 84 CB 00 00 00
016FEA10:
mov edx,[esi+0000D264]
016FEAAA:
db 0F 87 E3 00 00 00
016FEAB7:
jmp dword ptr [ecx*4+016FEBA4]
dealloc(skill_id_hook)


Hotkeys are not acceptable for this trainer; is there a way to use the CT scripts from a checkbox in a trainer? I've looked up guides on converting scripts to LUA and couldn't find anything substantial, aside from 2-3 line basics. If you can point me in the right direction or convert this ... all of my other scripts use the above lines. I'm really wanting to learn, so please point me in the right direction. Thanks Smile And if there's a way to just use the scripts from the CT without converting them ... that's even better!
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Wed Mar 30, 2016 9:37 pm    Post subject: Reply with quote

Code:
function CheckBoxOnChange(sender)
  getAddressList().getMemoryRecordByDescription("Script Description").Active = sender.Checked
end
Back to top
View user's profile Send private message
Derpicus
Newbie cheater
Reputation: 1

Joined: 30 Mar 2016
Posts: 15

PostPosted: Wed Mar 30, 2016 9:48 pm    Post subject: Reply with quote

Zanzer wrote:
Code:
function CheckBoxOnChange(sender)
  getAddressList().getMemoryRecordByDescription("Script Description").Active = sender.Checked
end

You are a literal saint; thank you SO much for your help! Do you have any suggestions for me to learn to convert things like this to Lua? Even though I have a resolution, thanks to you, I'd love to learn to convert things like this. Much love, though, man; you have no idea how happy I am rn.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Wed Mar 30, 2016 10:43 pm    Post subject: Reply with quote

Code:

enable_mycheat = [[
alloc(skill_id_hook,128)
label(skill_id_return)
alloc(delay,4)
define(skill_id, #142120030)

delay:
dw 0
016FE8B7:
db 90 90 90 90 90 90
016FE8C3:
db 90 90 90 90 90 90
016FE91B:
db 90 E9
016FEA10:
jmp skill_id_hook
nop
skill_id_return:
skill_id_hook:
inc [delay]
cmp dword ptr [delay], #1
jne skill_id_return
mov [delay], 0
mov edx,skill_id
jmp skill_id_return
016FEAAA:
db 90 90 90 90 90 90
016FEAB7:
jmp 016FEAEB
dw 9090
]]

disable_mycheat = [[
016FE8B7:
db 0F 84 DE 02 00 00
016FE8C3:
db 0F 88 D2 02 00 00
016FE91B:
db 0F 84 CB 00 00 00
016FEA10:
mov edx,[esi+0000D264]
016FEAAA:
db 0F 87 E3 00 00 00
016FEAB7:
jmp dword ptr [ecx*4+016FEBA4]
dealloc(skill_id_hook)
]]

function CheckBoxOnChange(sender)
  if sender.Checked then
    autoAssemble(enable_mycheat)
  else
    autoAssemble(diasble_mycheat)
  end
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