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 


Cheat Engine Forum Index
PostGo back to topic
FreeER
Grandmaster Cheater Supreme
Reputation: 53
Joined: 09 Aug 2013
Posts: 1091

PostPosted: Sun Jan 14, 2018 4:21 pm    Post subject:

use
Code:
[ENABLE]
{$lua}
-- don't run when editing script
if syntaxcheck then return end
-- ignore hotkey stuff if not trigged by first hotkey
if not (memrec.HotkeyCount > 0 and memrec.Hotkey[0].Keys[1] and isKeyPressed(memrec.Hotkey[0].Keys[1])) then return end
local t = createTimer()
t.Interval = 100
t.OnTimer = function(t)
  -- sanity check to prevent errors
  if not (memrec.HotkeyCount > 0 and memrec.Hotkey[0].Keys[1]) then
    t.destroy()
    return
  end
  -- if key not pressed then disable script
  if not isKeyPressed(memrec.Hotkey[0].Keys[1]) then
    memrec.Active = false
    t.destroy()
  end
end
{$asm}

// ... whatever enable code

[DISABLE]

// ... whatever disable code


as your script and replace

"// ... whatever enable code" with whatever code you have for the enable section and "// ... whatever disable code " with whatever code you have for the disable section.
Back to top
View user's profile Send private message
Post reviews:   Approve 1
Author Review
ByTransient
Review: Approve
Post reference:
ReviewPosted: Thu Jan 20, 2022 4:48 am

Thanks masters
Back to top
View user's profile Send private message
Display:  
Cheat Engine Forum Index


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites