# Forum > MMO > Guild Wars 2 > GW2 Bots and Programs >  [Release] Tomatoes' Event Running AFK Bot.

## Tomatoes99

I just made this Autoit bot. I see a lot of people using very primitive macros to spam "1". These are really obvious and will probably get you reported fast. This bot checks for mobs, then attacks and casts skills with random sleep times. It also has functionality to log out after a set amount of time, and then log back in. This should be a solid framework to develop further autoit bots.
I made the bot to run events, but it can definitely have more uses. You could easily program it yourself to run certain circuits if you like...

*
Instructions:*
1. Open SciTE script editor
2. Make a new .au3 file and paste in the script
3. Set the resolution to your screen
4. Change the skills, if necessary (DO NOT remove any numbers here. If you don't want to cast a specific skill, list a different skill twice.)
5. Compile the script
6. Close SciTE and open the script "as administrator".
7. Open Guild Wars, *change it to "FULLSCREEN WINDOWED" or it will not work!!!*
8. Press "=" on your keyboard to start script. "x" stops script.
9.* DO: +Rep, contribute, help other users in the thread, share good spots you found, give thanks, et cetera.
DO NOT PM me asking where to use it!!*

*
Changelog:*
1.0.6 Added a check to make sure the mob is in range before attacking.
1.0.5 Fixed a problem people were having where the bot would find a target but not attack, added instructions.
1.0.4 Fixed bugs with pixelsearch, logout, fixed a bug where script won't stop attacking.
1.0.3 Changed pixelsearch--hopefully it works now for you! 
1.0.2 Cleaned up functions, added x/yrat to logout/in functions
1.0.1 Added logout, fixed small bugs



```
;+++ AFK BOT 1.0.6 by Tomatoes99. +++
#RequireAdmin
Global $Paused, $Go = False, $c = 0, $r = 0


;=====Edit Settings here:
HotKeySet("=", "Begin") ;script toggled on/off by pressing =
HotKeySet("{PAUSE}", "TogglePause") ;script toggle pause by pressing Pause/Break key
HotKeySet("x", "Stop") ;script stopped by pressing x

$playtime = 3 ;Time to spend playing, in hours
$logouttime = 1 ;Time to spend logged out, in hours
dim $skills[7]=["2", "3", "4", "5", "6", "7", "8"] ;keys your skills are bound to (DON'T CHANGE THE NUMBER OF SKILLS UNLESS YOU KNOW WHAT YOU ARE DOING!)
$xresolution =  1920      ;Put your X screen resolution here.
$yresolution = 1080      ;Put your Y screen resolution here.

;Do not change this:
$xrat = $xresolution/1366
$yrat = $yresolution/768


While 1
	  If $Go Then
			$c = 0
		 if CheckEvent() then 		;If a mob is found and in range...
			call("DoEvent") 	;Attack and cast a random skill
		 ElseIf $r >= $playtime*3600000 Then 	;If no mobs are found/in range, check if it is time to logout
			call("Logout")
			randsleep($logouttime*3600000)
			call("Login")
			$r = 0
		 else 	;Otherwise, sleep for 10 seconds
			sleep(10000)
			$r +=10000
		 endif
	  endif
WEnd
   
Func CheckEvent() ; Look for a mob for 15 seconds.
   do
	  $c +=1
	  $r +=1000		
	  Randsleep(900)
	  send("{TAB}")
	  randsleep(100)
	  PixelSearch($xresolution/2 -178, 86, $xresolution/2 + 74, 99, 0x972115, 5)
	  If not @error and Checkrange() Then
			return true
			exitloop
	  endif
   until $c >=15
   $c = 0
EndFunc   ; >CheckEvent

Func CheckRange() ; Check for the red range indicator at the bottom of the first skill box. 
    PixelSearch($xresolution/2 - 320, $yresolution - 22, $xresolution/2 - 270, $yresolution - 18, 0x911500, 3)
   If @error Then
	  return true										
   endif 
EndFunc ; >CheckRange
	 
Func DoEvent() ;Spend 3 seconds attacking.
	  $r +=3000
	  RandSkill()
	  Shoot1(1.5)
   EndFunc ; >DoEvent
   
   Func Shoot1($seconds)
	  Do
		 $c += 1
		 send("1")
		 randsleep(200)
	  Until $c >= ($seconds * 5)
	  $c = 0
   EndFunc ; >Shoot1
   
Func RandSkill()
	  send($skills[random(0,6,1)])
	  randsleep(1500)
   EndFunc ; >RandSkill

Func Logout()
	  MouseClick("left", 18*$xrat, 18*$yrat)
	  sleep(200)
	  MouseClick("left", 666*$xrat, 427*$yrat)
	  sleep(200)
	  MouseClick("left", 693*$xrat, 429*$yrat)
   EndFunc ; >Logout
   
Func Login()
	  MouseClick("left", 475*$xrat, 670*$yrat)
	  sleep(200)
	  MouseClick("left", 472*$xrat, 673*$yrat)
	  sleep(25000)
	  send("{ENTER}") ;close overflow msg
EndFunc ; >Login

func RandSleep($ms) ; Sleeps + or - 25% of amount
   sleep($ms*random(.75,1.25))
   endfunc ; >RandSleep
   
Func Begin()
        $Go = Not $Go
EndFunc   ; >Begin
 
Func TogglePause()
        $Paused = Not $Paused
        While $Paused
                Sleep(100)
        WEnd
EndFunc   ; >TogglePause	 
	 
Func Stop()
        Exit
EndFunc   ; >Stop
```

Scorps1 added the ability to check if you are low health, and if you are it will heal you:




> ```
> Func DoEvent() ;Spend 3 seconds attacking.
>    $r +=3000
>    RandSkill()
>    Shoot1(1.5)
>    checkhealth() ; this is where i am inserting the new function unless you have a better suggestion
> EndFunc ; >DoEvent
> 
> Func checkhealth() ; check health and if below ~75% heal me
> ...

----------


## dragonne

Its been super long since i used autoit >.< how do you use this again? COmpile script then run? It just says paused and doesnt do anything..

----------


## Tomatoes99

> Its been super long since i used autoit >.< how do you use this again? COmpile script then run? It just says paused and doesnt do anything..


Edit: okay now that the servers are up I just edited the script so you just have to put in your x and y resolution. Disregard rest of this post!

You need to set the coordinates in "Pixelsearch" to match where the red enemy health bar appears in your screen. The first 2 numbers are the top left, and the second 2 are the bottom right. It just needs to be the general area. It will probably be fine if you can just make a good guess.
Compile, open the script and press "=" to start it. "Pause" key on your keyboard pauses it, "X" closes the script.

----------


## critical88

Which level can I go tomatoes event. Where is it. Thanks

----------


## alcor75

Yes pls, where you run this, efficently?


Inviato dal mio HTC Desire con Tapatalk 2

----------


## dragonne

> Edit: okay now that the servers are up I just edited the script so you just have to put in your x and y resolution. Disregard rest of this post!
> 
> You need to set the coordinates in "Pixelsearch" to match where the red enemy health bar appears in your screen. The first 2 numbers are the top left, and the second 2 are the bottom right. It just needs to be the general area. It will probably be fine if you can just make a good guess.
> Compile, open the script and press "=" to start it. "Pause" key on your keyboard pauses it, "X" closes the script.


Thank you very much  :Big Grin: 

Repped!

----------


## zanderos

Any good events lvl 20-30 this works on?

----------


## makaveli10a

> Any good events lvl 20-30 this works on?


Yeah, i made my own, same principle, mine just looks for the even bar, and not the hp bar, anyhow, it works on the portal.

and to OP, you might want to make a script for focus if the game crashes, to auto start and auto login, something like.

if WinActive then
xxxxxxx
else
re-start pixel search for icon and login

----------


## noker

This is not working for me set x y resolution then run it and all it does is tab between monsters, doesn't attack

----------


## hellrazor113

Any nice spots for this now that most of the events that spawn instantly are patched?

----------


## w4st3

> This is not working for me set x y resolution then run it and all it does is tab between monsters, doesn't attack


Very nice script !
However i don't get it to works, got the same problem as above : it tabs between mobs but doesnt attack.

Btw do you need to have range attacks for this to works ?

----------


## noker

> Very nice script !
> However i don't get it to works, got the same problem as above : it tabs between mobs but doesnt attack.
> 
> Btw do you need to have range attacks for this to works ?


I tried with and without ranged attacks and both didn't work

----------


## alcor75

To them saying this do not work, the developer said that you need to tune the coord for pixelsearch for the target health bar, upper left x, y....bottom right x,y. That explaon whu you do not attack.

Now, can someone share some good spot to abuse pls? around lev 20 would bo great. Tnx and hope i helped someone.

Inviato dal mio HTC Desire con Tapatalk 2

----------


## Dkid

Sorry if this sounds stupi but, what are the cords for check the top middle on hp bar?
Because i cant find it, how to find the cords.

thanks

----------


## GW2yoyo

Same here, using the resolution 1366x768 with 3 of my friends, and we are all noobs that fails to find the cords. Anyone have a guess, thanks.

----------


## Dkid

Nevermind i found it, thanks anyway  :Big Grin:

----------


## w4st3

> To them saying this do not work, the developer said that you need to tune the coord for pixelsearch for the target health bar, upper left x, y....bottom right x,y. That explaon whu you do not attack.


Dude you didnt read properly :



> *Edit: okay now that the servers are up I just edited the script so you just have to put in your x and y resolution. Disregard rest of this post!*
> 
> You need to set the coordinates in "Pixelsearch" to match where the red enemy health bar appears in your screen. The first 2 numbers are the top left, and the second 2 are the bottom right. It just needs to be the general area. It will probably be fine if you can just make a good guess.
> Compile, open the script and press "=" to start it. "Pause" key on your keyboard pauses it, "X" closes the script.


He made a ratio in the script wich helps find the health bar without having to set pixelsearch. You're supposed to enter only you screen resolution. But something goes wrong... :/

EDIT: btw i tried editing the pixelsearch with the right coords and bin the ratio thingy, still only tabs and tabs and tabs...

----------


## Tomatoes99

> Dude you didnt read properly :
> 
> 
> He made a ratio in the script wich helps find the health bar without having to set pixelsearch. You're supposed to enter only you screen resolution. But something goes wrong... :/
> 
> EDIT: btw i tried editing the pixelsearch with the right coords and bin the ratio thingy, still only tabs and tabs and tabs...


Yes! The problem was that I accidentally reversed the division in "$x/yrat"! oops! Please try the new version.

w4st, if you tried the new version and it didn't work, and if you are 101% positive you entered the coords in correctly, the only thing I can think of is that the color for "red" of the mob health bar is different on your resolution. Do you think you could take a screenshot and post the color in hex here for everybody to use? I also increased the tolerance to "5" so this may help you.
Also be sure to change what skills the bot uses to suit your action bar.
Yes, you should use ranged skills because this version of the bot does not move unless you tell it to.

----------


## w4st3

Yup i saw you reversed the ratio, corrected that and still not working.
Then tried to change the color, i spoted with Window Info the color, and ended up putting "0x9E2313, 10" in the script. (tolerance of 10 shades might be a bit too much...)

I tried your new script, with your color set and mine, it still doesn't work.

There might be a problem with coords maths : i spotted the right coords for me, they should be 784, 88, 1032, 97.
With my 1920/1280 =1,5, the factor 474 for the top left is not enough. Should be about 523.

But still, when i tried to get rid of the ratio calculation and entered the right coordinates of health bar it still didnt worked !
Something's gotta be broken with your "if pixelsearch = true then DoEvent".  :Wink:

----------


## GW2yoyo

Tomato, after you updated the script it won't target monters or do anything after presseng "=". My resolution (1366-76 :Cool:  is already set in the new code so I cant figure out what I am doing wrong. Btw. great script cant wait to make it work and give rep, your doing a awesome work.

----------


## noker

> Tomato, after you updated the script it won't target monters or do anything after presseng "=". My resolution (1366-76 is already set in the new code so I cant figure out what I am doing wrong. Btw. great script cant wait to make it work and give rep, your doing a awesome work.


Same problem here

----------


## Dkid

A small issue i have now that i cant fix is that when he kills a mob he doesnt stop casting skills? how can i fix that?

----------


## Tomatoes99

> Yup i saw you reversed the ratio, corrected that and still not working.
> Then tried to change the color, i spoted with Window Info the color, and ended up putting "0x9E2313, 10" in the script. (tolerance of 10 shades might be a bit too much...)
> 
> I tried your new script, with your color set and mine, it still doesn't work.
> 
> There might be a problem with coords maths : i spotted the right coords for me, they should be 784, 88, 1032, 97.
> With my 1920/1280 =1,5, the factor 474 for the top left is not enough. Should be about 523.
> 
> But still, when i tried to get rid of the ratio calculation and entered the right coordinates of health bar it still didnt worked !
> Something's gotta be broken with your "if pixelsearch = true then DoEvent".


Hmm.. scratching my head here.. What if you tried using the latest version (1.0.4) and setting that line to 


> PixelSearch(0, 0, 1920, 1280, 0x962014, 5)


That will make it attack when there is red ANYWHERE on your screen. If you try that and your character attacks we could narrow it down to a problem with coords.




> A small issue i have now that i cant fix is that when he kills a mob he doesnt stop casting skills? how can i fix that?


OK I think I know what was causing this. Hope I fixed this for you--try latest version.

----------


## Dkid

> Originally Posted by *Dkid*  ([Release] Tomatoes' Event Running AFK Bot.) 
> A small issue i have now that i cant fix is that when he kills a mob he doesnt stop casting skills? how can i fix that?
> OK I think I know what was causing this. Hope I fixed this for you--try latest version.


Now it's not even attacking anymore and you forgot to put start , stop keys in it but i've done that myself

----------


## Tomatoes99

> Now it's not even attacking anymore and you forgot to put start , stop keys in it but i've done that myself


Are you sure you're using the latest version? If you are, any "not attacking" problems are probably a problem with the pixelsearch. I just tested the attack functions again and they work. I also re-added the buttons--oops!

----------


## GW2yoyo

I found the cords and the bot is running, the only problem now is: When you attack a target, it casts 3-4 spells, and then find a new target attacks the new target, and then start running to attack yet another.

----------


## Dkid

Thanks i found my issue  :Stick Out Tongue:  thanks for the wonderfull script  :Smile:

----------


## Dkid

> I found the cords and the bot is running, the only problem now is: When you attack a target, it casts 3-4 spells, and then find a new target attacks the new target, and then start running to attack yet another.


Change the buttons of your skills dont let them default like they are in the script but change them like you use them

----------


## Tomatoes99

> I found the cords and the bot is running, the only problem now is: When you attack a target, it casts 3-4 spells, and then find a new target attacks the new target, and then start running to attack yet another.


Right. It attacks for 6 seconds, then it presses tab and it will attack whatever it finds. If you want it to attack the same target for longer, you can add more lines of "randskill" and "shoot1" to


```
Func DoEvent() ;Attacks until it can't find mobs.
	  $r +=6000
	  RandSkill()
	  Shoot1(1.5)
	  RandSkill()
	  Shoot1(1.5)
   EndFunc ; >DoEvent
```

----------


## GW2yoyo

> Right. It attacks for 6 seconds, then it presses tab and it will attack whatever it finds. If you want it to attack the same target for longer, you can add more lines of "randskill" and "shoot1" to
> 
> 
> ```
> Func DoEvent() ;Attacks until it can't find mobs.
> 	  $r +=6000
> 	  RandSkill()
> 	  Shoot1(1.5)
> 	  RandSkill()
> ...


Thanks. It still runs in the middle of the fight, is there a way to just change the 6 seconds instead of adding more attacks?

----------


## Tomatoes99

> Thanks. It still runs in the middle of the fight, is there a way to just change the 6 seconds instead of adding more attacks?


What are you trying to do?

----------


## GW2yoyo

The problem is. It attacks, finish the mob, and then the character keeps running forward until stopped and killed by mobs, pulling everything on its way. I want it to stay the same spot, target and kill one at a time if possible.

----------


## d0pe

First time using Autoit so I was kinda doomed to not get it working. Tried editing and found the correct pixels (I think) with photoshop. Still not working for me. 

Posting how I've edited the script just in case I've ****ed up something.



```
;+++ AFK BOT 1.0.4 by Tomatoes99. +++
Global $Paused, $Go = False, $c = 0, $r = 0
HotKeySet("+", "Begin") ;script toggled on/off by pressing =
HotKeySet("{PAUSE}", "TogglePause") ;script toggle pause by pressing Pause/Break key
HotKeySet("x", "Stop") ;script stopped by pressing x

$playtime = 6 ;Time to spend playing, in hours
$logouttime = 0 ;Time to spend logged out, in hours
dim $skills[7]=["2", "4", "5", "T", "Q", "E", "R"] ;keys your skills are bound to (DON'T CHANGE THE NUMBER OF SKILLS UNLESS YOU KNOW WHAT YOU ARE DOING!)
$xresolution = 1920     ;Put your X screen resolution here.
$yresolution = 1080       ;Put your Y screen resolution here.

;Don't change this:
$xrat = $xresolution/1280
$yrat = $yresolution/720

While 1
	  If ($Go) Then
			$c = 0
		 if CheckEvent() then 	;If a mob is found, attack it for 6 seconds
			   call("DoEvent")
			ElseIf $r >= $playtime*3600000 Then 	;If no mobs are around, check if it is time to logout
			   call("Logout")
			   randsleep($logouttime*3600000)
			   call("Login")
			   $r = 0
			else 	;Otherwise, sleep for 10 seconds
			   sleep(10000)
			   $r +=10000
		 endif
	  endif
WEnd
   
Func CheckEvent() ; Look for a mob for 15 seconds.
   do
	  $c +=1
	  $r +=1000
	  sleep(900)
	  send("{TAB}")
	  sleep(100)
	  PixelSearch(782*$xrat, 104*$yrat, 1036*$xrat, 102*$yrat, 0x962014, 5)
	  If not @error Then
		 return true
	  endif
   until not @error OR $c >=15
   $c = 0
EndFunc   ; >CheckEvent
	 
Func DoEvent() ;Attacks until it can't find mobs.
	  $r +=6000
	  RandSkill()
	  Shoot1(1.5)
	  RandSkill()
	  Shoot1(1.5)
   EndFunc ; >DoEvent
   
   Func Shoot1($seconds)
	  Do
		 $c += 1
		 send("1")
		 randsleep(200)
	  Until $c >= ($seconds * 5)
	  $c = 0
   EndFunc
   
Func RandSkill()
	  send($skills[random(0,6,1)])
	  randsleep(1500)
EndFunc ; >RandSkill

Func Logout()
	  MouseClick("left", 15*$xrat, 15*$yrat)
	  sleep(200)
	  MouseClick("left", 625*$xrat, 401*$yrat)
	  sleep(200)
	  MouseClick("left", 650*$xrat, 403*$yrat)
   EndFunc
   
Func Login()
	  MouseClick("left", 446*$xrat, 629*$yrat)
	  sleep(200)
	  MouseClick("left", 446*$xrat, 629*$yrat)
	  sleep(25000)
	  send("{ENTER}")
EndFunc

func RandSleep($ms) ; Sleeps + or - 25% of amount
   sleep($ms*random(.75,1.25))
   endfunc ; >RandSleep
   
Func Begin()
        $Go = Not $Go
EndFunc   ; >Begin
 
Func TogglePause()
        $Paused = Not $Paused
        While $Paused
                Sleep(100)
        WEnd
EndFunc   ; >TogglePause	 
	 
Func Stop()
        Exit
EndFunc   ; >Stop
```

----------


## Tomatoes99

> The problem is. It attacks, finish the mob, and then the character keeps running forward until stopped and killed by mobs, pulling everything on its way. I want it to stay the same spot, target and kill one at a time if possible.


Did you edit the $skills to match your action bar? The script shouldn't move your character at all.
For the time being, unfortunately you're just going to have to estimate how many seconds it takes to kill stuff. Death detection is necessary to kill stuff "one at a time". It's hard enough getting the pixelsearch for the health bar to work for everybody, so I'm probably not going to add it unless there's a really good spot where it is necessary/extremely useful.




> First time using Autoit so I was kinda doomed to not get it working. Tried editing and found the correct pixels (I think) with photoshop. Still not working for me.


Did you try running 1.0.4 without any editing (besides changing spells/resolution to your setup)? What happens when you try to run the script in game? Can you quote the part you edited?

----------


## d0pe

> $xresolution = 1920 ;Put your X screen resolution here.
> $yresolution = 1080 ;Put your Y screen resolution here.
> 
> Func CheckEvent() ; Look for a mob for 15 seconds.
> do
> $c +=1
> $r +=1000
> sleep(900)
> send("{TAB}")
> ...


Changed the start key as well, but that shouldnt destroy it?

Didnt try running 1.0.4 fresh since i have another screen resolution.

Nothing happens while im ingame.

----------


## GW2yoyo

> Did you edit the $skills to match your action bar? The script shouldn't move your character at all.
> For the time being, you're just going to have to estimate how many seconds it takes to kill stuff. Death detection is necessary to kill stuff "one at a time". It's hard enough getting the pixelsearch for the health bar to work for everybody, so I'm probably not going to add it unless there's a really good spot where it is necessary/extremely useful.


Sorry for being a total noob on autoit, but the skills I see in the script are:
RandSkill()
Shoot1(1.5)

How do I find the names for my other skills (so I can insert them instead of the ones above), I've tried using autoit to detect the names on the skills to add, but no luck.

----------


## Tomatoes99

> Changed the start key as well, but that shouldnt destroy it?
> 
> Didnt try running 1.0.4 fresh since i have another screen resolution.
> 
> Nothing happens while im ingame.


Try 1.0.4 and change it to your resolution where it says to




> Sorry for being a total noob on autoit, but the skills I see in the script are:
> RandSkill()
> Shoot1(1.5)
> 
> How do I find the names for my other skills (so I can insert them instead of the ones above), I've tried using autoit to detect the names on the skills to add, but no luck.




```
dim $skills[7]=["2", "3", "4", "5", "6", "7", "8"] ;keys your skills are bound to
```

change the numbers in quotes to the buttons on your keyboard of the skills you want to use, and leave them in quotes.

----------


## d0pe

Only changing the screen res. did not help.

----------


## Tomatoes99

> Only changing the screen res. did not help.


Ah that's too bad. Looks like its not so easy to make it work with every resolution. I would try subtracting from the first 2 coords and adding to the second 2 coords to make the detection box bigger. See if that works. For instance:
PixelSearch(416*$xrat, 38*$yrat, 769*$xrat, 155*$yrat, 0x962014, 5)
If that doesnt work, you can make it as big as your whole screen.
And if THAT doesnt work, its definitely the color that is the problem.
Let us know if anything works for you.

----------


## endless0001

which section to edit to make it not constantly attacking even no mobs

----------


## bopoiu

re edited

hi I want to know if itdid work for some people cause all i see is prob.

not complainig here jeust want to know if some people got it to work without prob

----------


## d0pe

Still nothing. Could it have something to do with me having 2 monitors?

----------


## XActionJesus

Bot is trageting usw but he doesnt attacks!

----------


## G00DFe77a

Fixed.....

----------


## Tomatoes99

> Fixed.....


can you tell us what you did to fix it? What resolutions are people using for the problem with not attacking?

d0pe: did you try making detection box the size of your screen?

----------


## bopoiu

> can you tell us what you did to fix it? What resolutions are people using for the problem with not attacking?
> 
> d0pe: did you try making detection box the size of your screen?


hi i d like to know if there are people that are able to run this scrip and actually bot with it ..


is it leveling^

----------


## Tomatoes99

> hi i d like to know if there are people that are able to run this scrip and actually bot with it ..
> 
> 
> is it leveling^


I'm able to use it perfectly, but I'm having trouble getting it to work for other people. If someone is willing to work with me to troubleshoot I could have it working for everybody, but until then I have no way of telling what the issue is.

----------


## donotwant

+rep cause noone else gives some although this is pretty cool  :Smile:

----------


## bwessel

Thanks for this!

----------


## jayjay555

I tried this and it didn't seem to work(My reso is the default 1920/1280) windowed full screen, but it doesn't seem to be attacking. I tried editing the skill numbers to just ["3", "4", "5"]. Want do I need to do. Thanks

----------


## bopoiu

ok lets see step by step. 
i installed gw2, 
installed auto it 3.3.8.1 from clu***ic
event though i run seven 64 i installed x86 as it is recommended (dont know if it causses prob)
i copied pasted the first code in a txt file on desktop,
i did put my windows resolution in x and y once
i went in auto it compile the txt file to exe file (didnt know how to make a .au3file)
opened gw2 
went were there are mosqitos 
started the .exe 

nothing happened

inoticed that the resolution is abit different in windows vs in the game set up. wich one sould we put in?

help needed

----------


## GW2yoyo

First of all, I'm the biggest autoit noob, but after trying a lot of stuff I would like to share how I made the tomato script work:

1. Create a new .au3ile and copy paste the tomato script.
2. Edit your script and add the correct resolution, in my case: 1366x728 (Right click on your desktop --> click properties and find your resolution)
_$xresolution = 1366 ;Put your X screen resolution here.
$yresolution = 728 ;Put your Y screen resolution here._
3. Open GW2 and put your guild wars 2 in windowed mode, not full windowed, just window mode as if it was a normal program running, and you can see your process bar with start button and etc.


4. Open the program: Autoit V3 window info.
5. Target the enemies red health bar *upper left corner* with the FINDER TOOL in Autoit V3 window info. This can me done when GW2 is running in windowed mode in the background of autoit v3 window info. 
6. After targeting the upper left corner: Go to Autoit v3 Window info, and click the option "Mouse", here you will find _position:_ 522 (x), 108 (y) for upper left corner (The numbers found here in case of my resolution.)

7. Repeat, only this time target the *bottom right* corner of the enemies health bar. In this case, I get the _position_ 750 (x), 123(y)
8. Edit your script and insert the following new cords for upper left AND buttom right XY you found.
PixelSearch(*522**$xrat, *108**$yrat, *750**$xrat, *123**$yrat, 0x962014, 5)
9. Save and run the script as administrator.
10. Open GW2 in the window mode / not full window mode, but as a normal program, having the process line start options available and etc.)
11. Press "="
12. The script will now start, and automatically find the nearest target and attack the enemy.

