Sign in to follow this  
Followers 0

Key "Bot"

7 posts in this topic

Posted (edited)

Hello, I'm new user of AutoIT and need make easy key bot

Can any one help me pls ?

when i press key "F5" ... program start function "keyset1"
keyset1 = send key "A", wait "100ms", send key "B", wait "100ms", send key "C", wait "100ms" and loap

when i press key "F6" ... program start function "keyset2"
keyset2 = send key "D", wait "100ms", send key "E", wait "100ms", send key "F", wait "100ms" and loap

when i press key "F7" ... program stop loap of "keyset1"

when i press key "F8" ... program stop loap of "keyset1"

when i press key "F9" ... program start all loap

when i press key "F10" ... program stop all loap

Thanks very much ... i need learn language of this program now :)

Edited by codename23

Share this post


Link to post
Share on other sites



Posted

Hello, I'm new user of AutoIT and need make easy key bot

Can any one help me pls ?

when i press key "F5" ... program start function "keyset1"
keyset1 = send key "A", wait "100ms", send key "B", wait "100ms", send key "C", wait "100ms" and loap

when i press key "F6" ... program start function "keyset2"
keyset2 = send key "D", wait "100ms", send key "E", wait "100ms", send key "F", wait "100ms" and loap

when i press key "F7" ... program stop loap of "keyset1"

when i press key "F8" ... program stop loap of "keyset1"

when i press key "F9" ... program start all loap

when i press key "F10" ... program stop all loap

Thanks very much ... i need learn language of this program now :)

Read in help file about HotKeySet(), Sleep(), Send() and something about functions.

Share this post


Link to post
Share on other sites

Posted

TY for reaction ... but i need for learn easy exempl of that :)

Share this post


Link to post
Share on other sites

Posted (edited)

TY for reaction ... but i need for learn easy exempl of that :)

And in help file exist examples of this functions. You need just start learn how to use them. Edited by Andreik

Share this post


Link to post
Share on other sites

Posted

Whats a loap?

Share this post


Link to post
Share on other sites

Posted

sry ... i mean loop

Share this post


Link to post
Share on other sites

Posted

Here is an example... probably wont be as efficient as you want.. but its a place to start

CODE
;#include <Misc.au3>

HotKeySet("{ESC}", "Terminate")

HotKeySet("{F5}", "Start1")

HotKeySet("{F6}", "Start2")

HotKeySet("{F7}", "Stop1")

HotKeySet("{F8}", "Stop2")

HotKeySet("{F9}", "StartAll")

HotKeySet("{F10}", "StopAll")

Opt("SendKeyDelay", 100) ; delay between sending keys - default 5

Opt("SendKeyDownDelay", 5) ; how long to hold down a key - default 5

Global $flag1 = 0, $flag2 = 0

While 1

Sleep(100) ; always a good idea so you dont max your cpu

If $flag1 Then Send("abc")

If $flag2 Then Send("def")

WEnd

Func Start1()

$flag1 = 1

EndFunc ;==>Start1

Func Start2()

$flag2 = 1

EndFunc ;==>Start2

Func Stop1()

$flag1 = 0

EndFunc ;==>Stop1

Func Stop2()

$flag1 = 0

EndFunc ;==>Stop2

Func StartAll()

$flag1 = 1

$flag2 = 1

EndFunc ;==>StartAll

Func StopAll()

$flag1 = 0

$flag2 = 0

EndFunc ;==>StopAll

Func Terminate()

Exit 0

EndFunc ;==>Terminate

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.