Genbot.mac 12.38 -- Updated 6/4/2004

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Genbot.mac 12.38 -- Updated 6/4/2004

Post by Vexix » Sat May 22, 2004 2:45 am

In the MQZip dated June 02 2004 16:55:49 MQ2 release, Genbot does not work. The more recent June 04 2004 15:25:36 stealth release does work. A bug has been logged here: http://macroquest2.com/phpBB2/viewtopic.php?p=53721 In particular, your buff list, shortcuts, and routines, and prolly some other stuff won't function correctly. Dman has posted a fix in the above thread, or you can just download the latest zip, which does work..

Current File Versions:
Genbot.mac 12.35
BotCore.inc 12.38
BotCombat.inc 12.37
BotSpell.inc 12.37
BotHealer.inc 12.34
BotShortCut.inc 12.35 <--- shortcuts.inc has been changed to botshortcut.inc for consistency
Personal.inc 12.30
GenbotDoc 12.38 <----- Current!

Changelog 2004-06-04

sj_digriz was kind enough to sort botcore.inc, so subroutines are much easier to find now!
Seagreen500 has updated the documentation for genbot!

Changelog 2004-06-02

Added item option into both sn and snt, as in "sn journeyman boots". It irritated me that genbot was always trying to assist master just to click on his booties.

Added /gb alias for /echo genbot, so now you can just type commands "/gb sit" if you're tired of typing out /echo genbot sit.

Fixed looking up at the ceiling or floor after battles and returning to anchor.

Improved the lootall code. Genbot will no longer assist you or get into endless loops on unreachable corpses when doing lootall.

Added additional event calls for EventGainedExp, EventZoned, EventDead, and EventAttacked. I'll be doing some more write up on this later, and adding additional Event calls, but for now if you want to add in a shortcut with that name, it will be called when that event happens.

Changelog 2004-05-30

Added the immunity spell messages below and some other targetting changes.

Changelog 2004-05-29

Implemented /commands natively into genbot. Any command to the bot which begins with a / will be executed by the bot. For example, "/wave" or "/yell" or "/target id 1234" or "/call MySubroutine" are all valid bot commands.

Added conditions to terminate early to several /delay calls to improve bot responsiveness.

Added /target clear commands to improve assist and targetting accuracy.

Changed the default behavior for snt to cast on your current target instead of assist you if no "on so-and-so" found in the command, i.e. "snt Anarchy" will now cast Anarchy on the bot's current target instead of the master's target. If you want to cast on the master's target, use "sn Anarchy"

Likewise, attack now defaults to the bots current target if not given a target, instead of assisting you. If you want the bot to assist you, use the assist command.

Changed the default for buff from do nothing to cast buff on master, i.e. "buff sheild of blades" will cast that buff on the master.

Removed the IsBard variable from the .ini's. MQ2 is smart enough to tell by itself if you are a bard or not, and will ignore whatever value is in the .ini. By the way, does bard spellcasting work in genbot, anyway?

Fixed /sit to work better. Why the SitTimer was hardcoded to be set to 1140m (19 hours) in the code is a mystery to me. Also added SitTimer setting to the attacked events, so you will wait the appropriate amount of time before sitting after getting wacked.

Added multiple commands into shortcuts. For example the following is a valid shortcut:
byebye=/wave|/sit on|/camp desktop

Added targeted commands to shortcuts. Any command ended by with " on" will use the argument of the calling shortcut.
For example, the shortcut:

markon=snt Mark of the righteous on|snt Mark of kings on

Could then be called with "markon bob" or "markon yourself" and would target correctly and then cast.
Shortcuts can be used to do some very cool stuff. For instance, shortcuts can also call other shortcuts. If the above "mark" shortcut had the " on" removed to allow it to cast on the current target instead of expecting you to provide one, then:

mark=snt Mark of the righteous|snt Mark of kings|/target clear

Then you could make another shortcut:

markparty=/target clear|/keypress F1|mark|/keypress F2|mark|/keypress F3|mark|/keypress F4|mark|/keypress F5|mark|/keypress F6|mark

Which would buff your entire party for you. If you didn't have 6 people in your party, it would still try to target them and cast, but it would immediately get an error and time out, so no real loss.

NOTE: You can use DataVar expressions in shortcuts, but be warned they will be evaluated by the first MQ2 char they hit. In otherwards, if you are running MQ2, and give your bot the command /say My name is ${Me.Name}, the bot will say, My name is MasterName, since the datavar is evaluated by the master MQ2. If you're not running MQ2, and give the same command, the bot will say, "My name is Bot."

CAUTIONS:
With great power, comes great responsibility. ;) Since shortcuts can call other shortcuts, it's possible to create shortcuts which would endlessly loop. I don't recommend that. :P

Shortcuts take full control of your bot during execution. It would be easy to make a long cleric buff shortcut chain which would cast every buff on every member of your party, but remember that until your buff chain finished, your cleric bot will do no healing or moving. I hope nothing spawns or wanders into your party!

Changelog 2004-05-22

Added IRC capability back into Genbot. Credit Venidar
Fixed Pet Heals Credit mpmq
Fixed spinning at anchor point Credit chickenisgoot
Updated code for new blech events. Credit Seagreen500
Move to anchor code fixed Credit fez_ajer
Other fixes from posts

For this update, I've incorporated posted bug fixes, and unified shortcuts into one format, which accepts any EQ, MQ, or Genbot command.

Here is the information on the new shortcuts:

I've been working with Genbot a bit, and wanted increased flexibility with my shortcuts, so I've changed the code a bit so I can use any everquest, macroquest, or genbot command.

For instance, the following would be a valid Genbot .ini section:

Code:
[Shortcuts]
eyepatch=itemcast Eyepatch of Plunder
nukeit=sn Lure of Flame
sowme=buff spirit of wolf on me
uberaa=/alt activate 33
takemehome=/echo play:PoKtoNexxus 1 f nopp z;NexxustoBazaar 10 cr nopp z;BazaartoShadHav 1 cf nopp noz

Shortcuts give an easy way to abbreviate long commands, like interzone advpaths, and also have some really cool possibility for controlling parties. For instance, you could have you leader say nukeit in groupsay, and each of the PCs in the party could respond with an appropriate nuke as defined in their .ini file. The wizzy Lures it, the enchanter smacks it with his DD+stun, the druid casts wildfire, and the warrior, um, slams it!

Similarly, if you called evacuate, if you set up the .ini's right, the druid could cast his evac, the cleric might automatically heal the druid to make sure he survives, and the warrior could hit AE taunt to pull aggro from the druid. Fun, fun!

To show what shortcuts you have defined in your .ini file while running the macro, I added the shortcuts command. Type "shortcuts" for a list of available shortcuts, and type "shortcuts name_of_shortcut" to see what that particular shortcut does.

--Vexix
Last edited by Vexix on Tue Jun 08, 2004 8:04 am, edited 14 times in total.

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

genbot.mac

Post by Vexix » Sat May 22, 2004 2:47 am

genbot.mac

Code: Select all

|genbot.mac 
|Generic bot macro for any class. 
|Version 12.35 
|Date:05/29/2004
| 
||** 
[genbot] 
version=12.35
**|| 
| 

#include botcore.inc 
#include botspell.inc 
#include botcombat.inc 
#include bothealer.inc 
#include botshortcut.inc 
#include personal.inc 
#include advpath.inc 
#turbo 40 

Sub Main 
   /declare Commands[2,500] string outer 
   /declare Toggles[5,50] string outer 
   /declare TopCommand int outer 1 
   /declare TopToggle int outer 1 
    
   |Determine master(s) 
   |Determine if masterlist already exists - will exist if this is a reload 
   /if (!${Defined[MasterList]}) { 
      /if (!${Defined[Param0]}) { 
         /echo Usage: /macro generic <Master Name1> <Master Name2>... 
         /endmacro 
      } 
      /declare MasterList string global 
   } 
   /if (${Defined[Param0]}) { 
      |clear and rebuild master list if a list was passed 
      /varset MasterList | 
      /declare MasterCount int local 
      /for MasterCount 0 to ${Macro.Params} 
         /varset MasterList ${MasterList}${Param${MasterCount}}| 
      /next MasterCount 
   } 
    
    
    |Initialize variables in each include 
   /call Init-Core 
   /call Init-Combat 
   /call Init-Spell 
   /call Init-Healer 
   /call Init-Toggles 
   /call Init-Shortcuts 
   /call Init-Personal 
   :MainLoop 
   /varset BreakOut 0 
   /doevents 
   |Fire tasks in each Include 
   /call CoreMain 
   /call HealerMain 
   /call SpellMain 
   /call CombatMain  
   /call PersonalMain 
   /call AdvPathPoll 
   /goto :MainLoop 
/return 

Last edited by Vexix on Sat May 29, 2004 8:50 am, edited 1 time in total.

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Post by Vexix » Sat May 22, 2004 2:47 am

botcore.inc

Code: Select all


|botcore.inc 
|Bot core module. 
|Version 12.38 
|Date:06/04/2004 
| 
||** 
[botcore] 
version=12.38 
**|| 

#chat chat 
#chat group 
#chat tell 

#event Appear "You appear." 
#event Appearing "You feel yourself starting to appear." 
#event CorpseTooFar "You are too far away to loot that corpse." 
#event ExpGained "#*#You gain#*#experience#*#" 
#event FollowOff "You are no longer auto-following#*#" 
#event ImDead "You have been slain by#*#" 
#event IRC "<#1#> #2#" 
#event LosingLev "You feel as if you are about to fall" 
#event SelfEcho "[MQ2] Genbot #*#" 
#event Zoned "LOADING, PLEASE WAIT..." 

Sub Init-Core 
   /declare cmds-CORE string outer Core: 
   |For each command 
   |/call AddCommand "Command Section" "Command Phrase" "Called Sub" 
   |Command Section - where the command will be listed in response to the cmd phrase 
   |Command Phrase to trigger bot - End User can change to suit prefferences 
   |Called Sub - Routine to execute in response to Command Phrase 
   /call AddCommand CORE accept Do-accept 
   /call AddCommand CORE afk Do-afk 
   /call AddCommand CORE anchor Do-anchor 
   /call AddCommand CORE anchorradius Do-anchorradius 
   /call AddCommand CORE assist Do-assist 
   /call AddCommand CORE autoinv Do-autoinv 
   /call AddCommand CORE camp Do-camp 
   /call AddCommand CORE chatin Do-chatin 
   /call AddCommand CORE cmds Do-cmds 
   /call AddCommand CORE consent Do-consent 
   /call AddCommand CORE door Do-door 
   /call AddCommand CORE dismount Do-dismount 
   /call AddCommand CORE duck Do-duck 
   /call AddCommand CORE exp Do-exp 
   /call AddCommand CORE face Do-face 
   /call AddCommand CORE follow Do-follow 
   /call AddCommand CORE FollowMode Do-FollowMode 
   /call AddCommand CORE group Do-group 
   /call AddCommand CORE invite Do-invite 
   /call AddCommand CORE itemcast Do-itemcast 
   /call AddCommand CORE lootall Do-lootall 
   /call AddCommand CORE lootup Do-lootup 
   /call AddCommand CORE mount Do-mount 
   /call AddCommand CORE moveto Do-moveto 
   /call AddCommand CORE MoveToMode Do-MoveToMode 
   /call AddCommand CORE norelay Do-norelay 
   /call AddCommand CORE notarget Do-notarget 
   /call AddCommand CORE pause Do-pause 
   /call AddCommand CORE petattack Do-petattack 
   /call AddCommand CORE petguard Do-petguard 
   /call AddCommand CORE petback Do-petback 
   /call AddCommand CORE random Do-random 
   /call AddCommand CORE reject Do-reject 
   /call AddCommand CORE relay Do-relay 
   /call AddCommand CORE reload Do-reload 
   /call AddCommand CORE reportbuffs Do-reportbuffs 
   /call AddCommand CORE rmod Do-rmod 
   /call AddCommand CORE rset Do-rset 
   /call AddCommand CORE Rptvar Do-Rptvar 
   /call AddCommand CORE run Do-run 
   /call AddCommand CORE say Do-say 
   /call AddCommand CORE saytarget Do-saytarget 
   /call AddCommand CORE Setvar Do-Setvar 
   /call AddCommand CORE sit Do-sit 
   /call AddCommand CORE stand Do-stand 
   /call AddCommand CORE stay Do-stay 
   /call AddCommand CORE stop Do-stop 
   /call AddCommand CORE target Do-target 
   /call AddCommand CORE tell Do-tell 
   /call AddCommand CORE trade Do-trade 
   /call AddCommand CORE verbosity Do-verbosity 
   /call AddCommand CORE yesres Do-yes 
   |Declare Vars 
   /declare advpath bool outer 
   /declare Afollow int outer 0 
   /declare AnchorRadius int outer 10 
   /declare AnchorX int outer 0 
   /declare AnchorY int outer 0 
   /declare AttackOnAssist bool outer FALSE 
   /declare BehindOnAssist bool outer FALSE 
   /declare BreakOut bool outer FALSE 
   /declare ChatIn string outer Tell 
   /declare ChatInChannel string outer 
   /declare CheckName bool outer FALSE 
   /declare Combatstatus bool outer FALSE 
   /declare CommandParam string outer 
   /declare CorpseRadius int outer 
   /declare CurrCommand string outer 
   /declare FaceFastini int outer 
   /declare FastRange int outer 14 
   /declare FastMin int outer 6 
   /declare FollowDistanceini int outer 
   /declare FollowTarget string outer 
   /declare FollowMode int outer 1 
   /declare GenLastXLoc int outer 0 
   /declare GenLastYLoc int outer 0 
   /declare IgnGroupList string outer 
   /declare IsAnchored bool outer FALSE 
   /declare ListenChan string outer 
   /declare ListenChat bool outer FALSE 
   /declare ListenGroup bool outer FALSE 
   /declare LootTooFar int outer 0 
   /declare MasterName string outer ${MasterList.Arg[1,|]} 
   /declare MountItem string outer 
   /declare MoveToMode int outer 1 
   /declare PetOnAssist bool outer FALSE 
   /declare ObstacleCheck int outer 0 
   /declare Relaytells bool outer TRUE 
   /declare RangeMin int outer 10 
   /declare RangeMax int outer 12 
   /declare SilentFlagini int outer 
   /declare SpeedSenseini int outer 
   /declare Supportstatus bool outer 
   /declare Verbosity int outer 9 

|Timers 
   /declare SitTimer timer 

   /call LoadSetting AnchorRadius CORE AnchorRadius 6 
   /call LoadSetting AttackOnAssist CORE AttackOnAssist 0 
   /call LoadSetting BehindOnAssist CORE BehindOnAssist 0 
   /call LoadSetting ChatIn CORE ChatIn Tell 
   /call LoadSetting ChatInChannel CORE ChatInChannel "Channel Name" 
   /call LoadSetting CheckName CORE CheckName 0 
   /call LoadSetting CorpseRadius CORE MaxLootRadius 50 
   /call LoadSetting FaceFastini advpath FaceFast 1 
   /call LoadSetting FastMin CORE FastMin 6 
   /call LoadSetting FastRange CORE FastRange 14 
   /call LoadSetting FollowDistanceini advpath FollowDistance 20 
   /call LoadSetting FollowMode CORE FollowMode 1 
   /call LoadSetting IgnGroupList CORE IgnGroupList duck|say|tell|group|cmds|trade|run|backstab|taunt|evade|slam|bash|kick|flyingkick|disarm|traps|puller|| 
   /call LoadSetting ListenChan CORE ListenChan Name_of_channel 
   /call LoadSetting ListenChat CORE ListenChat 1 
   /call LoadSetting ListenGroup CORE ListenGroup 1 
   /call LoadSetting MountItem CORE MountItem "Name of Bridle or Drum" 
   /call LoadSetting MoveToMode CORE MoveToMode 1 
   /call LoadSetting PetOnAssist CORE PetOnAssist 0 
   /call LoadSetting RangeMax CORE RangeMax 12 
   /call LoadSetting RangeMin CORE RangeMin 10 
   /call LoadSetting Relaytells CORE Relaytells 1 
   /call LoadSetting SilentFlagini advpath SilentFlag 1 
   /call LoadSetting SpeedSenseini advpath SpeedSense 15 
   /call LoadSetting Verbosity CORE Verbosity 9 

   /squelch /alias /gb /echo genbot 


   /declare advpathv float local 
   /varset advpathv ${Ini[advpath.inc,advpath,version,99999]} 
   /if (${advpathv}==99999) { 
      /echo Advanced pathing NOT available. 
      /varset advpath 0 
   } else { 
      /if (${advpathv}>=1.24) { 
         /varset advpath TRUE 
         /call InitAPFVars ${FaceFastini} ${SpeedSenseini} ${FollowDistanceini} 
         /varset SilentFlag ${SilentFlagini} 
      } else { 
         /echo Minimum advpath.inc v(1.24) required - you have v(${advpathv}) 
         /echo Advanced pathing found, but too old. Update it! 
         /varset advpath FALSE 
      } 
   } 
/return 

Sub AddCommand(string CmdSect,string CmdPhrase,string CmdRoutine) 
   /varset Commands[1,${TopCommand}] ${CmdPhrase} 
   /varset Commands[2,${TopCommand}] ${CmdRoutine} 
   /varcalc TopCommand ${TopCommand}+1 
   /varset cmds-${CmdSect} ${cmds-${CmdSect}} ${CmdPhrase} 
/return 

