genbot.mac Generic Bot macro for any class. V8 with ini

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Rollback.

Post by grimjack » Sun Oct 26, 2003 5:48 am

Had to pull out some of the changes.

Heal code was doing some very odd things so I reverted to old method that worked. Also fixed problems in personal.inc.

bots will now listen in chat chans now if listengroup is on. Use caution with this.

When I removed the new healer code I had to remove the watchtarget stuff for now too. I'll re-add it once I can find a copy of the code I had used previous to the update.

I think I'm going to hold off on any more major changes for a few days if not a week to get this current code more stable.

Thanks
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

Post by LordGiddion » Sun Oct 26, 2003 9:32 am

Grim Please define odd and weirdness, so I can try to fix.

Narces
a lesser mummy
a lesser mummy
Posts: 37
Joined: Thu Aug 07, 2003 7:50 am

Commands

Post by Narces » Sun Oct 26, 2003 11:17 am

I had been using a modified version for quiet awhile on a high end raid rogue. Some commands you might want to add:

Range Mod: Necessary to be able to change this thru command as sometimes you need to attack at max range. Example: /tell bot rmod -5 (to shorten range) or /tell bot rmod +10 (to fight further away)

Code: Select all

Sub Do-rmod 
   /if $strlen("$p1")!=0 {
      /tell $MasterName Old Ranges: $RangeMin $RangeMax $FastRange
      /delay 2s
      /varset rangemod $p1
      /varcalc RangeMin $RangeMin +$rangemod
      /varcalc RangeMax $RangeMax +$rangemod
      /varcalc FastRange $FastRange +$rangemod
      /tell $MasterName New Ranges: $RangeMin $RangeMax $FastRange
   }
/return 
Circle Strafing. I talked about this on your old macro, but found the one you use to be useful in certain situations. Added a flag for which type to use. Circle Strafing code mostly from Jay.

Code: Select all

Sub Do-behind
   :behind
   /doevents
   /call RangeSub
  | ----- Clockwise Rotate Check ----- 
   /if n $target(heading)>=180 /if n $calc($target(heading)-180)<=$char(heading) /if n $char(heading)<$calc($target(heading)-22.5) /call bsclock 
   /if n $target(heading)>=180 /if n $char(heading)<=180 /if n $calc($char(heading)-22.5)>$calc($target(heading)-360) /call bscounter 
   /if n $target(heading)<=180 /if n $char(heading)<$calc($target(heading)-22.5) /call bsclock 
  | ----- Counter Clockwise Rotate Check ----- 
   /if n $char(heading)>=180 /if n $calc($char(heading)-180)<=$target(heading) /if $char(heading)>$calc($target(heading)+22.5) /call bscounter 
   /if n $char(heading)>=180 /if n $target(heading)<=180 /if n $calc($char(heading)-157.5)<$calc($target(heading)+180) /call bsclock 
   /if n $char(heading)<=180 /if n $target(heading)<=180 /if n $char(heading)>$calc($target(heading)+25) /call bscounter 
   /if n $calc($abs($target(heading)-$char(heading)))>30 {
      /goto :behind
}
/return

Sub bsclock
   /echo Strafing right.
   /sendkey down ctrl 
   /sendkey down right
   /delay 3
   /sendkey up right
   /sendkey up ctrl 
   /press right
   /press ctrl
   /face fast nopredict
/return

Sub bscounter
   /echo Strafing left.
   /sendkey down ctrl 
   /sendkey down left
   /delay 3
   /sendkey up left
   /sendkey up ctrl
   /press left
   /press ctrl 
   /face fast nopredict
/return
Goblin Skull Earring. Auto equips and recasts as needed. Not the best code, looks pretty fucking sloppy, but it worked for my purposes.

Code: Select all

Sub Do-Gob
   /click left hotkey 6
   /delay 1s
   /click left hotkey 4
   /delay 1s
   /click right hotkey 4 
   /delay 1s
   /click left hotkey 4
   /delay 1s
   /click left hotkey 6
   /delay 1s
/return

Sub Event_Gob
   /click left hotkey 6
   /delay 1s
   /click left hotkey 4
   /delay 1s
   /click right hotkey 4 
   /delay 1s
   /click left hotkey 4
   /delay 1s
   /click left hotkey 6
   /delay 1s
