HELP TO SETUP BOT Topic is solved

Ask gaming related questions (AHK v1.1 and older)
PlayerOnline

HELP TO SETUP BOT

29 Apr 2017, 15:58

Hello , I want to create Bot to Online game . Easy one and not complicated , all farming in this game mostly bases on clicking 1,2,3,1,2,3 and so on but there I want few things extra . Every 60 miniutes have to click different numbers with shift modifier to buff my character for next 60 minutes and need to loop it thats a second loop , first one is all the time usying 1,2,3, every 1-2 seconds delay . Next great info is that I play on multiple accounts , it would be very easy if ControlSend could work I could just send 1 to all windows at the same time but I have to switch clients and do something like send switch send switch and so on, Game Guard Nprotection system dont allow any outside actions I have tried everything only one way how it is working it to switch window by WinActivate, ahk_id ( because all clients have exact name have to use id ) so we have another loop to switch between loops , I was thinking about something like - attack 1,2,3 switch to client 2 , attack 1,2,3 switch to client 3 , attack 1,2,3 switch to client 4 . Next important thing it to have buttons that stop/pause/reset all script , and another option to start script and skip loop with buffing characters if buffs are there already ( in case if some1 player see me I have to pause loop , I still have buffs on so I want to continue loop but without buffing ) . Looks complicated but it is simple script with only commands like send , sleep , WinActivate , Loop . I just dont know how to make loop in loop and skip loops . I was thinking about something like this :

It is enough to show me the script only for 2 clients and I will write it for 4 clients myself after I got idea how to do that.