Sub LoadSetting(string VarName,string SectionName,string KeyName,string DefaultValue) 
   /if (!${Defined[LoadFrom]}) { 
      /declare LoadFrom string outer ini 
   } 
   /if (${LoadFrom.Equal[ini]}) { 
      /declare IniValue string local 
      /if (!${Defined[IniFile]}) { 
         |setup ini File Reference 
         /declare IniFile string outer genbot_${Me.CleanName}.ini 
      } 
      /varset IniValue ${Ini[${IniFile},${SectionName},${KeyName},NOTFOUND]} 
      /if (${IniValue.Equal[NOTFOUND]}) { 
           /ini ${IniFile} "${SectionName}" "${KeyName}" "${DefaultValue}" 
         /varset ${VarName}  ${DefaultValue} 
      } else { 
         /varset ${VarName}  ${IniValue} 
      } 
   } 

/return 

Sub CoreMain 
   /if (!${Combatstatus}) { 
      /if ((!${Supportstatus})&&(!${IsAnchored})) { 
         /if (${Afollow}) { 
            /target ${FollowTarget} 
            /varset CommandParam ${FollowTarget} 
            /call Do-moveto ${FollowTarget} 
         } 
          /if (${advpath}) /call AdvPathPoll 
      } 
      /if (${IsAnchored}) { 
         /if (${Math.Distance[${AnchorY},${AnchorX}]}>${AnchorRadius}) { 
            /call MoveToAnchor 
         } else { 
            /if ((${SitAfterCast})&&(${Me.Standing})) /sit 
         } 
      } 
   } 
/return 

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

Sub Do-accept 
   /target clear 
   /invite 
/return 

Sub Do-reject 
   /target clear 
   /disband 
/return 

Sub Do-afk 
   /if (!${Defined[Param0]}) { 
      /afk 
   } else { 
      /afk ${CommandParam} 
   } 
   /call ChatOut 3 ${MasterName} "Going afk." 
/return 

Sub Do-anchor 
   /if (!${IsAnchored}) { 
      /varset IsAnchored 1 
      /varset AnchorX ${Me.X} 
      /varset AnchorY ${Me.Y} 
      /varset Afollow 0 
      /varset FollowTarget NULL 
      /if (${advpath} && ${FollowFlag}) /call StopFunction 
      /keypress LEFT 
      /keypress RIGHT 
      /call ChatOut 5 ${MasterName} "Created anchor at Loc: ${AnchorY},${AnchorX}." 
      /return 
   } 
   /if (${IsAnchored}) { 
     /varset IsAnchored 0 
     /call ChatOut 5 ${MasterName} "Removed Anchor." 
   } 
/return 

Sub Do-anchorradius(int NewRadius) 
   /if (!${Defined[NewRadius]}) { 
      /call ChatOut 3 ${MasterName} "My anchor radius is ${AnchorRadius}." 
   } 
   /if (${NewRadius}<3) /return 
   /varset AnchorRadius ${NewRadius} 
   /call ChatOut 3 ${MasterName} "My new anchor radius is ${AnchorRadius}." 
/return 

Sub Do-assist(string AssistName) 
   /varset Supportstatus 1 
   /if (!${Defined[AssistName]}) { 
      /call Assist "${MasterName}" 
   } else /if (${AssistName.Equal[me]}) { 
      /call Assist "${MasterName}" 
   } else /if (${AssistName.Equal[yourself]}) { 
      /return 
   } else /if (${AssistName.Equal[${Me.CleanName}]}) { 
      /return 
   } else { 
      /call Assist "${CommandParam}" 
   } 
   /if (!${Target.ID}) { 
      /call ChatOut 5 ${MasterName} "I failed to get a target." 
   } else { 
      /call ChatOut 5 ${MasterName} "My target is now ${Target.CleanName}." 
      /if (${AttackOnAssist}) /varset Combatstatus 1 
      /if (${BehindOnAssist}) /call do-getbehind 
      /if (${PetOnAssist}) { 
         /if (${Me.Sitting}) /Stand 
         /call Delay 5 
         /pet attack 
         /call Delay 5 
         /if (${SitAfterCast} && ${Me.Standing}) /varset SitTimer ${DelayBeforeSit} 
      } 
   } 
   /call ExecCommand assistcall 
/return 

Sub Do-autoinv 
   /autoinventory 
/return 

Sub Do-camp 
   /dismount 
   /varset Afollow 0 
   /if ((${advpath})&&(${FollowFlag})) /call StopFunction 
   /varset FollowTarget NULL 
   /keypress LEFT 
   /keypress RIGHT 
   /call ChatOut 3 ${MasterName} "Camping out." 
   /if (${Me.Standing}) /Sit 
   /camp desktop 
/return 

Sub Do-chatin 
   /if (!${Defined[Param0]}) { 
      /call ChatOut 1 ${MasterName} "My chat goes to ${ChatIn}." 
      /return 
   } 
   /varset ChatIn ${Param0} 
   /call ChatOut 1 ${MasterName} "My chat goes to ${ChatIn}." 
/return 

Sub Do-cmds 
   /declare CommandTypes string local Core|Spell|Combat|Healer|Personal|Toggles|Shortcuts| 
   /if (${Defined[Param0]} && ${CommandTypes.Find[${Param0}]}) { 
      /call ChatOut 2 ${MasterName} "${cmds-${Param0.Upper}}" 
      /return 
  } else { 
      /call ChatOut 3 ${MasterName} "Must specify one of ${CommandTypes}" 
  } 
/return 

Sub Do-consent(string TargetName) 
   /if (!${Defined[TargetName]}) { 
      /call Assist "${MasterName}" 
      /varset CommandParam ${Target.CleanName} 
      /consent ${Target.CleanName} 
   } else /if (${TargetName.Equal[me]}) { 
      /call ChatOut 3 ${MasterName} "I'm giving you consent." 
      /consent ${MasterName} 
      /varset CommandParam ${MasterName} 
      /return 
   } else /if (${TargetName.Equal[yourself]}) { 
      /return 
   } else /if (${TargetName.Equal[${Me.CleanName}]}) { 
      /return 
   } else { 
      /consent ${CommandParam} 
   } 
   /call ChatOut 3 ${MasterName} "I gave consent to ${CommandParam}" 
/return 

Sub Do-Door 
   /doort 
   /face door 
   /keypress u 
/return 

Sub Do-duck 
   /keypress DUCK 
   /varset SpellFail 1 
   /varset CTimer 0 
/return 

Sub Do-exp 
   /call ChatOut 5 ${MasterName} "I am at ${Me.PctExp} percent exp. 
/return 

Sub Do-face 
   /call StandardTarget "${CommandParam}" 
   /call ChatOut 5 ${MasterName} "Facing ${Target.CleanName}." 
   /if (${Me.Sitting}) /Stand 
   /call Delay 5 
   /face 
/return 

Sub Do-follow 
   /if (${Me.Sitting}) /Stand 
   /varset IsAnchored 0 
   /if (!${Defined[Param0]}) { 
         /varset FollowTarget ${MasterName} 
   } else /if (${CommandParam.Equal[me]}) { 
         /varset FollowTarget ${MasterName} 
   } else /if (${CommandParam.Equal[yourself]}) { 
         /return 
   } else /if (${CommandParam.Equal[${Me.CleanName}]}) { 
         /return 
   } else { 
         /varset FollowTarget ${CommandParam} 
   } 
   /call Target "${FollowTarget}" 
   /if (${FollowMode}==1) { 
      /varset Afollow 1 
   } 
   /if (${FollowMode}==2) { 
      /call FollowFunction "${Target.CleanName}" 
   } 
   /if (${FollowMode}==3) { 
      /follow 
   } 
   /if (${Target.ID}) { 
      /call ChatOut 5 ${MasterName} "I am now following ${Target.CleanName}." 
   } else { 
      /call ChatOut 5 ${MasterName} "Unable to follow ${FollowTarget}." 
      /call StopFunction 
      /varset FollowTarget NULL 
   } 
/return 

Sub Do-FollowMode 
   /if (!${Defined[Param0]}) /return 
   /varset FollowMode ${Param0} 
/return 

Sub Do-group 
   /if (!${Defined[Param0]}) { 
      /return 
   } else { 
      /g ${CommandParam} 
   } 
/return 

Sub Do-invite(string TargetName) 
   /if (!${Defined[Param0]}) { 
      /call Assist "${MasterName}" 
   } else /if (${TargetName.Equal[me]}) { 
      /call Target "pc ${MasterName}" 
   } else /if (${TargetName.Equal[yourself]}) { 
      /return 
   } else /if (${TargetName.Equal[${Me.CleanName}]}) { 
      /return 
   } else { 
      /call Target "pc ${CommandParam}" 
   } 
   /call ChatOut 3 ${MasterName} "Inviting ${Target.CleanName}." 
   /invite 
/return 

Sub Do-lootall 
   /declare DeadCount int local 
   /declare CorpseList string local 
   /declare si int local 
   /if (${Me.Combat}) { 
      /call ChatOut 5 ${MasterName} "I'm busy fighting right now.  Ask me to loot again later!" 
      /return 
   } 
   /varset DeadCount ${SpawnCount[corpse radius ${CorpseRadius}]} 
   /if (!${DeadCount}) { 
      /call ChatOut 5 ${MasterName} "No corpses within range to loot." 
      /return 
   } 
   /vardata CorpseList String[ ] 
   /for si 1 to ${DeadCount} 
      /varset CorpseList ${CorpseList} ${NearestSpawn[${si},corpse radius ${CorpseRadius}].ID} 
   /next si 
   /for si 1 to ${DeadCount} 
      /call Target "id ${CorpseList.Arg[${si}]} 
      /if (${Target.Type.Equal[corpse]}) /call Loot 
   /next si 
/return 

Sub Do-lootup 
   /if (!${Defined[Param0]}) { 
      /call Assist "${MasterName}" 
   } else { 
      /call Target "${CommandParam}" 
   } 
   /call Loot 
/return 

Sub Do-mount 
   /if (${Me.Sitting}) /stand 
   /cast item "${MountItem}" 
   /call ChatOut 5 ${MasterName} "Summoning my mount." 
/return 

Sub Do-dismount 
   /dismount 
   /call ChatOut 5 ${MasterName} "I got off my mount." 
/return 

Sub Do-moveto(string TargetName) 
   /if (${Me.Sitting}) /stand 
   /varset ObstacleCheck 0 
   /varset GenLastXLoc ${Me.X} 
   /varset GenLastYLoc ${Me.Y} 
   /if (!${Defined[TargetName]}) { 
      /call Assist "${MasterName}" 
      /varset CommandParam ${Target.CleanName} 
   } else /if (${TargetName.Equal[me]}) { 
      /call Target "${MasterName}" 
      /varset CommandParam ${Target.CleanName} 
   } else /if (${TargetName.Equal[yourself]}) { 
      /return 
   } else /if (${TargetName.Equal[${Me.CleanName}]}) { 
      /return 
   } else { 
      /call Target "${CommandParam}" 
   } 
   /if (!${Target.ID}) /return 
   /doevents 
   /if (${MoveToMode}==1) { 
      |/if (${Supportstatus}) /return 
      /call RangeSub 
   } 
   /if (${MoveToMode}==2) { 
      /call GotoFunction "${Target.Y}" "${Target.X}" "${Target.Z}" 
   } 
/return 

Sub Do-MoveToMode 
   /if (!${Defined[Param0]}) /return 
   /varset MoveToMode ${Param0} 
/return 

Sub Do-notarget 
   /target clear 
/return 

Sub Do-pause 
      /if (${advpath}) { 
         /if (!${PauseFlag}) { 
            /call ChatOut 5 ${MasterName} "Pausing." 
         } else { 
            /call ChatOut 5 ${MasterName} "Unpausing." 
         } 
         /call PauseFunction 
      } 
/return 

Sub Do-petattack 
   /call Assist "${MasterName}" 
   /if (!${Target.ID}) /call ChatOut 5 ${MasterName} "I failed to get a target." 
   /pet attack 
/return 

Sub Do-petback 
   /pet back off 
/return 

Sub Do-petguard 
   /pet guard here 
/return 

Sub Do-random 
   /if (!${Defined[Param0]}) /return 
   /if (!${Defined[Param1]}) { 
      /random ${Param0} 
   } else { 
      /random ${Param0} ${Param1} 
   } 
/return 

Sub Do-relay 
   /varset Relaytells 1 
/return 

Sub Do-norelay 
   /varset Relaytells 0 
/return 

Sub Do-reload 
   /call ChatOut 5 ${MasterName} "Reload initiated." 
   /mac genbot 
/return 

Sub Do-reportbuffs 
   /if (${Defined[Param0]}) { 
      /declare myBuffs string local Buffs: 
      /declare counter int local 
      /for counter 0 to 15 
          /if (${Me.Buff[${counter}].ID}) /varset myBuffs ${myBuffs} "${Me.Buff[${counter}]}" 
      /next counter 
      /call ChatOut 1 ${MasterName} "${myBuffs}" 
   } else { 
      /if (${Param0.Equal[queue]}) { 
         /declare counter int local 
         /for counter 1 to ${BuffListCount} 
            /call ChatOut 1 ${MasterName} "Buff ${BuffList[${counter},2]} needs to be refreshed on ${BuffList[${counter},1]} in {BuffListTimes[${counter},1]} seconds." 
         /next counter 
      } 
   } 
/return 

