genbot.mac Bot for any class.

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

Moderator: MacroQuest Developers

blakbelt
a lesser mummy
a lesser mummy
Posts: 70
Joined: Wed Aug 27, 2003 12:40 pm
Location: Scotland UK

Post by blakbelt » Thu Oct 16, 2003 2:52 am

Seems to be a boring night on shift again, yet another hastily modified version to suit my needs, here is botcombat modified for those monks out there.

Code: Select all

|botcombat.inc 
|Bot combat module. 
|Version 6.2 
|Date:10/08/2003 9:31pm 
|Modified for a monk being used as main tank
| 
|Commands in this module: 
|flyingkick, disarm
|attack, noattack
| 
| 

#Event Enraged "has become ENRAGED" 
#Event Offrage "is no longer enraged" 

Sub CombatCommands 
   /varset Commands(2,0) attack 
   /varset Commands(2,1) noattack 
   /varset Commands(2,2) flyingkick 
   /varset Commands(2,3) disarm
   /varset ArrayComb 4 
/return 

Sub TellCmds-combat 
   /msg @MasterName attack, noattack, flyingkick, disarm 
/return 


||||||||||||||||||||||||||||||||||||| 
Sub SetupCombatVars 
   /declare CmdList-combat global 
   /declare DoFlyingKick global 
   /declare DoDisarm global 
   /declare EnrageVar global 
   /declare Combatstatus global 
/return 

|Combatcheck 
|Used to check if attack is on and should not be. 
|Usage /call Combatcheck. 
Sub Combatcheck 
   /if @EnrageVar=="1" { 
      /if $target()=="TRUE" { 
         /return 
      } else { 
         /varset EnrageVar 0 
         /varset Combatstatus 0 
      } 
   } 
   /if $target()=="FALSE" { 
      /varset Combatstatus 0 
      /if $combat=="TRUE" { 
         /attack off 
      } 
      /return 
   } 
/return 

|RangeSub 
|Used to keep bot in combat range. 
|Usage /call Rangesub 
|Vars Used: RangeMax, RangeMin, FastRange 
Sub Rangesub 
   /face fast look nopredict 
   /if n $target(distance,nopredict)>=@FastRange /call Fastmove 
   /if n $target(distance,nopredict)>@RangeMax { 
      /press up 
   } 
   /if n $target(distance,nopredict)<@RangeMin { 
      /press down 
   } 
/return 

|MeleeAbility 
|Used to do melee abilities if vars are set to. 
|Usage /call MeleeAbility 
Sub MeleeAbility 
   /if n @DoDisarm==1 { 
      /if n $char(ability,"Disarm")>0 { 
         /doability "Disarm" 
      } 
   } 
   /if n @DoFlyingKick==1 { 
      /if n $char(ability,"Flying Kick")>0 { 
         /doability "Flying Kick" 
      } 
   } 
/return 

|Fastmove 
|Called by Rangesub for when mob is more than /press distance away. 
|Usage: /call Fastmove 
Sub Fastmove 
   :fastmoveloop 
   /doevents 
   /if $target()=="FALSE" { 
      /varset Combatstatus 0 
      /sendkey up up 
      /if $combat=="TRUE" { 
         /attack off 
         /return 
      } 
   } 
   /face fast look nopredict 
   /if n $target(distance,nopredict)>@FastRange { 
      /sendkey down up 
   } 
   /if n $target(distance,nopredict)<=@FastRange { 
         /if @Combatstatus=="1" { 
            /if @EnrageVar=="0" { 
            } 
         } 
      /sendkey up up 
      /return 
   } 
   /goto :fastmoveloop 
/return 

Sub Event_Enraged 
   /if $target()=="TRUE" { 
      /if n @Combatstatus==1 { 
         /varset EnrageVar 1 
         /attack off 
      } 
      /varset EnrageVar 1 
   } 
/return 

Sub Event_Offrage 
   /if $target()=="TRUE" { 
      /if n @Combatstatus==1 { 
         /varset EnrageVar 0 
         /attack 
      
      } 
      /varset EnrageVar 0 
   } 
/return 

||||||||||||||||Command Subs 
[color=red]Sub Do-flyingkick 
   /if @DoFlyingKick==0 { 
      /tell @MasterName AutoKick is now off 
      /varset DoFlyingKick 0 
      /return 
   } 
   /if @DoFlyingKick==1 { 
      /tell @MasterName AutoKick is now on 
      /varset DoFlyingKick 1 
      /return 
   } 
/return [/color]
Sub Do-disarm
   /if @DoDisarm==1 { 
      /tell @MasterName AutoDisarm is now off 
      /varset DoDisarm 0 
      /return 
   } 
   /if @DoDisarm==0 { 
      /tell @MasterName AutoDisarm is now on 
      /varset DoDisarm 1 
      /return 
   } 