I hope it works for your guys. I will edit and delete this guide if it turns out to only be working for me.
Have a great run, and remember you can and most likely should personalize the attacks to your character.

13. Changing the skills, edit following numbers:

dim $skills[7]=["2", "3", "4", "5", "6", "7", "8"] ;keys your skills are bound to

Cheers and thanks to tomato for a great script.

----------


## Tomatoes99

> I would like to share how I made the tomato script work.


Thanks Yoyo! This is an excellent guide to people who are having problems. I would add that you MUST run the script as administrator. You also don't need to run it in windowed but if that makes it easier for some people then so be it!

----------


## shenton99

Video tut or just a video of what it looks like running please?

----------


## dragonne

How do i find the resolution of my windowed gw2 game?

----------


## Tomatoes99

New version just released. I figured out the problem 90% of people are having is that
_YOU MUST FREAKING USE WINDOWED FULLSCREEN MODE!_
Thanks drogonne for testing with me! People should definitely +rep them because without their work I wouldn't have been able to release this new version!

----------


## dragonne

lol Thank you tomatoes  :Big Grin:  But i dodnt code it, Rep the op as he spent time and much patience with an autoit Newb.

! thing, Is it posible to code in a distance stop attacking measure?  :Smile:  Now that my character can finally attack Yay! Thanks again Tomatoes. It keeps shooting even though the target is like Miles away and will never ever come near me.