Sub Do-rmod(int RangeMod) 
   /if (!${Defined[RangeMod]}) { 
   /varcalc RangeMin ${RangeMin}+${RangeMod} 
   /varcalc RangeMax ${RangeMax}+${RangeMod} 
   /varcalc FastRange ${FastRange}+${RangeMod} 
   /varcalc FastMin ${FastMin}+${RangeMod} 
   /call ChatOut 3 ${MasterName} "New Ranges: FastMin=${FastMin} RangeMin=${RangeMin} RangeMax=${RangeMax} FastRange=${FastRange}" 
/return 

Sub Do-rset(int NewFastMin,int NewRangeMin,int NewRangeMax,int NewFastRange) 
   /if (!${Defined[NewFastMin]}) /return 
   /if (!${Defined[NewRangeMin]}) /return 
   /if (!${Defined[NewRangeMax]}) /return 
   /if (!${Defined[NewFastRange]}) /return 
   /if (${NewFastMin}>${NewRangeMin}) /return 
   /if (${NewRangeMin}>${NewRangeMax}) /return 
   /if (${NewRangeMax}>${NewFastRange}) /return 
   /varset FastMin ${NewFastMin} 
   /varset RangeMin ${NewRangeMin} 
   /varset RangeMax ${NewRangeMax} 
   /varset FastRange ${NewFastRange} 
   /call ChatOut 3 ${MasterName} "New Ranges: FastMin=${FastMin} RangeMin=${RangeMin} RangeMax=${RangeMax} FastRange=${FastRange}" 
/return 

Sub Do-Rptvar 
   /if (!${Defined[Param0]}) /return 
   /call ChatOut 5 ${MasterName} "${Param0} is equal to ${${Param0}}" 
/return 

Sub Do-run 
   /keypress ctrl+r 
/return 

Sub Do-say 
   /if (!${Defined[Param0]}) { 
      /return 
   } else { 
      /say ${CommandParam} 
   } 
/return 

Sub Do-saytarget 
   /call ChatOut 5 ${MasterName} "my target is ${Target.CleanName}." 
/return 

Sub Do-Setvar 
   /if (!${Defined[Param0]}) /return 
   /declare VarLen int local 
   /declare ValueLen int local 
   /declare VarName string Local 
   /varset VarName ${CommandParam.Arg[1]} 
   /varset VarLen ${CommandParam.Length} 
   /varset ValueLen ${CommandParam.Length} 
   /varcalc ValueLen ${ValueLen}-${VarLen} 
   /varset ${VarName} ${CommandParam.Right[${ValueLen}]} 
   /call ChatOut 5 ${MasterName} "${Param0} is now equal to ${${Param0}}" 
/return 

Sub Do-sit 
   /varset Afollow 0 
   /varset FollowTarget NULL 
   /if ((${advpath})&&(${FollowFlag})) /call StopFunction 
   /if (${Me.Standing}) /sit 
/return 

Sub Do-stand 
   /if (${Me.Sitting}) /Stand 
/return 

Sub Do-stay 
   /varset Afollow 0 
   /varset FollowTarget NULL 
   /if ((${advpath})&&(${FollowFlag})) /call StopFunction 
   /keypress LEFT 
   /keypress RIGHT 
/return 

Sub Do-stop 
   /dismount 
   /varset Supportstatus 0 
   /varset BreakOut 1 
   /varset LootTooFar 1 
   /varset SpellFail 1 
   /varset Afollow 0 
   /if ((${advpath})&&(${FollowFlag})) /call StopFunction 
   /varset FollowTarget NULL 
   /call ChatOut 5 ${MasterName} "Stopping." 
   /keypress LEFT 
   /keypress RIGHT 
   /keypress DUCK 
   /keypress DUCK 
   /target clear 
   /keypress right 
/return 

Sub Do-target 
   /varset Supportstatus 1 
   /call StandardTarget "${CommandParam}" 
   /call ChatOut 5 ${MasterName} "My target is now ${Target.CleanName}." 
/return 

Sub Do-tell 
   /if (!${Defined[Param0]}) { 
      /return 
   } else { 
      /tell ${CommandParam} 
   } 
/return 

Sub Do-trade 
   /call ChatOut 5 ${MasterName} "Clicking trade." 
   /notify TradeWnd TRDW_Trade_Button LeftMouseUp 
   /call Delay 3 
/return 

Sub Do-verbosity(int NewVerbosity) 
   /if (!${Defined[NewVerbosity]}) { 
      /call ChatOut 1 ${MasterName} "My Verbosity is set to ${Verbosity}." 
      /return 
   } 
   /varset Verbosity ${NewVerbosity} 
   /call ChatOut 1 ${MasterName} "My Verbosity is set to ${Verbosity}." 
/return 

Sub Do-yes 
   /call ChatOut 5 ${MasterName} "Clicking yes for res." 
   /notify ConfirmationDialogBox Yes_Button leftmouseup 
   /call Delay 3 
/return 


|||||||||||| Called subs 

Sub Assist(string sAssistName) 
   /squelch /target clear 
   /assist ${sAssistName} 
   /delay 3s ${Target.ID} 
   /if (!${Target.ID}) /echo Unable to locate a target. 
/return 

Sub ChatOut(int ChatPriority,string ChatTarget,string ChatText) 
   /if (${ChatPriority}>${Verbosity}) /return 
   /if (${ChatTarget.Equal[GROUP]}) { 
      /gsay ${ChatText} 
      /return 
   } 
   /if (${ChatTarget.Equal[${Me.CleanName}]}) { 
      /echo ${ChatText} 
      /return 
   } 
   /if (${ChatIn.Equal[tell]}) { 
      /tell ${ChatTarget} ${ChatText} 
   } else /if (${ChatIn.Equal[Group]}) { 
      /gsay ${ChatText} 
   } else /if (${ChatIn.Equal[Raid]}) { 
      /rsay ${ChatText} 
   } else /if (${ChatIn.Equal[Say]}) { 
      /say ${ChatText} 
   } else /if (${ChatIn.Equal[Channel]}) { 
      /chat #${ChatInChannel} ${ChatText} 
   } else /if (${ChatIn.Equal[IRC]}) { 
      /irc ${ChatText} 
   } 
/return 

Sub Detectobst 
   /if (${Math.Distance[${GenLastYLoc},${GenLastXLoc},${Me.Z}:${Me.Y},${Me.X},${Me.Z}]}<1) /call Hitobst 5 
   /varset GenLastXLoc ${Me.X} 
   /varset GenLastYLoc ${Me.Y} 
/return 

Sub ExecCommand(string CommandText) 
   /declare counter int local 

   /if (${Macro.Params}>1) { 
      /for counter 1 to ${Math.Calc[${Macro.Params}-1]} 
         /varset CommandText ${CommandText} ${Param${counter}} 
      /next counter 
      /echo CommandText ${CommandText} 
   } 
   /if (${CommandText.Left[1].Equal[/]}) { 
      /docommand ${CommandText} 
      /return 
   } 
   /varset CurrCommand ${CommandText.Arg[1]} 
   /if (${CommandText.Arg[2].Length}) { 
      /varset CommandParam ${CommandText.Right[-${CurrCommand.Length}]} 
   } else { 
      /varset CommandParam 
   } 
   /if (${Defined[cmds-SHORTCUTS]}) { 
      /if (${String[ ${cmds-SHORTCUTS.Lower} ].Find[ ${CurrCommand.Lower} ]}) { 
         /call ShortCut "${CommandText}" 
         /return 
      } 
   } 

   /if (${Defined[cmds-ROUTINES]}) { 
      /if (${String[ ${cmds-ROUTINES.Lower} ].Find[ ${CurrCommand.Lower} ]}) { 
         /call Routine "${CommandText}" 
         /return 
      } 
   } 
   /for counter 1 to ${TopCommand} 
      /if (${CurrCommand.Equal[${Commands[1,${counter}]}]}) { 
         /call ${Commands[2,${counter}]} ${CommandParam} 
         /return 
      } 
   /next counter 

   /if (${Defined[Toggles]}) { 
      /for counter 1 to ${TopToggle} 
         /if (${CurrCommand.Equal[${Toggles[1,${counter}]}]}) { 
            /call SetToggle ${counter} ${CommandParam} 
            /return 
         } 
      /next counter 
   } 
/return 

Sub Fastback 
   /varset ObstacleCheck 0 
   /varset GenLastXLoc ${Me.X} 
   /varset GenLastYLoc ${Me.Y} 
   :fastbackloop 
      /doevents 
      /if (!${Target.ID}) { 
         /varset Combatstatus 0 
         /Keypress BACK 
         /if (${Me.Combat}) /attack off 
         /return 
      } 
      /if (${Me.Sitting}) /stand 
      /face fast 
      /if (${Target.Distance}<${FastMin}) /Keypress BACK hold 
      /if (${Target.Distance}>=${FastMin}) { 
            /Keypress BACK 
            /return 
         } 
   /if (${ObstacleCheck}>=8) { 
      /if ((${GenLastXLoc}==${Me.X})&&(${GenLastYLoc}==${Me.Y})) { 
         /if (${Math.Rand[100]}>50) { 
            /Keypress STRAFE_LEFT hold 
            /delay 1 
            /Keypress STRAFE_LEFT 
            /return 
         } else { 
            /Keypress STRAFE_RIGHT hold 
            /delay 1 
            /Keypress STRAFE_RIGHT 
            /return 
         } 
      } 
      /varset GenLastXLoc ${Me.X} 
      /varset GenLastYLoc ${Me.Y} 
   } 
   /varcalc ObstacleCheck ${ObstacleCheck}+1 
   /goto :fastbackloop 
/return 

|Fastmove 
|Called by Rangesub for when mob is more than /keypress distance away. 
|Usage: /call Fastmove 
Sub Fastmove 
   /varset ObstacleCheck 0 
   /varset GenLastXLoc ${Me.X} 
   /varset GenLastYLoc ${Me.Y} 
   :fastmoveloop 
   |/doevents   Took out since it was stuffing up evacs? 
   /if (!${Target.ID}) { 
      /varset Combatstatus 0 
      /keypress FORWARD 
      /if (${Me.Combat}) /attack off 
      /return 
   } 
   /if (${Me.Sitting}) /stand 
   /face fast 
   /if (${Target.Distance}>${FastRange}) /keypress FORWARD hold 
   /if (${Target.Distance}<=${FastRange}) { 
      /keypress FORWARD 
      /return 
   } 
   /if (${ObstacleCheck}>=60) { 
      /call Detectobst 
      /varset ObstacleCheck 0 
   } 
   /if (${Target.Distance}>=${FastRange}) /varcalc ObstacleCheck ${ObstacleCheck}+1 
   /goto :fastmoveloop 
/return 

Sub Hitobst(int HoldTime) 
   /keypress FORWARD 
   /keypress BACK hold 
   /if (${Math.Rand[100]}>50) { 
      /call Delay 2s 
      /keypress BACK 
      /keypress RIGHT hold 
      /call Delay ${HoldTime} 
      /keypress RIGHT 
      /keypress FORWARD hold 
      /call Delay 2s 
      /keypress FORWARD 

   } else { 
      /call Delay 2s 
      /keypress BACK 
      /keypress LEFT hold 
      /call Delay ${HoldTime} 
      /keypress LEFT 
      /keypress FORWARD hold 
      /call Delay 2s 
      /keypress FORWARD 
   } 
   /keypress LEFT 
   /keypress RIGHT 
/return 

sub Loot 
   /declare counter int local 
   /declare LootSlot int local 1 
   /if (${Me.Combat}) /return 
   /if (!${Target.ID}) /target corpse radius 100 
   /if (${Target.State.NotEqual[DEAD]}) /return 
   /call Rangesub 
   /face 
   /varset LootTooFar 0 
   /lootn never 
   /loot 
   /varset counter 0 
   :CoreWaitLoot 
      /call Delay 5 
      /doevents 
      /varcalc counter ${counter}+1 
      /if (${BreakOut}) /goto :donelooting 
      /if (${counter}>12) /goto :donelooting 
   /if (!${Corpse.Items}) /goto :CoreWaitLoot 
   /call ChatOut 5 ${MasterName} "Looting ${Target.CleanName}." 
   :lootloop 
      /if (${LootTooFar}) /goto :donelooting 
      /if (!${Corpse.Items}) /goto :donelooting 
      /doevents 
      /itemnotify loot${LootSlot} rightmouseup 
      /call Delay 1s 
      /varcalc LootSlot ${LootSlot}+1 
      /doevents 
      /if (${Cursor.ID}) /goto :donelooting 
      /if (${BreakOut}) /goto :donelooting 
   /goto :lootloop 
   :donelooting 
   /lootn always 
   /notify LootWnd DoneButton leftmouseup 
/return 

Sub MoveToAnchor 
   /varset GenLastXLoc ${Me.X} 
   /varset GenLastYLoc ${Me.Y} 
   /varset ObstacleCheck 0 
   /keypress Home 
   :AnchorMoveLoop 
      /if (!${IsAnchored}) { 
         /keypress BACK 
         /return 
      } 
      /doevents 
      /if (${Combatstatus}) { 
         /keypress down 
         /return 
      } 
      /if (${Me.Sitting}) /stand 
      /face nolook loc ${AnchorY},${AnchorX} 
      /if (${Math.Distance[${AnchorY},${AnchorX}]}>${AnchorRadius}) /keypress FORWARD hold 
      /if (${Math.Distance[${AnchorY},${AnchorX}]}<=${AnchorRadius}) { 
         /keypress FORWARD 
         /face away nolook loc ${AnchorY},${AnchorX} 
         /return 
      } 
      /if (${ObstacleCheck}>=3) { 
         /call Detectobst 
         /varset ObstacleCheck 0 
      } 
      /varcalc ObstacleCheck ${ObstacleCheck}+1 
   /goto :AnchorMoveLoop 
/return 


|RangeSub 
|Used to keep bot in combat range. 
|Usage /call Rangesub 
|Vars Used: RangeMax, RangeMin, FastRange, FastMin 
Sub Rangesub 
   /if (!${Target.ID}) /return 
   /if (${Target.CleanName.Equal[${Me.CleanName}]}) /return 
   /if (${Me.Sitting}) /stand 
   /face fast 
   /if (${Target.Distance}>=${FastRange}) /call Fastmove 
   /if (${Target.Distance}<=${FastMin}) /call FastBack 
   /if (${Target.Distance}>${RangeMax}) /keypress FORWARD 
   /if (${Target.Distance}<${RangeMin}) /keypress BACK 
/return 

Sub StandardTarget(string TargetName) 
   /if (!${Defined[TargetName]}) { 
      /return 
   } else /if (!${TargetName.Length}) { 
      /call Assist "${MasterName}" 
   } else /if (${TargetName.Equal[me]}) { 
      /call Target "pc ${MasterName}" 
   } else /if (${TargetName.Equal[yourself]}) { 
      /call Target myself 
   } else /if (${TargetName.Equal[${Me.CleanName}]}) { 
      /call Target myself 
   } else { 
      /call Target "${TargetName}" 
   } 
/return 

Sub Target(string sTargetName) 
   /squelch /target clear 
   /target ${sTargetName} 
   /delay 3s ${Target.ID} 
   /if (!${Target.ID}) /echo Unable to locate a target. 
/return 


|||||||||||| Events 

Sub Event_Appear 
   /call ChatOut 3 ${MasterName} "I'm no longer invis." 
/return 

Sub Event_Appearing 
   /call ChatOut 3 ${MasterName} "I'm starting to appear." 
/return 

Sub Event_Chat(string ChatType,string ChatSender,string ChatText) 
   /if (!${ChatType.Equal[GROUP]} && !${ChatType.Equal[${ListenChan}]}&& !${ChatType.Equal[TELL]}) { 
      /return 
   } 
   /if (${ChatType.Equal[GROUP]} && !${ListenGroup}) /return 
   /if (${ChatType.Equal[${ListenChan}]} && !${ListenChat}) /return 
   /if (${ChatType.Equal[${ListenChan}]} || ${ChatType.Equal[GROUP]}) { 
      /if (${CheckName} && ${ChatText.Arg[1].NotEqual[${Me.CleanName}]}) /return 
      /if (${CheckName}) { 
         /declare NameLength int local ${Me.CleanName.Length} 
         /varcalc NameLength ${NameLength}+1 
         /varset ChatText ${ChatText.Right[-${NameLength}]} 
      } else { 
         /if (${IgnGroupList.Find[${ChatText.Arg[1]}]}) /return 
      } 
   } 
   /if (${MasterList.Find[|${ChatSender}|]}) { 
      /varset MasterName ${ChatSender} 
      /call ExecCommand "${ChatText}" 
      /return 
   } 
   /if (${Relaytells} && ${ChatType.Equal[TELL]}) /call ChatOut 1 ${MasterName} "${ChatSender} told me: ${ChatText}" 
/return 

Sub Event_CorpseTooFar 
   /call ChatOut 5 ${MasterName} "I'm not close enough to loot ${Target.CleanName}." 
   /varset LootTooFar 1 
/return 

Sub Event_ExpGained 
   /call ExecCommand EventExpGained 
/return 

Sub Event_FollowOff 
   /target clear 
   /call ChatOut 5 ${MasterName} "Auto follow Off." 
/return 

Sub Event_ImDead 
   /call ExecCommand EventDead 
/return 

Sub Event_IRC(string IRCText,string IRCSender) 
      /if (${MasterList.Find[|${IRCSender}|]}) { 
      /declare NameLength int local ${IRCSender.Length} 
         /varcalc NameLength ${NameLength}+2 
         /varset IRCText ${IRCText.Right[-${NameLength}]} 
    /call ExecCommand "${IRCText}" 
      /return 
   } 
/return 

Sub Event_LosingLev 
   /call ChatOut 3 ${MasterName} "I'm losing Levitate" 
/return 

Sub Event_SelfEcho(string EchoText) 
   /varset MasterName ${Me.CleanName} 
   /varset EchoText ${EchoText.Right[-13]} 
   /call ExecCommand "${EchoText}" 
/return 

Sub Event_timer(string TimerName,string OldValue) 
   /if (${TimerName.Equal[SitTimer]}) { 
      /if (${Me.Standing}) /sit 
   } 
   /if (${TimerName.Equal[ChainStunTime]}) { 
      /call NextStun 
   } 
   /if (${TimerName.Equal[BuffListAdvance]}) { 
      /declare counter int local 
      /for counter 1 to ${BuffListCount} 
         /varcalc BuffListTimes[${counter},1] ${BuffListTimes[${counter},1]}-5 
         /if (${BuffListTimes[${counter},1]}<5) { 
            /call StandardTarget "${BuffList[${counter},1]}" 
            /if (${Target.CleanName.Equal[${BuffList[${counter},1]}]}) { 
               /call SpellSub "${BuffList[${counter},2]}" 
               /if (${Macro.Return}==0) /varset BuffListTimes[${counter},1] ${Spell[${BuffList[${counter},2]}].Duration.TotalSeconds} 
               /if (${Macro.Return}==1) /varcalc BuffListTimes[${counter},2] ${BuffListTimes[${counter},2]}+1 
               /if (${BuffListTimes[${counter},2]}>5) { 
                  /varset BuffListTimes[${counter},1] 900 
                  /varset BuffListTimes[${counter},2] 0 
               } 
            } 
         } 
      /next counter 
      /for counter 1 to 15 
         /if (${SelfBuffInt[${counter},1]}> 1) /varcalc SelfBuffInt[${counter},1] ${SelfBuffInt[${counter},1]}-5 
      /next counter 
      /varset BuffListAdvance 50 
   } 
/return 

Sub Event_Zoned 
   /varset IsAnchored 0 
   /keypress FORWARD 
   /call ExecCommand EventZoned 
/return
Last edited by Vexix on Fri Jun 04, 2004 10:18 am, edited 5 times in total.

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Post by Vexix » Sat May 22, 2004 2:53 am

botcombat.inc

Code: Select all


|botcombat.inc 
|Bot combat module. 
|Version 12.37 
|Date:06/02/2004 
| 
||** 
[botcombat] 
version=12.37 
**|| 
| 
#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 #*#" 
#Event GettingHit "#*#YOU for #*#" 
#Event AttackedMiss "#*#YOU, but #*#" 
#Event Slash "You slash #*#" 
#Event Hit "You Hit #*#" 
#Event Bash "You Bash #*#" 
#Event Pierce "You pierce #*#" 
#Event ArcheryTooFar "Your target is too far away, get closer"

Sub Init-Combat 
   /declare cmds-COMBAT string outer Combat: 
   |For each command 
   |/call AddCommand "Command Section" "Command Phrase" "Called Sub" 
   |Command Section - where the command will be listed in response to the cmd phrase 
   |Command Phrase to trigger bot - End User can change to suit prefferences 
   |Called Sub - Routine to execute in response to Command Phrase 
   /call AddCommand COMBAT attack Do-attack 
   /call AddCommand COMBAT noattack Do-noattack 
   /call AddCommand COMBAT getbehind Do-getbehind 
   /call AddCommand COMBAT behind Do-behind 
   /call AddCommand COMBAT disc Do-disc 
   /call AddCommand COMBAT shield Do-shield 
   /call AddCommand COMBAT hide Do-hide 
   /call AddCommand COMBAT sneak Do-sneak 
   |Declare Variables 
   /declare DoTraps bool outer FALSE 
   /declare DoKick bool outer FALSE 
   /declare DoBackstab bool outer FALSE 
   /declare DoTaunt bool outer FALSE 
   /declare DoEvade bool outer FALSE 
   /declare DoSlam bool outer FALSE 
   /declare DoBash bool outer FALSE 
   /declare DoFlyingKick bool outer FALSE 
   /declare DoDisarm bool outer FALSE 
   /declare DoArchery bool outer FALSE 
   /declare EnrageVar bool outer FALSE 
   /declare Aggressive bool outer FALSE 
   /declare DoFrenzy bool outer FALSE 
   /declare IsPuller bool outer FALSE 
   /declare AutoEngage bool outer FALSE 
   /declare AutoBehind bool outer FALSE 
   /declare DoIncite bool outer FALSE 
   /declare InCiteTimer timer outer 
    
   /call LoadSetting DoBackstab Combat DoBackstab 0 
   /call LoadSetting DoTaunt Combat DoTaunt 0 
   /call LoadSetting DoEvade Combat DoEvade 0 
   /call LoadSetting DoFrenzy Combat DoFrenzy 0 
   /call LoadSetting DoSlam Combat DoSlam 0 
   /call LoadSetting DoBash Combat DoBash 0 
   /call LoadSetting DoKick Combat DoKick 0 
   /call LoadSetting DoFlyingKick Combat DoFlyingKick 0 
   /call LoadSetting DoDisarm Combat DoDisarm 0 
   /call LoadSetting DoTraps Combat DoTraps 0 
   /call LoadSetting DoArchery Combat DoArchery 0 
   /call LoadSetting AutoEngage Combat AutoEngage 0 
   /call LoadSetting AutoBehind Combat AutoBehind 0 
   /call LoadSetting DoIncite Combat DoIncite 0 
   /call LoadSetting Aggressive Combat BeAggressive 0
/return 

Sub CombatMain 
   /call Combatcheck 
   /if ( !${Combatstatus} && ${DoTraps} ) /call TrapFinder 
   /if ( !${DoArchery} && ${Combatstatus} ) /call RangeSub 
   /if (${Combatstatus}) /call MeleeAbility 
   /if (${Me.Combat} && ${Target.ID} && !${Target.CleanName.Equal[${Me.CleanName}]} && ${AutoEngage}) { 
      /varset Combatstatus 1 
   } 
/return 

||||||||||||||||||||||||||||||||||||| 


|Combatcheck 
|Used to check if attack is on and should not be. 
|Usage /call Combatcheck. 
Sub Combatcheck 
   /if (${EnrageVar}) { 
      /if (${Target.ID}) { 
         /return 
      } else { 
         /varset EnrageVar 0 
         /varset Combatstatus 0 
         /attack off 
         /return 
      } 
   } 
   /if (${Supportstatus}) { 
      /if (!${Target.ID}) { 
         /call Delay 5 
         /if (!${Target.ID}) { 
            /varset Supportstatus 0 
         } 
      } 
   } 

   /if (${Combatstatus}) { 
      /if (!${Target.ID}) { 
         /call Delay 5 
         /if (!${Target.ID}) { 
            /varset Combatstatus 0 
            /varset Supportstatus 0 
            /attack off 
            /return 
         } 
      } 
      /if (${Me.Casting.ID}) /return 
      /if (${EnrageVar}) /return 
      /if ( !${DoArchery} && !${Me.Combat} ) /attack on 
      /if (${AutoBehind} && ${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.Degrees}]}*10]},${Math.Calc[${Target.X}+${Math.Sin[${Target.Heading.Degrees}]}*10]}]}>6) /call Do-behind 
   } 