/return 

Sub Do-attack 
   /varset Afollow 0 
   /varset FollowTarget "NULL" 
   /varset Combatstatus 1 
   /sit off 
   /if $defined(Param1)==FALSE { { 
      /assist @MasterName 
      /delay 5 
   } else /if $defined(Param2)==FALSE { 
      /target npc "@Param1" 
   } else /if $defined(Param3)==FALSE { 
      /target npc "@Param1 @Param2" 
   } else /if $defined(Param4)==FALSE { 
      /target npc "@Param1 @Param2 @Param3" 
   } else npc /target "@Param1 @Param2 @Param3 @Param4" 
   /tell @MasterName Attacking %t 
   /attack on 
/return 

Sub Do-noattack 
   /attack off 
   /varset @Combatstatus 0 
/return
untested as you no doubt have figured ;)
Blakbelt

blakbelt
a lesser mummy
a lesser mummy
Posts: 70
Joined: Wed Aug 27, 2003 12:40 pm
Location: Scotland UK

Post by blakbelt » Thu Oct 16, 2003 2:56 am

Grim have just noticed and corrected my version:

The code highlighted in red which in your botcombat is DoKick, the 0 and the 1 are the wrong way round.
Blakbelt

blakbelt
a lesser mummy
a lesser mummy
Posts: 70
Joined: Wed Aug 27, 2003 12:40 pm
Location: Scotland UK

Re: genbot.mac Bot for any class.

Post by blakbelt » Thu Oct 16, 2003 2:59 am

grimjack wrote: Sub Do-kick
/if @DoKick==1 {
/tell @MasterName AutoKick is now off
/varset DoKick 0
/return
}
/if @DoKick==0 {
/tell @MasterName AutoKick is now on
/varset DoKick 1
/return
}
/return
Realised when i read what i had written it was a touch vague, above you have @DoKick==1 .... /varset DoKick 0 and vice versa for the on toggle, is this correct or a typo??
Blakbelt

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

Re: genbot.mac Bot for any class.

Post by grimjack » Thu Oct 16, 2003 1:41 pm

blakbelt wrote:
grimjack wrote: Sub Do-kick
/if @DoKick==1 {
/tell @MasterName AutoKick is now off
/varset DoKick 0
/return
}
/if @DoKick==0 {
/tell @MasterName AutoKick is now on
/varset DoKick 1
/return
}
/return
Realised when i read what i had written it was a touch vague, above you have @DoKick==1 .... /varset DoKick 0 and vice versa for the on toggle, is this correct or a typo??

It is correct. It checks the current state, then sets it to the opposite state. That is what makes it a toggle.

Also I would prefere if you added things that you put them in the personal.inc. If they are changes that I like (Like the monk addidtion) I will add them to the base modules. It will be much easier for me to see what you did in the personal.inc.

You will need to change your toggle. I'll change it when i add the abilities to the combat module.

Thanks
GrimJack
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 » Thu Oct 16, 2003 2:17 pm

Updated personal.inc botcore.inc and botcombat.inc.

Anchors now get removed on zoning. Fix for problem with sucoring or porting an anchored bot.

Added AutoDisarm and AutoFlyingKick.

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
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

FIX

Post by grimjack » Fri Oct 17, 2003 4:23 am