^_^

----------


## noker

Thanks man working now repped. Where are some good spots to use it? im 45+ also im noticing i have to use ranged weapons and sometimes it gets stuck on monsters a long distance away and keeps attacking making it obvious to anyone walking past that you are botting

----------


## Tomatoes99

> Is it posible to code in a distance stop attacking measure?  Now that my character can finally attack Yay! Thanks again Tomatoes. It keeps shooting even though the target is like Miles away and will never ever come near me.


Yes, I have a good idea for how to implement this and I'll be doing it soon.

----------


## dragonne

> Yes, I have a good idea for how to implement this and I'll be doing it soon.


Wonderful  :Big Grin:

----------


## Tomatoes99

Hey everyone the "check range" feature is now up. Could someone please test to see if it works on larger resolutions? And remember to set your display to windowed fullscreen!

----------


## dragonne

Gonna test right now Tomatoes

----------


## wuddafxpwn

does this work in any zone?

----------


## Tomatoes99

> does this work in any zone?


It works anywhere. All it does is check if there is a mob in range. If there is, then it shoots at it and randomly casts whatever spells you define.

----------


## coLsquirtle

Having trouble with this, can't seem to fix the PixelSearch properly it just keeps "Tabbing" through the monsters.

- Changed Resolution
- Adjusted the PixelSearch according to "GW2yoyo" post
- Then adjusted the PixelSearch where teh CheckRange function is (my 'y' coordinates seem a lot bigger than yours for whatever reason)

