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 


Cheat Engine Script Hotkey

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

Joined: 10 Jul 2020
Posts: 2

PostPosted: Fri Jul 10, 2020 5:36 am    Post subject: Cheat Engine Script Hotkey Reply with quote

Hello, I'm trying to implement a script using mgr.inz.Player's code from this topic -- viewtopic.php?p=5500845
But instead of using keyboard or mouse, I need activation key to be on gamepad, which requires getXBox360ControllerState and I have no idea how it works

The code itself
Code:
tableWithValues = {}
for line in io.lines("my.txt") do
  table.insert(tableWithValues,tonumber(line))
end

hk1 = createHotkey("writeValueFromList", keys, ...)

function writeValueFromList()
  writeInteger(address,  tableWithValues[math.random(1, #tableWithValues)] )
end
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25840
Location: The netherlands

PostPosted: Fri Jul 10, 2020 6:27 am    Post subject: Reply with quote

Not really sure it'll work, but fore createHotkey use these key codes:
Code:

    VK_PAD_A = 0x5800
    VK_PAD_B = 0x5801
    VK_PAD_X = 0x5802
    VK_PAD_Y = 0x5803
    VK_PAD_RSHOULDER = 0x5804
    VK_PAD_LSHOULDER = 0x5805
    VK_PAD_LTRIGGER = 0x5806
    VK_PAD_RTRIGGER = 0x5807
    VK_PAD_DPAD_UP = 0x5810
    VK_PAD_DPAD_DOWN = 0x5811
    VK_PAD_DPAD_LEFT = 0x5812
    VK_PAD_DPAD_RIGHT = 0x5813
    VK_PAD_START = 0x5814
    VK_PAD_BACK = 0x5815
    VK_PAD_LTHUMB_PRESS = 0x5816
    VK_PAD_RTHUMB_PRESS = 0x5817
    VK_PAD_LTHUMB_UP = 0x5820
    VK_PAD_LTHUMB_DOWN = 0x5821
    VK_PAD_LTHUMB_RIGHT = 0x5822
    VK_PAD_LTHUMB_LEFT = 0x5823
    VK_PAD_LTHUMB_UPLEFT = 0x5824
    VK_PAD_LTHUMB_UPRIGHT = 0x5825
    VK_PAD_LTHUMB_DOWNRIGHT = 0x5826
    VK_PAD_LTHUMB_DOWNLEFT = 0x5827
    VK_PAD_RTHUMB_UP = 0x5830
    VK_PAD_RTHUMB_DOWN = 0x5831
    VK_PAD_RTHUMB_RIGHT = 0x5832
    VK_PAD_RTHUMB_LEFT = 0x5833
    VK_PAD_RTHUMB_UPLEFT = 0x5834
    VK_PAD_RTHUMB_UPRIGHT = 0x5835
    VK_PAD_RTHUMB_DOWNRIGHT = 0x5836
    VK_PAD_RTHUMB_DOWNLEFT = 0x5837         

_________________
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
View user's profile Send private message MSN Messenger
lk_ggds
How do I cheat?
Reputation: 0

Joined: 10 Jul 2020
Posts: 2

PostPosted: Fri Jul 10, 2020 6:31 am    Post subject: Reply with quote

Dark Byte wrote:
Not really sure it'll work, but fore createHotkey use these key codes:

You're my hero, thank you!

Ok one more thing, when I'm trying to assign different buttons for other addresses, only the last one works
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