Simple "BOT" Script, need full code.

Ask gaming related questions (AHK v1.1 and older)
User avatar
Dumitas
Posts: 167
Joined: 14 Dec 2017, 21:32

Simple "BOT" Script, need full code.

15 Dec 2017, 13:38

Hi everyone, Im new on AHK and learning I'm looking for a very basic bot. I know Im asking for a full code, but its pretty simple, once I understand how its done I will be able to do it more complex or change it at will.

I tryed to do it myself but first I cant make it start deactivated, second Im not able to press the key but send it (it "write" the letters)


What I want to do the bot its the next:
The script start deactivated and use a key to initiate and the same key to pause

D, D, D, D, D, A, A, A (repeat) (250ms between keys)

Click, wait 1 sec, Click (repeat every 5 sec)
The clicks on screen coordinates.


Clicks and Keys work at the same time, not in order.



Thank you in advance.
Image
Rohwedder
Posts: 7614
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Simple "BOT" Script, need full code.

16 Dec 2017, 03:34

Hallo,
if you are in an editor window and press a key, you will write the key!
Try:

Code: Select all

CoordMode, Mouse, Screen
Counter = 0
Return ;End of Auto-execute Section
F4:: ;On/Off with key F4
    If F4Active:=!F4Active
	{
        Keys = dddddaaa
		SetTimer Keys, 250
		SetTimer Clicks, 5000
	}
    Else
	{
        SetTimer Keys, Off
		SetTimer Clicks, Off
	}
Return
Keys:
	Counter := Mod(Counter,StrLen(Keys))+1
	Send, % SubStr(Keys,Counter,1)
Return
Clicks:
	Click
	Sleep, 1000
	Click
Return
User avatar
Dumitas
Posts: 167
Joined: 14 Dec 2017, 21:32

Re: Simple "BOT" Script, need full code.

16 Dec 2017, 21:18

Almost there, you did exactly what I asked for but I was wrong, instead of sending dddddaaa I need something like:

Code: Select all

Loop
  Send, {d down}
  Sleep, ;d time
  Send, {d up}
  Send, {a down}
  Sleep, ;a time
  Send, {a up}
But adapted to the previous scrip, I tryed to do tha with "keys" but its a label and doesn't work that way. (writed the whole thing instead)


Thank you.
Image

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 36 guests