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 


Need help for a toggle on/off please

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

Joined: 01 Apr 2019
Posts: 1

PostPosted: Mon Apr 01, 2019 8:45 pm    Post subject: Need help for a toggle on/off please Reply with quote

Iv setup a shadow map resolution to be increased to 4096 using the (Set Value to) option which works fine when i press F1 key, however id like to know where/what to put in this lua script to make the F1 key toggle the cheat on and off, iv tried all sorts and dont understand it, switches on fine but i cant put the game back to normal unless i fully exit the game

when i set a f2 option and set value to 1024 shadow res which is default res, when i moved ingame the shadows moved with me as if they were now static, so it prob best to have a way to just enable and disable with the F1 key

Im very noob at this so hope i explained enough of what im looking for
my script:


PROCESS_NAME = 'AssassinsCreedIIGame.exe'
--------
-------- Auto Attach
--------
local autoAttachTimer = nil ---- variable to hold timer object
local autoAttachTimerInterval = 1000 ---- Timer intervals are in milliseconds
local autoAttachTimerTicks = 0 ---- variable to count number of times the timer has run
local autoAttachTimerTickMax = 5000 ---- Set to zero to disable ticks max
local function autoAttachTimer_tick(timer) ---- Timer tick call back
---- Destroy timer if max ticks is reached
if autoAttachTimerTickMax > 0 and autoAttachTimerTicks >= autoAttachTimerTickMax then
timer.destroy()
end
---- Check if process is running
if getProcessIDFromProcessName(PROCESS_NAME) ~= nil then
timer.destroy() ---- Destroy timer
openProcess(PROCESS_NAME) ---- Open the process
end
autoAttachTimerTicks = autoAttachTimerTicks + 1 ---- Increase ticks
end
autoAttachTimer = createTimer(getMainForm()) ---- Create timer with the main form as it's parent
autoAttachTimer.Interval = autoAttachTimerInterval ---- Set timer interval
autoAttachTimer.OnTimer = autoAttachTimer_tick ---- Set timer tick call back
--TRAINERGENERATORSTART--
--This is autogenerated code. Changing code in this block will
--get erased and rewritten if you regenerate the trainer code

--Uncomment the following line if this is a Cheat Table format trainer and you don't want CE to show (Tip, save as .CETRAINER alternatively)
--hideAllCEWindows()

RequiredCEVersion=6.83
if (getCEVersion==nil) or (getCEVersion()<RequiredCEVersion) then
messageDialog('Please install Cheat Engine '..RequiredCEVersion, mtError, mbOK)
closeCE()
end
addresslist=getAddressList()
memrec0=addresslist.getMemoryRecordByID(0)

memrec0_hotkey0=memrec0.getHotkeyByID(0)

function onHotkey0(Hotkey)
--Executed before the hotkey is handled
CETrainer.CHEAT0.setActive(true, 1500)
if gPlaySoundOnAction then
playSound(gActivateSound)
end
end

memrec0_hotkey0.onHotkey=onHotkey0
CETrainer.SEPERATOR.Visible=false

getAutoAttachList().add("AssassinsCreedIIGame.exe")
gPlaySoundOnAction=false
CETrainer.show()
function AboutClick()
showMessage(gAboutText)
end
gAboutText=[[This trainer was made by Cheat Engine]]

function CloseClick()
--called by the close button onClick event, and when closing the form
closeCE()
return caFree --onClick doesn't care, but onClose would like a result
end

--TRAINERGENERATORSTOP--
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions 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