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

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

Post by LordGiddion » Sat Oct 04, 2003 8:37 am

May I suggest adding a sub routine call within the main loop, call it PersonalMain or something simular. That will allow for a standard routine within personal.inc where the user can add any routines that need to fire on every interation of main loop.

chickenisgoot
a ghoul
a ghoul
Posts: 84
Joined: Tue Oct 07, 2003 10:52 am

Post by chickenisgoot » Tue Oct 07, 2003 11:09 am

I get an error when an SK is in the group on an autoheal at the line:

/if "$spawn($group(@GroupMember),class)"=="Shadow Knight" /call Tankheal

It spams the screen saying that it can't parse 'shadow'. IT does end up doing the heal, but it spams the screen anytime a SK goes under the tankpctheal hit points.

I put in some debugging, it looks like the $spawn($group(@GroupMember),class) returns "Shadow Knight" but for some reason that line is spitting out errors.

I couldn't figure out how to get rid of the error, any help is appreciated.

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

Post by MacroFiend » Tue Oct 07, 2003 2:01 pm

Try

Code: Select all

/echo "$spawn($group(@GroupMember),class)"
and see if it eats one or both of the quotes.

chickenisgoot
a ghoul
a ghoul
Posts: 84
Joined: Tue Oct 07, 2003 10:52 am

Post by chickenisgoot » Tue Oct 07, 2003 2:32 pm

I've tried taking out the quotes around the $spawn line and it still gives the same error.
/if "$spawn($group(@GroupMember),class)"=="Shadow Knight" /call Tankheal
or
/if $spawn($group(@GroupMember),class)=="Shadow Knight" /call Tankheal

give the same error

/echo $spawn($group(@GroupMember),class) returns Shadow Knight



Is anyone else using this script and autohealing with a SK in the group?

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

Post by LordGiddion » Tue Oct 07, 2003 7:22 pm

ok I add some routines in my personal.inc that I think some people will want to use so I'm gonna post it. Things added, Farming both based on the bot's level and on a list of mobs, flagging the loot routine to keep or destory certain loot, Loot routine will loot all corpses near bot when it starts (needed for farming, may get a stack of corpses if bot gets lots of aggro), PL routine allows healer to keep 1 PC targeted and heal as needed, aggesive response allows bot to fight back if attacked, Combat spells allow bot to cast combat type spells while fighting,
All of this has been tested I used my 65 cleric running this script under pl and ran a troll SK from 1 to 30 using the farming routines.

needs to be added inside the "main" loop in genbot.mac

Code: Select all

   /call PersonalMain
   |||Sub from Personal.inc
This is my healer.inc I moved the targeting elements into the main heal routine so the spell calls can be used by the pl routine, fixed the sk targeting routine and added a patch heal call when target member is below half the tank threshold.

Code: Select all

|bothealer.inc 
|Bot healer module. 
|Version:6.0 
|Date:10/03/2003 00:31AM 
|
| 
|Commands in this module: 
|autoheal, togglehot, setpetheal, settankheal, setcasterheal, 
|setdefaultheal, autohealpets, heal 
| 
|Requires botspell.inc 

Sub HealerCommands 
   /varset Commands(4,0) autoheal 
   /varset Commands(4,1) settankheal 
   /varset Commands(4,2) setcasterheal 
   /varset Commands(4,3) setdefaultheal 
   /varset Commands(4,4) heal
   /varset Commands(4,5) togglehot
   /varset Commands(4,6) setpetheal
   /varset Commands(4,7) autohealpets 
   /varset ArrayHeal 7
/return

Sub TellCmds-healer 
   /msg @MasterName autoheal, settankheal, setcasterheal, setdefaultheal, heal, togglehot, setpetheal, autohealpets 
/return 


Sub SetupHealerVars 
   /declare CmdList-healer global 
   /declare HealPetMsg global 
   /declare PetPctHeal global 
   /declare HealPets global 
   /declare PetSpell global 
   /declare CasterPctHeal global 
   /declare TankPctHeal global 
   /declare PalHealGrpMsg global 
   /declare PalHealMsg global 
   /declare HealCasterMsg global 
   /declare HealTankMsg global 
   /declare HotDelay global 
   /declare ReportAutoHeal global 
   /declare PallyHealSpell global 
   /declare PallyGroupSpell global 
   /declare CasterHealIsHot global 
   /declare HealedId global 
   /declare DefaultHealSpell global 
   /declare TankSpell global 
   /declare CasterSpell global 
   /declare IsHealer global 
   /declare IsPally global 
   /declare HOTWait timer 
   /declare CastMsgTimer1 timer 
   /declare CastMsgTimer2 timer 
/return 

Sub CheckGrpHealth
   /declare EmergencyThreshold local
   /varset GroupMember 0 
   /if n "@IsHealer"==0 /return 
   /if n "@IsPally"==1 /return 
   /varcalc GroupMax $group(count)-1 
   :GroupLoop 
   /doevents
   /varcalc EmergencyThreshold @TankPctHeal/2
   |Emergency Patch Heal
   /if n $spawn($group(@GroupMember),hp,pct)>=1 {
      /if n $spawn($group(@GroupMember),hp,pct)<@EmergencyThreshold {
         /if n $group(@GroupMember)!=$char(id) {
            /target id $group(@GroupMember)
            /delay 5
         }else {
            /press F1
         }
         /call CasterHeal
      } 
   }
   /if n $spawn($group(@GroupMember),hp,pct)<@TankPctHeal { 
      /if n $spawn($group(@GroupMember),hp,pct)>=1 {
         /if n $group(@GroupMember)!=$char(id) {
            /target id $group(@GroupMember)
            /delay 5
         }else {
            /press F1
         }
         /if $spawn($group(@GroupMember),class)=="Warrior" /call Tankheal 
         /if $spawn($group(@GroupMember),class)=="Paladin" /call Tankheal 
         /if "$spawn($group(@GroupMember),class)"=="Shadow Knight" /call Tankheal 
         /if $spawn($group(@GroupMember),class)=="Monk" /call Tankheal 
         /if $spawn($group(@GroupMember),class)=="Ranger" /call Tankheal      
      } 
   }
   /if n $spawn($group(@GroupMember),hp,pct)>=1 {
      /if n $spawn($group(@GroupMember),hp,pct)<@CasterPctHeal {
         /if n $group(@GroupMember)!=$char(id) {
            /target id $group(@GroupMember)
            /delay 5
         }else {
            /press F1
         }
         /if $spawn($group(@GroupMember),class)=="Wizard" /call Casterheal 
         /if $spawn($group(@GroupMember),class)=="Enchanter" /call Casterheal 
         /if $spawn($group(@GroupMember),class)=="Mage" /call Casterheal 
         /if $spawn($group(@GroupMember),class)=="Shaman" /call Casterheal 
         /if $spawn($group(@GroupMember),class)=="Rogue" /call Casterheal 
         /if $spawn($group(@GroupMember),class)=="Cleric" /call Casterheal 
         /if $spawn($group(@GroupMember),class)=="Druid" /call Casterheal 
      } 
   } 
   /if n @HealPets==1 {
      /if n $spawn($group(@GroupMember),pet)>0 {
         /if n $spawn($spawn($group(@GroupMember),pet),hp,pct)<@PetPctHeal {
            /target id $spawn($group(@GroupMember),pet)
            /delay 5
            /call Petheal
         }
      }
   }
   /if n @GroupMember>=@GroupMax /return 
   /varadd GroupMember 1 
   /doevents 
   /goto :GroupLoop 
/return 

Sub Tankheal
   /stand
   /if n @CastMsgTimer1<=0 { 
      /if n @ReportAutoHeal==1 /g @HealTankMsg 
      /varset CastMsgTimer1 50 
   } 
   /call SpellSub "@TankSpell" 
   /if n @SitAfterCast==1 /sit on 
   /press esc 
/return 

Sub CasterHeal 
   /if n @CasterHealIsHot==1 { 
      /if n HOTWait>0 { 
         /if n $group(@GroupMember)==@HealedId /return 
      } 
   }
   /varset HealedId $target(id)
   /varset HOTWait @HotDelay
   /stand 
   /if n @CastMsgTimer2<=0 { 
      /if n @ReportAutoHeal==1 /g @HealCasterMsg 
      /varset CastMsgTimer2 50 
   } 
   /call SpellSub "@CasterSpell" 
   /if n @SitAfterCast==1 /sit on 
   /press esc 
/return 

Sub Petheal
   /stand
   /if n @CastMsgTimer1<=0 { 
      /if n @ReportAutoHeal==1 /g @HealPetMsg 
      /varset CastMsgTimer1 50 
   } 
   /call SpellSub "@PetSpell" 
   /if n @SitAfterCast==1 /sit on 
   /press esc 
/return 

Sub PalGroupheal 
   /stand 
   /if n @ReportAutoHeal==1 /g @PalHealGrpMsg 
   /call SpellSub "@PallyGroupSpell" 
/return 

Sub PallyHeal 
   /if n @Combatstatus==1 /return
   /stand 
   /if n @Combatstatus==0 /g @PalHealMsg 
   /call SpellSub "@PallyHealSpell" 
/return 