/return 

|MeleeAbility 
|Used to do melee abilities if vars are set to. 
|Usage /call MeleeAbility 
Sub MeleeAbility 
   /if (${Me.Casting.ID} || !${Me.Standing} || !${Target.ID}) /return 
   /if (${Me.AltTimerReady}) {
      /if (${DoSlam}) { 
         /face fast 
         /doability "Slam" 
      } 
      /if (${DoBash}) { 
         /face fast 
         /doability "Bash" 
      } 
      /if (${DoBackstab} && ${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.Degrees}]}*10]},${Math.Calc[${Target.X}+${Math.Sin[${Target.Heading.Degrees}]}*10]}]}<15) { 
         /face fast 
         /doability "Backstab" 
      }  
      /if (${DoFrenzy}) { 
         /face fast 
         /doability "Frenzy" 
      } 
      /if (${DoKick}) { 
         /face fast 
         /doability "Kick" 
      } 
   } 
   /if (${DoEvade} && ${Me.AbilityReady[Hide]}) { 
      /attack off 
      /delay 1 
      /doability "Hide" 
      /attack on 
   } 
   /if (${DoTaunt} && ${Me.AbilityReady[Taunt]}) { 
      /doability "Taunt" 
   } 
   /if (${DoFlyingKick} && ${Me.AbilityReady[Flying Kick]}) { 
      /face fast 
      /doability "Flying Kick" 
   } 
   /if (${DoDisarm} && ${Me.AbilityReady[Disarm]}) { 
      /face fast 
      /doability "Disarm" 
   } 
   /if (${DoArchery}) { 
      /face fast 
      /range 
   } 
   /if (${DoIncite} && ${InCiteTimer}<=0) { 
      /face fast 
      /disc incite 
      /varset InCiteTimer 30s 
   } 
/return 

Sub bscounter 
   /if (!${Target.ID}) /return 
   /if (${Me.Sitting}) {
      /stand 
      /delay 3
   }
   /keypress strafe_right hold 
   :MoreCounter 
   /if (${DoBackstab} && ${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.Degrees}]}*10]},${Math.Calc[${Target.X}+${Math.Sin[${Target.Heading.Degrees}]}*10]}]}<15) { 
      /face fast 
      /doability "Backstab" 
   } 
   /if (!${Target.ID}) { 
      /keypress strafe_right 
      /return 
   } 
   /if (${Target.Distance}>20) { 
      /keypress strafe_right 
      /call RangeSub 
      /return 
   } 
   /if (${Target.Distance}<4) { 
      /keypress strafe_right  
      /call RangeSub 
      /return 
   } 
   /face fast 
   /if (${Me.Heading.Degrees}>=180 && ${Math.Calc[${Me.Heading.Degrees}-180]}<=${Target.Heading.Degrees} && ${Me.Heading.Degrees}>${Math.Calc[${Target.Heading.Degrees}+22.5]}) /goto :MoreCounter 
   /if (${Me.Heading.Degrees}<=180 && ${Target.Heading.Degrees}<=180 && ${Me.Heading.Degrees}>${Math.Calc[${Target.Heading.Degrees}+25]}) /goto :MoreCounter 
   /if (${Me.Heading.Degrees}>=180 && ${Target.Heading.Degrees}<=180 && ${Math.Calc[${Me.Heading.Degrees}-157.5]}<${Math.Calc[${Target.Heading.Degrees}+180]}) /goto :MoreCounter 
   /keypress strafe_right 
   /face fast 
/return 

Sub bsclock 
   /if (!${Target.ID}) /return 
   /if (${Me.Sitting}) {
      /stand 
      /delay 3
   }
   /keypress strafe_left hold 
   :MoreClock 
   /if (${DoBackstab} && ${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.Degrees}]}*10]},${Math.Calc[${Target.X}+${Math.Sin[${Target.Heading.Degrees}]}*10]}]}<15) { 
      /face fast 
      /doability "Backstab" 
   } 
   /if (!${Target.ID}) { 
      /keypress strafe_left 
      /return 
   } 
   /if (${Target.Distance}>20) { 
      /keypress strafe_left 
      /call RangeSub 
      /return 
   } 
   /if (${Target.Distance}<4) { 
      /keypress strafe_left 
      /call RangeSub 
      /return 
   } 
   /face fast 
   /if (${Target.Heading.Degrees}>=180 && ${Math.Calc[${Target.Heading.Degrees}-180]}<=${Me.Heading.Degrees} && ${Me.Heading.Degrees}<${Math.Calc[${Target.Heading.Degrees}-22.5]}) /goto :MoreClock 
   /if (${Target.Heading.Degrees}<=180 && ${Me.Heading.Degrees}<${Math.Calc[${Target.Heading.Degrees}-22.5]}) /goto :MoreClock 
   /if (${Target.Heading.Degrees}>=180 && ${Me.Heading.Degrees}<=180 && ${Math.Calc[${Me.Heading.Degrees}-22.5]}>${Math.Calc[${Target.Heading.Degrees}-360]}) /goto :MoreClock 
   /keypress strafe_left 
   /face fast 
/return 

Sub CheckAggressive(string AggroText) 
   /if (${Window[InventoryWindow].Open}) /return 
   /call CheckPuller 
   /if (!${Aggressive}) /return 
   /if (!${AggroText.Find[say]} && !${AggroText.Find[group]} && !${AggroText.Find[out of character]} && !${AggroText.Find[shout]} && !${AggroText.Find[guild]} && ${Target.ID}) { 
      /if (${Target.Type.NotEqual[NPC]}) { 
         /target clear 
         /call Delay 2s 
      } 
      /if ( !${Me.Combat} && ${Target.Type.Equal[NPC]} && ${Aggressive}) { 
         /call ChatOut 5 ${MasterName} "I am being attacked by ${Target.CleanName}." 
         /call Delay 2 
         /varset Combatstatus 1 
         /attack on 
      } 
   } 
/return 

Sub CheckPuller 
   /declare AggTemp bool local 
   /if (!${IsPuller}) /return 
   /if (${Math.Distance[${AnchorX},${AnchorY}]}<=${AnchorRadius}) /return 
   /declare mobface local 
   /varset mobface ${Math.Calc[(${Me.Heading.Degrees}+180)]} 
   /varcalc mobface ${mobface}%360 
   /if (${Target.Heading.Degrees}<=${Math.Calc[${mobface}+10]} && ${Target.Heading.Degrees}>=${Math.Calc[${mobface}-10]}) { 
      /attack off 
      /varset Combatstatus 0 
      /varset AggTemp ${Aggressive} 
      /varset Aggressive 0 
      /call MoveToAnchor 
      /varset Aggressive ${AggTemp} 
    } 
/return 


Sub Event_Pierce 
   /call CheckPuller 
/return 

Sub Event_Slash 
   /call CheckPuller 
/return 

Sub Event_Bash 
   /call CheckPuller 
/return 

Sub Event_Hit 
   /call CheckPuller 
/return 

Sub Event_Enraged 
   /if (${Target.ID}) { 
      /if (${Combatstatus}) { 
         /varset EnrageVar 1 
         /attack off 
      } 
      /varset EnrageVar 1 
   } 
/return 

Sub Event_Offrage 
   /if (${Target.ID}) { 
      /if (${Combatstatus}) { 
         /varset EnrageVar 0 
         /attack 

      } 
      /varset EnrageVar 0 
   } 
/return 

Sub Event_FoundBoxTrap 
   /if (${Me.AbilityReady[Disarm Traps]}) { 
      /call ChatOut 5 ${MasterName} "Trying to disarm a ${Target.CleanName} trap." 
      /doability "Disarm Traps" 
      /return 
   } 
/return 

Sub Event_FoundFloorTrap 
   /if (${Me.AbilityReady[Disarm Traps]}) { 
      /call ChatOut 5 ${MasterName} "Trying to disarm a floor trap." 
      /doability "Disarm Traps" 
      /return 
   } 
/return 

Sub Event_DisarmTrap 
   /call Delay 2s 
   /call ChatOut 5 ${MasterName} "Trap disarmed." 
/return 

Sub Event_GettingHit 
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit}
   /call CheckAggressive "${Param0}" 
   /call ExecCommand EventAttacked
/return 

Sub Event_AttackedMiss 
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit}
   /call CheckAggressive "${Param0}" 
   /call ExecCommand EventAttacked
/return 

Sub Event_ArcheryTooFar 
/return 

|TrapFinder 
|Used to auto sence traps when DoTraps is set to 1 
|Usage /call TrapFinder 
Sub TrapFinder 
   /if (${DoTraps} && ${Me.AbilityReady[Sense Traps]}) /doability "Sense Traps" 
   /doevents 
/return 

||||||||||||||||Command Subs 
Sub Do-behind 
   /if (!${Target.ID}) { 
      /call Assist "${MasterName}" 
      } 
   :behind 
   /if (!${Target.ID}) /return 
   /doevents 
   /call RangeSub 
  | ----- Clockwise Rotate Check ----- 
   /if (!${Target.ID}) /return 
   /if (${Target.Heading.Degrees}>=180 && ${Math.Calc[${Target.Heading.Degrees}-180]}<=${Me.Heading.Degrees} && ${Me.Heading.Degrees}<${Math.Calc[${Target.Heading.Degrees}-22.5]}) /call bsclock 
   /if (!${Target.ID}) /return 
   /if (${Target.Heading.Degrees}>=180 && ${Me.Heading.Degrees}<=180 && ${Math.Calc[${Me.Heading.Degrees}-22.5]}>${Math.Calc[${Target.Heading.Degrees}-360]}) /call bscounter 
   /if (!${Target.ID}) /return 
   /if (${Target.Heading.Degrees}<=180 && ${Me.Heading.Degrees}<${Math.Calc[${Target.Heading.Degrees}-22.5]}) /call bsclock 
  | ----- Counter Clockwise Rotate Check ----- 
   /if (!${Target.ID}) /return 
   /if (${Me.Heading.Degrees}>=180 && ${Math.Calc[${Me.Heading.Degrees}-180]}<=${Target.Heading.Degrees} && ${Me.Heading.Degrees}>${Math.Calc[${Target.Heading.Degrees}+22.5]}) /call bscounter 
   /if (!${Target.ID}) /return 
   /if (${Me.Heading.Degrees}>=180 && ${Target.Heading.Degrees}<=180 && ${Math.Calc[${Me.Heading.Degrees}-157.5]}<${Math.Calc[${Target.Heading.Degrees}+180]}) /call bsclock 
   /if (!${Target.ID}) /return 
   /if (${Me.Heading.Degrees}<=180 && ${Target.Heading.Degrees}<=180 && ${Me.Heading.Degrees}>${Math.Calc[${Target.Heading.Degrees}+25]}) /call bscounter 
   /if (!${Target.ID}) /return 
   /if (${Math.Abs[${Math.Calc[${Target.Heading.Degrees}-${Me.Heading.Degrees}]}]}>30) /goto :behind 
/return 

Sub Do-getbehind 
   /varset ObstacleCheck 0 
   /varset GenLastXLoc ${Me.Y} 
   /varset GenLastYLoc ${Me.X} 
   /if (!${Target.ID}) { 
      /call Assist "${MasterName}"
   } 
   /if (${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.Degrees}]}*10]},${Math.Calc[${Target.X}+${Math.Sin[${Target.Heading.Degrees}]}*10]}]}<3) /goto :noneed 
   /if (!${Target.ID}) /return 
   /keypress FORWARD hold 
   :gobehindloop 
   /if (${Me.State.NotEqual[STAND]}) /stand 
   /if (!${Target.ID}) { 
      /keypress FORWARD 
      /return 
   } 
   /if (${ObstacleCheck}>=60) { 
      /if (${GenLastXLoc}==${Me.Y} && ${GenLastYLoc}==${Me.X}) { 
         /keypress FORWARD 
         /return 
      } 
      /varset GenLastXLoc ${Me.Y} 
      /varset GenLastYLoc ${Me.X} 
      /varset ObstacleCheck 0 
   } 
   /varcalc ObstacleCheck ${ObstacleCheck}+1  
   /doevents 
   /face nolook fast loc ${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.Degrees}]}*10]},${Math.Calc[${Target.X}+${Math.Sin[${Target.Heading.Degrees}]}*10]} 
   /if (${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.Degrees}]}*10]},${Math.Calc[${Target.X}+${Math.Sin[${Target.Heading.Degrees}]}*10]}]}>1) /goto :gobehindloop 
   /keypress FORWARD 
   /face fast 
:noneed 
/keypress FORWARD 
/return 


Sub Do-attack 
   /varset Supportstatus 1 
   /varset Combatstatus 1 
   /if (${Me.Sitting}) /stand 
   /call StandardTarget "${CommandParam}" 
   /if (${Me.Name.Equal[${Target.CleanName}]}) { 
      /varset Combatstatus 0 
      /return 
   } 
   /call ChatOut 5 ${MasterName} "Attacking ${Target.CleanName}." 
   /if (!${DoArchery}) /attack on 
/return 

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

Sub Do-disc 
   /if (!${Defined[Param0]}) /return 
     /disc ${Param0} 
/return 

Sub Do-shield 
   /if ( !${Defined[Param0]} || ${Param0.Equal[me]}) { 
      /shield ${MasterName} 
   } else { 
      /shield ${CommandParam} 
   } 
/return 

Sub Do-hide 
   /doability Hide 
   /call Delay 2s 
   /if (${Me.AbilityReady[Hide]}) { 
      /call ChatOut 5 ${MasterName} "I'm not hiding" 
   } else { 
      /call ChatOut 5 ${MasterName} "I am hiding." 
   } 
/return 

Sub Do-sneak 
   /doability Sneak 
   /call Delay 2s 
   /if (${Me.AbilityReady[Sneak]}) { 
      /call ChatOut 5 ${MasterName} "I'm not sneaking atm" 
   } else { 
      /call ChatOut 5 ${MasterName} "I'm sneaking" 
   } 
/return 

Last edited by Vexix on Tue Jun 01, 2004 1:12 pm, edited 3 times in total.

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Post by Vexix » Sat May 22, 2004 2:53 am

botspell.inc

Code: Select all


|botspell.inc 
|Bot spell module. 
|Version 12.37 
|Date:06/02/2004 
| 
||** 
[botspell] 
version=12.37 
**|| 
| 

#event Collapse "Your gate is too unstable, and collapses." 
#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 CastInterrupt "Your casting has been 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 Recovered "Spell recovery time not yet met." 
#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!" 
#event Stunned "You *CANNOT* cast spells, you have been silenced!" 
#event MissedNote "You miss a note, bringing your song to a close!" 
#event ImmuneSlow "Your target is immune to changes in its attack speed."
#event ImmuneRoot "Your target is immune to changes in its run speed." 
#event NoOverWrite "Your spell would not have taken hold on your target." 

