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 


insert keypress into target window?

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

Joined: 22 Jun 2015
Posts: 34

PostPosted: Sun Jan 01, 2017 6:28 pm    Post subject: insert keypress into target window? Reply with quote

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
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Sun Jan 01, 2017 6:44 pm    Post subject: Re: insert keypress into target window? Reply with quote

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
View user's profile Send private message
catfood
Cheater
Reputation: 0

Joined: 22 Jun 2015
Posts: 34

PostPosted: Sun Jan 01, 2017 7:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Sun Jan 01, 2017 7:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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