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 


Mouse Click as Hotkey

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

Joined: 10 Jun 2025
Posts: 1

PostPosted: Tue Jun 10, 2025 2:41 pm    Post subject: Mouse Click as Hotkey Reply with quote

i know theres a way to set left mouse button as hotkey as i have done it before, but i got nooooo idea how to do it now

but, just incase im wrong and the only way to do it is by scripting (which i doubt)

this is what i have
[ENABLE]
luacall(speedhack_setSpeed(1.15))
[DISABLE]
luacall(speedhack_setSpeed(1.1))

i have seen the code below, but that makes no sense to me, and it keeps getting error messages
first i have to add enable and dissable, so i copy pasta it to where "luacall(speedhack_setSpeed(1.15))" was
then it says line 10 isnt working, which would be "last speed"?
so id really like if someone knows how to just add LMB as hotkey rather than any coding


wantedSpeed=10
lastSpeed=1

function checkKeys(timer)
if isKeyPressed(VK_LBUTTON) then
if lastSpeed==1 then
speedhack_setSpeed(wantedSpeed)
lastSpeed=wantedSpeed
end
else
if lastSpeed~=1 then
speedhack_setSpeed(1)
lastSpeed=1
end
end
end

if t~=nil then
t.destroy()
t=nil
end

t=createTimer()
t.Interval=50
t.OnTimer=checkKeys
t.Enabled=true

_________________
im a pirate and coming for that booty~
AAAAARGH!!!
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 36

Joined: 16 Feb 2017
Posts: 1511

PostPosted: Tue Jun 10, 2025 3:23 pm    Post subject: Reply with quote

Prepare the asm script.
Right click on the address list.
From the menu: Select "Set/Change Hotkeys".
Assign a hotkey in the window that opens.

A copy like this may appear.
(Copy the code and paste it into the address list.)

Code:
<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
  <CheatEntries>
    <CheatEntry>
      <ID>0</ID>
      <Description>"SpeedHack1"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>
[ENABLE]
{$lua}
if syntaxcheck then return end
speedhack_setSpeed(1.15)

{$asm}
[DISABLE]

{$lua}
speedhack_setSpeed(1.0)
</AssemblerScript>
      <Hotkeys>
        <Hotkey>
          <Action>Toggle Activation</Action>
          <Keys>
            <Key>115</Key>
          </Keys>
          <ID>0</ID>
        </Hotkey>
      </Hotkeys>
    </CheatEntry>
  </CheatEntries>
</CheatTable>


For "LButton", edit this field in the code::
F4
<Key>115</Key>

LBUTTON
<Key>1</Key>

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN 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