Fixed fix to something that could have been a nasty bug. Somehow some {'s got doubled last post. You will want to regrab all but the personal.inc

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

blakbelt
a lesser mummy
a lesser mummy
Posts: 70
Joined: Wed Aug 27, 2003 12:40 pm
Location: Scotland UK

Post by blakbelt » Fri Oct 17, 2003 4:48 am

Thanks Grim tried to post about that last night but "could not connect to database".
Blakbelt

weapon
a ghoul
a ghoul
Posts: 101
Joined: Tue Oct 01, 2002 7:20 pm

fixes / additions

Post by weapon » Sat Oct 18, 2003 2:10 am

First of all Grim thanks for the great macro. This thing is sick.

BotHealer.inc fixes

Code: Select all

Sub CasterHeal 
   /if n @CasterHealIsHot==1 { 
      /if n [color=red]@[/color]HOTWait>0 { 
         /if n $group(@GroupMember)==@HealedId /return 
      } 
   } 
   /if n $group(@GroupMember)==$char(id) /press F1 
   /if n $group(@GroupMember)!=$char(id) /target id $group(@GroupMember) 
   /varset HealedId $group(@GroupMember) 

   /stand 
   /if n @CastMsgTimer2<=0 { 
      /if n @ReportAutoHeal==1 /g @HealCasterMsg 
      /varset CastMsgTimer2 50 
   } 
   /call SpellSub "@CasterSpell" 
   /if n @SitAfterCast==1 /sit on 
[color=red]   /varset HOTWait @HotDelay [/color]
   /press esc 
/return 
And these added ifs allow you to use sn sub to request spell casts on me. For instance: /tell bot sn virute me

Code: Select all

Sub Do-sn 
   /assist @MasterName 
   /delay 5 
   /if $defined(Param1)==FALSE { 
      /return 
   } else /if $defined(Param2)==FALSE { 
      /tell "@MasterName" Casting @Param1 on %T 
      /call SpellSub "@Param1" 
   } else /if $defined(Param3)==FALSE { 
[color=red]      /if "@Param2"=="me" /target @MasterName {
         /tell "@MasterName" Casting @Param1 on %T 
         /call SpellSub "@Param1" 
      } else {
         /tell "@MasterName" Casting @Param1 @Param2 on %T 
         /call SpellSub "@Param1 @Param2"       
      }
   } else /if $defined(Param4)==FALSE { 
      /if "@Param3"=="me" /target @MasterName {
          /tell "@MasterName" Casting @Param1 @Param2 on %T 
          /call SpellSub "@Param1 @Param2" 
      } else {
          /tell "@MasterName" Casting @Param1 @Param2 @Param3 on %T 
          /call SpellSub "@Param1 @Param2 @Param3"      
      }
   } else { 
      /if "@Param4"=="me" /target @MasterName {
          /tell "@MasterName" Casting @Param1 @Param2 @Param3 on %T 
          /call SpellSub "@Param1 @Param2 @Param3" 
      } else {
          /tell "@MasterName" Casting @Param1 @Param2 @Param3 @Param4 on %T 
          /call SpellSub "@Param1 @Param2 @Param3 @Param4" 
      }
   } [/color]
   /stand 
   /if n @SitAfterCast==1 /sit on 
   /press esc 
/return 

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

Re: fixes / additions

Post by grimjack » Sat Oct 18, 2003 2:36 pm

Added fix for HOT var.

Modules updated:
bothealer.inc

Added fix for sn.

Modules updated:
botspell.inc

Both changes are credited to weapon. 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
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Sat Oct 18, 2003 9:37 pm

Another update tonight. Totaly redid the healing routines. You must have the newest version of all files for this to work. Added section in personal.inc to define what is a tank and what is a caster for purposes of heals. Also added a variable called WatchTarget in personal.inc. When this is set to 1 it will heal any PC that is targeted that is below the pct of health threshold for the class it is (Uses same settings as normal autoheal). You can use this to target a person who is not in groups for autoheals. I will add a command to toggle this sometime after people give feedback on how well it is working.

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

fwiggles
a hill giant
a hill giant
Posts: 161
Joined: Mon Jun 17, 2002 8:29 pm

Post by fwiggles » Sat Oct 18, 2003 9:38 pm

yay just what i wanted grimjack! you the man
[color=red]Latest survey shows that 3 out of 4 people make up 75% of the world's population.[/color]

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

bothealer.inc

Post by grimjack » Sun Oct 19, 2003 12:41 am

Posted a new bothealer.inc

Hopfuly fixed but that would casue healer to not heal target with new code. Will test tonight.
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

GLoBB

Could use some help =)

Post by GLoBB » Sun Oct 19, 2003 8:30 pm

Howdy all

I am totaly dumb when it comes to programing and such, so this wuestion might be dumb, but still.

Been using genbot.mac om my cleric, but cant seem to get him to autoheal my melee char. i start macro bu using /macro genbot "melee name", do the conf tells to set tankheal, casterheal, autoheal, but still it wont autoheal, even tou it reports autoheal=1. am i missing a step in the config or isnt it supposed to autoheal??

"Why strain you brain when there are people smarter then you that already know"

theafkxper
a hill giant
a hill giant
Posts: 207
Joined: Sun Sep 08, 2002 6:41 pm

Post by theafkxper » Sun Oct 19, 2003 9:58 pm

are they in the same group?

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

More fixes.

Post by grimjack » Sun Oct 19, 2003 10:54 pm

Another big update. More bug fixes in the new autoheal code. It should work as intended now. Also updated a bunch of the built in commands so that you can tell the bot /msg botname command me, or /msg botname command yourself, and last /tell botname command botname. Other fixes are also included but I can't remember all of them. All files updated to v7.

Oh 1 last thing, you can now call Sub Tankheal and Casterheal directly. You just have to supply the spawn id of what to heal. Example: /call Tankheal 2342
or /call Tankheal $target(id)


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