genbot.mac - Bot for any class scirpts.

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

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

genbot.mac - Bot for any class scirpts.

Post by grimjack » Wed Jul 09, 2003 4:29 am

Major rewrite: V5.0

Commands that you add now go in the personal.inc

The cmds command now takes an argument of core, spell, heal, combat, or personal.

Example /tell botname cmds spell

Code: Select all

|genbot.mac
|Generic bot macro for any class.
|Version 5.0
|Date:10/02/2003 10:31AM
|
|Varspace used: a(1,#), v1, v2, v3, v4, v5
|
|Modules loaded by default:
|botcore, botspell, bothealer, botcombat
|
|
#define CmdArraySize-core v1
#define CmdArraySize-spell v2
#define CmdArraySize-combat v3
#define CmdArraySize-healer v4
#define CmdArraySize-personal v5
#define personal-array 0
#define botcore-array 2
#define botcombat-array 4
#define botspell-array 6
#define bothealer-array 8
#include botcore.inc
#include botspell.inc
#include botcombat.inc
#include bothealer.inc
#include personal.inc
#turbo 75

Sub Main

|Core variables
   /varset RangeMin 10
   /varset RangeMax 12
   /varset FastRange 15
|Spell Module Variables
   /varset SitAfterCast 0
   /varset DefaultSpellSet "default"
   /varset EvacSpell "Evacuate"
|Combat Module Variables
   /varset DoBackstab 0
   /varset DoTaunt 0
   /varset DoEvade 0
   /varset DoSlam 0
   /varset DoBash 0
   /varset DoKick 0
   /varset DoTraps 0
|Healer Module Variables
   /varset IsHealer 0
   /varset IsPally 0
   /varset ReportAutoHeal 0
   /varset CasterHealIsHot 0
   /varset HotDelay 60
   /varset HealPets 0
   /varset TankSpell "Name of autoheal spell for tanks"
   /varset CasterSpell "Name of autoheal spell for casters"
   /varset PetSpell "Name of autoheal for pets"
   /varset HealCasterMsg "Healing %t"
   /varset HealTankMsg "Big Healing %t"
   /varset HealPetMsg "Healing %t"
   /varset PalHealGrpMsg "Pally group heal inc.
   /varset PalHealMsg "Healing %t"
   /varset DefaultHealSpell "Name of default heal spell"
   /varset PallyGroupSpell "Name of Pally group heal
   /varset PallyHealSpell "Name of Pally heal"
   /varset CasterPctHeal 51
   /varset TankPctHeal 51
   /varset PetPctHeal 51
||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||
   /if n $strlen("$p0")<=0 {
     /echo Usage: /macro generic <Master Name1> <Master Name2>...
     /endmacro
   }
   /if n $strlen("$p1")<=0 {
      /varset MName1 $p0
      /varset MName2 NULL
      /varset MName3 NULL
      /varset MName4 NULL
      /varset MName5 NULL

      /varset MName6 NULL
   } else /if n $strlen("$p2")<=0 {
      /varset MName1 $p0
      /varset MName2 $p1
      /varset MName3 NULL
      /varset MName4 NULL
      /varset MName5 NULL
      /varset MName6 NULL
   } else /if n $strlen("$p3")<=0 {
      /varset MName1 $p0
      /varset MName2 $p1
      /varset MName3 $p2
      /varset MName4 NULL
      /varset MName5 NULL
      /varset MName6 NULL
   } else /if n $strlen("$p4")<=0 {
      /varset MName1 $p0
      /varset MName2 $p1
      /varset MName3 $p2
      /varset MName4 $p3
      /varset MName5 NULL
      /varset MName6 NULL
   } else /if n $strlen("$p5")<=0 {
      /varset MName1 $p0
      /varset MName2 $p1
      /varset MName3 $p2
      /varset MName4 $p3
      /varset MName5 $p4
      /varset MName6 NULL
   } else {
      /varset MName1 $p0
      /varset MName2 $p1
      /varset MName3 $p2
      /varset MName4 $p3
      /varset MName5 $p4
      /varset MName6 $p5   
   }
|Don't edit these
   /varset BotName $char(name)
   /varset Afollow 0
   /varset Combatstatus 0
|||This is where the commands the bot can take is set up
   /call CoreCommands
   /call SpellCommands
   /call CombatCommands
   /call HealerCommands
   /call PersonalCommands

   /call CountArraySize botcore-array
   /varset CmdArraySize-core $int($return)
   /call CountArraySize botcombat-array
   /varset CmdArraySize-combat $int($return)
   /call CountArraySize botspell-array
   /varset CmdArraySize-spell $int($return)
   /call CountArraySize bothealer-array
   /varset CmdArraySize-healer $int($return)
   /call CountArraySize personal-array
   /varset CmdArraySize-personal $int($return)
   
   :MainLoop
   /doevents
   |||Sub from bothealer.inc
   /call CheckGrpHealth
   ||| Sub From bothealer.inc
   /call PalGrpHealChk
   ||| Sub From bothealer.inc
   /call PalHealChk
   |||Sub from botcombat.inc
   /call Combatcheck
   |||Sub from botcombat.inc
   /if n $Combatstatus==0 {
      /if n $DoTraps==1 /call TrapFinder
   }
   /if n $Combatstatus==1 /call RangeSub
   /if n $Combatstatus==1 /call MeleeAbility
   /if n $Combatstatus!=1 {
      /if n $IsAnchored==0 {
         /if n $Afollow==1 {
            /call Do-moveto foo $FollowTarget
         }
      }
      /if n $IsAnchored==1 {
         /if n $distance($AnchorX,$AnchorY)>18 /call MoveToAnchor
      }
   }
   /doevents
   /varset CmdArrayNum 0
   /goto :MainLoop
/return


Code: Select all

|botcore.inc
|Bot core module.
|Version:5.0
|Date:10/02/2003 10:31AM
|
|Varspace used: a(1,#), a(2,#), v20, v98
|
|Commands in this module:
|target, saytarget, assist, sit, stand, notarget, afk, afollow, say, group, tell,
|accept, invite, stop, follow, camp, duck, moveto, petattack, petguard, petbackoff,
|anchor, consent, reportbuffs
|

#chat tell
#define CmdList-core v98
#define AnchorX a(1,1)
#define AnchorY a(1,2)
#define IsAnchored a(1,3)
#define LootSlot a(1,4)
#define LootTooFar a(1,5)
#define BotName a(1,6)
#define MasterName a(1,7)
#define CmdArrayNum a(1,8)
#define GroupMember a(1,9)
#define GroupMax a(1,10)
#define ChatInput1 a(1,11)
#define ChatInput2 a(1,12)
#define ChatInput3 a(1,13)
#define SitAfterCast a(1,14)
#define MyXLoc a(1,15)
#define MyYLoc a(1,16)
#define countdown a(1,17)
#define RangeMin a(1,18)
#define RangeMax a(1,19)
#define FastRange a(1,20)
#define Remem a(1,21)
#define MyClass a(1,22)
#define FollowTarget a(1,23)
#define Afollow a(1,24)
#define MName1 a(1,25)
#define MName2 a(1,26)
#define MName3 a(1,27)
#define MName4 a(1,28)
#define MName5 a(1,29)
#define MName6 a(1,30)
#define Fail a(1,31)
#Event CorpseTooFar "You are too far away to loot that corpse."

Sub CoreCommands
   /varset a(2,0) afk
   /varset a(2,1) accept
   /varset a(2,2) reject
   /varset a(2,3) invite
   /varset a(2,4) follow
   /varset a(2,5) stop
   /varset a(2,6) moveto
   /varset a(2,7) sit
   /varset a(2,8) stand
   /varset a(2,9) camp
   /varset a(2,10) duck
   /varset a(2,11) run
   /varset a(2,12) say
   /varset a(2,13) tell
   /varset a(2,14) group
   /varset a(2,15) cmds
   /varset a(2,16) target
   /varset a(2,17) notarget
   /varset a(2,18) assist
   /varset a(2,19) saytarget
   /varset a(2,20) afollow
   /varset a(2,21) itemcast
   /varset a(2,22) lootup
   /varset a(2,23) anchor
   /varset a(2,24) trade
   /varset a(2,25) yesres
   /varset a(2,26) consent
   /varset a(2,27) reportbuffs
/return

Sub TellCmds-core
   /msg $MasterName afk, accept, reject, invite, follow, stop, moveto, sit, stand, camp, duck, run, say, tell, group, cmds, target, notarget, assist, saytarget, afollow, itemcast, lootup, anchor, trade, yesres, consent, reportbuffs
/return

Sub TellCmds-
   /msg $MasterName Specify a module:core, spell, healer, combat, personal
/return

Sub Event_Chat
   /varset CmdArrayNum 0
   /if "$MName1"=="$p1" /goto :SetupTime
   /if "$MName2"=="$p1" /goto :SetupTime
   /if "$MName3"=="$p1" /goto :SetupTime
   /if "$MName4"=="$p1" /goto :SetupTime
   /if "$MName5"=="$p1" /goto :SetupTime
   /if "$MName6"=="$p1" /goto :SetupTime
   /tell $MName1 $p1 told me: $p2
   /return
   :SetupTime
   /varset MasterName $p1
   /if n $CmdArraySize-core>0 {
      /for v20 0 to $CmdArraySize-core
         /if "$arg(1,"$p2")"=="$a(botcore-array,$v20)" {
            /call Do-$a(botcore-array,$v20) $p2
            /return
         }
      /next v20
   }
   /if n $CmdArraySize-spell>0 {
      /for v20 0 to $CmdArraySize-spell
         /if "$arg(1,"$p2")"=="$a(botspell-array,$v20)" {
            /call Do-$a(botspell-array,$v20) $p2
            /return
         }
      /next v20
   }
   /if n $CmdArraySize-combat>0 {
      /for v20 0 to $CmdArraySize-combat
         /if "$arg(1,"$p2")"=="$a(botcombat-array,$v20)" {
            /call Do-$a(botcombat-array,$v20) $p2
            /return
         }
      /next v20
   }
   /if n $CmdArraySize-healer>0 {
      /for v20 0 to $CmdArraySize-healer
         /if "$arg(1,"$p2")"=="$a(bothealer-array,$v20)" {
            /call Do-$a(bothealer-array,$v20) $p2
            /return
         }
      /next v20
   }
   /if n $CmdArraySize-personal>0 {
      /for v20 0 to $CmdArraySize-personal
         /if "$arg(1,"$p2")"=="$a(personal-array,$v20)" {
            /call Do-$a(personal-array,$v20) $p2
            /return
         }
      /next v20
   }
/return

sub CountArraySize
   /varset l0 0
   :CountArrayLoop
    /if n $strlen("$a($p0,$l0)")<=0 {
       /goto :CountArrayEnd
   }
   /varadd l0 1
   /goto :CountArrayLoop
   :CountArrayEnd
   /varsub l0 1
/return $l0

Sub Detectobst
   /if n $MyXLoc==$char(x) /if $MyYLoc==$char(y) /call Hitobst 5
   /varset MyXLoc $char(x)
   /varset MyYLoc $char(y)
/return

Sub Hitobst
   /sendkey up up
   /sendkey down down
   /if n $rand(99)>50 {
      /delay 2s
      /sendkey up down
      /sendkey down Right
      /delay $p0
      /sendkey up Right
      /sendkey down up
      /delay 2s
      /sendkey up up
   } else {
      /delay 2s
      /sendkey up down
      /sendkey down left
      /delay $p0
      /sendkey up left
      /sendkey down up
      /delay 2s
      /sendkey up up       
   }
   /sendkey up down
   /sendkey up Right
   /sendkey up Left
   /sendkey down up
/return

sub Loot
   /if "$target()"=="FALSE" {
      /msg $MasterName No corpse on target to loot.
      /return
   }
   /varset LootTooFar 0
   /loot
   /delay 3s
   /doevents
   /if n $LootTooFar==1 /goto :donelooting
   /msg $MasterName Looting %t.
   /lootn never
   :lootloop
   /if n $LootSlot>=9 /goto :donelooting
   /if n $LootTooFar==1 /goto :donelooting
   /doevents
   /click right corpse $LootSlot
   /delay 2s
   /varadd LootSlot 1
   /goto :lootloop
   :donelooting
   /lootn always
   /varset LootSlot 0
   /press esc
   /press esc
   /press esc
/return

Sub MoveToAnchor
   :AnchorMoveLoop
   /doevents
   /if n $Combatstatus==1 {
      /sendkey up up
      /return
   }
   /if "$char(state)"=="SIT" /stand
   /face loc $AnchorX,$AnchorY
   /if n $distance($AnchorX,$AnchorY)>11 /sendkey down up
   /if n $distance($AnchorX,$AnchorY)<=11 {
      /sendkey up up
      /return
   }
   /goto :AnchorMoveLoop
/return

Sub Event_CorpseTooFar
   /msg $MasterName I'm not close enough to loot %t.
   /varset LootTooFar 1
/return

||||||||||||Do- subs

Sub Do-target
   /if n $strlen("$p1")<=0 {
      /return
   } else /if n $strlen("$p2")<=0 {
      /target "$p1"
   } else /if n $strlen("$p3")<=0 {
      /target "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
      /target "$p1 $p2 $p3"
   } else /target "$p1 $p2 $p3 $p4"
   /tell $MasterName my target is %t
/return

Sub Do-saytarget
   /tell $MasterName my target is %t
/return

Sub Do-assist
   /if n $strlen("$p1")<=0 {
      /assist $MasterName
      /delay 3
   } else /if n $strlen("$p2")<=0 {
      /assist "$p1"
   } else /if n $strlen("$p3")<=0 {
      /assist "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
      /assist "$p1 $p2 $p3"
   } else /assist "$p1 $p2 $p3 $p4"
   /tell $MasterName my target is %t
/return

Sub Do-sit
   /varset Afollow 0
   /varset FollowTarget "NULL"
   /sit off
   /sit
/return

Sub Do-stand
   /sit off
/return

Sub Do-notarget
   /press esc
   /press esc
   /press esc
/return

Sub Do-afk
   /varset CmdArrayNum 0
   /if n $strlen("$p1")<=0 {
      /afk
   } else /if n $strlen("$p2")<=0 {
      /afk $p1
   } else /if n $strlen("$p3")<=0 {
      /afk $p1 $p2
   } else /if n $strlen("$p4")<=0 {
      /afk $p1 $p2 $p3
   } else /if n $strlen("$p5")<=0 {
      /afk $p1 $p2 $p3 $p4
   } else /if n $strlen("$p6")<=0 {
      /afk $p1 $p2 $p3 $p4 $p5
   } else /if n $strlen("$p7")<=0 {
      /afk $p1 $p2 $p3 $p4 $p5 $p6
   } else /if n $strlen("$p8")<=0 {
      /afk $p1 $p2 $p3 $p4 $p5 $p6 $p7
   } else /if n $strlen("$p9")<=0 {
      /afk $p1 $p2 $p3 $p4 $p5 $p6 $p7 $p8
   } else {
      /afk $p1 $p2 $p3 $p4 $p5 $p6 $p7 $p8 $p9
   }
/return

Sub Do-afollow
   /if n $strlen("$p1")<=0 {
      /return
   } else /if n $strlen("$p2")<=0 {
      /varset FollowTarget "$p1"
      /varset Afollow 1
   } else /if n $strlen("$p3")<=0 {
      /varset FollowTarget "$p1 $p2"
      /varset Afollow 1
   } else /if n $strlen("$p4")<=0 {
      /varset FollowTarget "$p1 $p2 $p3"
      /varset Afollow 1
   } else /varset FollowTarget "$p1 $p2 $p3 $p4"
      /varset Afollow 1
   }
   /msg $MasterName Auto follow on.
/return

Sub Do-say
   /varset CmdArrayNum 0
   /if n $strlen("$p1")<=0 {
      /return
   } else /if n $strlen("$p2")<=0 {
      /say $p1
   } else /if n $strlen("$p3")<=0 {
      /say $p1 $p2
   } else /if n $strlen("$p4")<=0 {
      /say $p1 $p2 $p3
   } else /if n $strlen("$p5")<=0 {
      /say $p1 $p2 $p3 $p4
   } else /if n $strlen("$p6")<=0 {
      /say $p1 $p2 $p3 $p4 $p5
   } else /if n $strlen("$p7")<=0 {
      /say $p1 $p2 $p3 $p4 $p5 $p6
   } else /if n $strlen("$p8")<=0 {
      /say $p1 $p2 $p3 $p4 $p5 $p6 $p7
   } else /if n $strlen("$p9")<=0 {
      /say $p1 $p2 $p3 $p4 $p5 $p6 $p7 $p8
   } else /if n $strlen("$p10")<=0 {
   } else {
      /say $p1 $p2 $p3 $p4 $p5 $p6 $p7 $p8 $p9
   }
/return

Sub Do-group
   /varset CmdArrayNum 0
   /if n $strlen("$p1")<=0 {
      /return
   } else /if n $strlen("$p2")<=0 {
      /g $p1
   } else /if n $strlen("$p3")<=0 {
      /g $p1 $p2
   } else /if n $strlen("$p4")<=0 {
      /g $p1 $p2 $p3
   } else /if n $strlen("$p5")<=0 {
      /g $p1 $p2 $p3 $p4
   } else /if n $strlen("$p6")<=0 {
      /g $p1 $p2 $p3 $p4 $p5
   } else /if n $strlen("$p7")<=0 {
      /g $p1 $p2 $p3 $p4 $p5 $p6
   } else /if n $strlen("$p8")<=0 {
      /g $p1 $p2 $p3 $p4 $p5 $p6 $p7
   } else /if n $strlen("$p9")<=0 {
      /g $p1 $p2 $p3 $p4 $p5 $p6 $p7 $p8
   } else /if n $strlen("$p10")<=0 {
   } else {
      /g "$p1 $p2 $p3 $p4 $p5 $p6 $p7 $p8 $p9
   }
/return

Sub Do-tell
   /varset CmdArrayNum 0
   /if n $strlen("$p1")<=0 {
      /return
   } else /if n $strlen("$p2")<=0 {
      /return
   } else /if n $strlen("$p3")<=0 {
      /tell $p1 $p2
   } else /if n $strlen("$p4")<=0 {
      /t $p1 $p2 $p3
   } else /if n $strlen("$p5")<=0 {
      /t $p1 $p2 $p3 $p4
   } else /if n $strlen("$p6")<=0 {
      /t $p1 $p2 $p3 $p4 $p5
   } else /if n $strlen("$p7")<=0 {
      /t $p1 $p2 $p3 $p4 $p5 $p6
   } else /if n $strlen("$p8")<=0 {
      /t $p1 $p2 $p3 $p4 $p5 $p6 $p7
   } else /if n $strlen("$p9")<=0 {
      /t $p1 $p2 $p3 $p4 $p5 $p6 $p7 $p8
   } else {
      /t $p1 $p2 $p3 $p4 $p5 $p6 $p7 $p8 $p9
   }
/return

Sub Do-accept
   /press esc
   /press esc
   /invite
/return

Sub Do-reject
   /press esc
   /press esc
   /disband
/return

Sub Do-invite
   /if n $strlen("$p1")<=0 {
      /assist $MasterName
      /delay 3
   } else /if n $strlen("$p2")<=0 {
      /target "$p1"
   } else /if n $strlen("$p3")<=0 {
      /target "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
      /target "$p1 $p2 $p3"
   } else /target "$p1 $p2 $p3 $p4"
   /tell $MasterName Inviting %t
   /invite
/return

Sub Do-follow
   /varset Afollow 0
   /varset FollowTarget "NULL"
   /target $MasterName
   /face
   /follow
   /tell $MasterName Autofollow on %t.
/return

Sub Do-stop
   /dismount
   /varset LootTooFar 1
   /varset Fail 1
   /tell $MasterName Stoping.
   /varset Afollow 0
   /varset FollowTarget "NULL"
   /sendkey up up
   /press d
   /press d
   /press esc
   /press esc
   /press esc
   /press right
/return

Sub Do-camp
   /dismount
   /varset Afollow 0
   /varset FollowTarget "NULL"
   /tell $MasterName Camping out.
   /stand
   /sit
   /camp
/return

Sub Do-duck
   /press d
   /varset Fail 1
   /varset CTimer 0
   /press d
/return

Sub Do-cmds
   /call TellCmds-$p1
/return

Sub Do-moveto
   /sit off
   /varset countdown 0
   /varset MyXLoc $char(x)
   /varset MyYLoc $char(y)
   /if n $strlen("$p1")<=0 {
      /assist $MasterName
      /delay 3
   } else /if n $strlen("$p2")<=0 {
      /if $target(name)!="$p1" /target "$p1"
   } else /if n $strlen("$p3")<=0 {
      /if $target(name)!="$p1 $p2" /target "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
      /if $target(name)!="$p1 $p2 $p3" /target "$p1 $p2 $p3"
   } else /if $target(name)!="$p1 $p2 $p3 $p4 $p4" /target "$p1 $p2 $p3 $p4"
   /if $p1=="me" /target $MasterName
   /if $Afollow!="1" /tell $MasterName Moving to %t.
   :gotopointloop
   /doevents
   /if $target()==FALSE {
      /sendkey up up
      /return
   }
   /face fast nopredict
   /if n $target(distance,nopredict)>15 /sendkey down up
   /if n $target(distance,nopredict)<=15 {
      /sendkey up up
      /return
   }
   /face fast nopredict
   /if n $countdown>=3 {
      /call Detectobst
      /varset countdown 0
   }
   /varadd countdown 1
   /doevents
   /goto :gotopointloop
   }
   /sendkey up up
   /face
