Page 1 of 2

VG Bot - Warrior Bot (By Ant)

Posted: March 24th, 2007, 6:20 pm
by antareus
Hey all,

This is my second melee bot which is pretty much the same as the paladin bot, expect without all the self healing aspects.

As with the paladin bot, the warrior bot is a modification of the original sample necro bot, and has several fixes for that sample bot.


Here's a list of the new features that are currently in the Ant Warrior Bot:

-Chain Attacks have been added to the end of the attack line in the KillCurrentTarget function.

-The combat loop now loops properly.

-The Auto Attack code has been fixed as well, now the bot will check to see if your Auto Attack ability is on before trying to turn it on itself. Previous with the sample bot, the bot would just turn on ( or in most cases off) the auto attack, without checking first to see if it was on or off.

In Development:

-The bot being able to handle adds. This is a huge problem for many and I'll be looking more closely over this during the weekend.

- Self buffing. I will try to make the bot buff itself at the beginning of the bot, and then rebuff once the buff has run out. The buffing shouldn't be a problem, but still haven't found a proper way to help the bot see if the buff is on or off.

- The chocie to avoid certain mobs, as in you put the mobs names on a list and if that mob appears the bot will move safely away from that mob.

- A possible Self Resurrecter. Yet this is still in concept :P.
BUGs

-So far I've only experienced one bug, and that is a mob health bug. When the mobs die, their health sometimes doesn't go all the way down. This confuses the bot and causes it to continue to attack the mob till the mob vanishes. Still looking for a solution to this, if there is on.

How to set up

If you've already tried the sample necro bot then you will notice that the Ant Warrior Bot is self tuned in pretty much the same way.
However here's a remind for what you need to tweak in order for the bot to work properly on your pc.

1) First you will see a long list of skills with their sleep time added under them. In this list, add the variables for the skills that you want your bot to use. Forexample, if you want the bot to be able to identify your characters different attacks as variables, then use the following string of

code:
const HOTKEY_SPELL_ATTACK = "1"
Note: The "1" is the location of your attack on your in-game hotbar.

Next you will want to add a variable for "waiting", so that the bot will pause for a short while after activating the attack. You can do this with this.

code:
const SLEEP_SPELL_ATTACK = 2000
Note: the 2000 is how many seconds you want the bot to wait. 1000 = 1 second.

Also in the skills list, make sure that your hotkeys are all set correctly, such as for the Target Next Mob variable.Default for this variable is TAB.

1.5) For the string "const MAX_RUNS = 500000", besure to edit the number to how many times you want the bot to run.

2) Now that you have your skills defined, you will need to tell the bot what mobs you want to hunt. You do this under the "Dim GoodSpawns(3)" code. Now first off, the "3" in Dim GoodSpawns(3), tells the bot how many mobs you want to kill. Since the bot also counts the number 0.. 4 mobs is equal to 3. So if there's a total of 6 mobs in the area that you want to kill, simply change the 3 to a 5.
Now under Dim GoodSpawns(3), you will see a list of names as follows:

GoodSpawns(0) = "Grass Beetle"
GoodSpawns(1) = "Giant Spider"
GoodSpawns(2) = "Young Leaper"
GoodSpawns(3) = "Infected Rat"

These are the default settings which you will no doubt need to change in order for the bot to work for you. However this is done simply by changing the name. So if you want to attack a deer called "Horny Deer" then add this code:

GoodSpawns(4) = "Horny Deer"
or just change one of the previous "GoodSpawns()".

Also note: if you add a GoodSpawn string, don't forget to increase the number in Dim GoodSpawns().

3) As it is, your bot is ready to fight a basic fight, however you will want to customize it as much as possible, in order for the bot to work in the best possible way.

In the bot, scroll down to :
function KillCurrentTarget()
From this point to endfuction, every attack your bot does is defined here.
Now it is very important that you make sure that the skill names defined, and the order of location, are correct according to your specifications.
Im not gonna go into too much detail but here's how to make a simple attack code:

faceMob getTarget
Log.DebugLog ("Cast HOTKEY_ATTACK_SPELL_...")
VGSendText HOTKEY_ATTACK_SPELL_
Sleep SLEEP_ATTACK_SPELL_

The Log.DebugLog, gives you messages in the VGExtreme client. VGSendtext, is the hotkey you want the bot to press (note that this is where the previously defined variables comes in). And finally theres Sleep ( again with the previously defined variables).