Still just keeps tabbing ... ?

----------


## fragnot

4. Open the program: Autoit V3 window info. <---- And where is this ?

----------


## fragnot

You should probably edit the main post, as doing "just" that, isnt going to make it work.

----------


## Tomatoes99

> 4. Open the program: Autoit V3 window info. <---- And where is this ?


I don't understand what you are asking. Care to explain?

----------


## ex0rdium

Seeking a new event that I can run this script at that will give a level 35+ decent experience. I'll rep the first person who finds me a new event to level at with Tomatoes autoit script.

----------


## darkbluefirefly

> Seeking a new event that I can run this script at that will give a level 35+ decent experience. I'll rep the first person who finds me a new event to level at with Tomatoes autoit script.


bad way to ask for something.

----------


## ex0rdium

> bad way to ask for something.


Thank you for your productive response, you could have at least PMed me. Found what I was looking for.

----------


## ktkn01

Hey, when I try run as Administrator I get

AutoIt Error

Line 90 (File " "):

----------


## Tomatoes99

> Hey, when I try run as Administrator I get
> 
> AutoIt Error
> 
> Line 90 (File " "):


Open the source code in SciTE editor and go to "Tools">"Go"

what error comes up?

----------


## Xound

+REP

Tomatoes good work mate, scripts works perfectly as a baseline, followed your instructions and it works, not too sure how others are going wrong.