/return

Sub Do-petattack
   /assist $MasterName
   /delay 5
   /pet attack %t
/return

Sub Do-petguard
   /pet guard here
/return

Sub Do-petbackoff
   /pet back off
/return

Sub Do-anchor
   /if n $IsAnchored==0 {
      /varset IsAnchored 1
      /varset AnchorX $char(y)
      /varset AnchorY $char(x)
      /msg $MasterName Created anchor at Loc: $AnchorX,$AnchorY
      /return
   }
   /if n $IsAnchored==1 {
     /varset IsAnchored 0
     /msg $MasterName Removed Anchor.
   }
/return

Sub Do-trade
   /msg $MasterName Clicking trade.
   /click left button npctrade_give
   /delay 3
/return

Sub Do-yesres
   /msg $MasterName Clicking yes for res.
   /click left button confirm_yes
   /delay 3
/return

Sub Do-lootup
   /if n $strlen("$p1")<=0 {
      /assist $MasterName
      /delay 3
   } else /if n $strlen("$p2")<=0 {
      /target corpse "$p1"
   } else /if n $strlen("$p3")<=0 {
      /target corpse "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
      /target corpse "$p1 $p2 $p3"
   } else /target corpse "$p1 $p2 $p3 $p4"
   /delay 5
/call Loot
/return