Sub Init-Spell 
   /declare cmds-SPELL string outer Spell: 
   |For each command 
   |/call AddCommand "Command Section" "Command Phrase" "Called Sub" 
   |Command Section - where the command will be listed in response to the cmd phrase 
   |Command Phrase to trigger bot - End User can change to suit prefferences 
   |Called Sub - Routine to execute in response to Command Phrase 
   /call AddCommand SPELL sn Do-sn 
   /call AddCommand SPELL mana Do-mana 
   /call AddCommand SPELL evac Do-evac 
   /call AddCommand SPELL loadlist Do-loadlist 
   /call AddCommand SPELL snt Do-snt 
   /call AddCommand SPELL setlompct Do-setlompct 
   /call AddCommand SPELL chainnuke Do-chainnuke 
   /call AddCommand SPELL chainstun Do-chainstun 
   /call AddCommand SPELL Buff Do-Buff 
   /call AddCommand SPELL SelfBuff AddSelfBuff 
   /call AddCommand SPELL spellgem Do-spellgem 
   |/declare Vars 
   /declare DefaultSpellSet string outer 
   /declare EvacSpell string outer 
   /declare DoAgain bool outer FALSE 
   /declare StartCast bool outer FALSE 
   /declare SpellSlot int outer 
   /declare CastTime int outer 
   /declare SitAfterCast bool outer FALSE 
   /declare LastSn string outer NA  
   /declare ReportLom bool outer FALSE 
   /declare LomMsg string outer 
   /declare DoCanni bool outer FALSE 
   /declare DoYaulp bool outer FALSE 
   /declare CanniSpell string outer 
   /declare YaulpSpell string outer 
   /declare ChainNuke string outer 
   /declare ChainStun string outer 
   /declare ChainStunNum int outer 
   /declare IsBard bool outer FALSE 
   /declare SpellFail bool outer FALSE 
   /declare DelayBeforeSit string outer 3s 
   /declare Remem bool outer FALSE 
   /declare BuffList[50,2] string outer 
   /declare BuffListTimes[50,2] int outer 0 
   /declare BuffListCount int outer 0 
   /declare SelfBuffList string outer 
   /declare SelfBuff[15] string outer 
   /declare SelfBuffInt[15,2] int outer 0 
   /declare SelfBuffCount int outer 0 
   /declare SelfBuffPass int outer 0 
   /declare SpellGem int outer 
   /declare CTimer timer outer 
   /declare OOMtimer timer outer 
   /declare LomTimer timer outer 
   /declare CannTimer timer outer 
   /declare CannAATimer timer outer 
   /declare YaulpTimer timer outer 
   /declare ChainStunTime timer outer 
   /declare BuffListAdvance timer outer 
   /declare SitTimer timer outer 
    
   /call LoadSetting DelayBeforeSit Spell DelayBeforeSit 3s 
   /call LoadSetting SpellGem Spell SpellGem 8 
   /call LoadSetting SitAfterCast Spell SitAfterCast 0 
   /call LoadSetting DefaultSpellSet Spell DefaultSpellSet Default 
   /call LoadSetting EvacSpell Spell EvacSpell NONE 
   /call LoadSetting ReportLom Spell ReportLom 0 
   /call LoadSetting LomMsg Spell LomMsg "Warning I'm running low on Mana." 
   /call LoadSetting CanniSpell Spell CanniSpell Canniblize 
   /call LoadSetting DoCanni Spell DoCanni 0 
   /call LoadSetting YaulpSpell Spell YaulpSpell yaulp 
   /call LoadSetting DoYaulp Spell DoYaulp 0 
   /call LoadSetting ChainStun Spell ChainStun "Your Chain Stun Spells sperated with |." 
   /call LoadSetting ChainNuke Spell ChainNuke "Your Chain Nuke Spells sperated with |." 
   /call LoadSetting SelfBuffList Spell SelfBuffList "Buffs you wish to maintain of yourself separated with |" 
   /varset IsBard ${Me.Class.Name.Equal[Bard]}
   /call LoadSetting Remem Spell Remem 0 
   /declare ArgNum int local 1 
   :SelfBuffLoad 
      /if (${SelfBuffList.Arg[${ArgNum},|].Length}) { 
         /varset CommandParam ${SelfBuffList.Arg[${ArgNum},|]} 
         /call AddSelfBuff "${CommandParam}" 
      } 
      /varcalc ArgNum ${ArgNum}+1 
   /if (${SelfBuffList.Arg[${ArgNum},|].Length}) /goto :SelfBuffLoad 
    
/return 

Sub SpellMain 
   /if (${DoCanni}) /call CheckCann 
   /if (${DoYaulp}) /call CheckYaulp 
   /if (${SelfBuffPass}>40) { 
      /call CheckSelfBuffs 
   } else { 
      /varcalc SelfBuffPass ${SelfBuffPass}+1 
   } 
/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(string SpellName) 
   /if ((${Me.Casting.ID} || ${CTimer}>0) && !${IsBard}) /return 1 
   /if (${SpellName.Equal[NA]}) /return 1 
   /varset SpellFail 0 
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit}
   /If (${Target.Distance}>${Spell[${SpellName}].Range} && ${Spell[${SpellName}].Range}>0) { 
      /varset SpellFail 1 
      /call ChatOut 7 ${MasterName} "Too far away. " 
      /varset CTimer 0 
      /return 1  
   } 
   /if (${Me.Sitting}) /stand 
   /varset Remem 0 
   /if (!${IsBard}) { 
      /if (${Me.Moving}) { 
            /keypress FORWARD 
            /keypress BACK 
            /delay 1s 
      } 
      :WaitForStop 
      /doevents 
      /if (${BreakOut}) /return 
      /if (${Me.Moving}) { 
            /echo moving 
            /delay 1s 
            /goto :WaitForStop 
      } 
   } 
   /if (${IsBard}) /stopsong 
   |Check if character Knows the Spell requested 
   /if (${Me.Book[${SpellName}]}<1) { 
      /call ChatOut 5 ${MasterName} "Don't know the spell ${SpellName} so failing to cast" 
      /goto :SpellFail 
   } 
   |Check if Spell is mem'd on a gem 
   /if (!${Me.Gem[${SpellName}]}) { 
      /call ChatOut 3 ${MasterName} "memorizing the spell ${SpellName}" 
      /memspell ${SpellGem} "${SpellName}" 
      :MemWait 
         /if (${BreakOut}) /return 
         /delay 1 
         /if (!${Me.Gem[${SpellName}]}) /goto :MemWait 
   } 
   /varset SpellSlot ${Me.Gem[${SpellName}]} 
   /doevents 
   /if (${SpellFail}) /goto :SpellFail 
   |Check if spell is ready to cast 
   /if (!${Me.SpellReady[${SpellSlot}]}) { 
      /echo waiting on refresh 
      :refreshwait 
         /if (${BreakOut}) /return 
         /delay 1 
         /if (!${Me.SpellReady[${SpellSlot}]}) /goto :refreshwait 
   } 
   /varset CastTime ${Spell[${SpellName}].MyCastTime.Int} 
   /if (!${IsBard}) /varcalc CastTime ${CastTime}+1 
   :BeginCast 
   /varset SpellFail 0 
   /varset DoAgain 0 
   /varset StartCast 0 
   /call WaitForStart 
   :TimerLoop 
   /doevents 
   /if ((${IsBard})&&(${Combatstatus})) /call RangeSub 
   /if (${DoAgain}) /goto :BeginCast 
   /if (${SpellFail}) /goto :SpellFail 
   /if (${CTimer}>0) /goto :TimerLoop 
   /if (${IsBard}) { 
      /call Delay 1 
   } else { 
      /call Delay 2 
   } 
   /doevents 
   /if (${DoAgain}) /goto :BeginCast 
   /if (${Remem}) { 
      /memspellset ${DefaultSpellSet} 
      :loadsploop1 
      /delay 1s (!${Window[SpellBookWnd].Open})
      /if (${Window[SpellBookWnd].Open}) /goto :loadsploop1 
   } 
   /return 0 
   :SpellFail 
   /varset SpellFail 0 
   /if (${Remem}) { 
      /memspellset ${DefaultSpellSet} 
      :loadsploop2
      /delay 1s (!${Window[SpellBookWnd].Open})
      /if (${Window[SpellBookWnd].Open}) /goto :loadsploop2  
   } 
   /if ((${Me.Standing})&&(${SitAfterCast})) /sit
   /varset CTimer 0
/return 1 

|WaitForStart 
|Used by SpellSub to determine when to start spell ObstacleCheck. 
Sub WaitForStart 
   /cast ${SpellSlot} 
   :StartLoop 
   /doevents 
   /if (${SpellFail}) /return 
   /if (${DoAgain}) /return 
   /if ( !${IsBard} && !${StartCast}) /goto :StartLoop 
   /varset CTimer ${Math.Calc[${CastTime}*10]} 
/return 

Sub Event_CastStart 
   /varset StartCast 1 
/return 

Sub Event_CastFizzle 
   /call Delay 2 
   /varset DoAgain 1 
/return 

Sub Event_MissedNote 
   /call Delay 2 
   /varset DoAgain 1 
/return 

Sub Event_CastInterrupt 
   /call Delay 2 
   /if (${SpellFail}) /return 
   /varset DoAgain 1 
/return 

Sub Event_Sitting 
   /stand 
   /call Delay 2 
   /varset DoAgain 1 
/return    

Sub Event_CastTooFar 
   /varset SpellFail 1 
   /call ChatOut 3 ${MasterName} "Too far away. " 
   /varset CTimer 0 
/return 

Sub Event_ImmuneSlow 
   /varset SpellFail 1 
   /call ChatOut 3 ${MasterName} "Cannot Slow this Target (Immune)!" 
   /varset CTimer 0 
/return 

Sub Event_ImmuneRoot 
   /varset SpellFail 1 
   /call ChatOut 3 ${MasterName} "Cannot Root or Snare this Target!" 
   /varset CTimer 0 
/return 

Sub Event_Distracted 
   /call ChatOut 5 ${MasterName} "I can't cast. I'm too distracted. " 
   /varset SpellFail 1 
   /varset CTimer 0 
/return 

Sub Event_NoTarget 
   /varset SpellFail 1 
   /call ChatOut 3 ${MasterName} "I don't know what target to cast on. " 
   /varset CTimer 0 
/return 

Sub Event_NoOverWrite 
   /varset SpellFail 1 
   /call ChatOut 3 ${MasterName} "The spell won't take hold on the target." 
   /varset CTimer 0 
/return 

Sub Event_NoMem 
   /call ChatOut 5 ${MasterName} "That spell is not memed. " 
   /varset SpellFail 1 
   /varset CTimer 0 
/return 

Sub Event_RootOff 
   /call ChatOut 5 ${MasterName} "Root has worn off. " 
/return 

Sub Event_CastNoMana 
   /if (${IsPally}) { 
      /varset SpellFail 1 
      /if (${OOMtimer}<=0) { 
         /call ChatOut 5 "${MasterName} I am OOM!" 
         /varset OOMtimer 100 
         /return 
      } 
   } 
   /if (${OOMtimer}<=0) /call ChatOut 5 ${MasterName} "OOM. Medding 13 seconds and trying again. " 
   /varset DoAgain 1 
   /if (${Me.Standing}) /sit 
   /varset OOMtimer 130 
   :medingwait 
   /delay 1 
   /doevents 
   /if (${OOMtimer}>0) /goto :medingwait 
   /sit off 
/return 

Sub Event_Stunned 
   /call ChatOut 5 ${MasterName} "Stunned waiting 3 seconds to try again. " 
   /delay 3s 
   /varset DoAgain 1 
/return 

Sub Event_Recovered 
   /call Delay 2s 
   /varset DoAgain 1 
/return 

Sub Event_CastResist 
   /call ChatOut 3 ${MasterName} "${Target.CleanName} Resisted." 
   /varset SpellFail 1 
/return 

Sub Event_Collapse 
   /varset DoAgain 1 
/return 

Sub Event_NoLOS 
   /call ChatOut 10 ${MasterName} "I can't see my target. " 
   /varset SpellFail 1 
   /varset CTimer 0 
/return 

Sub Event_CastFizzle 
   /call Delay 2 
   /varset DoAgain 1 
/return 

sub CheckSelfBuffs 
   /declare counter int local 
   /varset SelfBuffPass 0
  /if (${SelfBuffList.Equal[Buffs you wish to maintain of yourself separated with |]} || !${SelfBuffList.Length}) /return 
   /for counter 1 to ${SelfBuffCount} 
      /if (!${Me.Buff[${SelfBuff[${counter}]}].ID} && ${SelfBuffInt[${counter},1]}<1) { 
         /call Target myself 
         /call SpellSub "${SelfBuff[${counter}]}" 
         /if (${Macro.Return}==1 && ${SelfBuffInt[${counter},2]}<6) { 
            /varset SelfBuffInt[${counter},1] 5 
            /varset SelfBuffInt[${counter},2] ${SelfBuffInt[${counter},2]}+1 
         } 
         /if (${Macro.Return}==1 && ${SelfBuffInt[${counter},2]}>=6) { 
            /varset SelfBuffInt[${counter},1] 900 
            /varset SelfBuffInt[${counter},2] 0 
         } 
      } 
   /next counter 
/return 

Sub CheckMana 
   /if (${LomTimer}<=0) { 
      /if (${Me.PctMana}<${LomPct}) { 
         /call ChatOut 5 ${MasterName} "${LomMsg}" 
         /varset LomTimer 2m 
      } 
   } 
/return 

Sub CheckCann 
   /if (!${Me.Moving}) { 
      /if (${Me.PctMana}<80 && ${Me.PctHPs}>=60 && ${Me.CurrentHPs}>1900 && ${CannAATimer}<=0) { 
         /alt activate 47 
         /varset CannAATimer 3m 
      } 
      /if (${Me.PctMana}<95 && ${Me.PctHPs}>=40 && ${CannTimer}<=0) { 
         /call SpellSub "${CanniSpell}" 
         /varset CannTimer 4s 
      } 
   } 
/return 

Sub CheckYaulp 
   /if (!${Me.Moving} && ${Me.PctMana}<95 && ${YaulpTimer}<=1) { 
      /call SpellSub "${YaulpSpell}" 
      /varset YaulpTimer 25s 
   } 
/return 

Sub NextStun 
   /if (${BreakOut}) /return 
   /if (!${Target.ID}) /return 
   :JumpStunSpell 
      /if (${Me.Gem[${ChainStun.Arg[${ChainStunNum},|]}]}) { 
         /cast "${ChainStun.Arg[${ChainStunNum},|]}" 
         /varset ChainStunTime 50 
      } else { 
         /varcalc ChainStunNum ${ChainStunNum}+1 
         /goto :JumpStunSpell 
      } 
   /varcalc ChainStunNum ${ChainStunNum}+1 
   /if (!${ChainStun.Arg[${ChainStunNum},|].Length}) /varset ChainStunNum 1 
/return 

|||||||||||||||Bot command subs 
Sub AddSelfBuff 
   /if (!${Defined[Param0]}) /return 
   /if (${Param0.Equal[off]}) { 
      /varset SelfBuffCount 0 
      /return 
   } 
   /varcalc SelfBuffCount ${SelfBuffCount}+1 
   /varset SelfBuff[${SelfBuffCount}] ${CommandParam} 
/return 

Sub Do-sn(string newSpell) 
   /call Assist "${MasterName}"
   /if ( !${Defined[newSpell]} && ${LastSn.Equal[NA]}) /return  
   /if (!${Defined[newSpell]}) /varset CommandParam "${LastSn}"  
   /call ChatOut 1 "${MasterName}" "Casting ${CommandParam}  on ${Target.CleanName}" 
   /if (${CommandParam.Arg[1].Lower.Equal[item]}) {
      /varset ${CommandParam} ${CommandParam.Right[-${CommandParam.Arg[1].Length}]}
      /cast item "${CommandParam}"
   } else {
      /call SpellSub "${CommandParam}" 
   }
   /varset LastSn ${CommandParam} 
/return 

Sub Do-mana 
   /if (!${Me.Class.CanCast}) /return 
   /declare RoundMana int local ${Math.Calc[${Math.Calc[${Me.PctMana}/5].Int}*5].Int} 
   /if (${RoundMana}==100) { 
     /call ChatOut 2 ${MasterName} "fm" 
   } else { 
     /call ChatOut 2 ${MasterName} "${RoundMana}m" 
   } 

/return 

Sub Do-loadlist(string Spellset) 
   /if (!${Defined[Spellset]}) /return 
   /memspellset ${Spellset} 
/return 

Sub Do-evac 
   /if (${EvacSpell.NotEqual[None]}) /call ChatOut 5 ${MasterName} "Moving to you and casting ${EvacSpell}!" 
   /call Do-moveto ${MasterName} 
   /call Delay 2s 
   /if (${EvacSpell.NotEqual[None]})  /call SpellSub "${EvacSpell}" 
/return 

Sub Do-itemcast 
   /if (!${Defined[Param0]}) /return 
   /if (${Me.Sitting}) { 
      /stand 
      /delay 3 
   } 
   /call Assist "${MasterName}" 
   /cast item "${CommandParam}" 
   /call ChatOut 3 ${MasterName} "Using ${CommandParam} on ${Target.CleanName}" 
/return 