Just edit that code and add it to your bot in order for it to activate that a skill during combat.


4. And that's it for now, just press F5, and let the bot do it's job.

As a final note however, the bot uses an array waypoint feature, which is simply a bunch of waypoints combined into a list. You can use pretty much any waypoint creater that you find for vanguard in these forums, just be sure to select X, Y as the format which you want the waypoints to be in.
I recommend using the Waypoint Creator 1.0 by Binafus. It's really simple to use and fully compatible with the Ant bots ( just be sure to set the format to equal to 2, in the waypoint creater). You can find it here:
Register to unlock hidden link

When you have the waypoint list you will need to do two things.
First you need to copy and paste the list into the Ant Bot, replacing the list which you should be able to see in the beginning of the script.
Secondly you will notice this string of code:

const WAYPOINTS = 23
Dim WAYPOINT_ARRAY(23,1)

These two strings of code tell the bot how many way points there are, and what format they are in. So for const WAYPOINT, you simply put the number of waypoints you want your bot to go through. Secondly under Dim WAYPOINT_ARRAY, as before insert the number of waypoints that you want the bot to go through, however make sure that the number after is "1" as it tells the bot that you're using X and Y variables to define your waypoints.

FAQ.

Q- Sometimes I leave my computer for a couple of minutes and when I come back I find my character dead! Is there anyway for the bot to ress my character and continue the grinding as he did before?

A- Atm, the bot is only an attacker bot so it hasn't been equiped with a self resser. The main reason for this was because I was only planning on the Ant bots being used as short term project, untill the bigger VGextreme bots start appearing. But if I see that it will be a while before the more advance bots start appear, then I'll try to add some more features such as self ressing.

Note:Also a good way to avoid getting killed is placing your bot in areas with non aggresive mobs. In other words, mobs that don't attack you unless you attack them first. Doing so will no doubtly keep your player alive longer, and it will stop those trains of mobs coming after you. Start to create some waypoints for your character to follow as well. Waypoints really help make the bot more effective at grinding, and it helps your character avoid aggroing mobs.

Q- My character isn't a warrior or a paladin, and is therefore his abilities have not be fully taken advantage of by this bot! Will you be porting this bot to any other classes?

A- I'll most likely end up porting the ant warrior bot to other classes, especially the scout classes.However because I'm a regular vangaurd player as well, and because I don't have a character for every class, it could take a while before I start to make some proper ports to the other classes. With that said, feel free to port the Ant warrior bot to other classes if your interested in doing so, my main objective is getting a proper working bot out to as many people as possible, and the more people who can help me accomplish this, the better.
Atm kumqwat420 has offered to port the warrior bot over to dreadknight class.

Q- Back to the bot. Sometimes when I go hunting my bot ignores some of the mobs which I've stated as the ones I wish to hunt! Why is that?!

A- Well, the bot works by finding mobs, then pressing "Tab" to select them. If the mobs are too far away, or if there are other mobs which are closer to you then the one you want killed, then the bot cant select it and will therefore continue to looking for other mobs. Hence why the bot may ignore some mobs.

If you have any other questions, please feel free to ask below.

Conclusion

Let me know how the bot runs for you and if you are experiencing any problems while running the bot.


Regards,
Antareus

Posted: March 25th, 2007, 4:38 am
by antareus
The following features have been added to the bot:

Ant VG Warrior Bot V1.10
-The bot will now stop attacking the mobs once they are dead. The issue with the bot continuing to attack has therefore now been fixed.
-A new array waypoint system has been added.

Ant VG Warrior Bot V1.15
- A new, more advance auto attack script has been written in order to fix the issue with the bot continuing to attack, it's still a bit shaky atm so if you find any bugs with the auto attack script, let me know. (keep in mind that the bot now relys on the hotkey attacks to initiate the auto attack sequence, and that the bot will now end auto attack at the end of the combat sequence).


Ant VG Warrior Bot V1.16
-THe auto attack script has been edited yet again (lol). This time i've fixed the spamming issue the autoattack on/off script was causing. Instead I've decided to let the auto attack stay on after it has been activated by a melee attack skill, and the bot will now stop attacking once it notices that your character isn't auto attacking. Again I consider all parts of the code to still be in testing so if you notice any bugs, or if you have any suggestions, let me know :).

Posted: March 25th, 2007, 9:37 am
by lead2gold
Its working fine for me, keep up the great work :)