Sub Do-petattack
   /assist $MasterName
   /delay 5
   /pet attack %t
/return

Sub Do-petguard
   /pet guard here
/return

Sub Do-petbackoff
   /pet back off
/return

Sub Do-anchor
   /if n $IsAnchored==0 {
      /varset IsAnchored 1
      /varset AnchorX $char(y)
      /varset AnchorY $char(x)
      /msg $MasterName Created anchor at Loc: $AnchorX,$AnchorY
      /return
   }
   /if n $IsAnchored==1 {
     /varset IsAnchored 0
     /msg $MasterName Removed Anchor.
   }
/return

Sub Do-consent
   /if n $strlen("$p1")<=0 {
      /msg $MasterName Who would you like me to consent?
      /return
   } else /if n $strlen("$p2")<=0 {
      /msg $MasterName Giving consent to "$p1"
      /consent $p1
   } else /if n $strlen("$p3")<=0 {
      /msg $MasterName Giving consent to "$p1 $p2"
      /consent $p1 $p2
   } else /if n $strlen("$p4")<=0 {
      /msg $MasterName Giving consent to "$p1 $p2 $p3"
      /conesnt $p1 $p2 $p3
   } else {
      /msg $MasterName Giving consent to "$p1 $p2 $p3 $p4"
      /consent $p1 $p2 $p3 $p4
   }
/return

Sub Do-reportbuffs
   /msg $MasterName Buffs: $char(buff,1), $char(buff,2), $char(buff,3), $char(buff,4), $char(buff,5), $char(buff,6), $char(buff,7), $char(buff,8), $char(buff,9), $char(buff,10), $char(buff,11), $char(buff,12), $char(buff,13), $char(buff,14), $char(buff,15)
/return


Code: Select all

|botspell.inc
|Bot spell module.
|Version 5.0
|Date:10/02/2003 10:31AM
|
|Varspace used: a(5,#), a(6,#), t4, t5, v96
|
|Commands in this module:
|sn, mana, loadlist, aftercastsit, evac itemcast
|
|

#define CmdList-spell v96
#define DefaultSpellSet a(5,1)
#define EvacSpell a(5,2)
#define DoAgain a(5,3)
#define StartCast a(5,4)
#define SpellSlot a(5,5)
#define SpellName a(5,6)
#define CastTime a(5,7)
#define CTimer t4
#define OOMtimer t5
#event Collapse "Your gate is too unstable, and collapses."
#event FollowOff "You are no longer auto-following"
#event RootOff "Your Immobilize spell has worn off."
#event NoLOS "You cannot see your target."
#Event CastStart "You begin casting"
#Event CastFizzle "Your spell fizzles!"
#Event CastInterrupt "Your spell is interrupted."
#Event CastNoMana "Insufficient Mana to cast this spell"
#Event CastTooFar "Your target is out of range, get closer!"
#Event Recovered "You haven't recovered yet..."
#Event CastResist "Your target resisted "
#Event Distracted "You are too distracted to cast a spell now!"
#Event NoTarget "You must first select a target for this spell!"
#Event Sitting "You must be standing to cast a spell."
#Event NoMem "You do not seem to have that spell memorized."
#Event Stunned "You can't cast spells while stunned!"



Sub SpellCommands
   /varset a(6,0) sn
   /varset a(6,1) mana
   /varset a(6,2) evac
   /varset a(6,3) aftercastsit
   /varset a(6,4) loadlist
/return   

Sub TellCmds-spell
   /msg $MasterName sn, mana, evac, aftercastsit, loadlist
/return

|SpellSub
|Main spell casting sub. 
|Used to handle all spell casting.  Auto mems spells and handles fizzles.
|Will need to set the DefaultSpellSet var to your default spell set.
|
|Usage /call SpellSub "spellname"
|
Sub SpellSub
   /varset Remem 0
   /sendkey up up
   /if n $Afollow==1 /delay 3s
   /if n $Combatstatus==1 /delay 3s
   /varset Fail 0
   /varset SpellName "$p0"
   :MemWait
   /doevents
   /if n $Fail==1 {
      /varset Fail 0
      /if n $Remem==1 {
         /memspellset $DefaultSpellSet
         :loadsploop
         /delay 5
         /if $char(spellbook)=="TRUE" /goto :loadsploop
      }
      /return
   }   
   /varset SpellSlot $char(gem,"$SpellName")
   /if n $SpellSlot<0 {
      /delay 1s
      /goto :MemWait
   }
   /if n $SpellSlot==0 {
      /memspell 2 "$p0"
      /varset SpellSlot 2
      /varset Remem 1
      :refreshwait
      /doevents
      /if n $Fail==1 {
         /varset Fail 0
         /if n $Remem==1 {
            /memspellset $DefaultSpellSet
            :loadsploop
            /delay 5
            /if $char(spellbook)=="TRUE" /goto :loadsploop
         }
         /return
      }   
      /delay 5
      /if n $char(gem,"$SpellName")<=0 /goto :refreshwait
   }
   /varset CastTime "$spell("$SpellName",casttime)"
   /varadd CastTime 1
   :BeginCast
   /varset Fail 0
   /varset DoAgain 0
   /varset StartCast 0
   /call WaitForStart
   :TimerLoop
   /doevents
   /if n $DoAgain==1 /goto :BeginCast
   /if n $Fail==1 {
      /varset Fail 0
      /if n $Remem==1 {
         /memspellset $DefaultSpellSet
         :loadsploop
         /delay 5
         /if $char(spellbook)=="TRUE" /goto :loadsploop
      }   
      /return
   }
   /if n $CTimer>0 /goto :TimerLoop
   /delay 2
   /doevents
   /if n $DoAgain==1 /goto :BeginCast
   /if n $Remem==1 {
      /memspellset default
      :loadsploop
      /delay 5
      /if $char(spellbook)=="TRUE" /goto :loadsploop
   }   
/return

|WaitForStart
|Used by SpellSub to determine when to start spell countdown.
Sub WaitForStart
   /cast $SpellSlot
   :StartLoop
   /doevents
   /if n $Fail==1 /return
   /if n $DoAgain==1 /return
   /if n $StartCast==0 {
      /goto :StartLoop
   }
   /varset CTimer "$CastTime"s
/return

Sub Event_CastStart
   /varset StartCast 1
/return

Sub Event_CastFizzle
   /delay 2
   /varset DoAgain 1
/return

Sub Event_CastInterrupt
   /delay 2
   /if n $Fail==1 /return
   /varset DoAgain 1
/return

Sub Event_FollowOff
   /press esc
   /press esc
   /delay 5
   /tell $MasterName Auto Follow Off.
/return

Sub Event_Sitting
   /stand
   /delay 2
   /varset DoAgain 1
/return

Sub Event_CastTooFar
   /varset Fail 1
   /tell $MasterName Too far away.
   /varset CTimer 0
/return

Sub Event_Distracted
   /tell $MasterName I can't cast. I'm too distracted.
   /varset Fail 1
   /varset CTimer 0
/return

Sub Event_NoTarget
   /varset Fail 1
   /tell $MasterName I have no target to cast on.
   /varset CTimer 0
/return

Sub Event_NoMem
   /tell $MasterName That spell is not memed.
   /varset Fail 1
   /varset CTimer 0
/return

Sub Event_RootOff
   /tell $MasterName Root has worn off.
/return

Sub Event_CastNoMana
   /if $IsPally==1 {
      /varset Fail 1
      /if $OOMtimer<=0 {
         /tell $MasterName I am OOM!
         /varset OOMtimer 100
         /return
      }
   }
   /tell $MasterName OOM. Medding 13 seconds and trying again.
   /varset DoAgain 1
   /sit off
   /sit on
   /varset OOMtimer 130
   :medingwait
   /delay 1
   /doevents
   /if n $OOMtimer>0 /goto :medingwait
   /sit off
/return

Sub Event_Stunned
   /tell $MasterName Stunned waiting 3 seconds to try again.
   /delay 3s
   /varset DoAgain 1
/return

Sub Event_Recovered
   /delay 2s
   /varset DoAgain 1
/return

Sub Event_CastResist
   /tell $MasterName Resisted.
   /varset Fail 1
/return

Sub Event_Collapse
   /varset DoAgain 1
/return

Sub Event_NoLOS
   /tell $MasterName I can't see my target.
   /varset Fail 1
   /varset CTimer 0
/return

|||||||||||||||Bot command subs

Sub Do-sn
   /assist $MasterName
   /delay 5
   /if n $strlen("$p1")<=0 {
      /return
   } else /if n $strlen("$p2")<=0 {
      /tell "$MasterName" Casting $p1 on %T
      /call SpellSub "$p1"
   } else /if n $strlen("$p3")<=0 {
      /tell "$MasterName" Casting $p1 $p2 on %T
      /call SpellSub "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
      /tell "$MasterName" Casting $p1 $p2 $p3 on %T
      /call SpellSub "$p1 $p2 $p3"
   } else {
      /tell "$MasterName" Casting $p1 $p2 $p3 $p4 on %T
      /call SpellSub "$p1 $p2 $p3 $p4"
   }
   /stand
   /if n $SitAfterCast==1 /sit on
   /press esc
/return

Sub Do-mana
   /press F1
   /tell $MasterName $char(mana,pct)m
   /press esc
/return

Sub Do-loadlist
   /if n $strlen("$p1")<=0 {
      /return
   } else {
   /memspellset "$p1"
   }
/return

Sub Do-aftercastsit
   /if n $SitAfterCast=1 {
      /varset SitAfterCast 0
      /return
   }
   /varset SitAfterCast 1
/return

Sub Do-evac
   /tell $MasterName Moving to you and casting Evac!
   /call Do-moveto evac $MasterName
   /delay 2s
   /call SpellSub "$EvacSpell"
/return

Sub Do-itemcast
   /if $char(state)=="SIT" {
      /stand
      /delay 3
   }
   /if n $strlen("$p1")<=0 {
      /return
   /assist $MasterName
   /delay 5
   } else /if n $strlen("$p2")<=0 {
      /tell "$MasterName" Casting item $p1 on %T
      /cast item "$p1"
   } else /if n $strlen("$p3")<=0 {
      /tell "$MasterName" Casting item $p1 $p2 on %T
      /cast item "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
      /tell "$MasterName" Casting item $p1 $p2 $p3 on %T
      /cast item "$p1 $p2 $p3"
   } else {
      /tell "$MasterName" Casting item $p1 $p2 $p3 $p4 on %T
      /cast item "$p1 $p2 $p3 $p4"
   }
   /press esc
/return


Code: Select all

|botcombat.inc
|Bot combat module.
|Version:5.0
|Date:10/02/2003 10:31AM
|
|Varspace used: a(3,#) a(4,#), v97
|
|Commands in this module:
|getbehind, kick, traps, taunt, backstab, evade, slam
|bash, attack, noattack
|
|
#define CmdList-combat v97
#define DoTraps a(3,0)
#define DoKick a(3,1)
#define DoBackstab a(3,2)
#define DoTaunt a(3,3)
#define DoEvade a(3,4)
#define DoSlam a(3,5)
#define DoBash a(3,6)
#define EnrageVar a(3,7)
#define Combatstatus a(3,8)

#Event Enraged "has become ENRAGED"
#Event Offrage "is no longer enraged"
#Event FoundFloorTrap "You sense a trap in this direction"
#Event FoundBoxTrap "You are certain that"
#Event DisarmTrap "You have disarmed"

Sub CombatCommands
   /varset a(4,0) attack
   /varset a(4,1) noattack
   /varset a(4,2) backstab
   /varset a(4,3) taunt
   /varset a(4,4) evade
   /varset a(4,5) slam
   /varset a(4,6) bash
   /varset a(4,7) getbehind
   /varset a(4,8) kick
   /varset a(4,9) traps
   /varset a(4,10) petattack
   /varset a(4,11) petguard
   /varset a(4,12) petbackoff
/return

Sub TellCmds-combat
   /msg $MasterName attack noattack backstab taunt evade slam bash getbehind kick traps petattack petguard petbackoff
/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 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 $DoBash==1 {
      /if n $char(ability,"Bash")>0 {
      /doability "Bash"
      }
   }
   /if n $DoBackstab==1 {
      /if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))<8 {
         /face fast nopredict
         /delay 2
         /doability "Backstab"
      }
   }
   /if n $DoSlam==1 {
      /if n $char(ability,"Slam")>0 {
         /face fast nopredict
         /delay 2
         /doability "Slam"
      }
   }
   /if n $DoEvade==1 {
      /if n $char(ability,"Hide")>0 {
         /attack off
         /doability "Hide"
         /if $enrageVar!=1 /attack
      }
   }
   /if n $DoTaunt==1 {
      /if n $char(ability,"Taunt")>0 {
         /doability "Taunt"
      }
   }
   /if n $DoKick==1 {
      /if n $char(ability,"Kick")>0 {
         /doability "Kick"
      }
   }
/return

|TrapFinder
|Used to auto sence traps when DoTraps is set to 1
|Usage /call TrapFinder
Sub TrapFinder
   /if n $DoTraps==1 {
      /if n $char(ability,"Sense Traps")>0 {
         /doability "Sense Traps"
      }
   }
   /doevents
/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 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

Sub Event_FoundBoxTrap
   /if n $char(ability,"Disarm Traps")>0 {
      /msg $MasterName Trying to disarm a %t trap.
      /doability "Disarm Traps"
      /return
   }
/return

Sub Event_FoundFloorTrap
   /if n $char(ability,"Disarm Traps")>0 {
      /msg $MasterName Trying to disarm a floor trap.
      /doability "Disarm Traps"
      /return
   }
/return

Sub Event_DisarmTrap
   /delay 2s
   /msg $MasterName Trap disarmed.
/return



||||||||||||||||Command Subs
Sub Do-getbehind
   /varset Afollow 0
   /varset FollowTarget "NULL"
   /if $target()==FALSE {
      /return
   }
   /if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))<3 /goto :noneed
   /sendkey down up
   :gobehindloop
   /if $target()==FALSE {
      /sendkey up up
      /return
   }
   /doevents
   /face fast loc $calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10)
   /if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))>1 /goto :gobehindloop
   /sendkey up up
   /face fast nopredict
:noneed
/return

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

Sub Do-traps
   /if $DoTraps==1 {
      /tell $MasterName AutoTraps is now off
      /varset DoTraps 0
      /return
   }
   /if $DoTraps==0 {
      /tell $MasterName AutoTraps is now on
      /varset DoTraps 1
      /return
   }
/return

Sub Do-taunt
   /if $DoTaunt==1 {
      /tell $MasterName AutoTaunt is now off
      /varset DoTaunt 0
      /return
   }
   /if $DoTaunt==0 {
      /tell $MasterName AutoTaunt is now on
      /varset DoTaunt 1
      /return
   }
/return

Sub Do-backstab
   /if $DoBackstab==1 {
      /tell $MasterName AutoBackstab is now off
      /varset DoBackstab 0
      /return
   }
   /if $DoBackstab==0 {
      /tell $MasterName AutoBackstab is now on
      /varset DoBackstab 1
      /return
   }
/return

Sub Do-evade
   /echo made it to evade sub
   /echo $DoEvade
   /if $DoEvade==1 {
      /tell $MasterName AutoEvade is now off
      /varset DoEvade 0
      /return
   }
   /if $DoEvade==0 {
      /tell $MasterName AutoEvade is now on
      /varset DoEvade 1
      /return
   }
/return

Sub Do-slam
   /if $DoSlam==1 {
      /tell $MasterName AutoSlam is now off
      /varset DoSlam 0
      /return
   }
   /if $DoSlam==0 {
      /tell $MasterName AutoSlam is now on
      /varset DoSlam 1
      /return
   }
/return

Sub Do-bash
   /if $DoBash==1 {
      /tell $MasterName AutoBash is now off
      /varset DoBash 0
      /return
   }
   /if $DoBash==0 {
      /tell $MasterName AutoBash is now on
      /varset DoBash 1
      /return
   }
/return

Sub Do-attack
   /varset Afollow 0
   /varset FollowTarget "NULL"
   /varset Combatstatus 1
   /sit off
   /if n $strlen("$p1")<=0 {
      /assist $MasterName
      /delay 5
   } else /if n $strlen("$p2")<=0 {
      /target npc "$p1"
   } else /if n $strlen("$p3")<=0 {
      /target npc "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
      /target npc "$p1 $p2 $p3"
   } else npc /target "$p1 $p2 $p3 $p4"
   /tell $MasterName Attacking %t
   /attack on
/return

Sub Do-noattack
   /attack off
   /varset $Combatstatus 0
/return


Code: Select all

|bothealer.inc
|Bot healer module.
|Version:5.0
|Date:10/02/2003 10:31AM
|
|Varspace used: a(7,#), a(8,#), t2, t3, v95
|
|Commands in this module:
|autoheal, togglehot, setpetheal, settankheal, setcasterheal,
|setdefaultheal, autohealpets, heal
|
|

#define CmdList-core v95
#define HealPetMsg a(7,1)
#define PetPctHeal a(7,2)
#define HealPets a(7,3)
#define PetSpell a(7,4)
#define CasterPctHeal a(7,5)
#define TankPctHeal a(7,6)
#define PalHealGrpMsg a(7,7)
#define PalHealMsg a(7,8)
#define HealCasterMsg a(7,9)
#define HealTankMsg a(7,10)
#define HotDelay a(7,11)
#define ReportAutoHeal a(7,12)
#define PallyHealSpell a(7,13)
#define PallyGroupSpell a(7,14)
#define CasterHealIsHot a(7,15)
#define HealedId a(7,16)
#define DefaultHealSpell a(7,17)
#define TankSpell a(7,18)
#define CasterSpell a(7,19)
#define IsHealer a(7,20)
#define IsPally a(7,21)

#define HOTWait t1
#define CastMsgTimer1 t2
#define CastMsgTimer2 t3


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

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

Sub CheckGrpHealth
   /varset GroupMember 0
   /if n "$IsHealer"==0 /return
   /if n "$IsPally"==1 /return
   /varcalc GroupMax $group(count)-1
   :GroupLoop
   /doevents
   /if n $spawn($group($GroupMember),hp,pct)<$TankPctHeal {
      /if n $spawn($group($GroupMember),hp,pct)>=1 {
         /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 $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 {
            /call Petheal
         }
      }
   }
   /if n $GroupMember>=$GroupMax /return
   /varadd GroupMember 1
   /doevents
   /goto :GroupLoop
/return

Sub Tankheal
   /if n $group($GroupMember)==$char(id) /press F1
   /if n $group($GroupMember)!=$char(id) /target id $group($GroupMember)
   /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
      }
   }
   /if n $group($GroupMember)==$char(id) /press F1
   /if n $group($GroupMember)!=$char(id) /target id $group($GroupMember)
   /varset HealedId $group($GroupMember)
   /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
   /target id $spawn($group($GroupMember),pet)
   /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
   /if n $group($GroupMember)==$char(id) /press F1
   /if n $group($GroupMember)!=$char(id) /target id $group($GroupMember)
   /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 {
         /call PallyHeal
      }
   }
   /if n $GroupMember>=$GroupMax /return
   /varadd GroupMember 1
   /doevents
   /goto :GroupLoop
/return






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

Sub Do-togglehot   
   /if n $strlen("$p1")<=0 {
      /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 $p1=="off" /varset CasterHealIsHOT 0
   /if $p1=="on" /varset CasterHealIsHOTIsHealer 1
   /if $p1=="1" /varset CasterHealIsHOT 1
   /if $p1=="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 n $strlen("$p1")<=0 {
      /if $IsHealer==1 /tell $MasterName Autoheal=Yes
      /if $IsHealer==0 /tell $MasterName Autoheal=No
      /return
   }
   /if $p1=="off" /varset IsHealer 0
   /if $p1=="on" /varset IsHealer 1
   /if $p1=="1" /varset IsHealer 1
   /if $p1=="0" /varset IsHealer 0
   /if $IsHealer==1 /tell $MasterName Autoheal=Yes
   /if $IsHealer==0 /tell $MasterName Autoheal=No
/return

Sub Do-setpetheal
   /if n $strlen("$p1")<=0 {
      /tell $MasterName Pet heal is $PetSpell
      /return
   } else /if n $strlen("$p2")<=0 {
      /varset PetSpell $p1
   } else /if n $strlen("$p3")<=0 {
      /varset PetSpell "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
     /varset PetSpell "$p1 $p2 $p3"
   } else /varset PetSpell "$p1 $p2 $p3 $p4"
   /tell $MasterName Pet heal is now $PetSpell
/return

Sub Do-settankheal
   /if n $strlen("$p1")<=0 {
      /tell $MasterName Tank heal is $TankSpell
      /return
   } else /if n $strlen("$p2")<=0 {
      /varset TankSpell $p1
   } else /if n $strlen("$p3")<=0 {
      /varset TankSpell "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
     /varset TankSpell "$p1 $p2 $p3"
   } else /varset TankSpell "$p1 $p2 $p3 $p4"
   /tell $MasterName Tank heal is now $TankSpell
/return

Sub Do-setdefaultheal
   /if n $strlen("$p1")<=0 {
      /tell $MasterName Default heal is $DefaultHealSpell
      /return
   } else /if n $strlen("$p2")<=0 {
      /varset DefaultHealSpell $p1
   } else /if n $strlen("$p3")<=0 {
      /varset DefaultHealSpell "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
     /varset DefaultHealSpell "$p1 $p2 $p3"
   } else /varset DefaultHealSpell "$p1 $p2 $p3 $p4"
   /tell $MasterName Default heal is now $DefaultHealSpell
/return

Sub Do-setcasterheal
   /if n $strlen("$p1")<=0 {
      /tell $MasterName Caster heal is $CasterSpell
      /return
   } else /if n $strlen("$p2")<=0 {
      /varset CasterSpell $p1
   } else /if n $strlen("$p3")<=0 {
      /varset CasterSpell "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
     /varset CasterSpell "$p1 $p2 $p3"
   } else /varset CasterSpell "$p1 $p2 $p3 $p4"
   /tell $MasterName Caster heal is now $CasterSpell
/return

Sub Do-autohealpets   
   /if n $strlen("$p1")<=0 {
      /if $HealPets==1 /tell $MasterName Auto heal pets=Yes
      /if $HealPets==0 /tell $MasterName Auto heal pets=No
      /return
   }
   /if $p1=="off" /varset HealPets 0
   /if $p1=="on" /varset HealPets 1
   /if $p1=="1" /varset HealPets 1
   /if $p1=="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 n $strlen("$p1")<=0 {
      /assist $MasterName
      /delay 3
   } else /if n $strlen("$p2")<=0 {
      /if "$p1"=="me" /target $MasterName
      /if "$p1"!="me" /target "$p1"
      /if "$p1"=="$BotName" /press f1
   } else /if n $strlen("$p3")<=0 {
      /target "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
      /target "$p1 $p2 $p3"
   } else /target "$p1 $p2 $p3 $p4"
   /call SpellSub "$DefaultHealSpell"
/return


Code: Select all

|personal.inc
|Example of personal include file.
|Version 5.0
|Date:10/02/2003 10:31AM
|
|Varspace used: a(0,#)
|
|Modules loaded by default:
|
|
|
Sub PersonalCommands
   /varset a(0,0) test
/return

Sub TellCmds-personal
   /msg $MasterName test
/return

Sub Do-test
   /echo testing
/return
Last edited by grimjack on Thu Oct 02, 2003 12:59 pm, edited 43 times in total.
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

papiraul
a lesser mummy
a lesser mummy
Posts: 76
Joined: Fri Sep 27, 2002 8:46 am

Post by papiraul » Wed Jul 09, 2003 4:53 am

Nice stuff..
Where can I find botcore.txt and botspell.inc ?!!?

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

Post by grimjack » Wed Jul 09, 2003 5:54 am

papiraul wrote:Nice stuff..
Where can I find botcore.txt and botspell.inc ?!!?
botcore.txt I had not pasted yet. It is there now.
botspell.inc is botspell.txt.

I have changed all .txt extentions to .inc now and pasted all the files.

This is still a WIP but I needed to post it so I could work on it some more when I get home. Everything except the spell/list meming should work fine since it's taken from my other generic macro. The real reason I'm doing this is to make the scripts easier to read and easier to modify. The spell meming will be tweaked once I have a chance to play with it.

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

papiraul
a lesser mummy
a lesser mummy
Posts: 76
Joined: Fri Sep 27, 2002 8:46 am

Post by papiraul » Wed Jul 09, 2003 8:03 am

Awsome man.. keep it up..

DrMadd
a lesser mummy
a lesser mummy
Posts: 43
Joined: Tue Jun 03, 2003 1:03 pm

Post by DrMadd » Wed Jul 09, 2003 9:23 pm

Not working for me. Says Bothealer.inc That is what I have, under the description it says ||| from bothealer.txt



When I run this macro I get, Subroutine CheckGrpHealth not found.

Its in bothealer.inc which is in same dir.


Advice /thx

DrMadd
a lesser mummy
a lesser mummy
Posts: 43
Joined: Tue Jun 03, 2003 1:03 pm

Post by DrMadd » Wed Jul 09, 2003 9:45 pm

If I rem out /call checkgrphealth then I get the error for combatcheck. If I rem them both out I get all the basic commands that are in botcore.inc. It seems it is not loading any of the other includeed .inc files.



Here is what my generic.mac looks like

Code: Select all

|genbot.mac 
|Generic bot example. 
|Make sure you edit this macro to add the commands you want. 
|Version 3.01 
|Grimjack 
#turbo 75 
#include botcore.inc
#include botspell.inc
#include botcombat.inc
#include bothealer.inc


Sub Main 
   /if n $strlen("$p0")<=0 { 
     /echo Usage: /macro generic <Master Name> 
     /endmacro 
   } 
   /varset MasterName $p0 
   /varset IsHealer 0 
   /varset RangeMin 10 
   /varset RangeMax 12 
   /varset FastRange 15 
   /varset Combatstatus 0 
   /varset SitAfterCast 0 

|||This is where the commands the bot can take is set up 

|||Commands in botcore.inc 
   /varset a(1,0) afk 
   /varset a(1,1) accept 
   /varset a(1,2) reject 
   /varset a(1,3) invite 
   /varset a(1,4) follow 
   /varset a(1,5) stop 
   /varset a(1,6) moveto 
   /varset a(1,7) sit 
   /varset a(1,8) stand 
   /varset a(1,9) camp 
   /varset a(1,10) duck 
   /varset a(1,11) run 
   /varset a(1,12) say 
   /varset a(1,13) tell 
   /varset a(1,14) group 
   /varset a(1,15) cmds 
   /varset a(1,16) target 
   /varset a(1,17) notarget 
   /varset a(1,18) assist 
   /varset a(1,19) saytarget 
|||Commands in botcombat.inc 
   /varset a(1,20) attack 
   /varset a(1,21) noattack 
|||Commands in botheal.inc 
   /varset a(1,22) autoheal 
|||Commands in botspell.inc 
   /varset a(1,23) sn 
   /varset a(1,24) mana 
   /varset a(1,25) evac 
   /varset a(1,26) aftercastsit 
|||||||||||||||||||||||Personal Commands||||||||||||||||||||||||||||||||| 
|||Add commands you want here.  
|||Example: 
|||   /varset a(1,26) mycommand 
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 

|||Bot commands setup ends here 


   /call CountArraySize 1    | Calculate size of command list array(Thanks to Kagonis) 
   /varset CmdArraySize $int($return) 
   /varset CmdList "$a(1,0), $a(1,1), $a(1,2), $a(1,3), $a(1,4), $a(1,5) $a(1,6), $a(1,7), $a(1,8), $a(1,9), $a(1,10), $a(1,11), $a(1,12), $a(1,13), $a(1,14), $a(1,15), $a(1,16), $a(1,17), $a(1,18), $a(1,19), $a(1,20) $a(1,21), $a(1,22), $a(1,23), $a(1,24), $a(1,25), $a(1,26), $a(1,27), $a(1,28), $a(1,29), $a(1,30), $a(1,31), $a(1,32), $a(1,33), "$a(1,34), $a(1,35), $a(1,36), $a(1,37), $a(1,38), $a(1,39), $a(1,40)" 
   /varset CmdArrayNum 0 
   :MainLoop 
|   /call CheckGrpHealth                    |||Sub from bothealer.txt 
|   /call Combatcheck                       |||Sub from botcombat.txt 
   /if $Combatstatus=="1" /call RangeSub   |||Sub from botcombat.txt 
   /doevents 
   /varset CmdArrayNum 0 
   /goto :MainLoop 
/return 

|||||||||||||||||||||||Personal Commands||||||||||||||||||||||||||||||||| 
|||Add Sub routines for any commands you added here.  
|||Example: 
|||   Sub do-mycommand 
|||      /echo this is my command 
|||   /return 
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 

|||||||||||||||||||||||Personal Commands|||||||||||||||||||||||||||||||||
Notice I removed the two /call lines. This allows me to use the basic commands.

Any clue?

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

Untested.

Post by grimjack » Thu Jul 10, 2003 12:36 am

I have not had time to test the macro since I broke eveything out. I just made some minor modifications though. You may want to copy/paste the main script again and see if it works. If it is still not including the others correctly I'll try to take a look at it as soon as I can.

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

DrMadd
a lesser mummy
a lesser mummy
Posts: 43
Joined: Tue Jun 03, 2003 1:03 pm

Post by DrMadd » Fri Jul 11, 2003 8:01 pm

Still wont do any of the #include commands.

Maby If I copy all the commands from the #include and paste them????

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

#include

Post by grimjack » Sat Jul 12, 2003 2:22 am

I still have not had a chance to play. My guess is that MQ won't do multiple #include statements. You could past it all in to one macro but that was half the reason for posting this. I'll see what I can find out once I get a chance to play.

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

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Sat Jul 12, 2003 11:07 am

Yes, MQ will do multiple #include statements. I do them all the time.

I've run into problems with includes due to hidden characters that get stuck in files from copying/pasting things.

First thing you do is remove ALL leading whitespace from ALL lines. Then reformat to suit yourself. Rerun macro to see if that helps.

Make sure you are spelling the sub name the same in both the main macro and the include file. Have run into that before. Also make sure you don't have the same sub name in two different include files. For example, in my autofight.inc the sub names end in AF (AttackAF, CloserAF, etc.) For autoloot.inc they end in AL.
MQ2: Think of it as Evolution in action.

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

Post by grimjack » Sat Jul 12, 2003 12:55 pm

Thanks for clearing that up Mckorr. I thought I had seen multiple includes in macros before. Everything should be spelled the same. It was all one macro untill I decided to make it more module based.

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

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Sat Jul 12, 2003 1:06 pm

One more thing. Check if you are calling an include file from within another include file... meaning macro A calls the include macro B, which calls the include macro C. If so you need to make sure to put #include macroC inside of macro B... confused yet?

And check your include statements. Make sure you are calling the right file, for example #include macroB.inc instead of #include macroB.mac. I went back a while ago and changed all my include files to INC instead of MAC, but forgot to change the extensions in the files calling them.
MQ2: Think of it as Evolution in action.

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

Fixed

Post by grimjack » Sat Jul 12, 2003 4:03 pm

This should now be fixed for the most part. It did not like the coments on the same line as sub definitions. I tested the macro for about 20 minutes and made a few tweaks as well. Let me know of any bugs you find and I'll fix them as I find time.

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

macrotoon
a ghoul
a ghoul
Posts: 106
Joined: Wed Sep 18, 2002 4:38 pm

Post by macrotoon » Mon Jul 14, 2003 9:13 am

I like the way you cleaned up my pally code. Looks good. I'll give it a try later today.

Wishbringer
Contributing Member
Contributing Member
Posts: 230
Joined: Thu Nov 14, 2002 7:00 am

Post by Wishbringer » Mon Jul 14, 2003 12:10 pm

Possible to make macro useable by more than one master?

Buff Bitch for say 4 ppl?