Sub Do-snt 
   /if (!${Defined[Param0]}) /return 
   /if (${Param0.Equal[on]} && ${LastSn.NotEqual[NA]}) /return 
   /declare SpellNameParam string local ${Param0} 
   /declare TargetName string local 
   /declare ParamCount int local 1 
   /if (${Param0.Equal[on]}) { 
      /varset SpellNameParam ${LastSn} 
      /goto :Do-sntTargetStart 
   } 
    
   :Do-sntSpellLoop 
      /if (${Defined[Param${ParamCount}]}) { 
         /if (${Param${ParamCount}.Equal[on]}) /goto :Do-sntTargetStart 
         /varset SpellNameParam ${SpellNameParam} ${Param${ParamCount}} 
         /varcalc ParamCount ${ParamCount}+1 
         /goto :Do-sntSpellLoop 
      } 
   :Do-sntTargetStart 
   /varcalc ParamCount ${ParamCount}+1 
   /if (${Defined[Param${ParamCount}]}) {
      /varset TargetName ${Param${ParamCount}} 
      /varcalc ParamCount ${ParamCount}+1 
      :Do-sntTargetLoop 
         /if (${Defined[Param${ParamCount}]}) { 
            /varset TargetName ${TargetName} ${Param${ParamCount}} 
            /varcalc ParamCount ${ParamCount}+1  
            /goto :Do-sntTargetLoop 
         } 
      /echo Target SHOULD be ${TargetName} 
      /call StandardTarget "${TargetName}" 
      /if (!${Target.ID}) { 
         /call ChatOut 5 ${MasterName} "I failed to get a target." 
         /return 
      } 
   }
   /if (${SpellNameParam.Arg[1].Lower.Equal[item]}) {
      /varset SpellNameParam ${SpellNameParam.Right[-${SpellNameParam.Arg[1].Length}]}
      /cast item "${SpellNameParam}"
   } else {
      /call SpellSub "${SpellNameParam}" 
   }
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit} 
   /varset LastSn ${CommandParam} 
/return 

Sub Do-setlompct 
   /if (!${Defined[Param0]}) /return 
   /varset LomPct ${Param0} 
   /call ChatOut 3 ${MasterName} "I'll let you know if I get below ${LomPct} percent mana" 
/return 

Sub Do-ChainNuke 
   /declare NukeNum int local 1 
   /call StandardTarget "${CommandParam}" 
   :ChainNukeLoop 
      /if (${BreakOut}) /return 
      /if (!${Target.ID}) /return 
      /if (${Me.Gem[${ChainNuke.Arg[${NukeNum},|]}]}) /cast "${ChainNuke.Arg[${NukeNum},|]}" 
      /varcalc NukeNum ${NukeNum}+1 
      /if (!${ChainNuke.Arg[${NukeNum},|].Length}) /varset NukeNum 1 
   /goto :ChainNukeLoop 
/return 

Sub Do-ChainStun 
   /call StandardTarget "${CommandParam}" 
   /if (!${Target.ID}) /return 
   /varset ChainStunNum 1 
   /call NextStun 
/return 

Sub Do-Buff 
   /if (!${Defined[Param0]}) /return 
   /if (${Param0.Equal[on]}) /return 
   /if (${Param0.Equal[off]}) { 
      /varset BuffListCount 0 
      /return 
   } 
   /declare SpellNameParam string local ${Param0} 
   /declare TargetName string local 
   /declare ParamCount int local 1 
   /if (${Param0.Equal[on]}) { 
      /varset SpellNameParam ${LastSn} 
      /goto :Do-BuffTargetStart 
   } 
   :Do-BuffSpellLoop 
      /if (${Defined[Param${ParamCount}]}) { 
         /if (${Param${ParamCount}.Equal[on]}) /goto :Do-BuffTargetStart 
         /varset SpellNameParam ${SpellNameParam} ${Param${ParamCount}} 
         /varcalc ParamCount ${ParamCount}+1 
         /goto :Do-BuffSpellLoop 
      } 
   :Do-BuffTargetStart 
   /varcalc ParamCount ${ParamCount}+1 
   /if (!${Defined[Param${ParamCount}]}) {
      /varset TargetName me
   } else {
      /varset TargetName ${Param${ParamCount}} 
      /varcalc ParamCount ${ParamCount}+1 
      :Do-BuffTargetLoop 
         /if (${Defined[Param${ParamCount}]}) { 
            /varset TargetName ${TargetName} ${Param${ParamCount}} 
            /varcalc ParamCount ${ParamCount}+1  
            /goto :Do-BuffTargetLoop 
         } 
      /if (${TargetName.Equal[yourself]} || ${TargetName.Equal[${Me.CleanName}]}) { 
         /varset CommandParam ${SpellNameParam} 
         /call AddSelfBuff ${CommandParam} 
         /return 
      } 
   }
   /call StandardTarget "${TargetName}" 
   /if (!${Target.ID}) { 
      /call ChatOut 5 ${MasterName} "I failed to get a target." 
      /return 
   } 
   /call SpellSub "${SpellNameParam}" 
   /if (${Macro.Return}==0) { 
      /declare NewBuff local 
      /varset NewBuff ${BuffListCount} 
      /varcalc NewBuff ${NewBuff}+1 
      /varset BuffList[${NewBuff},1] ${Target.CleanName} 
      /varset BuffList[${NewBuff},2] ${SpellNameParam} 
      /varset BuffListTimes[${NewBuff},1] ${Spell[${SpellNameParam}].Duration.TotalSeconds} 
      /varset BuffListCount ${NewBuff} 
      /varset BuffListAdvance 50 
   } 
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit}    
/return 

Sub Do-SpellGem 
   /if (!${Defined[Param0]}) { 
      /call ChatOut 3 ${MasterName} "I Gem ${SpellGem} when I need to mem new spells." 
      /return 
   } 
   /varset SpellGem ${Param0} 
   /call ChatOut 3 ${MasterName} "I will now use Gem ${SpellGem} when I need to mem new spells." 
/return 

Last edited by Vexix on Tue Jun 01, 2004 1:03 pm, edited 4 times in total.

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Post by Vexix » Sat May 22, 2004 2:54 am

bothealer.inc

Code: Select all

|bothealer.inc 
|Bot healer module. 
|Version 12.34 
|Date:05/22/2004 
| 
||** 
[bothealer] 
version=12.34 
**|| 
| 
Sub Init-Healer 
   /declare cmds-HEALER string outer Healer: 
   |For each command 
   |/call AddCommand "Command Section" "Command Phrase" "Called Sub" 
   |Command Section - where the command will be listed in response to the cmd phrase 
   |Command Phrase to trigger bot - End User can change to suit prefferences 
   |Called Sub - Routine to execute in response to Command Phrase 
   /call AddCommand HEALER settankheal Do-settankheal 
   /call AddCommand HEALER setcasterheal Do-setcasterheal 
   /call AddCommand HEALER setdefaultheal Do-setdefaultheal 
   /call AddCommand HEALER heal Do-heal 
   /call AddCommand HEALER setpetheal Do-setpetheal 
   /call AddCommand HEALER watchtarget Do-watchtarget 
   /call AddCommand HEALER resetwatch Do-resetwatch 
   /call AddCommand HEALER setpatchheal Do-setpatchheal 
   /call AddCommand HEALER setcasterhealpct Do-setcasterhealpct 
   /call AddCommand HEALER settankhealpct Do-settankhealpct 
   /call AddCommand HEALER setpethealpct Do-setpethealpct 
   |declare Vars 
   /declare HealPetMsg string outer 
   /declare PetPctHeal int outer 81 
   /declare HealPets bool outer FALSE 
   /declare PetSpell string outer 
   /declare CasterPctHeal int outer 81  
   /declare TankPctHeal int outer 51 
   /declare PalGrpPct int outer 81 
   /declare PalHealPct int outer 81 
   /declare PalHealGrpMsg string outer 
   /declare PalHealMsg string outer 
   /declare HealCasterMsg string outer 
   /declare HealTankMsg string outer 
   /declare ReportAutoHeal bool outer TRUE 
   /declare PallyHealSpell string outer 
   /declare PallyGroupSpell string outer 
   /declare DefaultHealSpell string outer 
   /declare TankSpell string outer 
   /declare CasterSpell string outer 
   /declare IsHealer bool outer FALSE 
   /declare IsPally bool outer FALSE 
   /declare TankList string outer 
   /declare CasterList string outer 
   /declare LowHealthCheck int outer 0 
   /declare CastMsgTimer1 timer outer 
   /declare CastMsgTimer2 timer outer 
   /declare WatchTargets[15] string outer 
   /declare WatchTargetIDs[15] int outer 0 
   /declare WatchTargetCount int outer 0 
   /declare WatchWaitCount int outer 0 
   /declare HealTargets[21] int outer 0 
   /declare PatchHealer bool outer TRUE 
   /declare PatchSpell string outer 
   /declare PatchHealMsg string outer 
    
   /call LoadSetting IsHealer Healer IsHealer 0 
   /call LoadSetting IsPally Healer IsPally 0 
   /call LoadSetting ReportAutoHeal Healer ReportAutoHeal 1 
   /call LoadSetting HealPets Healer HealPets 0 
   /call LoadSetting PatchHealer Healer PatchHealer 1 
   /call LoadSetting TankSpell Healer TankSpell "Name of heal spell autoheal uses on Tanks" 
   /call LoadSetting CasterSpell Healer CasterSpell "Name of heal spell autoheal uses on Non Tanks" 
   /call LoadSetting DefaultHealSpell Healer DefaultHealSpell "Name of Default Heal Spell" 
   /call LoadSetting PetSpell Healer PetSpell "Name of Pet Heal Spell" 
   /call LoadSetting PatchSpell Healer PatchSpell "Name of Patch Heal Spell" 
   /call LoadSetting HealCasterMsg Healer HealCasterMsg "Healing %t" 
   /call LoadSetting HealTankMsg Healer HealTankMsg "Big Heal on %t" 
   /call LoadSetting HealPetMsg Healer HealPetMsg "Healing %t" 
   /call LoadSetting PatchHealMsg Healer PatchHealMsg "Patch Healing %t" 
   /call LoadSetting PallyHealSpell Healer PallyHealSpell "Name of Pally Heal Spell" 
   /call LoadSetting PalHealMsg Healer PalHealMsg "Healing %t"    
   /call LoadSetting PallyGroupSpell Healer PallyGroupSpell "Name of Pally Group Heal Spell" 
   /call LoadSetting CasterPctHeal Healer CasterPctHeal 70 
   /call LoadSetting TankPctHeal Healer TankPctHeal 51 
   /call LoadSetting PetPctHeal Healer PetPctHeal 51 
   /call LoadSetting PalGrpPct Healer PalGrpPct 81 
   /call LoadSetting PalHealPct Healer PalHealPct 81 
  
   /varset TankList ${Ini[${IniFile},Healer,TankList,NotFound]} 
   /varset CasterList ${Ini[${IniFile},Healer,CasterList,NotFound]} 
   /if (${TankList.Equal[NotFound]} && ${CasterList.Equal[NotFound]}) { 
      /ini ${IniFile} Healer TankList "Warrior|Shadow Knight|Paladin|Monk|Beastlord|Ranger|Shaman|Berserker" 
      /ini ${IniFile} Healer CasterList "Necromancer|Wizard|Enchanter|Magician|Rogue|Druid|Cleric|Bard" 
      /varset TankList Warrior|Shadow Knight|Paladin|Monk|Beastlord|Ranger|Shaman|Berserker 
      /varset CasterList Necromancer|Wizard|Enchanter|Magician|Rogue|Druid|Cleric|Bard 
   } 
/return 

Sub HealerMain 
   /call CheckGrpHealth 
   /call PalGrpHealChk 
   /call PalHealChk 
/return 

Sub CheckGrpHealth 
   /declare HealCount int local 0 
   /declare BadIDs int local 0 
   /declare SaveCombatStat int local 0 
   /declare SaveCombatID int local 0 
   /declare QuickID int local 0 
   /declare tempvar int local 0 
   /varset BreakOut 0 
   /if (!${IsHealer}) /return 
   /if (${IsPally}) /return 
   /if (${Combatstatus}) { 
      /varset SaveCombatStat 1 
      /varset SaveCombatID ${Target.ID} 
   } 
   /varset HealCount ${Group} 
   /for tempvar 1 to ${Group} 
      /varset HealTargets[${tempvar}] ${Group[${tempvar}].ID} 
   /next tempvar 
   /varcalc HealCount ${HealCount}+1 
   /varset HealTargets[${HealCount}] ${Me.ID} 
   /if (${WatchWaitCount}>10 && ${WatchTargetCount}>0) { 
      /for tempvar 1 to ${WatchTargetCount} 
         /varcalc HealCount ${HealCount}+1 
         /varset HealTargets[${HealCount}] ${WatchTargetIDs[${tempvar}]} 
      /next tempvar 
      /varset WatchWaitCount 0 
   }  
   /varcalc WatchWaitCount ${WatchWaitCount}+1 
   /for tempvar 1 to ${HealCount} 
      /if (${tempvar}>${Group} && ${Target.ID}!=${HealTargets[${tempvar}]} && ${HealTargets[${tempvar}]}!=${Me.ID}) { 
         /if (${Combatstatus}==1) /attack off 
         /target id ${HealTargets[${tempvar}]} 
         /delay 5 
         /if (${Target.ID}!=${HealTargets[${tempvar}]}) { 
            /varcalc BadIDs ${BadIDs}+1 
         } 
      } 
      /doevents 
      /varset QuickID ${HealTargets[${tempvar}]} 
      /if (${Spawn[${QuickID}].PctHPs}<${TankPctHeal} && ${Spawn[${QuickID}].State.NotEqual[DEAD]}) { 
         /if (${TankList.Find[${Spawn[${QuickID}].Class}]}) { 
            /if (${Spawn[${QuickID}].PctHPs}<${Math.Calc[${TankPctHeal}/2]} && ${PatchHealer}) /call PatchHeal ${QuickID} 
            /if (${Me.Combat}) /attack off 
            /call CastHeal ${QuickID} "${TankSpell}" "${HealTankMsg}" 
         } 
      } 
      /if (${BreakOut}) /return 
      /if ((${Spawn[${QuickID}].PctHPs}<${CasterPctHeal})&&(${Spawn[${QuickID}].State.NotEqual[DEAD]})) { 
         /if (${CasterList.Find[${Spawn[${QuickID}].Class}]}) { 
            /if ((${Spawn[${QuickID}].PctHPs}<${Math.Calc[${CasterPctHeal}/2]})&&(${PatchHealer})) /call PatchHeal ${QuickID} 
            /if (${Me.Combat}) /attack off 
            /call CastHeal ${QuickID} "${CasterSpell}" "${HealCasterMsg}" 
         } 
      }  
      /if (${BreakOut}) /return 
      /if (${HealPets} && ${Spawn[${QuickID}].Class.PetClass} && ${Spawn[${QuickID}].Pet.ID}) { 
         /if (${Spawn[${QuickID}].Pet.PctHPs}<${PetPctHeal}) { 
            /if (${Me.Combat}) /attack off 
            /call CastHeal ${Spawn[${QuickID}].Pet.ID} "${PetSpell}" "${HealPetMsg}" 
         } 
      } 
      /doevents 
   /next tempvar 
   /if (${SaveCombatStat}) { 
      /if (${Target.ID}!=${SaveCombatID}) /target ID ${SaveCombatID} 
      /if (${Target.ID} && ${Target.Type.Equal[NPC]}) { 
         /if (${Me.Sitting}) /stand 
         /attack on 
         /varset Combatstatus 1 
      } 
   } 
   /if (${BadIDs}>0) /call ResetWatchTargets 
/return 

Sub CastHeal(int TarID,string HealSpell,string castMsg) 
   /if (${Me.Moving}) /return 
   /declare BadTarget local 
   /varset BadTarget 0 
   :CastHealTarget 
      /if (${TarID}==${Me.ID}) { 
         /target myself 
      } else { 
         /if (${Target.ID}!=${TarID}) /target id ${TarID} 
      } 
      /call Delay 1 
      /if (${Target.ID}!=${TarID} && ${BadTarget}<10) { 
         /varcalc BadTarget ${BadTarget}+1 
         /goto :CastHealTarget 
      } 
   /if (${Target.ID}!=${TarID}) /return 
   /if (${Me.Sitting}) /stand 
   /if (${CastMsgTimer1}<=0) { 
      /if (${ReportAutoHeal}) /g ${castMsg} 
      /varset CastMsgTimer1 50 
   } 
   /call SpellSub "${HealSpell}" 
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit}  
/return 

Sub Patchheal(int TarID) 
   /if (${Me.Moving}) /return 
   /if (${TarID}==${Me.ID})  /target myself 
   /if (${TarID}!=${Me.ID} && ${Target.ID}!=${TarID}) /target id ${TarID} 
   /call Delay 1 
   /if (${Me.Sitting}) /stand 
   /if (${CastMsgTimer1}<=0) { 
      /if (${ReportAutoHeal}) /g ${PatchHealMsg} 
      /varset CastMsgTimer1 50 
   } 
   /if (${Me.Gem[${PatchSpell}]}) /cast "${PatchSpell}" 
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit} 
/return 

Sub PalGroupheal 
   /if (${Me.Sitting}) /stand 
   /if (${ReportAutoHeal}) /g ${PalHealGrpMsg} 
   /call SpellSub "${PallyGroupSpell}" 
/return 

Sub PallyHeal(int TarID) 
   /if (${Combatstatus}) /return 
   /if (${TarID}==${Me.ID}) /target myself 
   /if (${TarID}!=${Me.ID}) /target id ${TarID} 
   /if (${Me.Sitting}) /stand 
   /if (!${Combatstatus}) /g ${PalHealMsg} 
   /call SpellSub "${PallyHealSpell}" 
/return 

Sub PalGrpHealChk 
   /declare tempvar int local 1 
   /if (!${IsPally}) /return 
   /if (!${IsHealer}) /return 
   /if (${Me.PctHPs}>${PalHealPct}) { 
      /varset LowHealthCheck 0 
   } else { 
      /varset LowHealthCheck 1 
   } 
   /for tempvar 1 to ${Group} 
      /doevents 
      /if ((${Group[${tempvar}].PctHPs}<${PalHealPct})&&(${Group[${tempvar}].State.NotEqual[DEAD]})) /varcalc LowHealthCheck ${LowHealthCheck}+1 
      /if (${LowHealthCheck}>=3) { 
         /call PalGroupheal 
         /return 
      } 
   /next tempvar 
/return 

Sub PalHealChk 
    /declare tempvar int local 0 
   /if (!${IsPally}) /return 
   /if (!${IsHealer}) /return  
   /for tempvar 0 to ${Group} 
      /doevents 
      /if ((${Group[${tempvar}].PctHPs}<${PalHealPct})&&(${Group[${tempvar}].State.NotEqual[DEAD]})) /call PallyHeal ${Group[${tempvar}].ID} 
   /next tempvar 
/return 

Sub ResetWatchTargets 
   /declare counter int local 
   /for counter 1 to ${WatchTargetCount} 
      /target PC ${WatchTargets[${counter}]} 
      /call Delay 25 
      /if (${Target.CleanName.Equal[${WatchTargets[${counter}]}]}) { 
            /varset WatchTargetIDs[${counter}] ${Target.ID} 
      } else { 
            /call ChatOut 5 ${MasterName} "I failed to find ${WatchTargets[${counter}]} in the zone." 
      } 
   /next counter 
/return 

||||||||||||||||||Do- Subs 
Sub Do-setpetheal 
   /if (!${Defined[Param0]}) { 
      /call ChatOut 3 ${MasterName} "My pet heal is ${PetSpell}." 
      /return 
   }  
   /varset PetSpell ${CommandParam} 
   /call ChatOut 3 ${MasterName} "I'll use ${PetSpell} to heal pets." 
/return 

Sub Do-setpatchheal 
   /if (!${Defined[Param0]}) { 
      /call ChatOut 3 ${MasterName} "I use ${PatchSpell} for patch heals." 
      /return 
   } 
   /varset PatchSpell ${CommandParam} 
   /call ChatOut 3 ${MasterName} "I'll use ${PatchSpell} for patch heals now." 
/return 

Sub Do-settankheal 
   /if (!${Defined[Param0]}) { 
      /call ChatOut 3 ${MasterName} "My tank heal is ${TankSpell}" 
      /return 
   } 
   /varset TankSpell ${CommandParam} 
   /call ChatOut 3 ${MasterName} "I'll use ${TankSpell} to heal tanks." 
/return 

Sub Do-setdefaultheal 
   /if (!${Defined[Param0]}) { 
      /call ChatOut 3 ${MasterName} "I usualy heal with ${DefaultHealSpell}." 
      /return 
   } 
   /varset DefaultHealSpell ${CommandParam} 
   /call ChatOut 3 ${MasterName} "I'll start using ${DefaultHealSpell}." 
/return 

Sub Do-setcasterheal 
   /if (!${Defined[Param0]}) { 
      /call ChatOut 3 ${MasterName} "I heal non tanks with ${CasterSpell}." 
      /return 
   } 
   /varset CasterSpell ${CommandParam} 
   /call ChatOut 3 ${MasterName} "I'll start using ${CasterSpell} on non tanks." 
/return 

Sub Do-heal 
   /call StandardTarget "${CommandParam}" 
   /if (!${Target.ID}) { 
      /target pc ${MasterName} 
   } else { 
      /if (${Target.Type.Equal[NPC]}) /target pc ${MasterName}         
   } 
   /call ChatOut 3 ${MasterName} "Casting ${DefaultHealSpell} on ${Target.CleanName}." 
   /call SpellSub "${DefaultHealSpell}" 
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit} 
/return 

Sub Do-watchtarget 
   /if (${String[${Param0}].Equal[off]}) { 
      /varset WatchTargetCount 0 
      /return 
   } 
   /target clear 
   /call delay 5 
   /call StandardTarget "${CommandParam}" 
   /call Delay 25 
   /if (${Target.ID}) { 
      /varcalc WatchTargetCount ${WatchTargetCount}+1 
      /varset WatchTargets[${WatchTargetCount}] ${Target.CleanName} 
      /varset WatchTargetIDs[${WatchTargetCount}] ${Target.ID} 
      /call ChatOut 3 ${MasterName} "Now watching the health of ${Target.CleanName}." 
   } else { 
      /call ChatOut 3 ${MasterName} "Who did you want me to watch?" 
   } 
/return 

Sub Do-resetwatch 
   /call ResetWatchTargets 
/return 

Sub Do-setcasterhealpct 
   /if (!${Defined[Param0]}) { 
      /call ChatOut 3 ${MasterName} "I heal non tanks at ${CasterPctHeal} %." 
      /return 
   } 
   /varset CasterPctHeal ${Param0} 
   /call ChatOut 3 ${MasterName} "I heal non tanks at ${CasterPctHeal} %." 
/return 

Sub Do-settankhealpct 
   /if (!${Defined[Param0]}) { 
      /call ChatOut 3 ${MasterName} "I heal tanks at ${TankPctHeal} %." 
      /return 
   } 
   /varset TankPctHeal ${Param0} 
   /call ChatOut 3 ${MasterName} "I heal tanks at ${TankPctHeal} %." 
/return 

Sub Do-setpethealpct 
   /if (!${Defined[Param0]}) { 
      /call ChatOut 3 ${MasterName} "I heal pets at ${PetPctHeal} %." 
      /return 
   } 
   /varset PetPctHeal ${Param0} 
   /call ChatOut 3 ${MasterName} "I heal pets at ${PetPctHeal} %." 
/return 

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Post by Vexix » Sat May 22, 2004 3:07 am

botshortcut.inc

Code: Select all


|botshortcut.inc 
|Module for linking Custom Commands to Character spells and items 
|Includes Variable Toggling function as well 
|Version 12.35 
|Date:05/29/2004
| 
||** 
[shortcuts] 
version=12.35 
**|| 

Sub Init-Toggles 
   /declare cmds-TOGGLES string outer Toggles: 
   |For each Variable that has a TRUE/FALSE State 
   |Each Command can be toggled by 1/0, TRUE/FALSE, On/Off, Yes/No 
   |/call AddToggle Command PhraseOff PhraseOn Variable Type 
   |Command to force Toggle - End User change change to suit prefferences 
   |PhraseOff returned by the bot when value is FALSE 
   |PhraseOn returned by the bot when value is TRUE 
   |Variable to be changed by the command 
   | Type TRUE Command will return Variable State when no Param Present 
   | Type FALSE Command Will Toggle Variable State when no Param Present 
   /call AddToggle aona "I will Not Attack when Assisting." "I will Attack when Assisting." AttackOnAssist TRUE 
   /call AddToggle bona "I won't move behind on assist." "I will move behind on assist." BehindOnAssist TRUE 
   /call AddToggle petona "I won't send pet in on assist." "I will send pet in on assist." PetOnAssist TRUE 
   /call AddToggle ListenChat "I will ignore Chat" "I will listen in Chat." ListenChat TRUE 
   /call AddToggle listengroup "I will ignore Group Chat." "I will listen in Group Chat." ListenGroup TRUE 
   /call AddToggle kick "Auto Kick is now off." "Auto Kick is now on." DoKick FALSE 
   /call AddToggle flyingkick "Auto FlyingKick is now off." "Auto FlyingKick is now on." DoFlyingKick FALSE 
   /call AddToggle disarm "Auto Disarm is now off." "Auto Disarm is now on." DoDisarm FALSE 
   /call AddToggle traps "I will not detect for traps." "I will detect for traps." DoTraps FALSE 
   /call AddToggle taunt "Auto Taunt is now off." "Auto Taunt is now on." DoTaunt FALSE 
   /call AddToggle backstab "Auto Backstab is now off." "Auto Backstab is now on." DoBackstab FALSE 
   /call AddToggle frenzy "Auto Frenzy is now off." "Auto Frenzy is now on." DoFrenzy FALSE 
   /call AddToggle evade "Auto Evade is now off." "Auto Evade is now on." DoEvade FALSE 
   /call AddToggle slam "Auto Slam is now off." "Auto Slam is now on." DoSlam FALSE 
   /call AddToggle bash "Auto Bash is now off." "Auto Bash is now on." DoBash FALSE 
   /call AddToggle beagg "Aggressive is set to off. " "Aggressive is set to on." Aggressive TRUE 
   /call AddToggle puller "I'm not the puller." "I'm the puller." IsPuller TRUE 
   /call AddToggle autoengage "I will not engage when attack is on." "I will engage when attack is on." AutoEngage TRUE 
   /call AddToggle archery "Archery is set to off." "Archery is set to on." DoArchery TRUE 
   /call AddToggle aftercastsit "I will no longer sit after casting." "I will now sit after casting." SitAfterCast FALSE 
   /call AddToggle autoheal "Let me know when people need heals." "I'll watch for heals." IsHealer TRUE 
   /call AddToggle autohealpets "I will not heal the pets." "I will heal the pets." HealPets TRUE 
   /call AddToggle patchheal "I'm not a patch Healer." "I'm a patch Healer." PatchHealer TRUE 
   /call AddToggle reportlom "I won't tell you when I'm low on Mana." "I'll let you know when I'm low on Mana." reportlom FALSE 
   /call AddToggle autobehind "I won't position myself behind the mob." "I will position myself behind the mob." AutoBehind FALSE 
   /call AddToggle incite "I won't use the incite discipline when in combat." "I will use the incite discipline when in combat." DoIncite FALSE 
   /call AddToggle yaulp "I won't Yaulp for mana." "I will Yaulp for mana." DoYaulp TRUE 
   /call AddToggle canni "I won't eat myself for mana." "I will eat myself for mana." DoCanni TRUE 
   /call AddToggle Checkname "I will respond to all commands." "I will only respond to commands that are addressed to me." CheckName TRUE 
   /call AddToggle Remem "I won't remem my spellset after casting." "I will remem my spellset after casting." Remem TRUE 

   /call AddCommand CORE shortcuts Do-shortcutsinfo 

/return 

Sub AddToggle(string commandText,string OffText,string OnText,string VarName,bool ToggleType) 
   /varcalc TopToggle ${TopToggle}+1 
   /varset Toggles[1,${TopToggle}] ${commandText} 
   /varset Toggles[2,${TopToggle}] ${OffText} 
   /varset Toggles[3,${TopToggle}] ${OnText} 
   /varset Toggles[4,${TopToggle}] ${VarName} 
   /varset Toggles[5,${TopToggle}] ${ToggleType} 
   /varset cmds-TOGGLES ${cmds-TOGGLES} ${commandText} 
/return 

Sub Init-Shortcuts 
   /declare cmds-SHORTCUTS string outer Shortcuts: 
   /declare Shortcutlist string local 
   /declare ArgNum int local 0 
   /declare Short string local 0 
   /declare ParamS string outer 

    
   /varset ArgNum 1 
   /varset Shortcutlist ${Ini[${IniFile},Shortcuts,-1,Undefined]} 
   /if (!${Shortcutlist.Find[Undefined]}) { 
      :shortcuts 
      /if (${Shortcutlist.Arg[${ArgNum},|].Length}) { 
         /varset Short ${Shortcutlist.Arg[${ArgNum},|].Lower} 
         |add Command 
         /varset cmds-SHORTCUTS ${cmds-SHORTCUTS} ${Short} 
         /if (!${Defined[ShortCuts-${Short}-Text]}) /declare ShortCuts-${Short}-Text string outer 
         /varset ShortCuts-${Short}-Text ${Ini[${IniFile},Shortcuts,${Short},NA]} 
         /varcalc ArgNum ${ArgNum}+1 
         /goto :shortcuts 
      } 
   } else { 
      /ini ${IniFile} Shortcuts default "/echo Put yer shortcuts in your .ini file!" 
   } 
/return 

Sub SetToggle(int ToggleNum,string newValue) 
   /if (!${Defined[newValue]} && ${Toggles[5,${ToggleNum}]}) { 
      /if (${${Toggles[4,${ToggleNum}]}}) { 
         /call ChatOut 9 ${MasterName} "${Toggles[3,${ToggleNum}]}" 
      } else { 
         /Call ChatOut 9 ${MasterName} "${Toggles[2,${ToggleNum}]}" 
      } 
      /return 
   } 
   /if ( !${Defined[newValue]} && !${Toggles[5,${ToggleNum}]}) { 
      /declare newValue Local 
      /if (${${Toggles[4,${ToggleNum}]}}) { 
         /varset newValue 0 
      } else { 
         /varset newValue 1 
      } 
   } 
   /if (${newValue.Equal[True]} || ${newValue.Equal[On]} || ${newValue.Equal[1]} || ${newValue.Equal[yes]}) { 
      /varset ${Toggles[4,${ToggleNum}]} 1 
   } else { 
      /varset ${Toggles[4,${ToggleNum}]} 0 
   } 
    
   /if (${${Toggles[4,${ToggleNum}]}}) { 
      /call ChatOut 9 ${MasterName} "${Toggles[3,${ToggleNum}]}" 
   } else { 
      /Call ChatOut 9 ${MasterName} "${Toggles[2,${ToggleNum}]}" 
   } 
/return 

Sub ShortCut(string ShortCutCommand) 
   /declare Name string local 
   /declare ParseText string local 
   /declare si int local

   /varset Name ${ShortCutCommand.Arg[1].Lower} 
   /varset ParseText ${ShortCuts-${Name}-Text}
   /for si 1 to ${Math.Calc[${ParseText.Count[|]}+1]}
      /if (${ParseText.Arg[${si},|].Lower.Right[3].Equal[ on]} && ${ShortCutCommand.Arg[2].Length}) {
         /call StandardTarget ${ShortCutCommand.Right[-${Name.Length}]}
         /call ExecCommand "${ParseText.Arg[${si},|].Left[-3]}"
      } else {
         /call ExecCommand "${ParseText.Arg[${si},|]}"
      }
   /next si       
/return 

Sub Do-shortcutsinfo 
   /if (${Defined[Param0]}) { 
      /if (${String[ ${cmds-SHORTCUTS.Lower} ].Find[ ${Param0.Lower} ]}) { 
         /call ChatOut 3 ${MasterName} "Shortcut ${Param0} does: ${ShortCuts-${Param0}-Text}" 
      } else { 
         /call ChatOut 3 ${MasterName} "I don't know the shortcut ${Param0}." 
      } 
   } else { 
      /call ChatOut 3 ${MasterName} "${cmds-SHORTCUTS}" 
      /call ChatOut 3 ${MasterName} "Type: shortcuts name_of_shortcut for more information on any particular shortcut. 
   } 
/return 

Last edited by Vexix on Sat May 29, 2004 1:00 am, edited 1 time in total.

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Post by Vexix » Sat May 22, 2004 3:10 am

personal.inc

Code: Select all

|personal.inc 
|Personal commands module example. 
|Version 12.30 
|Date:05/04/2004 9:00 pm 
| 
||** 
[personal] 
version=12.30 
**|| 
|Define your personal Events Here 
|#Event EExample "Explain it to me again" 


Sub Init-Personal 
   /declare cmds-PERSONAL string outer Personal: 
   |For each command 
   |/call AddCommand "Command Section" "Command Phrase" "Called Sub" 
   |Command Section - where the command will be listed in response to the cmd phrase 
   |Called Sub - Routine to execute in response to Command Phrase 
   |/call AddCommand PERSONAL command subroutine 
   |Command Phrase to trigger bot - End User can change to suit prefferences 
   |For each Variable that has a TRUE/FALSE State 
   |Each Command can be toggled by 1/0, TRUE/FALSE, On/Off, Yes/No 
   |/call AddToggle Command "PhraseOff" "PhraseOn" Variable Type 
   |Command to force Toggle - End User change change to suit prefferences 
   |PhraseOff returned by the bot when value is FALSE 
   |PhraseOn returned by the bot when value is TRUE 
   |Variable to be changed by the command 
   | Type TRUE Command will return Variable State when no Param Present 
   | Type FALSE Command Will Toggle Variable State when no Param Present 
   |/call AddToggle PerToggle "I will not do it anymore" "I will do it now" MyToggle TRUE 
   |Declare you variables here and Set their Defaults 
   |/declare PersonalValue string outer 
   |/Declare AnotherValue int outer default 
   |INI Values 
   |/call LoadSetting PersonalVar Personal Personalkey Default 
/return 

|Things that you want to happen every loop through the macro go in this sub. 
Sub PersonalMain 
   |/Call MyExampleSub 
   |/if (${AnotherValue}) /call ConditionalExample 
/return 

|Add your own Event and and other subroutines here 

|Sub Event_EExample 
|   Some Event Code 
|/return 

|Sub MyExampleSub 
| Some Code activate every loop of the code 
|/return 

|Sub CommandFunction 
|   Some Code that will run every time CommandName is activated 
|/return 

|sub ConditionalExample 
|   Some Code that will run everytime "AnotherValue" is true 
|/return 

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Post by Vexix » Sat May 22, 2004 3:20 am

genbotdoc.txt

Code: Select all

|GenbotDoc.txt 
|Manual for the Generic bot macro 
|Version 12.38 
|Date:06/04/2004 
| 
||** 
[genbotDoc] 
version=12.38
**|| 
| 

Welcome to Genbot, probably the easiest way to multibox characters in Everquest. 

To start genbot type /macro genbot <mastername> with <mastername> being the name of the character that will be in control of the bot. 

By default your bot will respond to any command the master character /tells him. 
By changing the values of listengroup, listenchat (in genbot_botname.ini), or by sending the toggle commands listenGroup, listenChat 
you can start the Bot listening for commands sent either in group or in a chat channel. 
The bot will still only respond to characters on it's list of masters but will do it in these other channels. 