What I would ask, is where would someone go to lean more about the coding used in this, so as to advance their own script, IE: Travel between DE's, maybe even use WP's to travel, and looting?

I added loot as an attack and it works ok, however, I thought if I could add a pixel check for the gold 'Loot' icon that comes up on the bottom right hand side I could have the script loot for me.

----------


## MrUnreal

> +REP
> 
> Tomatoes good work mate, scripts works perfectly as a baseline, followed your instructions and it works, not too sure how others are going wrong.
> 
> What I would ask, is where would someone go to lean more about the coding used in this, so as to advance their own script, IE: Travel between DE's, maybe even use WP's to travel, and looting?
> 
> I added loot as an attack and it works ok, however, I thought if I could add a pixel check for the gold 'Loot' icon that comes up on the bottom right hand side I could have the script loot for me.


Sure you can do that . Its literally like 5 lines of code . Something like this works fine . Switched to memory based event bots since then you can just check obstruction etc  :Smile:  




> PixelSearch($looTx,$looTy,$looTx,$looTy,$lootColor)
> If Not @error Then 
> ControlSend($hwnd,"","","F");
> EndIf

----------


## Tomatoes99

Hi Xound thanks for the feedback. Appreciate that you found this useful  :Big Grin:  Also, thanks much for helping them, MrUnreal!

Yes if you study my code and search AutoIt's documentation for what certain expressions mean it is not difficult to add new features. That's the way I learned autoit is studying other people's scripts to understand what they did, and trying to rewrite a part or a new feature myself from scratch. Autoit is really not that hard to learn!

I don't know the best method for movement with autoit because it seems difficult to deal with the issue of the camera and terrain. If somebody has a good idea of how to implement sophisticated movement to the bot, I would love to talk to them. Until then I would just record the keypresses necessary to move from one place to the other and keep it very simple.