/return
Haven't looked into your new code much, but looks like a nice piece of work. Any plans on making strictly a rogue version? Are settings in the ini sorted by character if someone wanted to use the script on more than one char?

greggor
orc pawn
orc pawn
Posts: 28
Joined: Tue Jun 17, 2003 2:30 pm

Post by greggor » Sun Oct 26, 2003 12:05 pm

yeah I didn't see anything too wierd ... just an extra ch every once in a while. Anyway here are some of the changes that I use just to give you some ideas, use them or not hehe.



1. the check agressive code in botcombat version 8.1...


Sub CheckAggressive
/if $invpanel==TRUE /return
/call CheckPuller
/if $combat==TRUE {
/if @Aggressive!="1" /return
}

/if @Agressive!="1" /return
/if "@Param0"!~"say" {
/if "@Param0"!="group" {
/if "@Param0"!="out of character" {
/if "@Param0"!="shout" {
/if "@Param0"!~"guild" {
/if $target()==TRUE /if "$target(type)"!="NPC" {
/target clear
/delay 2s
}


The red part is my addition... As a healer (and I would assume any caster) when trying to heal oneself and getting hit at the time he would deselect target in the middle of spellsub and if he were interrupted he would recast on the mob... Since I do not run aggressive code on anyone except the warrior this line helps.


2. A healer sitting right after healing oneself tends to lead to a vicious cycle... I used a different approach, but I think this would be a better way (UNTESTED) This is 8.15 but the basic premise should work in all versions as it has always been a problem for me since I started using your genbot macro about 4 month ago. And please don't take that as an insult Grim hehe we all bow to your greatness just try to thow you a little help every once in a while. I will leave the variable declare/ini file support sintax to you since it still goes a lil over my head... New variables are
@SitAfterCastTimer Global
@SitDown Global (ini file so you can choose to have bot auto sit down on starting macro)

/if n @CasterHealIsHot==1 {
/if n @HOTWait>0 {
/if n @Param0==@HealedId /return
}
}
/if n @Param0==$char(id)
{
/press F1
/varset SitAfterCast 0
/varset SitAfterCastTimer 15s
}

/if n @Param0!=$char(id) /target id @Param0
/stand
/if n @CastMsgTimer2<=0 {
/if n @ReportAutoHeal==1 /g @HealCasterMsg
/varset CastMsgTimer2 50
}
/call SpellSub "@CasterSpell"
/varset HealedId @Param0
/varset HOTWait @HotDelay
/if n @SitAfterCast==1
/if $char(state)==STAND/sit on

/press esc
/return



Sub Event_timer
/if "@Param0"=="SitAfterCastTimer" {
/varset SitAfterCast 1
/varset SitDown 1
/return


In my Personal.inc, but maybe if you would adopt this it should go directly into genbot.mac.

/if n @SitDown==1 {
/varset SitDown 0
/if $char(state)==STAND /sit
}

3. When resisted I liked having bot auto recast... so to give people the option I added to botspell.inc v8.21...

New variable @RecastOnResist global (ini file)


Sub Event_CastResist
/call ChatOut 3 @MasterName "%t Resisted."
/varset Fail 1

/if RecastOnResist==1 /varset DoAgain 1
/return


4. Personally all the cap/lowercase changes in variable are a bit annoying... Its your macro keep it how you will and I tried to stay with your variable syntax... but with the requirement of correct capitalization it can sometimes throw me off...

Great job overall and I hope what little I offered is of some use to you.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Sun Oct 26, 2003 12:54 pm

LordGiddion wrote:Grim Please define odd and weirdness, so I can try to fix.
It sometimes healed the wrong targets and sometimes didn't heal at all. All in all it didn't make for a good exp night for me hehe. I think I'm going to stick with the simpeler code for now and if something more involved is needed it can be added in the personal file. Once I can run this for a 3 or 4 days without finidng any bugs I'll then start to look into adding extra functionality.

Thanks
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

User avatar
Undies
a ghoul
a ghoul
Posts: 94
Joined: Mon Oct 20, 2003 9:12 pm

Post by Undies » Sun Oct 26, 2003 11:57 pm

Hmm well I had v8.0 running on a raid pulling monk before I was really familiar with it... comments

- with beagg=1 monk became extremely suicidal (death on first mob of raid)
- even with beagg=0 the script would do all sorts of crazy things to the monk and prevent him from manually returning to camp after the pull.

So I turned it off and used the old way. Maybe it has something to do with that puller code (still havent figured out what it is supposed to do yet).

- afollow (cant seem to turn it off easily)

Also personal.inc

I have several characters so a single personal.inc is unsuitable. I have cleaned out personal.inc and will make it call other routines based on the character, eg. monk.inc, shaman.inc etc. Just seems a cleaner way of doing it.

I'll have a go myself at trying to find the probs mentioned and get back....

Great job BTW!

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Mon Oct 27, 2003 5:07 am

Undies wrote:Hmm well I had v8.0 running on a raid pulling monk before I was really familiar with it... comments

- with beagg=1 monk became extremely suicidal (death on first mob of raid)
- even with beagg=0 the script would do all sorts of crazy things to the monk and prevent him from manually returning to camp after the pull.

So I turned it off and used the old way. Maybe it has something to do with that puller code (still havent figured out what it is supposed to do yet).

- afollow (cant seem to turn it off easily)

Also personal.inc

I have several characters so a single personal.inc is unsuitable. I have cleaned out personal.inc and will make it call other routines based on the character, eg. monk.inc, shaman.inc etc. Just seems a cleaner way of doing it.

I'll have a go myself at trying to find the probs mentioned and get back....

Great job BTW!
The stop command will stop afollow. With the ini file multil characters using the same personal.inc should not be a problem. I run 8 different classes with 1 personal file. You just have to set up each characters ini file to have the settings suitable for it. If you have puller set to on and you send the bot out to attack it will wack the mob once and head back to it's anchor point if you have one set.

Thanks
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

ScoobieDo

Testing

Post by ScoobieDo » Mon Oct 27, 2003 12:46 pm

To elaborate on the "wierdness" associated with the version 8.1 autohealer, including the watchtarget:

The healer would tell the group he was casting "NOTFOUND" for autoheals and then never cast. When told by master /msg to "heal", the healer would reply to master that he was casting "NA" on the target and never cast anything.

The healer in question has been testing genbot since inception and had the correct spell names and other info entered in the ini.

These issues occured with watchtarget enabled and no targets selected, with watchtarget enabled and single target selected and with watchtarget disabled. The testing was done with the master, healer bot and pet class bot on one machine and 4 other bots on other machines.

The watchtarget feature in genbot is promising in that it will enable a single healer bot to cover healing for those in same group and others outside of that group. I hope this information is helpful.

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Mon Oct 27, 2003 1:06 pm

healer would tell the group he was casting "NOTFOUND" for autoheals
I had to add "Tankhealmsg" manually to the INI file created for the user

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

Post by LordGiddion » Mon Oct 27, 2003 2:35 pm

I'll look into the ini stuff this evening, I just sent an updated bothealer to grim, if you want I could post here in the middle of the thread and edit it out next time he update the main posting. My testing 3 hrs with 55 cleric, 57 magician, 35 warior. Cleric (with VoQ) and Mage grouped (mage not taking much damage but pet taking some) warrior solo being pl'd by watchtarget. Cleric managed all the heals well - pet and warrior both stayed up even though mobs were yellow con to warrior. Warrior took an average of 2 heals per pull. Pet 1 heal per 2 and mage 2 heals during 3 hr period. Cleric didn't miss any heals but warrior did get down to 10% a couple of times before CH hit. Patch heal never fired but by the time warrior was below 25% the CH was already started. Warrior was anchored and Puller was on - he found and pulled his own targets perfectly - only three times did he get double pulls - and twice he lost aggro on 1 and it took off after the cleric. Cleric fought back with mace and spells (spells via my personal.inc) and still dropped heals on warrior though durring this point warrior got below 10% I think it was the extra delays caused by cleric dd spells. Honestly if mage hadn't finished off his mob and pulled mob off of cleric, cleric would have died to green con mob. Cleric kept aggressive on the mob till it died but still managed to drop heals on warrior.
Except for the fact that cleric can't fight worth crap I think all went well.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Mon Oct 27, 2003 8:14 pm

bob_the_builder wrote:
healer would tell the group he was casting "NOTFOUND" for autoheals
I had to add "Tankhealmsg" manually to the INI file created for the user
This was not the same issue that Scoobie had. He's a personal friend of mine.
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Mon Oct 27, 2003 8:16 pm

LordGiddion wrote:I'll look into the ini stuff this evening, I just sent an updated bothealer to grim, if you want I could post here in the middle of the thread and edit it out next time he update the main posting. My testing 3 hrs with 55 cleric, 57 magician, 35 warior. Cleric (with VoQ) and Mage grouped (mage not taking much damage but pet taking some) warrior solo being pl'd by watchtarget. Cleric managed all the heals well - pet and warrior both stayed up even though mobs were yellow con to warrior. Warrior took an average of 2 heals per pull. Pet 1 heal per 2 and mage 2 heals during 3 hr period. Cleric didn't miss any heals but warrior did get down to 10% a couple of times before CH hit. Patch heal never fired but by the time warrior was below 25% the CH was already started. Warrior was anchored and Puller was on - he found and pulled his own targets perfectly - only three times did he get double pulls - and twice he lost aggro on 1 and it took off after the cleric. Cleric fought back with mace and spells (spells via my personal.inc) and still dropped heals on warrior though durring this point warrior got below 10% I think it was the extra delays caused by cleric dd spells. Honestly if mage hadn't finished off his mob and pulled mob off of cleric, cleric would have died to green con mob. Cleric kept aggressive on the mob till it died but still managed to drop heals on warrior.
Except for the fact that cleric can't fight worth crap I think all went well.
Once I get a chance to test this out with my healer friends I'll add it back. I really like the code I just had so many additions pinpointing which one caused the problems was dificult. I have a fairly stable version I'm going to post here in the next 10 minutes or so that uses the chat and verbosity vunctions and I should be able to test your new healer tonight.

Thanks
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

User avatar
Undies
a ghoul
a ghoul
Posts: 94
Joined: Mon Oct 20, 2003 9:12 pm

Post by Undies » Mon Oct 27, 2003 9:11 pm

There are a couple of bugs still in the combat part.

When puller and bona are both on my monk starts fighting for a sec then sprints to the nearest cliff and throws herself off! Setting both to zero fixes it. (anchor = 0 too BTW). This happened more than once.

Also as I said earlier, when using monk as a semi-bot, manually looking around for something, tagging, FDing etc and returning to camp it does have some problems... she changes direction and refuses to move forward etc.... I gather this is because genbot was not designed for semi-auto mode. I'll still look into however. Expecting a bot to understand the nuances of monk pulling is certainly asking too much so it needs a manual mode where it does nothing at all until told.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Update:

Post by grimjack » Mon Oct 27, 2003 9:45 pm

Healer code from lorg has been tested(As good as a wizard pretending to be a cleric can) and is in. I tracked down the ini problem and made a few changes but all seems to be working. Added in the verbosity stuff from my last update and made a lot of /if ( blah==blah && blah2==blah2) into nested if's since I found some bugs hapening with that while debuging also. For the most part the /if like that works but it bombs out a lot worse than a nested if(kills the whole macro instead of moving on) when things go wrong. I found this the other day when debuging why chat code was bombing the macro out very randomly.

Files changed:
bothealer.inc
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Mon Oct 27, 2003 9:50 pm

Undies wrote:There are a couple of bugs still in the combat part.

When puller and bona are both on my monk starts fighting for a sec then sprints to the nearest cliff and throws herself off! Setting both to zero fixes it. (anchor = 0 too BTW). This happened more than once.

Also as I said earlier, when using monk as a semi-bot, manually looking around for something, tagging, FDing etc and returning to camp it does have some problems... she changes direction and refuses to move forward etc.... I gather this is because genbot was not designed for semi-auto mode. I'll still look into however. Expecting a bot to understand the nuances of monk pulling is certainly asking too much so it needs a manual mode where it does nothing at all until told.
Puller must have an anchor. If it does not have an anchor it will do very bad things. The point of puller is that it will check if you are close to the anchor after hiting a mob and if not it will return to close to the anchor. If you don't have an anchor set who knows where it will take you. Don't use puller on unless you are the puller and you need it to auto return to the anchor on pulls. If you want to partialy control the bot I would suggest that you don't run with aggressive, puller, anchor, or any code turned on that controls movement.

Thanks
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack