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 


hotkey for button to take value

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

Joined: 27 Feb 2021
Posts: 1
Location: Romania

PostPosted: Sat Feb 27, 2021 12:59 pm    Post subject: hotkey for button to take value Reply with quote

Hello , i have a question ,i wanna have a hotkey if i press this my button "Take Value"
store this values to "X" and "Y" (edit boxes)
My X pointer: "MSS31.dll"+0171A2EC , Offset: 650 , 14
Y pointer: "MSS31.dll"+0171A2EC, Offset: 654 , 14
how can i make it?

this is my LUA
Code:
--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=7.2
if (getCEVersion==nil) or (getCEVersion()<RequiredCEVersion) then
  messageDialog('Please install Cheat Engine '..RequiredCEVersion, mtError, mbOK)
  closeCE()
end
addresslist=getAddressList()
memrec31=addresslist.getMemoryRecordByID(31)
memrec0=addresslist.getMemoryRecordByID(0)

memrec31_hotkey0=memrec31.getHotkeyByID(0)
memrec31_hotkey1=memrec31.getHotkeyByID(1)
memrec0_hotkey0=memrec0.getHotkeyByID(0)
memrec0_hotkey1=memrec0.getHotkeyByID(1)

function onPostHotkey0(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.CHEAT0.setActive(isActive) --gui update, nothing else
  if gPlaySoundOnAction then
    if isActive then
      playSound(gActivateSound)
    else
      playSound(gDeactivateSound)
    end
  end
end

memrec31_hotkey0.onPostHotkey=onPostHotkey0

function onHotkey1(Hotkey)
  --Executed before the hotkey is handled
  local memrec=Hotkey.Owner
  memrec.Value=CETrainer.CHEAT1.Editvalue --this will also update the 'frozen' value
  CETrainer.CHEAT1.setActive(true, 1500)
  if gPlaySoundOnAction then
    playSound(gActivateSound)
  end
end

memrec31_hotkey1.onHotkey=onHotkey1
function onPostHotkey2(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.CHEAT2.setActive(isActive) --gui update, nothing else
  if gPlaySoundOnAction then
    if isActive then
      playSound(gActivateSound)
    else
      playSound(gDeactivateSound)
    end
  end
end

memrec0_hotkey0.onPostHotkey=onPostHotkey2

function onHotkey3(Hotkey)
  --Executed before the hotkey is handled
  local memrec=Hotkey.Owner
  memrec.Value=CETrainer.CHEAT3.Editvalue --this will also update the 'frozen' value
  CETrainer.CHEAT3.setActive(true, 1500)
  if gPlaySoundOnAction then
    playSound(gActivateSound)
  end
end

memrec0_hotkey1.onHotkey=onHotkey3

getAutoAttachList().add("MSS31.dll")
gPlaySoundOnAction=false
CETrainer.show()
function AboutClick()
  showMessage(gAboutText)
end
gAboutText=[[nothing
contact]]

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



If anyone can help..



12.png
 Description:
this is how look
 Filesize:  4.67 KB
 Viewed:  735 Time(s)

12.png


Back to top
View user's profile Send private message Yahoo Messenger
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