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 


Issue with readInteger

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
KalasWD
Master Cheater
Reputation: 0

Joined: 29 May 2016
Posts: 300

PostPosted: Sun Aug 27, 2017 11:28 am    Post subject: Issue with readInteger Reply with quote

Code:
if readInteger("AOM_Release_Final.exe") == nil then
  CETrainer.CELabel7.Caption = "Game Not Detected"
  CETrainer.CELabel7.Font.Color = 0x0000FF
else
  CETrainer.CELabel7.Caption = "Game Detected"
  CETrainer.CELabel7.Font.Color = 0x009900
end


Quote:
Should I make an event on CETrainer or the Panel so when I move the mouse It will execute the function?


For some reason the Trainer is not detecting the game when I open the Trainer before or after the game, I used Generate Trainer If that helps, but like should It detect It automatically or I need to add a button for that ?



This is my full code:

Code:
-- Donation --
function CEImage2Click(sender)
shellExecute("http://paypal.me/KalasCT")
end
-- Site --
function CELabel3Click(sender)
shellExecute("https://mrantifun.net/index.php")
end
-- Message --
function CELabel5Click(sender)
showMessage[[Compatible With (PATCH 08.23.2017)
====================
Unlimited Mayhem Ability: It may not show full bar, but when you enter a new mission or load a new area, you need to gain a bit of Mayhem Points, and then you can use the Mayhem Ability as much as you want.
====================
Unlimited Gremlin Tech: Disable When Crafting.
====================
Unlimited Items: Sets Items on pickup to 9999999.
====================
Unlimimted Car Health+Boost: When not needed disable them.
====================
Dragin Target Health (WIP): Currently effects player too, recommended using with Unlimited Shield+Health. (Disable the script when you drained your target Health so you can kill him)
====================
Easy Level: When gaining a level, instead of 1 level per time you'll be set to lvl 20, can use Easy XP to make it easier to gain XP.]]
end
-- GameDetect --
if readInteger("AOM_Release_Final.exe") == nil then
  CETrainer.CELabel7.Caption = "Game Not Detected"
  CETrainer.CELabel7.Font.Color = 0x0000FF
else
  CETrainer.CELabel7.Caption = "Game Detected"
  CETrainer.CELabel7.Font.Color = 0x009900
end





And this is the code after generating:

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=6.7
if (getCEVersion==nil) or (getCEVersion()<RequiredCEVersion) then
  messageDialog('Please install Cheat Engine '..RequiredCEVersion, mtError, mbOK)
  closeCE()
end
addresslist=getAddressList()
memrec19=addresslist.getMemoryRecordByID(19)
memrec23=addresslist.getMemoryRecordByID(23)
memrec6=addresslist.getMemoryRecordByID(6)
memrec18=addresslist.getMemoryRecordByID(18)
memrec29=addresslist.getMemoryRecordByID(29)
memrec68=addresslist.getMemoryRecordByID(68)
memrec73=addresslist.getMemoryRecordByID(73)
memrec63=addresslist.getMemoryRecordByID(63)
memrec82=addresslist.getMemoryRecordByID(82)
memrec87=addresslist.getMemoryRecordByID(87)
memrec79=addresslist.getMemoryRecordByID(79)
memrec43=addresslist.getMemoryRecordByID(43)
memrec74=addresslist.getMemoryRecordByID(74)
memrec85=addresslist.getMemoryRecordByID(85)
memrec90=addresslist.getMemoryRecordByID(90)

memrec19_hotkey0=memrec19.getHotkeyByID(0)
memrec23_hotkey0=memrec23.getHotkeyByID(0)
memrec6_hotkey0=memrec6.getHotkeyByID(0)
memrec18_hotkey0=memrec18.getHotkeyByID(0)
memrec29_hotkey0=memrec29.getHotkeyByID(0)
memrec68_hotkey0=memrec68.getHotkeyByID(0)
memrec73_hotkey0=memrec73.getHotkeyByID(0)
memrec63_hotkey0=memrec63.getHotkeyByID(0)
memrec82_hotkey0=memrec82.getHotkeyByID(0)
memrec87_hotkey0=memrec87.getHotkeyByID(0)
memrec79_hotkey0=memrec79.getHotkeyByID(0)
memrec43_hotkey0=memrec43.getHotkeyByID(0)
memrec74_hotkey0=memrec74.getHotkeyByID(0)
memrec85_hotkey0=memrec85.getHotkeyByID(0)
memrec90_hotkey0=memrec90.getHotkeyByID(0)

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

memrec19_hotkey0.onPostHotkey=onPostHotkey0

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

memrec23_hotkey0.onPostHotkey=onPostHotkey1

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

memrec6_hotkey0.onPostHotkey=onPostHotkey2

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

memrec18_hotkey0.onPostHotkey=onPostHotkey3

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

memrec29_hotkey0.onPostHotkey=onPostHotkey4

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

memrec68_hotkey0.onPostHotkey=onPostHotkey5

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

memrec73_hotkey0.onPostHotkey=onPostHotkey6

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

memrec63_hotkey0.onPostHotkey=onPostHotkey7

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

memrec82_hotkey0.onPostHotkey=onPostHotkey8

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

memrec87_hotkey0.onPostHotkey=onPostHotkey9

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

memrec79_hotkey0.onPostHotkey=onPostHotkey10

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

memrec43_hotkey0.onPostHotkey=onPostHotkey11

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

memrec74_hotkey0.onPostHotkey=onPostHotkey12

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

memrec85_hotkey0.onPostHotkey=onPostHotkey13

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

memrec90_hotkey0.onPostHotkey=onPostHotkey14


getAutoAttachList().add("AOM_Release_Final.exe")
gPlaySoundOnAction=false
CETrainer.show()
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 -> 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