Additionally if you have the IRC plugin properly set up on your system the bot can listen in an IRC channel for commands. 

By default the Bot will respond to it's Master in Tells. By changing the INI value ChatIn or by sending the command ChatIn, 
the bot can respond in tells, group, channel or IRC. (IRC requires functional IRC Plugin) 

The first time you run Genbot on a character the macro will create a default INI file. (genbot_botname.ini) 
You probably want to start the macro and /endmacro it the first time so that you check/modify the INI settings. 

BOT COMMANDS FROM THE BOT WINDOW: 
   /gb - Send commands to yourself. EXAMPLE /gb sit 
    
MASTER TO BOT COMMANDS: 
   /tell bot command <parameter> <parameter> ... 
* IF checkname is false, you can use group and chat commands like this; 
   /1 command <parameter> <parameter> ... 
   /g command <parameter> <parameter> ... 
* IF checkname is true, then use group and chat commands like this; 
   /1 bot command <parameter> <parameter> ... 
   /g bot command <parameter> <parameter> ... 

MISC: 
   shortcuts <shortcutname> - Display what <shortcutname> does, default will list all your shortcuts. 
    
   lootup <Me|Yourself|TargetName|clear> Commands bot to loot.
         - <clear> bot loots masters target 
         - <CorpseName> bot loots CorpseName
   lootall - Commands bot to attempt to loot all corpses around it. 
    
   setvar - Sets a var to new setting 
   rptvar - Commands bot to reply with the current value of a variable 
    
   target <Me|Yourself|TargetName|clear> - Causes the bot to change it's target; 
         - <Me> targets master 
         - <Yourself> bot targets itself 
         - <TargetName> name of target
         - <clear> clears your current target 
   notarget - Commands bot to clear it's target. 
   face - Commands bot to face it's current target. 
   assist - Commands bot to assist the master, how the bot acts when assisting is controlled by toggles. 
    
   accept - Command bot to accept the current group invite. 
   invite - Command bot to invite it's current target to group. 
   reject - Command bot to reject the current group invite. 
    
   consent <playername> - Commands bot to give consent to <playername>, default will consent it's master. 
   reload - Commands bot to re-init the macro 
   trade - Commands bot to hit the trade button in a trade window. 
   yesres - Commands bot to hit yes on a ressurection confirm box.  
    
MOVEMENT: 
   anchor - Causes the bot to remember it's current location and return there between fights. 
   anchorradius <distance> - Tells bot to stop moving when it is within <distance> of its anchor point. 
   door - Causes the bot to attempt to open the closest door. 
   duck - Commands the bot to duck. 
    
   follow <blank|name> - Command bot to follow the master or his designated target; 
         - <blank>   - if master has no target, tells the bot to follow you. 
         - <blank>   - if master has a target, tells the bot to follow master's target. 
         - <name>   - tells the bot to follow name, name can be your name,pcname or npcname. 
         - EXAMPLE /tell bot follow 
   followmode <1|2|3> - Sets how the bot follows; 
         - <1> (Combat mode) is facing you constantly and attempting to move directly towards you. 
         - <2> (AdvPathFollow) is plotting the path of it's target, and then following that path 
         - <3> (Eq's /follow) is the native /follow command used by EQ (group members only?) 
         - EXAMPLE /tell bot followmode 2 
   stay - Commands bot to stop following 
   pause - Pauses the advanced follow command 
    
   moveto <Me|Loc|TargetName> - commands the bot to move to a point, then stop; 
         - <Me>         moves bot to you 
         - <225,-300>   moves bot to the location 225 , -300 
         - <%T>         moves bot to your target 
         - EXAMPLE. /tell bot moveto Me 
   movetomode <1|2> - Sets how the bot movesto; 
         - <1> (normal) Genbot Anchor type 
         - <2> (AdvPathGoto) 
         - EXAMPLE. /tell bot movetomode 1 
          
   mount - Commands bot to get on it's mount (defined in genbot_botname.ini) 
   stop - Forces the bot to stop, will duck, dismount and stop moving. 
          

COMMUNICATION: 
   checkname - if set to true, bot will only respond to commands in group or chat if the command is preceeded with <botname> 
   exp - Commands bot to reply with it's current exp percent 
   norelay - Stops bot from sending received tells to it's master 
   relay - Starts bot sending received tells to it's master 
   saytarget - The bot will tell you what it's currently Targeting. 
   reportbuffs - Commands bot to tell it's master a list of currently active buffs. 
   cmds - Asks bot to return a list of available commands 
   verbosity - Changes what level chat the bot actually sends to it's master. 
   chatin <channelname> - Changes what channel the bot will use for replying to it's master. 


COMBAT: 
   attack - Commands bot to start attacking 
   noattack - Commands bot to Stop attacking 
    
   behind - Commands bot to move behind it's current target 
   getbehind - Commands bot to move behind the specified target 
    
   petattack - Assist's master for target and then issues the bot /pet attack command. 
    
   hide - Commands bot to use it's Hide ability 
   rmod <distance> - Changes relative distances in combat 
   rset <distance> - Changes the range settings used in combat 
   shield - Commands bot to /shield it's master 
   sneak - Commands bot to use it's sneak ability 
    
    
CASTING: 
   buff <spell> - Commands bot to cast <spell> on it's master 
   buff <spell> on <target> - Commands bot to cast buff <spell> ON <target>, bot will automatically refresh it. 
   chainnuke - Commands bot to start chaining nukes on <target> 
   chainstun - Commands bot to start chaining stuns on <target> 
   evac - Commands bot to move to it's master and cast it's evac spell, if defined in the .ini file.
   heal - Commands bot to heal <target> 
   itemcast <itemname> - Commands bot to trigger the specified item. 
   loadlist <listname> - Commands bot to load a spell list 
   mana - Commands bot to reply with it's current mana 
    
   sn <spell|item> - Commands bot to cast the specified spell on master's target. 
      <spell> - will cast <spell> on master's target. 
      <item> - will right click item on master's target. 
   snt <spell|item> on <target> - Commands bot to cast <spell|item> ON <target>,if "on <target>" is not specified, it will cast on bot's target 
      <spell> - snt brell's stalwart shield on PlayerName 
      <item> - snt Regent Symbol of Innoruuk on NPCName 
       
   spellgem <number> - This sets the spell gem used when bot is required to memorize a new spell. (1 to 8) 
   setlompct <percent> - Sets the mana percent at which the bot will report low mana 
    
   settankheal <spell> - Sets the spell used to heal tanks, if no <spell> is specified then the current spell is reported. 
   setcasterheal <spell> - Sets the spell used to heal casters, if no <spell> is specified then the current spell is reported. 
   setpetheal <spell> - Sets the spell used to heal pets, if no <spell> is specified then the current spell is reported. 
   setdefaultheal <spell> - Sets the spell used for the heal command, if no <spell> is specified then the current spell is reported. 
   setpatchheal <spell> - Sets the spell used to patch heal, if no <spell> is specified then the current spell is reported. 

   setcasterhealpct <percent> - Sets the HP % at which caster's will be healed, if <percent> is not specified, the current % is reported. 
   settankhealpct <percent> - Sets the HP % at which tank's will be healed, if <percent> is not specified, the current % is reported. 
   setpethealpct <percent> - Sets the HP % at which pet's will be healed, if <percent> is not specified, the current % is reported. 

   watchtarget - Commands bot to monitor the hit points of <target>. Needs to have autoheal on for target to be healed. 
   resetwatch - Commands bot to reaquire the ID's of it's targets, good to execute after zoning 


TOGGLES:  COMMAND - DESCRIPTION - DEFAULT 
Most toggles can have there default starting value set in your genbot_botname.ini file 
One example,when we are telling the bot to bash during combat, is the line: DoBash=1 

   listengroup - Toggles bot listening for commands in group chat - OFF 
   listenchat - Toggles bot listening for commands in the Chat Channel - OFF 

   aona - Toggles bot attacking targets on assist - OFF 
   bona - Toggles bot attacking from behind on assist - OFF 
   petona - Toggles bot doing /pet attack on assist - OFF 
   beagg - Toggles bot automatically fighting back when attacked - OFF 
   puller - Controls if the bot will return to it's anchor point when attacked - OFF 
   autoengage - Controls if the bot will close and engage when in combat - OFF 
   autobehind - Controls if the bot will automatically attempt to fight behind all targets during combat - OFF 
    
   backstab - Toggles bot using backstab while fighting - OFF 
   bash - Toggles bot using Bash during fighting - OFF 
   disarm - Toggles bot using disarm while fighting - OFF 
   evade - Toggles bot using Hide during fighting - OFF 
   flyingkick - Toggles bot using flyingkick while fighting - OFF 
   frenzy - Toggles bot using frenzy while fighting - OFF 
   incite - Toggles bot using incite while fighting - OFF 
   kick - Toggles bot using kick while fighting - OFF    
   slam - Toggles bot using Slam during fighting - OFF 
   taunt - Toggles bot using taunt while fighting - OFF 

   archery - Toggles bot using archery while fighting - OFF 
   run - Toggles run setting on bot 
   traps - Toggles bot trying to find and disarm traps - OFF 

   aftercastsit - Controls if the bot will sit after casting spells - OFF 
   autoheal - Controls if the bot will automatically use heals on group and watch targets - OFF 
   autohealpets - Controls if the bot will automatically use heals on pets - OFF 
   patchheal - Controls if the bot will automatically patch heal targets below half their heal percent - OFF 
   reportlom - Controls if the bot will automatically report when it's low on mana - OFF 
   yaulp - Toggles if bot will use yaulp (Yaulp spell is defined in genbot_botname.ini) when low on mana - OFF 
   canni - Toggles if bot will cannibalize when low on mana - OFF 
    
    
OBSOLETE COMMANDS 
These commands will be removed, all of them can be replaced by the native command support now built into genbot. 

"Implemented /commands natively into genbot. 
Any command to the bot which begins with a / will be executed by the bot. 
For example, "/wave" or "/yell" or "/target id 1234" or "/call MySubroutine" are all valid bot commands." -   Vexix 

   afk <message> - Turn bot's afk on with optional <message>.         USE: /tell bot /afk <message> 
   autoinv - Commands bot to use the /autoinv command               USE: /tell bot /autoinv 
   camp - Commands bot to camp out.                                USE: /tell bot /camp
   dismount - Commands bot to /dismount.                        USE: /tell bot /dismount 
   disc <discname> - Commands bot to fire the specified /disc.         USE: /tell bot /disc <discname> 
   group <message> - Commands the bot to /gsay <message>.            USE: /tell bot /g <message> 
   petback - Commands bot to execute it's /pet back command.         USE: /tell bot /pet back 
   petguard - Commands bot to execute it's /pet guard command.         USE: /tell bot /pet guard 
   random - Commands bot to /ran.                              USE: /tell bot /random <value> 
   say <message> - Commands the bot to /say <message>.               USE: /tell bot /say <message> 
   sit - Makes bot sit                                       USE: /tell bot /sit 
   stand - Makes bot stand                                    USE: /tell bot /stand 
   tell <name> <message - Commands the bot to /tell <name> <message>.   USE: /tell bot /tell <name> <message> 



SHORTCUTS - Vexix 
Genbot also includes shortcuts, which can run any everquest, macroquest, or genbot command. 
For instance, the following would be a valid Genbot .ini section: 

[Shortcuts] 
eyepatch=itemcast Eyepatch of Plunder 
nukeit=sn Lure of Fire 
sowon=buff spirit of wolf on 
uberaa=/alt activate 33 
takemehome=/echo play:PoKtoNexxus 1 f nopp z;NexxustoBazaar 10 cr nopp z;BazaartoShadHav 1 cf nopp noz 

Shortcuts give an easy way to abbreviate long commands, like interzone advpaths, and also have some really cool possibilities for controlling parties. 
For instance, you could have your leader say nukeit in groupsay, and each of the PCs in the party could respond with an appropriate nuke as defined 
in their .ini file. The wizzy Lures it, the enchanter smacks it with his DD+stun, the druid casts wildfire, and the warrior, um, slams it! 

Similarly, if you called evacuate, with the .ini's set up right, the druid could cast his evac, the cleric might automatically heal the druid 
to make sure he survives, and the warrior could hit AE taunt to pull aggro from the druid. Fun, fun! 

To show what shortcuts you have defined in your .ini file while running the macro, I added the shortcuts command. 
Type "shortcuts" for a list of available shortcuts, and type "shortcuts name_of_shortcut" to see what that particular shortcut does. 

Shortcuts can be used to do some very cool stuff.  For instance, shortcuts can also call other shortcuts.  
If the above "mark" shortcut had the " on" removed to allow it to cast on the current target instead of expecting you to provide one, then: 

Mark=snt Mark of the righteous|snt Mark of kings|/target clear 

Then you could make another shortcut: 

markparty=/target clear|/keypress F1|markon|/keypress F2|markon|/keypress F3|markon|/keypress F4|markon|/keypress F5|markon|/keypress F6|markon 

Which would buff your entire party for you.  If you didn't have 6 people in your party, it would still try to target them and cast, 
but it would immediately get an error and time out, so no real loss. 

Likewise this could be done for items, but in order to do so, a /delay command to account for the casting time would need to be included, 
since the /itemcast command doesn't wait for a response.  To shrink your entire party use: 

shrink=/itemcast "cobalt bracer"|/delay 8s|/target clear 
shrinkparty=/target clear|/keypress F1|shrink|/keypress F2|shrink|/keypress F3|shrink|/keypress F4|shrink|/keypress F5|shrink|/keypress F6|shrink 

Unfortunately, this shortcut would still wait after trying to all 6 party members, even if you only had 2. 

NOTE:  You can use DataVar expressions in shortcuts, but be warned they will be evaluated by the first MQ2 char they hit.  
In otherwards, if you are running MQ2, and give your bot the command /say My name is ${Me.Name}, the bot will say, 
My name is MasterName, since the datavar is evaluated by the master MQ2.  If you're not running MQ2, and give the same command, 
the bot will say, "My name is Bot." 

CAUTIONS: 
With great power, comes great responsibility.    
Since shortcuts can call other shortcuts, it's possible to create shortcuts which would endlessly loop.  
I don't recommend that.   

Shortcuts take full control of your bot during execution.  
It would be easy to make a long cleric buff shortcut chain which would cast every buff on every member of your party, 
but remember that until your buff chain finished, your cleric bot will do no healing or moving.  
I hope nothing spawns or wanders into your party! 


Genbot Credits and History:

Version 0-8.8           Genbot created and developed by Grimjack 
Version 8.8-?           Lasher took over the code.
Version ?-12.34         Lord Giddeon maintained the code.  Fez_Ajer did some trouble-shooting and code fixes.
Version 12.35 - Current Vexix Updated the code and introduced generalized shortcuts. 
Last edited by Vexix on Fri Jun 04, 2004 10:55 am, edited 2 times in total.

alcor75
a lesser mummy
a lesser mummy
Posts: 77
Joined: Wed Jan 29, 2003 7:35 am

Post by alcor75 » Sat May 22, 2004 3:24 am

A wery big Hug to you 2 for keeping this updated, this is my prefered macro since the begun.


Alcor.

EDIT:
Tnx for the update.
Last edited by alcor75 on Mon May 24, 2004 8:06 am, edited 2 times in total.

gus
a lesser mummy
a lesser mummy
Posts: 70
Joined: Fri Apr 09, 2004 11:58 pm

Post by gus » Sat May 22, 2004 12:42 pm

Thanks for the merging all the recent fixes.

I'm going to be reverting to the prior shortcut mechanism for now though.

While the changes to the shortcuts are nice in terms of flexibility, they add complexity for the user. You removed the auto-classification scheme, requiring more work to setup similar style shortcuts (read: forcing me to write macro code). I rather did like being able to just put in:

Code: Select all

[shortcut spells]
nuke=elnerick's electrical rending
fnuke=voltaic draught
[shortcut Items]
[shortcut notarget Spells]
selfinvis=Improved Invisibility
[shortcut notarget items] 
[shortcut AA]
[shortcut noTarget AA]
[Shortcut Disc]
[shortcut noTarget Disc]
Just add a new category for "generic" shortcuts if you so desire, ones which do not provide OOTB behaviour like the above did. Say:

Code: Select all

[shortcut generic]
eyepatch=itemcast Eyepatch of Plunder
nukeit=genbot sn Destruction
sowme=buff spirit of wolf on me
uberaa=/alt activate 33
chcheck=/tell ${MasterName} I have ${Math.Calc[${Me.CurrentMana}/400].Int} CHs left.
takemehome=/echo play:PoKtoNexxus 1 f nopp z;NexxustoBazaar 10 cr nopp z;BazaartoShadHav 1 cf nopp noz

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Sun May 23, 2004 3:34 am

Good job Vexix on keeping this going while LG is away, i think its close to being 100% now.
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]

Virtuoso65
a hill giant
a hill giant
Posts: 150
Joined: Wed Oct 15, 2003 2:29 pm

Post by Virtuoso65 » Sun May 23, 2004 10:43 pm

For the shortcuts the only thing i can think of is, is it posable to do multi line commands like.

sleep=/sit /camp

Mortedamour
orc pawn
orc pawn
Posts: 28
Joined: Tue Jan 07, 2003 2:30 pm

Post by Mortedamour » Mon May 24, 2004 6:31 pm

Anyone else have problem with Bot not listening to Chat channel?

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Post by Vexix » Tue May 25, 2004 8:43 am

More details. When you say chat channel, do you mean /1 type chat? Tells? Group? IRC?

--Vexix