View previous topic :: View next topic |
Author |
Message |
catfood Cheater
Reputation: 0
Joined: 22 Jun 2015 Posts: 34
|
Posted: Sun Jan 01, 2017 6:28 pm Post subject: insert keypress into target window? |
|
|
Hello, I'm surprised this isnt more commonly brought up, I found some posts about it but it didnt work right for me.
What I would like to do is be able to check a box, and it will spam a key (lets say F10), then i can tab away from my game window and it will continue to spam it. and uncheck the box to stop it.
Anyone know how i might achieve this?
Thanks very much!
|
|
Back to top |
|
 |
Filipe_Br Master Cheater
Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
Posted: Sun Jan 01, 2017 6:44 pm Post subject: Re: insert keypress into target window? |
|
|
If I understood correctly, this script will work.
Code: |
form = createForm(false)
form.Position = poDesktopCenter
checkbox = createCheckBox(form)
checkbox.Caption = "Spam key"
checkbox.Left = 20
checkbox.Top = 20
checkbox.OnChange = function()
if checkbox.State == cbChecked then
function active_keys()
doKeyPress(VK_F10)
end
if t then t.destroy(); t=nil end
t=createTimer()
timer_setInterval(t, 2000) -- 1000 == 1s
timer_onTimer(t, active_keys)
else
if t then t.destroy(); t=nil end
end
end
form.Show() |
_________________
... |
|
Back to top |
|
 |
catfood Cheater
Reputation: 0
Joined: 22 Jun 2015 Posts: 34
|
Posted: Sun Jan 01, 2017 7:01 pm Post subject: |
|
|
Thank you Filipe_Br!
I changed VK_F10 to VK_A and it can type in my game chatbox "AAAAA" but it cannot use skills on 'A'.
Why is that?
|
|
Back to top |
|
 |
Filipe_Br Master Cheater
Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
Posted: Sun Jan 01, 2017 7:06 pm Post subject: |
|
|
If you want your character to move for example, try changing "timer_setInterval(t, 2000)" that number "2000" by a smaller number as "1".
That would look like this "timer_setInterval(t, 1)"
_________________
... |
|
Back to top |
|
 |
|