Posted: March 25th, 2007, 11:16 am
by antareus
lead2gold wrote:Its working fine for me, keep up the great work :)
Thanks, good to hear :). And don't worry, I still have a lot more features that I want to add to my bots.

Nice

Posted: March 25th, 2007, 12:12 pm
by yantox
Thank you antareus , this is what i ask as my first post to Tault_mississippi on 18 Feb 2007 18:51, a simple bot script with explanation...wow you great.

It works nice and simple.

Thank you so much antareus.
yantox

Posted: March 25th, 2007, 6:35 pm
by wyvernx
antareus, in a very soon patch, I'll have a ability list, and a current buff/spells list. To see what spells are active.

Posted: March 26th, 2007, 7:12 am
by antareus
wyvernx wrote:antareus, in a very soon patch, I'll have a ability list, and a current buff/spells list. To see what spells are active.
Sounds really nice Wyvernx, will definantly be very usefull for the self-buffing add-on, which I'm planning on releasing soon :D

Posted: March 27th, 2007, 9:55 am
by antareus
Btw I've been thinking. Shouldn't we be getting some kind of TU Bucks for our efforts? :P

Posted: March 27th, 2007, 12:32 pm
by antareus
Ok so a little heads up as to what I'm up to atm.

As I see it, the bot has three major flaws.

1. If a mob flees during combat the bot fails to follow the mob.
2. The bot does not rest after combat. ( This is especially an issue for the warrior bots).
3. And last but not least, the bot has trouble handling adds.

So atm I'm trying to solve these 3 issues before I start to add the extra features such as the buffing and harvesting.

The first and second issues I've pretty much got covered, I know exactly why it's doing it and what I need to do to fix it. The third one is a bit tricky as I may have to re-write a larger portion of my attack function in order to give the bot more defined variables to work with.

Mind you I've been noticing the Bloodmages progress as I must say that there are a lot of brilliant ideas flowing in it's thread. With that said, I'm planning on copying the bloodmages pause script and its "what to do if someone sends the bot a tell" script. I hope you don't mind Binafus :P .

Anyway I'll probaly be releasing V1.70 tomorrow which should include a fix to the first two issues mentioned in this post.

Regards,
Antareus

EDIT: Because of the VG update, I've been unable to test the new set of code that I've written for the warrior bot. I'll post the new version (1.70) as soon as I get it tested which now probaly won't be till on saturday ( seeing as thats the day I probaly have the most spare time in order to fix the little bugs that the 1.70 script might have).
Sorry for the delay.

Posted: March 27th, 2007, 1:12 pm
by wyvernx
Yes, its just that tubucks are down atm. They are working on adding back in points/bucks to the new forums.

Posted: March 27th, 2007, 1:54 pm
by binafus
Mind you I've been noticing the Bloodmages progress as I must say that there are a lot of brilliant ideas flowing in it's thread. With that said, I'm planning on copying the bloodmages pause script and its "what to do if someone sends the bot a tell" script. I hope you don't mind Binafus .
I do not mind at all.

I was thinking about redoing some of the code that would make it generic, then all that would need to be redone for other classes would be the actual fighting part.

You might hold off on the sends the bot a tell part there needs to be a way to tell the bot to stop, where it will close all the open files and logs instead of manually stoping the bot.

On the checking for a pause part you will need to check for it more often than I'm doing now.
You have to actually be hitting the pause key when it checks even though that is not the way it is suppose to work.

Posted: March 28th, 2007, 6:14 pm
by morken
just tried out the bot. My character is just running past mobs and not attacking though. I read it in the FAQ, but there are sometimes no other mobs around at all and hes right next to the mob! any ideas?

*More Attempts*
I tried disabling the entire waypoint part of the code, and just sat my character next to one of the "Good Mobs" i have written down in the section. He just sits there and nothing happens... =(

Posted: March 29th, 2007, 12:49 am
by afterthott
please do a DK bot :)

I love that I can customize the spell/ability and the sleep time.

I could prob convert this one into a DK bot eh?

Posted: March 29th, 2007, 9:30 am
by antareus
afterthott wrote:please do a DK bot :)

I love that I can customize the spell/ability and the sleep time.

I could prob convert this one into a DK bot eh?
has already been done :P
Register to unlock hidden link

but feel free to do any changes that you feel necessary, the code is very basic so it shouldnt be too hard :P.


Also to the previous poster, atm all bots are down till VGE is updated.

Posted: April 26th, 2007, 7:13 am
by kashyma2k
dont work for mi :(