I would also briefly caution that "ControlSend" does have the advantage of letting you run a script without the window focused, however to my understanding it is a more sketchy method of sending keys because it sends a key which I believe looks different to the client than a normal keypress.

----------


## pikachu2003

Tomatoes99 thanks for the awesome script I turned on auto look and replaced several of the attacks with F so it loots okay. I was wondering if you could implement something like this so it would send the key to GW without tying up the keyboard?

BTW I took this from someone else comment but I'm not skilled enough to know if it will work with yours.

func one()
while $i<2
ControlSend ("Guild Wars 2", "", "", "1")
sleep(random(100,150))
WEnd
EndFunc

----------


## Tomatoes99

> Tomatoes99 thanks for the awesome script I turned on auto look and replaced several of the attacks with F so it loots okay. I was wondering if you could implement something like this so it would send the key to GW without tying up the keyboard?
> 
> BTW I took this from someone else comment but I'm not skilled enough to know if it will work with yours.
> 
> func one()
> while $i<2
> ControlSend ("Guild Wars 2", "", "", "1")
> sleep(random(100,150))
> WEnd
> EndFunc




```
ControlSend ("Guild Wars 2", "", "", "1")
```

Is the only part you need to replace. So if I wrote "send({KEY})" you would change it to ControlSend("Guild Wars 2", "", "", "{KEY}") I don't recommend using controlsend though because my understanding is that it can make you more susceptible to detection.

----------


## Neymar

Is there anyway to produce a relogger for this? I have a dodgy connection at times thanks to my ISP and will get booted with error 7. Is there any way I could use this to log me back in??

----------


## Tomatoes99

> Is there anyway to produce a relogger for this? I have a dodgy connection at times thanks to my ISP and will get booted with error 7. Is there any way I could use this to log me back in??


Yes. If you study the pixelsearch and what my "Logout()" function do, you could easily create this. Make sure to share it here in the thread for others to use.

----------


## evagon

Thanks for all your hard work tomato. I'm using v1.06 and I'm still having the tabbing problem. I've set the pixel coordinates according to Yoyo's instructions and it still keeps tabbing. In your more recent versions, they should automatically be found? Any ideas?

----------


## Thepro27

Hey Tomatoes99 I just wanna thank you for the script. 

I have a few questions, my bot attacks just fine, but if I try to tab out to do other things, it will keep hitting "tab" "I think".. So I can't really type I.E. on skype, or in game even. Now this isn't a big problem for me, but I was wondering is their a way to fix this? So I can do backround mode stuff, like watch youtube or something? Also is their a way to turn off the logout/log back in option? I don't bot all night, so I'd like to be able to just run it for a few hours without it logging out, thanks!

----------


## Tomatoes99

> Thanks for all your hard work tomato. I'm using v1.06 and I'm still having the tabbing problem. I've set the pixel coordinates according to Yoyo's instructions and it still keeps tabbing. In your more recent versions, they should automatically be found? Any ideas?


Thanks for your appreciation.
What resolution are you using? Are you running fullscreen windowed? Did you try to just use it with my instructions instead of yoyos? Did you change your desktop gamma? What's broken is the pixelsearch for the red health bar, so that is what you must fix.




> I was wondering is their a way to fix this? So I can do backround mode stuff, like watch youtube or something? Also is their a way to turn off the logout/log back in option? I don't bot all night, so I'd like to be able to just run it for a few hours without it logging out, thanks!


Hey thanks,
I talked earlier in the thread about controlsend which lets you do this. You can also just run the bot in a virtual machine like VMware. It won't logout for 3 hours, but if thats too short for you there is a setting you can just increase the setting.

----------


## FushionXI

Thanks for the script.

----------


## evagon

> Thanks for your appreciation.
> What resolution are you using? Are you running fullscreen windowed? Did you try to just use it with my instructions instead of yoyos? Did you change your desktop gamma? What's broken is the pixelsearch for the red health bar, so that is what you must fix.
> 
> 
> Hey thanks,
> I talked earlier in the thread about controlsend which lets you do this. You can also just run the bot in a virtual machine like VMware. It won't logout for 3 hours, but if thats too short for you there is a setting you can just increase the setting.


Thanks for the timely response. 

-Yes running fullscreen window
-Followed your instructions first (using default pixel coords) and I had the tabbing problem.. then I tried Yoyo's tips on how to get pixel coordinates for the red health bar and it keeps tabbing. I'm using a 46" LED TV, colours are definitely brighter. Does this have anything to do with it?
-I did not change my desktop gamma. How do I go about doing this?

I've read someone's post about fixing the hex code for the colour of the red bar, does this have something to do with it?

----------


## Tomatoes99

> Thanks for the timely response. 
> 
> -Yes running fullscreen window
> -Followed your instructions first (using default pixel coords) and I had the tabbing problem.. then I tried Yoyo's tips on how to get pixel coordinates for the red health bar and it keeps tabbing. I'm using a 46" LED TV, colours are definitely brighter. Does this have anything to do with it?
> -I did not change my desktop gamma. How do I go about doing this?
> 
> I've read someone's post about fixing the hex code for the colour of the red bar, does this have something to do with it?


Either the Pixelsearch "box" is searching in the wrong place, or looking for the wrong color. You can find the part in my script and adjust it like this:
pixelsearch(Top left of search area X, Y, Bottom right of search area X, Y, Hex code for the color, Tolerance)




> Thanks for the script.


No problem!

----------


## ziknos

There are some spot to try this for level 35 ~ ?

----------


## sworder

Just thought I'd throw my two cents in about your pixel issues. I had the same problem when I used my custom Diablo Auction House bot on different computers. What I did was produce a static screen on both my computers and recorded a certain pixel (the color looks the same, but it was slightly different - causing issues). Simply take the difference between the two pixels and record that difference in a settings file (I used .ini). From then on, take $pixel + IniRead(Settings.ini, settings, pixel) and you get the exact difference  :Smile: .

----------


## findingwaldo

Any chance we can get a copy of this to run in the background?

----------


## Tomatoes99

> Just thought I'd throw my two cents in about your pixel issues. I had the same problem when I used my custom Diablo Auction House bot on different computers. What I did was produce a static screen on both my computers and recorded a certain pixel (the color looks the same, but it was slightly different - causing issues). Simply take the difference between the two pixels and record that difference in a settings file (I used .ini). From then on, take $pixel + IniRead(Settings.ini, settings, pixel) and you get the exact difference .