Sub PalGrpHealChk 
   /varset GroupMember 0 
   /if n "@IsPally"==0 /return 
   /if n "@IsHealer"==0 /return 
   /varcalc GroupMax $group(count)-1 
   /varset LowHealthCheck 0 
   :GroupLoop 
   /doevents 
   /if n $spawn($group(@GroupMember),hp,pct)<81 { 
      /if n $spawn($group(@GroupMember),hp,pct)>=1 { 
         /varadd LowHealthCheck 1 
      } 
   } 
   /if n @LowHealthCheck>=3 /call PalGroupheal 
   /if n @GroupMember>=@GroupMax /return 
   /varadd GroupMember 1 
   /doevents 
   /goto :GroupLoop 
/return 

Sub PalHealChk 
   /varset GroupMember 0 
   /if n "@IsPally"==0 /return 
   /if n "@IsHealer"==0 /return 
   /varcalc GroupMax $group(count)-1 
   :GroupLoop 
   /doevents 
   /if n $spawn($group(@GroupMember),hp,pct)<81 { 
      /if n $spawn($group(@GroupMember),hp,pct)>=1 {
         /if n $group(@GroupMember)!=$char(id) {
            /target id $group(@GroupMember)
            /delay 5
         }else {
            /press F1
         }
         /call PallyHeal 
      } 
   } 
   /if n @GroupMember>=@GroupMax /return 
   /varadd GroupMember 1 
   /doevents 
   /goto :GroupLoop 
/return 






||||||||||||||||||Do- Subs 

