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 


adding button, linked to cheat engine table adress.

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

Joined: 29 Oct 2017
Posts: 2
Location: Netherlands

PostPosted: Sun Oct 29, 2017 11:39 am    Post subject: adding button, linked to cheat engine table adress. Reply with quote

Hallo,
Iam trying to add an adress from the cheat table to a button.
Code:

function CEButton1Click(sender)
writeInteger("[[[[[[CryGame.dll"+01230450]+10]+c]+28]+10]+58]+104",9)
 end


but its giving a error.
what am i doing wronge here?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Oct 29, 2017 11:44 am    Post subject: Reply with quote

The quote after .dll.
Back to top
View user's profile Send private message
badboy77
How do I cheat?
Reputation: 0

Joined: 29 Oct 2017
Posts: 2
Location: Netherlands

PostPosted: Sun Oct 29, 2017 12:11 pm    Post subject: Reply with quote

Zanzer wrote:
The quote after .dll.


thanks the error is gone, but the button isnt working.

Code:

 function CEButton1Click(sender)
 writeInteger("[[[[[[CryGame.dll+01230450]+10]+c]+28]+10]+58]+104",9)
  end
--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.7
if (getCEVersion==nil) or (getCEVersion()<RequiredCEVersion) then
  messageDialog('Please install Cheat Engine '..RequiredCEVersion, mtError, mbOK)
  closeCE()
end
addresslist=getAddressList()
memrec156=addresslist.getMemoryRecordByID(156)
memrec178=addresslist.getMemoryRecordByID(178)

memrec156_hotkey0=memrec156.getHotkeyByID(0)
memrec156_hotkey1=memrec156.getHotkeyByID(1)
memrec156_hotkey2=memrec156.getHotkeyByID(2)
memrec156_hotkey3=memrec156.getHotkeyByID(3)
memrec178_hotkey0=memrec178.getHotkeyByID(0)
memrec178_hotkey1=memrec178.getHotkeyByID(1)
memrec178_hotkey2=memrec178.getHotkeyByID(2)

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

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

memrec156_hotkey1.onHotkey=onHotkey1
function onHotkey2(Hotkey)
  --Executed before the hotkey is handled
  CETrainer.CHEAT2.setActive(true, 1500)
  if gPlaySoundOnAction then
    playSound(gActivateSound)
  end
end

memrec156_hotkey2.onHotkey=onHotkey2
function onHotkey3(Hotkey)
  --Executed before the hotkey is handled
  CETrainer.CHEAT3.setActive(true, 1500)
  if gPlaySoundOnAction then
    playSound(gActivateSound)
  end
end

memrec156_hotkey3.onHotkey=onHotkey3
function onPostHotkey4(Hotkey)
  --Executed after the "toggle*" cheat got executed
  local memrec=Hotkey.Owner
  local isActive=memrec.Active --get the state after the hotkey got triggered
  CETrainer.CHEAT4.setActive(isActive) --gui update, nothing else
  if gPlaySoundOnAction then
    if isActive then
      playSound(gActivateSound)
    else
      playSound(gDeactivateSound)
    end
  end
end

memrec178_hotkey0.onPostHotkey=onPostHotkey4

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

memrec178_hotkey1.onHotkey=onHotkey5
function onHotkey6(Hotkey)
  --Executed before the hotkey is handled
  CETrainer.CHEAT6.setActive(true, 1500)
  if gPlaySoundOnAction then
    playSound(gActivateSound)
  end
end

memrec178_hotkey2.onHotkey=onHotkey6
CETrainer.SEPERATOR.Visible=false

getAutoAttachList().add("Launcher.exe")
gPlaySoundOnAction=false
CETrainer.show()
function AboutClick()
  showMessage(gAboutText)
end


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--



problem is fixed, after trying random stuf Very Happy
so it works with this code. thanks for the help anyway.
Code:


function CEButton1Click(sender)
writeFloat("[[[[[CryGame.dll+01230450]+10]+28]+10]+58]+104",100)

end








I have a diffrent problem now,

I got hotkey (*) that toggles freez in cheat engine, but how do i code that in lua ?

i have to make CEButton5:TCEbutton (CEButton5Click) toggle freeze this adres :

Code:
writeFloat("[[[[[CryGame.dll+0122E6F0]+20]+208]+50]+98]+14
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