Hey this is a great method to get the pixelsearch to work for 99% of people. I don't have much time right now to work on this project, but when I do I'll add it. If someone wants to do the work sooner and share it with everybody here in the thread, the relevant information you need is here: http://www.autoitscript.com/autoit3/...elGetColor.htm

----------


## NaPeK

To avoid problems with resolution:



```
$xrat = @DesktopWidth/1366
$yrat = @DesktopHeight/768
```

----------


## KiLL3rAs

any script for loot ?

----------


## bopoiu

from what i understand, this tool will see red line of moobs and attack them,

does it run ramdomly around the map ? or does it stay at same place ? or can we record him a path?


--------

also can it be used to farm copper ore and gahter stuff ? anyone can do it atm? farming copper would be awosme

thx guy

----------


## Strake17

Great script Tomatoes. Easily modified and used. I've been working on character movement to not avail. Has anyone figured out any code for character movement or camera movement?( i.e just back and forth, routes not necessary). Sending a movement key does not seem to work, I'm assuming the key hold needs to be continuous. Again, well done. +rep

----------


## evagon

What value do I put in if I want it to log out and instantly log back in? 0.1?

----------


## asdflsh

Hey everyone, I'm pretty new to AutoIt and I had a quick question:

Let's say I don't want my character using the skill bound to the "4" button. What do I need to change to fix this?

----------


## ralphlauren55

read the first post in the thread bro...



ok everyone I tried what was posted in this thread to make the bot usable when tabbed out of guild wars but it made the bot spam B in game. can anyone fix this, tell me why it did this, or post a working version of a tab-able bot? thx!

----------


## kindbudz

+rep. i took this and adapted it for 2boxing using gwLoader.

----------


## ichsuger

Shouldn't it move my character? because it doesn't  :Smile:  did I make a mistake somewhere along the road?

----------


## scorps1

tomatoes99, great script. definitely gave me some ideas as i am new to this whole thing. haven't done programming since high school but i remember bits and pieces because as it was fun!!!

i don't really do botting, but i do like to set a macro key to do keypresses and loot for me while i do the walking around myself. 

Question 1) how would i set up a script to recognize which weapon i am holding, and then select a different set of attacks depending on the weapon? i am guessing it will involve using the <select... case> statement, however i have no idea how to have the script recognize which weapon i am holding. just to clarify, this is not to auto-switch weapons but to know which weapon i am holding and dos something based on that.

Question 2) why does your script #RequireAdmin? i don't see anything that requires that, but i am new so maybe you can help me understand.

----------


## herthus

Great Script! Thx!
Is there a list of events out there (usable with this bot like lvl 15-30 & 30 -45 ect...)?

----------


## Tomatoes99

> tomatoes99, great script. definitely gave me some ideas as i am new to this whole thing. haven't done programming since high school but i remember bits and pieces because as it was fun!!!
> 
> i don't really do botting, but i do like to set a macro key to do keypresses and loot for me while i do the walking around myself. 
> 
> Question 1) how would i set up a script to recognize which weapon i am holding, and then select a different set of attacks depending on the weapon? i am guessing it will involve using the <select... case> statement, however i have no idea how to have the script recognize which weapon i am holding. just to clarify, this is not to auto-switch weapons but to know which weapon i am holding and dos something based on that.


 The easiest solution would be to just create a function that changes the values in the array I made for weapon skills. Then, you can assign a hotkey to these (two or more) functions, and press them based on what weapon you are using.

You could also arrange a function to "toggle" the values based on a keypress, and assign that to the same key you use to switch weapons, however if you do this you MUST temporarily unassign the hotkey and re-send the key to the game, or else it will not switch weapons, like this: Send keys issue. - General Help and Support - AutoIt Forums

The third option is using something like getpixelcolor() or imagesearch() and assign the array's values based on that.




> Question 2) why does your script #RequireAdmin? i don't see anything that requires that, but i am new so maybe you can help me understand.


I did this because people were having problems and I figured it couldn't hurt.

Let me know how it goes  :Smile:

----------


## scorps1

> You could also arrange a function to "toggle" the values based on a keypress, and assign that to the same key you use to switch weapons, however if you do this you MUST temporarily unassign the hotkey and re-send the key to the game, or else it will not switch weapons, like this: Send keys issue. - General Help and Support - AutoIt Forums


since i am an elementalist, and do not have a weapon switch button, then this is a moot point. but i like the idea, and will probably just create an array toggle like you suggest. thinking....





> The third option is using something like getpixelcolor() or imagesearch() and assign the array's values based on that.


i assume you mean imagesearch() = pixelsearch()? also looking at pixelchecksum(). hmmmm......

----------


## 187

> since i am an elementalist, and do not have a weapon switch button, then this is a moot point. but i like the idea, and will probably just create an array toggle like you suggest. thinking....


In terms of coding, weapon switching and attunement switching are exactly the same. Just do the analogous case for each of your attunement key shortcuts, i.e., a >2-key toggle switch. I don't see the problem here.

----------


## Tomatoes99

> i assume you mean imagesearch() = pixelsearch()? also looking at pixelchecksum(). hmmmm......


 No. Imagesearch is a separate function. I would just do pixelgetcolor() and just make sure you pick a spot on your action bar that becomes different color for every attunement you are using.

----------


## herthus

@Tomatoes99: Is there a way to change your script to work in fullscreen mode (not windowed)? Buttonsend to winactive, is this also possible with pixelsearch?

----------


## Tomatoes99

> @Tomatoes99: Is there a way to change your script to work in fullscreen mode (not windowed)? Buttonsend to winactive, is this also possible with pixelsearch?


The only reason for fullscreen windowed is to make sure the color is proper in the pixelsearch. There could be a way to get pixelsearch to work without having the window focused, right now I don't know how to do that myself.

----------


## herthus

@Tomatoes99: Thanks! And your script even works in 1280*1024 res  :Smile:  I had my doubt because of the $xrat = $xresolution/1366 ect. however it is working!

----------


## Tomatoes99

For people that want to run it in the background: the easiest way to do this with autoit is probably VMware. Just run the script in the virtual machine.

----------


## scorps1

tomatoes99, i have a suggestion on the skills. currently you have it set to spam "6" or "self-heal" as part of the array. you could also set it to only spam "6" if the health is below a certain amount by using a pixelsearch on the health circle, such as:

PixelSearch([x1], [y1], [x2], [y2], [red color], 15) ; check health and if below ~75% heal me
If @error Then
Send("6") 
EndIf

----------


## Tomatoes99

> tomatoes99, i have a suggestion on the skills. currently you have it set to spam "6" or "self-heal" as part of the array. you could also set it to only spam "6" if the health is below a certain amount by using a pixelsearch on the health circle, such as:
> 
> PixelSearch([x1], [y1], [x2], [y2], [red color], 15) ; check health and if below ~75% heal me
> If @error Then
> Send("6") 
> EndIf


