simple autoit bot

10/04/2008 16:50 jitsuk#1
So what we're gonna do today is a very basic bot that pulls one mob at a time that you are able to tab target while ingame aka you need to see X amount of mobs infront of you for this to be optimal.

The way WAR has been designed makes this very easy to do, your character automatically turns towards the mob you want to attack and pretty much no mobs are actually linked so you can stand infront of a huge cluster of mobs and pull one mob over and over.

[Only registered and activated users can see links. Click Here To Register...]

This is where I started and I'm now level 38, each and every zone has several places like this one.. or maybe not exactly like that one because the mobs there respawn very quickly.
I am netting about 1.3 million xp during a night with this at the moment, obviously need to change spots each or every second level as mobs that are the same level or above you give twice as much xp as a mob that is one level or more below you.


1. Download and install AutoIt.
[Only registered and activated users can see links. Click Here To Register...]
2. Once installed launch up the SciTE Editor.
3. Read the shit below.
4. If you feel that youre done with a script or want to try it you can go to Tools > Build (to compile an .exe file) or Go to try it out.



So this is where we start.

Code:
While 1 = 1 WEnd
So what the script above does is create a function that will run over and over until 1 does not equal 1 so its a simple way for us to make something run indefinately.

Code:
While 1 = 1 Send ("{2}") Sleep(1600) WEnd
Now we'll add onto this function a button press, in this case I'll choose 2 to be pressed and because of the While function we made above itll keep running until you terminate the script (right-click the icon in the system tray and press Exit to stop the script).

Send ("{2}") would then be the key that we want it to press and Sleep(1600) means that you want it to wait for 1.6 seconds (to account for lag) before continuing and since theres a 1.5 second global cooldown on spells this is needed for it to work.


Code:
While 1 = 1 Sleep(500) Send ("{TAB}") Sleep(500) Send ("{1}") Sleep(1600) Send ("{2}") Sleep(1600) Send ("{2}") Sleep(1600) Send ("{2}") Sleep(1600) Send ("{2}") Sleep(1600) Send ("{2}") Sleep(1600) WEnd
Here I added Send ("{TAB}") at the top and by now you should understand that what this will do is press tab for you and automatically target the closest enemy.
This will target a mob, press 1 (ranged attack to pull with) and then press 2 five times - hopefully the mob will be dead by then.. obviously 5 times is optimistic you should add a few more in there to make sure the mob dies 100% incase they parry/block/resist.

That should get you started.
10/04/2008 16:58 Punctuality#2
what happens if get caught with this?
10/04/2008 17:33 MaXiMiUS#3
Little autoit tip: you don't even need the 1 = 1 thing, you can just use While 1.

Also, it should be reasonably easy to make the bot (attempt) to loot corpses. Just have it right click the ground every time it (thinks) it's killed a monster.

I'll have to look in to that more, though.

Another note: you probably need to set this option for mouseclicks from AutoIt to register correctly.

Opt("MouseClickDownDelay",100)
10/07/2008 15:45 fatalaty#4
sehr geiler Guide, hat mir sehr geholfen! klappt bei sorc lvl 30 perfeckt!
hat jemand das mit dem looten eingebaut? klappt das so mit dem einen commando?
10/10/2008 02:50 MaXiMiUS#5
Quote:
Originally Posted by myndflame View Post
I have a problem here, can someone check please and tell me what's the mistake?

THX

[Only registered and activated users can see links. Click Here To Register...]
Uhm.. is that all one line?

Each command needs a new line.

Also, that option you set at the end won't really do anything.. you didn't use MouseClick()
10/12/2008 22:45 jasejunk#6
Looting is harder if you're a ranged class though. The best way (that I've seen) to do it, is to have your mouse scan the whole play screen until your cursor changes (indicating that it is over a monster. Then have the bot click it and run a small way and then click it again. Rpt until monster is looted and then continue bot.
10/12/2008 23:47 MaXiMiUS#7
Quote:
Originally Posted by jasejunk View Post
Looting is harder if you're a ranged class though. The best way (that I've seen) to do it, is to have your mouse scan the whole play screen until your cursor changes (indicating that it is over a monster. Then have the bot click it and run a small way and then click it again. Rpt until monster is looted and then continue bot.
I could do it better :-P

(and just to prove it to myself, I'm trying to! hehe)

Code:
;$config[1] = width
;$config[2] = height
Func ScanForEnemyCorpse()
	BlockInput(1)
	For $x = 10 To $config[1] Step 1
		For $y = 0 To $config[2] Step 1
			MouseMove($x,$y,0)
			Switch IsArray(PixelSearch($x, $y, $x+100, $y+100, 0x000000))
				Case 1
						; This assumes 1 second = 2x full width .. which could be very wrong
						; Also assumes 1 second of running = 0.4x full height .. which is PROBABLY very wrong
					Switch $x > $halfWidth
						Case 0
							Turn(($x/(2*$config[1])),0)
						Case 1
							Turn(($x/(2*$config[1])),1)
					EndSwitch
					Switch ($temp = ($y/0.4/$config[2])) < 80
						Case 1
							MouseClick("right",$x,$y)
						Case 0
							MoveForward(($y/0.4/$config[2]))
					EndSwitch
					ScanForEnemyCorpse()
					Return 1
			EndSwitch
		Next
	Next		
	BlockInput(1)
EndFunc
Too tired to continue working on it for today.

Edit:

Dragging the mouse to the center of the screen instead of Turning would probably be much more accurate.
10/13/2008 19:12 MissCountry#8
Yeah macro looting is pretty hard to pull of in this game because regardless you always have to "click" the corpse...
hehe
10/14/2008 05:41 LastDance#9
Can you make 1 for Squig Herder? Cos if mob comes into melee range the arrows won't go off.

And if Squig dies, to summon again.

Thanks!