Sub Do-togglehot    
   /if $defined(Param1)==FALSE { { 
      /if @CasterHealIsHot==1 /tell @MasterName Should we consider the caster heal as a HOT?=Yes 
      /if @CasterHealIsHot==0 /tell @MasterName Should we consider the caster heal as a HOT?=No 
      /return 
   } 
   /if @Param1=="off" /varset CasterHealIsHOT 0 
   /if @Param1=="on" /varset CasterHealIsHOTIsHealer 1 
   /if @Param1=="1" /varset CasterHealIsHOT 1 
   /if @Param1=="0" /varset CasterHealIsHOT 0 
   /if @CasterHealIsHOT==1 /tell @MasterName Shoulw we consider the caster heal as a HOT?=Yes 
   /if @CasterHealIsHOT==0 /tell @MasterName Should we consider the caster heal as a HOT?=No 
/return 

Sub Do-autoheal    
   /if $defined(Param1)==FALSE { { 
      /if @IsHealer==1 /tell @MasterName Autoheal=Yes 
      /if @IsHealer==0 /tell @MasterName Autoheal=No 
      /return 
   } 
   /if @Param1=="off" /varset IsHealer 0 
   /if @Param1=="on" /varset IsHealer 1 
   /if @Param1=="1" /varset IsHealer 1 
   /if @Param1=="0" /varset IsHealer 0 
   /if @IsHealer==1 /tell @MasterName Autoheal=Yes 
   /if @IsHealer==0 /tell @MasterName Autoheal=No 
/return 

Sub Do-setpetheal 
   /if $defined(Param1)==FALSE { { 
      /tell @MasterName Pet heal is @PetSpell 
      /return 
   } else /if $defined(Param2)==FALSE { 
      /varset PetSpell @Param1 
   } else /if $defined(Param3)==FALSE { 
      /varset PetSpell "@Param1 @Param2" 
   } else /if $defined(Param4)==FALSE { 
     /varset PetSpell "@Param1 @Param2 @Param3" 
   } else /varset PetSpell "@Param1 @Param2 @Param3 @Param4" 
   /tell @MasterName Pet heal is now @PetSpell 
/return 

Sub Do-settankheal 
   /if $defined(Param1)==FALSE { { 
      /tell @MasterName Tank heal is @TankSpell 
      /return 
   } else /if $defined(Param2)==FALSE { 
      /varset TankSpell @Param1 
   } else /if $defined(Param3)==FALSE { 
      /varset TankSpell "@Param1 @Param2" 
   } else /if $defined(Param4)==FALSE { 
     /varset TankSpell "@Param1 @Param2 @Param3" 
   } else /varset TankSpell "@Param1 @Param2 @Param3 @Param4" 
   /tell @MasterName Tank heal is now @TankSpell 
/return 

Sub Do-setdefaultheal 
   /if $defined(Param1)==FALSE { { 
      /tell @MasterName Default heal is @DefaultHealSpell 
      /return 
   } else /if $defined(Param2)==FALSE { 
      /varset DefaultHealSpell @Param1 
   } else /if $defined(Param3)==FALSE { 
      /varset DefaultHealSpell "@Param1 @Param2" 
   } else /if $defined(Param4)==FALSE { 
     /varset DefaultHealSpell "@Param1 @Param2 @Param3" 
   } else /varset DefaultHealSpell "@Param1 @Param2 @Param3 @Param4" 
   /tell @MasterName Default heal is now @DefaultHealSpell 
/return 

Sub Do-setcasterheal 
   /if $defined(Param1)==FALSE { { 
      /tell @MasterName Caster heal is @CasterSpell 
      /return 
   } else /if $defined(Param2)==FALSE { 
      /varset CasterSpell @Param1 
   } else /if $defined(Param3)==FALSE { 
      /varset CasterSpell "@Param1 @Param2" 
   } else /if $defined(Param4)==FALSE { 
     /varset CasterSpell "@Param1 @Param2 @Param3" 
   } else /varset CasterSpell "@Param1 @Param2 @Param3 @Param4" 
   /tell @MasterName Caster heal is now @CasterSpell 
/return 

Sub Do-autohealpets    
   /if $defined(Param1)==FALSE { { 
      /if @HealPets==1 /tell @MasterName Auto heal pets=Yes 
      /if @HealPets==0 /tell @MasterName Auto heal pets=No 
      /return 
   } 
   /if @Param1=="off" /varset HealPets 0 
   /if @Param1=="on" /varset HealPets 1 
   /if @Param1=="1" /varset HealPets 1 
   /if @Param1=="0" /varset HealPets 0 
   /if @IsHealer==1 /tell @MasterName Auto heal pets=Yes 
   /if @IsHealer==0 /tell @MasterName Auto heal pets=No
/return 

Sub Do-heal 
   /if $defined(Param1)==FALSE { { 
      /assist @MasterName 
      /delay 3 
   } else /if $defined(Param2)==FALSE { 
      /if "@Param1"=="me" /target @MasterName 
      /if "@Param1"!="me" /target "@Param1" 
      /if "@Param1"=="@BotName" /press f1 
   } else /if $defined(Param3)==FALSE { 
      /target "@Param1 @Param2" 
   } else /if $defined(Param4)==FALSE { 
      /target "@Param1 @Param2 @Param3" 
   } else /target "@Param1 @Param2 @Param3 @Param4"
   /tell @MasterName healing %t
   /call SpellSub "@DefaultHealSpell"
   /stand
   /if n @SitAfterCast==1 /sit on
/return
And to add all the commands my personal.inc

Code: Select all

|personal.inc 
|Personal commands module. 
|Version:6.0 
|Date:10/10/2003 11:31AM 
| 
| 
|Commands in this module: 
| beaggessive, farm, keep, destroy, pl
| 
| 
|

#Event GettingHit " YOU for " 
#Event AttackedMiss " YOU, but "
#Event KilledIt "slain"
#Event SnaredIt "is surrounded by darkness"
#Event SnareDown "Darkness has worn off"
#Event Weaken "You feel your strength grow"
#Event WeakDown "Your stolen strength fades"
#Event Slash "You slash"
#Event Hit "You Hit"
#Event Bash "You Bash"
#Event CastingCheck "You can't use that command while casting"

Sub PersonalCommands
   /varset Commands(0,O) beaggessive
   /varset Commands(0,1) farm
   /varset Commands(0,2) keep
   /varset Commands(0,3) destroy
   /varset Commands(0,4) pl
   /varset Commands(0,5) puller
   /varset ArrayPers 5
/return

Sub PersonalMain
   /if $invpanel==TRUE /return
   /if @FarmListLast!="0" /call FarmNext
   /if @APower=="1" /call CheckPLHealth
   /if @CombatCast=="1" /call CombatSpells
/return

Sub TellCmds-personal
   /declare Cmds local
   /declare counter local
   /varset Cmds " "
   /for counter 0 to @ArrayPers
      /varset Cmds "@Cmds, @Commands(0,@counter)"
   /next counter
   /msg @MasterName @Cmds
/return 

Sub SetupPersonalVars 
   /declare Aggressive global
   /declare PLTarget global
   /declare APower global
   /declare FarmList array
   /declare FarmListLast global
   /declare KeepList array
   /declare KeepListLast global
   /declare DestroyList array
   /declare DestroyListLast global
   /declare FarmWait global
   /declare LevelRange global
   /declare CombatCast global
   /declare snared global
   /declare IsWeak global
   /declare IsCasting global
   /declare IPuller global
   /declare startexp global
   /declare startaaxp global
   /varset FarmListLast 0
   /varset KeepListLast 0
   /varset DestroyListLast 0
   /varset FarmWait 0
   /varset LevelRange 5
   /varset snared 0
   /varset IsWeak 0
   /varset CombatCast 0
   /varset IsCasting 0
   /varset IPuller 0
   /varset startexp $char(exp) 
   /varset startaaxp $char(aa,exp)
   /varset MasterName @MName1 
/return

||| Toggle Aggressive on and off. 
Sub Do-beaggessive
   /if $defined(Param1)==FALSE {
      |/tell @MasterName Aggressive=@Aggressive
      /return 
   } 
   /if (@Param1=="off" || @Param1=="0") {
      /varset Aggressive 0
      |/tell @MasterName I'll ignore attacks
   } 
   /if (@Param1=="on" || @Param1=="1") {
      /varset Aggressive 1 
      |/tell @MasterName I'll fight back if attacked
   } 
/return 

||| Toggle Puller on and off. 
Sub Do-puller
   /if $defined(Param1)==FALSE {
      /tell @MasterName Puller=@IPuller
      /return 
   } 
   /if (@Param1=="off" || @Param1=="0") {
      /varset IPuller 0
      |/tell @MasterName I'm not the puller
   } 
   /if (@Param1=="on" || @Param1=="1") {
      /varset IPuller 1 
      |/tell @MasterName I'm the puller
   } 
/return 

Sub Event_GettingHit
   /call CheckAggressive @Param0
/return 

Sub Event_AttackedMiss 
   /call CheckAggressive @Param0
/return

Sub CheckAggressive
   /if ($combat==TRUE || @Aggressive!="1") /return
   /varset Combatstatus 1
   /if ("@Param0"!~"say" && "@Param0"!~"group") /if ("@Param0"!~"out of character" && "@Param0"!~"shout") {
      /if "@Param0"!~"guild" {
         /if $target()==TRUE /if "$target(type)"!="NPC" {
            /target clear
            /delay 2s
         }
         /if $target()==TRUE /if $combat==FALSE /if $target(type)=="NPC" /if @Aggressive==1 {
            ||/tell @MName1 I am being attacked by $target(name,clean)
            /delay 2
            /press Backward
            /attack on
            /varset Combatstatus 1
         }
      }
   }
/return

Sub Do-farm
   /if $defined(Param1)==FALSE {
      /return
   }
   /if @Param1=="off" {
      /varset FarmListLast 0
      /return 
   }
   /varadd FarmListLast 1
   /if $defined(Param2)==FALSE {
      /varset FarmList(@FarmListLast) "@Param1"
   } else /if $defined(Param3)==FALSE {
      /varset FarmList(@FarmListLast) "@Param1 @Param2"
   } else /if $defined(Param4)==FALSE {
      /varset FarmList(@FarmListLast) "@Param1 @Param2 @Param3"
   } else { 
      /varset FarmList(@FarmListLast) "@Param1 @Param2 @Param3 @Param4"
   }
/return

Sub FarmNext
   /declare MinLevel local
   /declare MaxLevel local
   /declare MobRange local
   /declare CloseMob local
   /declare counter local
   /if @Combatstatus==1 /return
   /if $Combat==TRUE /return
   /if n $char(mana,max)>10 {
      /if n $char(mana,pct)<50 {
         /if $char(state)=="STAND" /sit
         /return
      }
   }
   /if n $char(hp,pct)<50 {
      /if $char(state)=="STAND" /sit
      /return
   }
   /if n @FarmWait<5 {
      |wait before starting next farm to check for aggro 
      /varadd FarmWait 1 
      /delay 1s 
      /return 
   } 
   /varset FarmWait 0 
   /target clear 
   /sit off 
   /if "@FarmList(1)"=="level" {
      /varset MinLevel $char(level)
      /varsub MinLevel LevelRange
      /if n @MinLevel<1 /varset MinLevel 1
      /varset MaxLevel $char(level)
      /varadd MaxLevel LevelRange
      /target nopcnear 60 radius 800 range @MinLevel @MaxLevel npc
   } else {
      /varset MobRange 300000
      /for counter 1 to @FarmListLast 
         /target nopcnear 60 radius 800 npc @FarmList(@counter) 
         /delay 5
         /if n $target(distance)<@MobRange {
            /varset MobRange $target(distance)
            /varset CloseMob @counter
         } 
      /next counter
      /target nopcnear 60 radius 800 npc @FarmList(@CloseMob)
      /delay 5
   }
   /attack on
/return

Sub Do-pl 
   /if @Param1=="off" {
      /varset APower 0 
      /return 
   } 
   /if $defined(Param1)==FALSE {
      /return
   } else /if $defined(Param2)==FALSE {
      /if "@Param1"=="me" {
         /varset PLTarget "@MasterName"
      }else {
         /varset PLTarget "@Param1"
      }
      /varset APower 1 
   } else /if $defined(Param3)==FALSE {
      /varset PLTarget "@Param1 @Param2"
      /varset APower 1 
   } else /if $defined(Param4)==FALSE {
      /varset PLTarget "@Param1 @Param2 @Param3"
      /varset APower 1 
   } else { 
      /varset PLTarget "@Param1 @Param2 @Param3 @Param4"
      /varset APower 1
   } 
/return
||| Monitor PL Target health and call heal subs. 
Sub CheckPLHealth
   /declare EmergencyThreshold local
   /if @IsHealer==0 /return
   /if @Combatstatus==1 /return
   /doevents 
   /if "$target(name,clean)"!="@PLTarget" {
      /target "@PLTarget"
      /delay 5
   }
   /varcalc EmergencyThreshold @TankPctHeal/2
   |Emergency Patch Heal
   /if n $target(hp,pct)>=1 {
      /if n $target(hp,pct)<@EmergencyThreshold {
         /call SpellSub "@DefaultHealSpell"
      } 
   } 
   /if n $target(hp,pct)<@TankPctHeal /if n $target(hp,pct)>=1 {
      /if n $target(hp,max)>1500 {
         /if "$target(class)"=="Warrior" /call Tankheal
         /if "$target(class)"=="Paladin" /call Tankheal
         /if "$target(class)"=="Shadow Knight" /call Tankheal
         /if "$target(class)"=="Monk" /call Tankheal
         /if "$target(class)"=="Ranger" /call Tankheal
      }
   } 
   /if n $target(hp,pct)>=1 /if n $target(hp,pct)<@CasterPctHeal {
      /call CasterHeal
   }
   /if n @HealPets==1 {
      /if n $spawn($group(@GroupMember),pet)>0 {
         /if n $spawn($spawn($group(@GroupMember),pet),hp,pct)<@PetPctHeal {
            /target id $spawn($target(id),pet)
            /delay 5
            /call Petheal
         }
      }
   }
   /doevents
/return

Sub Event_KilledIt
   /if "@Param0 @Param1 @Param2 @Param3 @Param4 @Param5"~~"YOU have been slain" {
      /varset FarmListLast 0
      /return
   }
   /attack off
   /varset Combatstatus 0
   /varset snared 0
   /varset IsWeak 0
   /declare currentxp local
   /declare xpgain local
   /declare currentaa local
   /declare aagain local
   /varset currentxp $char(exp) 
   /varcalc xpgain @currentxp-@startexp 
   /varset currentaa $char(aa,exp) 
   /varcalc aagain @currentaa-@startaaxp 
   /echo "You've gained @xpgain% xp and @aagain% aaxp." 
   /varset startexp $char(exp) 
   /varset startaaxp $char(aa,exp) 
   /delay 5s
   /doevents
   /if $combat==TRUE /return
   /if n @KeepListLast>0 /Call Mylootcorpse
/return

Sub Event_CastingCheck
   /varset IsCasting 1
/return

Sub Do-keep
   /if @Param1=="off" {
      /varset KeepListLast 0
      /return
   }
   /if $defined(Param1) {
      /return
   }
   /varadd KeepListLast 1
   /if $defined(Param2) {
      /varset KeepList(@KeepListLast) "@Param1"
   } else /if $defined(Param3) {
      /varset KeepList(@KeepListLast) "@Param1 @Param2"
   } else /if $defined(Param4) {
      /varset KeepList(@KeepListLast) "@Param1 @Param2 @Param3"
   } else {
      /varset KeepList(@KeepListLast) "@Param1 @Param2 @Param3 @Param4"
   }
/return

Sub Do-Destroy
   /if @Param1=="off" {
      /varset DestroyListLast 0
      /return
   }
   /if $defined(Param1) {
      /return
   }
   /varadd DestroyListLast 1
   /if $defined(Param2) {
      /varset DestroyList(@DestroyListLast) "@Param1"
   } else /if $defined(Param3) {
      /varset DestroyList(@DestroyListLast) "@Param1 @Param2"
   } else /if $defined(Param4) {
      /varset DestroyList(@DestroyListLast) "@Param1 @Param2 @Param3"
   } else {
      /varset DestroyList(@DestroyListLast) "@Param1 @Param2 @Param3 @Param4"
   }
/return

Sub Mylootcorpse
   /declare counter local
   :LootCycle
   /if $combat==TRUE /return
   /target corpse
   /delay  10
   /if $target(state)!=DEAD /return
   /if n $target(distance,nopredict)>100 /return
   /call Rangesub
   /loot
   /delay 2s
   /varset LootSlot 0
   :Mylootloop
      /if n @LootSlot==10 /goto :LootDone
      /click left corpse @LootSlot
      /delay 35
      /if "$cursor()"!="TRUE" /goto :LootDone
      /varadd LootSlot 1
      /if "@KeepList(1)"!="all" {
         /for counter 1 to KeepListLast
            /if "$cursor(name)"~~"@KeepList(@counter)" {
               /click left auto
               /delay 1
               /goto :Mylootloop
            }
         /next counter
         /if "$cursor()"=="TRUE" {
            /click left destroy
            /delay 1
         }
      }else {
         /for counter 1 to DestroyListLast
            /if "$cursor(name)"~~"@DestroyList(@counter)" {
               /click left destroy
               /delay 1
               /goto :Mylootloop
            }
         /next counter
         /if "$cursor()"=="TRUE" {
            /click left auto
            /delay 1
         }
      }
   /goto :Mylootloop
   :LootDone
   /click left corpse done
   /delay 2s
   /doevents
   /goto :LootCycle
/return

Sub Event_SnaredIt
   /varset snared 1
/return

Sub Event_SnaredDown
   /varset snared 0
/return

Sub Event_Weaken
   /varset IsWeak 1
/return

Sub Event_WeakDown
   /varset IsWeak 0
/return

Sub CombatSpells
   /if @Combatstatus!="1" /return
   |/if $char(ismoving)==TRUE /return
   /declare mobface local
   /varset mobface $char(heading)
   /varadd mobface 180
   /varcalc mobface @mobface%360
	/if n $target(heading)>$calc(@mobface+10) /if n $target(heading)>$calc(@mobface-10) /return
	|Cleric Spells
	/if "$char(class)"=="Cleric" {
	   |level 44
	   /if n $char(mana,pct)>50 {
	      /if n $char(gem,"Retribution")>0 /cast "Retribution"
	   }
	}
   |Shaman Spells
   /if "$char(class)"=="Shaman" {
      |level 24
      /if n $char(mana,cur)>100 {
         /if n $char(gem,"Tainted Breath")>0 /cast "Tainted Breath"
         /if n $char(gem,"Flash of Light")>0 /cast "Flash of Light"
         /if n $char(gem,"Burst of Flame")>0 /cast "Burst of Flame"
      }
   }
   /if "$char(class)"=="Shadow Knight" {
       |level 22
      /if n $char(mana,cur)>60 {
         /if n @Snared<1 {
            /if n $char(gem,"Engulfing Darkness")>0 /cast "Engulfing Darkness"
         }else {
            /if n $char(gem,"Lifespike")>0 /cast "Lifespike"
         }
      }
      |level 15
      /if n $char(mana,cur)>38 {
         /if n @Snared<1 {
            /if n $char(gem,"Clinging Darkness")>0 /cast "Clinging Darkness"
         }else {
            /if n $char(gem,"Lifespike")>0 /cast "Lifespike"
         }
      }
      |level 9
      /if n $char(mana,cur)>24 {
         /if n $char(gem,"Disease Cloud")>0 /cast "Disease Cloud"
         /if n $char(gem,"Lifetap")>0 /cast "Lifetap"
         /if n @IsWeak<1 {
            /if n $char(gem,"Siphon Strength")>0 /cast "Siphon Strength"
         }
      }
   }
/return

Sub Event_Slash
	/call CheckPuller
/return

Sub Event_Bash
	/call CheckPuller
/return

Sub Event_Hit
	/call CheckPuller
/return

Sub CheckPuller
	/if IPuller=="0" /return
	/if n $distance(@AnchorX,@AnchorY)<=30 /return
	/declare mobface local
   /varset mobface $char(heading)
   /varadd mobface 180
   /varcalc mobface @mobface%360
	/if n $target(heading)<=$calc(@mobface+10) /if n $target(heading)>=$calc(@mobface-10) {
	   /attack off
	   /varset Combatstatus 0
	   /call MoveToAnchor
	 } 
/return
Planning to add pulling function so bot can get a mob and bring it back to the camp.
Last edited by LordGiddion on Fri Oct 10, 2003 10:51 pm, edited 1 time in total.

mackster
a ghoul
a ghoul
Posts: 95
Joined: Mon Sep 09, 2002 3:02 pm

Post by mackster » Tue Oct 07, 2003 8:50 pm

How do you tell it what mobs to farm or what level range to pull? That looks pretty promising.

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

PersonalMain

Post by grimjack » Tue Oct 07, 2003 9:25 pm

Added the call to PersonalMain to the main loop and fixed a few bugs. Thanks for posting your personal.inc. I hope others do the same.


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

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Wed Oct 08, 2003 12:34 am

hey quick question, tried using a macro command (basically a hotkey to tell what mana i have) in /rs (raidsay) and it came up as code :shock: lol thankfully everyone thought i was just suggesting verant make a code similar to waht i typed to make telling how much mana u have simpler lol

In any case, is code not working in rs for some reason? i had it saying the same thing to group and/rs and for whatever reason RS didnt take the code..just spewed it as exactly how it was written. Didnt have a chance to test it a second time (as i wasnt going to give myself away to a buncha peeps lol)

But anyway, just curious if anyone knows anything bout that :) thought i'd post here cuz it was here that i edited it to say something in rs :P

Anyway,

DReakz

RogerWilco
a ghoul
a ghoul
Posts: 86
Joined: Thu Aug 28, 2003 4:05 am

Post by RogerWilco » Wed Oct 08, 2003 12:38 am

Grimjack...

the pet attack command in your new botcore.inc does not work...

I stripped this out of the old code and how would you update it to run on the new CVS

Sub Do-petattack
/assist $MasterName
/delay 1s
/if $target()=="FALSE" {
/msg $MasterName failed to get target for pet.
/return
}
/pet attack
/return



would it be:

Sub Do-petattack
/assist @MasterName
/delay 1s
/if $target()=="FALSE" {
/msg @MasterName failed to get target for pet.
/return
}
/pet attack
/return

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

Post by grimjack » Wed Oct 08, 2003 12:54 am

When posting a problem if you could include the date and version of the code you are using it would be very helpful.

What I have in the current version:

Code: Select all

Sub Do-petattack
   /assist @MasterName
   /delay 1s
   /pet attack
/return
worked last time I checked. You may want to up the delay to 1.5 or 2 seconds if you experience a lot of lag.

Code: Select all

Sub Do-petattack
   /assist @MasterName
   /delay 1s
   /if $target()=="FALSE" { 
      /msg @MasterName I failed to get a target. 
   }
   /pet attack
/return

This will most likely be the way this looks in the next version.
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

RogerWilco
a ghoul
a ghoul
Posts: 86
Joined: Thu Aug 28, 2003 4:05 am

Post by RogerWilco » Wed Oct 08, 2003 1:23 am

Sorry about that Grimjack.... it was verson 6 Dated 10/3


Sub Do-petattack
/assist @MasterName
/delay 1s
/pet attack
/return

this command for some reason never worked for me even in the outdated verson either... or course in the outdated verson the @ was a $


using this command in verson 6 dated 10/3 all it does is...

-------- the BoT selects the masters target


but the pet is never sent out to attack...


Also....

as you can tell im alittle new to looking at all this code :shock: gives me a headache looking at it too much... :wink:

After saying that....

What is the purpose of personal.inc??



From what I can gather... from LordGiddion's post... you can add customized routines to the Personal.inc instead of messing with the original routines... Botcombat, botspells, Botcore, bothealer, genbot


Another silly question for you... when I do a /t <bot> Follow <master> ... it follows... what is the silly command to make him stop following... :lol:

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

Post by grimjack » Wed Oct 08, 2003 2:03 am

RogerWilco wrote:Sorry about that Grimjack.... it was verson 6 Dated 10/3


Sub Do-petattack
/assist @MasterName
/delay 1s
/pet attack
/return
You may have a problem with lag. If assist takes more than 1 second to appear it will run the /pet attack before you get a target. You will want to change the /delay 1s line to be /delay 2s or /delay 3s and see if that is the problem. If it is you can tweak it down the the shortest delay you are comfortable with.
What is the purpose of personal.inc??
It is for adding your own commands. You simply add another element to the array and creat a do- sub routine for it.

Example :

Code: Select all

 /varset Commands(4,1) mynewcommand

Code: Select all

Sub do-mynewcommand
    |what you want it to do goes here
/return
Another silly question for you... when I do a /t <bot> Follow <master> ... it follows... what is the silly command to make him stop following... :lol:
/tell <bot> stop

The stop command will stop the bot from doing most things including but not limited to, following the master, casting a spell, moving to a mob or pc via the moveto command, ect.


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:

Update

Post by grimjack » Wed Oct 08, 2003 10:43 am

Updated petattack and a few other small items. Also added LordGiddion beaggressive code to the botcombat.inc(I hope you don't mind). The bot now can take unlimited masters as well.

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

RogerWilco
a ghoul
a ghoul
Posts: 86
Joined: Thu Aug 28, 2003 4:05 am

Post by RogerWilco » Wed Oct 08, 2003 1:24 pm

Grimjack...

Petattack works perfect now with Verson 6.2



I was wondering ... I have been looking at the Sub Do-sn in the botspell.inc ... and trying to figure out ... if my boT starts melee attacking and I cast a spell the BoT stops melee attacking.... is there a way once you initiate the melee attack even if you cast a spell in the middle of the melee attack the BoT goes back to melee attack


I also noticed once I cast a spell the BoT de-selects the target
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 {
/tell "@MasterName" Casting @Param1 @Param2 on %T
/call SpellSub "@Param1 @Param2"
} else /if $defined(Param4)==FALSE {
/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"
}
/stand
/if n @SitAfterCast==1 /sit on
/press esc
/return
SO... after saying all that... if I was to replace
/press esc
with
/attack on
only makes sence the BoT will keep attacking untill the mob is dead, but on the flip side the BoT will try to attack a PC after the BoT buff someone.

Any suggestions on correcting that or am I being too picky and just need to be thankful (which I am) of what I already have :P

mackster
a ghoul
a ghoul
Posts: 95
Joined: Mon Sep 09, 2002 3:02 pm

Post by mackster » Wed Oct 08, 2003 1:32 pm

How do you set the healing thresholds? For example when I run this on my druid it heals at about 45%. How could i make it heal at say, 75%?

Thanks.