$1:: ; start script
Loop
{
WinActivate, ahk_id 0xd041c ;switch to client1 and use skills 1,2,3 with delay 1 second between them
Send 1
Sleep, 1000
Send 2
Sleep, 1000
Send 3
Sleep, 1000
WinActivate, ahk_id 0x5c0026 ;switch to client2 and use skills 1,2,3 with delay 1 second between them
Send 1
Sleep, 1000
Send 2
Sleep, 1000
Send 3
Sleep, 1000


;BUFFS

Loop ;Buffs character with skills shift+1,2,3,4,5
{
Send +1
Sleep, 1000
Send +2
Sleep, 1000
Send +3
Sleep, 1000
Send +4
Sleep, 1000
Send +5
Sleep, 1000
}
Sleep, 3600000 ;Once all buffs 1,2,3,4,5 and done need break 60 minutes before have to use it again


Now how to make it all work together ?


$1:: ; start script
Loop
{
WinActivate, ahk_id 0xd041c
Send 1
Sleep, 1000
Send 2
Sleep, 1000
Send 3
Sleep, 1000
WinActivate, ahk_id 0x5c0026
Send 1
Sleep, 1000
Send 2
Sleep, 1000
Send 3
Sleep, 1000
}
return

Loop
{
Send +1
Sleep, 1000
Send +2
Sleep, 1000
Send +3
Sleep, 1000
Send +4
Sleep, 1000
Send +5
Sleep, 1000
}
Sleep, 3600000
eduardoblu
Posts: 19
Joined: 28 Apr 2017, 18:54

Re: HELP TO SETUP BOT

29 Apr 2017, 16:43

you wasnt clear enought to me. What you mean by "buff"
playeronline

Re: HELP TO SETUP BOT

30 Apr 2017, 02:09

Oh dont worry about this , it is a name of some "skills" in game . For autohotkey it is only Send 1 , Send 2 , just have to click in game 1 ,2 ,3 ..
playeronline

Re: HELP TO SETUP BOT  Topic is solved

30 Apr 2017, 02:13

On my script , second loop when autohotkey will send shift+1 , shift+2 .. keys , I want them to be send every 60 minutes and then repeat loop all the time .

send shift+1 , sleep 1000 , send shift+2 sleep 1000 ...... send shift+8 sleep 1000 , NOW Sleep for 60 minutes and continue loop send 1 , sleep1 , send 2 , sleep 1000 , send 3 , sleep 1000 so the main loop is to send keys 1 ,2 ,3 every 1 second delay and every 60 minutes need to send shift modifiers
eduardoblu
Posts: 19
Joined: 28 Apr 2017, 18:54

Re: HELP TO SETUP BOT

30 Apr 2017, 15:06

Hope this work, it wasnt tested

Code: Select all

f1::
settimer, clickingpart, 1000
gosub, whateverbuffmeas
sleep, 6000
settimer, whateverbuffmeas, 3600000, 2
return


clickingpart:
{
WinActivate, ahk_id 0xd041c ;switch to client1 and use skills 1,2,3 with delay 1 second between them
Send 1
Sleep, 1000
Send 2
Sleep, 1000
Send 3
Sleep, 1000 
WinActivate, ahk_id 0x5c0026 ;switch to client2 and use skills 1,2,3 with delay 1 second between them
Send 1
Sleep, 1000
Send 2
Sleep, 1000
Send 3
Sleep, 1000 
}
return

whateverbuffmeas:
{
Send +1
Sleep, 1000
Send +2
Sleep, 1000
Send +3
Sleep, 1000
Send +4
Sleep, 1000
Send +5
Sleep, 1000 
}
return
playeronline

Re: HELP TO SETUP BOT

01 May 2017, 02:44

Looks sense , I think it will work but could you explain me why is there sleep 6000 ?


f1::
settimer, clickingpart, 1000
gosub, whateverbuffmeas
sleep, 6000
settimer, whateverbuffmeas, 3600000, 2
return



Becase in clickingpart all actions send1,2,3 switch send 1,2,3 takes 6 seconds ? if it was send 1 sleep 2000 send 2 sleep 2000 send 3 sleep 2000 send 4 sleep 2000 ( 8000 together ) then I should set there sleep 8000 after gosub line ?
eduardoblu
Posts: 19
Joined: 28 Apr 2017, 18:54

Re: HELP TO SETUP BOT

01 May 2017, 11:14

Yes, and because both buff's part and clicking part(fixed script bellow) takes 6 secs to finish, otherwise buff part would be triggered 6 secs earlier(maybe less) and idk if your game has one kind of "exausted" mode that will not allow the action and wait 60 min till next.
You can reduce to 1 sec, i think it wont affect, i was just being careful.

Gosub: Jumps to the specified label and continues execution until Return is encountered.
https://autohotkey.com/docs/commands/Gosub.htm
SetTimer: Causes a subroutine to be launched automatically and repeatedly at a specified time interval.
https://autohotkey.com/docs/commands/SetTimer.htm


Code: Select all

f1::
settimer, clickingpart, 1000
sleep, 6200 ;sum of sleep's clicking part + 200ms switch client
gosub, whateverbuffmeas
sleep, 6000 ;sum of sleep's buff part
settimer, whateverbuffmeas, 3600000, 2
return


clickingpart:
{
WinActivate, ahk_id 0xd041c ;switch to client1 and use skills 1,2,3 with delay 1 second between them
Send 1
Sleep, 1000
Send 2
Sleep, 1000
Send 3
Sleep, 1000 
WinActivate, ahk_id 0x5c0026 ;switch to client2 and use skills 1,2,3 with delay 1 second between them
Send 1
Sleep, 1000
Send 2
Sleep, 1000
Send 3
Sleep, 1000 
}
return

whateverbuffmeas:
{
Send +1
Sleep, 1000
Send +2
Sleep, 1000
Send +3
Sleep, 1000
Send +4
Sleep, 1000
Send +5
Sleep, 1000 
}
return
playeronline

Re: HELP TO SETUP BOT

01 May 2017, 15:32

Thanks for help , one more question . ControlSend looks like not working for this game , But I am able to change game window title , is there any way I could send my keys to this game ? My idea is to send key while game window is inactive .
eduardoblu
Posts: 19
Joined: 28 Apr 2017, 18:54

Re: HELP TO SETUP BOT

01 May 2017, 17:13

Take a look on this post:
https://autohotkey.com/boards/viewtopic.php?f=5&t=31237

which game you intend to use this? just for curiosity.
playeronline

Re: HELP TO SETUP BOT

02 May 2017, 01:58

R.O.H.A.N ORIGIN it has game protection or something like that . Just cant send keys directly to window , I have to use just 'Send' keys and need to keep my window activate ;/

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 63 guests