This song is for you, scorps1: Snap - I ve Got The power - YouTube

Part of the reason why I released it open source is so people like you can add features like this. Seems like you have a good idea how to implement this--why don't you test/refine it and post a function here for everybody to use?

----------


## scorps1

no probs, as i mentioned i am using input from your script in a different way but this is how i would incorporate it into yours:



```
Func DoEvent() ;Spend 3 seconds attacking.
   $r +=3000
   RandSkill()
   Shoot1(1.5)
   checkhealth() ; this is where i am inserting the new function unless you have a better suggestion
EndFunc ; >DoEvent

Func checkhealth() ; check health and if below ~75% heal me
   PixelSearch([x1], [y1], [x2], [y2], [red color], 15) 
   If @error Then
      Send("6") 
   EndIf
EndFunc ; >checkhealth
```

note: i have refrained from inserting x/y coordinate conversions and colors etc. as they are easy to get through the info tool yourself.  :Smile: 

oh, and don't forget to change the skills array for "6" to something else.  :Smile:

----------


## 187

Note you can also do a similar feature for auto-looting, so that you only "spam" the loot key whenever you see the yellow hue'd Loot region in the bottom-ish right region of your UI. This way, you won't have to deal with constantly initiating conversations with NPCs whenever they're nearby, making it less apparent that you're botting and more convenient when looting.

I haven't rigorously done the coding, but it should be simple enough: just use PixelSearch with the hue in the Loot region with an "If PixelSearch(...) Then Send ("Loot Key")" type of command.

----------


## scorps1

> Note you can also do a similar feature for auto-looting, so that you only "spam" the loot key whenever you see the yellow hue'd Loot region in the bottom-ish right region of your UI. This way, you won't have to deal with constantly initiating conversations with NPCs whenever they're nearby, making it less apparent that you're botting and more convenient when looting.
> 
> I haven't rigorously done the coding, but it should be simple enough: just use PixelSearch with the hue in the Loot region with an "If PixelSearch(...) Then Send ("Loot Key")" type of command.


yep, done that too. only problem is when you are moving then the loot region goes semi-transparent, making the pixelsearch not work so well. no problem for botters though.  :Mad:

----------


## Falwethiel

I paused the script but now I can't unpause it.

----------


## Nitemaru

1st of all thank you for the script Tomatoes!!  :Smile:  i have a problem tho. i can't seem to fix the "don't target mobs outside my range" thing :/ i target the red line under my 1st skill so i get the x,y coords but it doesnt seem to work. by the /2 before the value u mean i need to write down the half of what i get?i use 1680x1050 and i have this setting

Func CheckRange() ; Check for the red range indicator at the bottom of the first skill box.
PixelSearch($xresolution/2 - 299, $yresolution - 515, $xresolution/2 - 300, $yresolution - 515, 0x911302, 3)

----------


## Lashley93

noob at this, cant get it working

----------


## oijkn

Hello, i try this script and works perfectly !!!! Someone can make the code for autoloot ? or explain me how to ?

And how i can set the *$playtime* in minutes please ? I tried to set the value to 0.10 (for ten minutes but nothings happens)

Best regards.

----------


## Wuffkeks

can anyone please help me make a script that "if we fall,wait for our character to stand up and then jump/press spacebar"?

----------


## Tomatoes99

> no probs, as i mentioned i am using input from your script in a different way but this is how i would incorporate it into yours:


Excellent work! I will integrate this into the initial post and give you credit.

----------


## awp2004

Could someone please explain the function of this? Does it run around, does it scan for mobs=> do I put it somewhere and it will just farm the mobs?
Can you enable a path?

----------


## awp2004

okay I could read that in the first page.

But does it have any looting? OR is it for standing afk in an event zone and not just spamming 1 key? Id like to know if I can make it farm mobs

----------


## Moocho

thx for the script, but i have the error line 18

If ($Go) Then
If (^ ERROR
>Exit code: 1 Time: 0.213

----------


## Tomatoes99

> thx for the script, but i have the error line 18
> 
> If ($Go) Then
> If (^ ERROR
> >Exit code: 1 Time: 0.213


 Remove the parentheses in line 18...

----------


## scorps1

Tomatoes99, 
i released my version of the script i am using, which is based on yours. check it out, you can find it here:

Post link is here! ([Release] LazyPad script by Scorps1)

----------


## Tomatoes99

> Tomatoes99, 
> i released my version of the script i am using, which is based on yours. check it out, you can find it here:
> 
> Post link is here! ([Release] LazyPad script by Scorps1)


Hey scorps, this is great work! Thanks for sharing this with everyone. I'm glad to see people expanding on my script, because that is the reason I released it. People can get a lot of use out of this.

----------


## Rafahil

It keeps atacking mobs that are far away. (Or maybe is it because I have autoattack enabled in the options menu ingame?)

----------


## wastaken

So been using your script and i like it very much so... my question is i wanted to make a basic movement script but i have no idea whats so ever how to do this other then send w 50 times or something... was wondering is there somthing that can track everything you push/etc over a period of time? if so is there a script that can start or stop when something from your script starts like attacking?.. sorry if thats vague basic idea im shooting for is i make a simple path your scripts see's enemy mine stops movement said enemy dies movement restarts from last point.... dont want it made for me im not lazy just clueless  :Big Grin:

----------


## Tomatoes99

> my question is i wanted to make a basic movement script but i have no idea whats so ever how to do this other then send w 50 times or something... is there a script that can start or stop when something from your script starts like attacking?.. sorry if thats vague basic idea im shooting for is i make a simple path your scripts see's enemy mine stops movement said enemy dies movement restarts from last point.... dont want it made for me im not lazy just clueless


Yes! This is totally possible.
What I would do is make a function for each direction that does what you're describing. So for example here's what forward would be:


```
Func Forward($seconds) ;
Send ("{W DOWN}")
   For 1 to $seconds*5
	  $r +=200		
	  send("{TAB}")
	  randsleep(200)
	  PixelSearch($xresolution/2 -178, 86, $xresolution/2 + 74, 99, 0x972115, 5)
	  If not @error and Checkrange() Then
                        Send ("{W UP}")
			call("DoEvent")
                        Send ("{W DOWN}")
	  endif
   Next
Send ("{W UP}")
EndFunc   ; >Forward
```

so a scripted path would look something like:


```
 Forward(20)
Left(.5)
Forward(45)
Right(.23)
Forward(5)
```

----------

