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 


Hello :) I need small help ;)

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

Joined: 06 Oct 2015
Posts: 9

PostPosted: Tue Oct 06, 2015 6:09 pm    Post subject: Hello :) I need small help ;) Reply with quote

Hello everyone

I'd like to get small help in Lua scripting Smile

I need 2 things,

1st. Add hotkeys for my cheatboxes


for example this is my function for one cheatbox and just I would like to turn on/off by same hotkey, for button I used createHotkey(WallhackClick, VK_PRIOR) but for my cheatbox it doesn't work.
Code:
function MyExample(sender)
 memrec=addresslist_getMemoryRecordByDescription(getAddressList(), "ExampleAddress")
 if checkbox_getState(sender)== 1 then
    memoryrecord_setValue(memrec, 850)
  else
    memoryrecord_setValue(memrec, memoryrecord_getValue(addresslist_getMemoryRecordByDescription(getAddressList(), "2ndAddress")))
  end
end


and 2nd thing is...

Original cheat engine Freeze interval is 100, we can change it to 1 but I need much faster,
Is able to use Lua script to make faster freeze Interval for one address from cheat table? Or use freeze interval based on max CPU's speed? I just need script for enable one address with the best freeze interval which I can get.
Thank you for helping Smile
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Oct 06, 2015 6:56 pm    Post subject: Reply with quote

It sounds like your createHotkey is simply executing WallhackClick.
It does not actually check the box. You would need to do something like:
Code:
checkboxname.Checked = not checkboxname.Checked

As for faster freezing than 1 millisecond...
You can try creating multiple timers and having each one of them updating your value.
Although I don't know if CE actually uses a thread for each one. So multiples may not help.
/shrug
Back to top
View user's profile Send private message
bosman88
How do I cheat?
Reputation: 0

Joined: 06 Oct 2015
Posts: 9

PostPosted: Wed Oct 07, 2015 10:18 am    Post subject: Reply with quote

Zanzer wrote:
It sounds like your createHotkey is simply executing WallhackClick.
It does not actually check the box. You would need to do something like:
Code:
checkboxname.Checked = not checkboxname.Checked

As for faster freezing than 1 millisecond...
You can try creating multiple timers and having each one of them updating your value.
Although I don't know if CE actually uses a thread for each one. So multiples may not help.
/shrug


Well, I made new funtion for cheatbox of "GateHack" and named GateKey added change state of that cheatbox to enable when click hotkey
and my cheatbox got enabled but didn't do his function,

I made this script

Code:
function GateKey(sender)
  setProperty(MyForm_GateHack,"State",1)
end
createHotkey(GateKey, VK_HOME)


Multiples ofc should work but I'm wondering if is any script to use max freezeinterval as my PC can do.
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 Oct 07, 2015 6:15 pm    Post subject: Reply with quote

Code:
function GateHackOnClick()
  local memrec=addresslist_getMemoryRecordByDescription(getAddressList(), "ExampleAddress")
  local value = 850
  if checkbox_getState(MyForm_GateHack) ~= 1 then
    value = memoryrecord_getValue(addresslist_getMemoryRecordByDescription(getAddressList(), "2ndAddress"))
  end
  memoryrecord_setValue(memrec, value)
end

function GateKey(sender)
  MyForm_GateHack.Checked = not MyForm_GateHack.Checked
  GateHackOnClick()
end
createHotkey(GateKey, VK_HOME)
Back to top
View user's profile Send private message
bosman88
How do I cheat?
Reputation: 0

Joined: 06 Oct 2015
Posts: 9

PostPosted: Thu Oct 08, 2015 9:55 am    Post subject: Reply with quote

Zanzer wrote:
Code:
function GateHackOnClick()
  local memrec=addresslist_getMemoryRecordByDescription(getAddressList(), "ExampleAddress")
  local value = 850
  if checkbox_getState(MyForm_GateHack) ~= 1 then
    value = memoryrecord_getValue(addresslist_getMemoryRecordByDescription(getAddressList(), "2ndAddress"))
  end
  memoryrecord_setValue(memrec, value)
end

function GateKey(sender)
  MyForm_GateHack.Checked = not MyForm_GateHack.Checked
  GateHackOnClick()
end
createHotkey(GateKey, VK_HOME)


Thank you, it works Smile Now I can add hotkeys hehe Smile Thank you again
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