View previous topic :: View next topic |
Author |
Message |
Lanceadora How do I cheat?
Reputation: 0
Joined: 15 Nov 2018 Posts: 3
|
Posted: Thu Nov 15, 2018 9:01 pm Post subject: send key inputs at specific pointer value |
|
|
I'm trying to write a script that presses two keys at the same time when my pointer has a certain value.
For example,
If the value in pointer is 1000, send inputs a and b.
I have little scripting experience and I'm looking for the best way to do this. Lua, ahk, or another method?
The key presses need to be able to be detected by the active game window.
Any info helps
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 468
Joined: 09 May 2003 Posts: 25712 Location: The netherlands
|
Posted: Fri Nov 16, 2018 2:29 am Post subject: |
|
|
Create a timer or thread (createTimer/createThread)
in there poll the value of the pointer (AddressList.getMemoryRecordByDescription('xxx').Value)
Then if the value matches make the keys go down (keyDown(virtualkeycode) for each key)
Wait a bit for the game to pick that up (sleep for 100 ms or so)
and then release the key (keyUp(virtualkeycode))
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
Lanceadora How do I cheat?
Reputation: 0
Joined: 15 Nov 2018 Posts: 3
|
Posted: Fri Nov 16, 2018 11:04 am Post subject: |
|
|
So I have basically no experience with lua or any scripting for that matter, so this attempt probably looks silly, but this is what I manged to scrape together looking at the lua wiki.
local timer = createTimer(getMainForm())
timer.Interval = 100
timer.OnTimer = function(timer)
AddressList.getMemoryRecordByDescription('MyActiveFrames').Value)
if Value == 1000
keyDown(0x41)(0x42)
Sleep 100
keyUp (0x41)(0x42)
end
I'm sure there's things wrong with syntax, how I define the 'value' I want read, etc. Absolute beginner here
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 468
Joined: 09 May 2003 Posts: 25712 Location: The netherlands
|
Posted: Sat Nov 17, 2018 5:56 am Post subject: |
|
|
you get the value in Value by doing
Code: |
Value=tonumber(AddressList.getMemoryRecordByDescription('MyActiveFrames').Value)
|
to press down two keys, call keyDown twice.
so:
Code: |
keyDown(0x41)
keyDown(0x42)
|
and same for keyUp
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
Lanceadora How do I cheat?
Reputation: 0
Joined: 15 Nov 2018 Posts: 3
|
Posted: Thu Nov 29, 2018 5:13 pm Post subject: |
|
|
Got it working, appreciate your help!
|
|
Back to top |
|
 |
|