Genbot v13.1.5 [Updated 07/11/2004] Invites and Events!

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 v13.1.5 [Updated 07/11/2004] Invites and Events!

Post by Vexix » Sun Jun 20, 2004 12:00 pm

Current File Versions:
Genbot.mac 13.1.5
BotCore.inc 13.1.5
BotCombat.inc 13.1.5
BotSpell.inc 13.1.5
BotHealer.inc 13.1.5
BotShortCut.inc 13.1.5
Personal.inc 13.1.0
GenbotDoc.txt 12.38

Changelog 2004-07-11

Fixed Bot continuing to attack after original target is gone. FYI, "${XXX.NotEqual[YYY]}" is not the same as "!${XXX.Equal[YYY]}" if there is a possibility that XXX is NULL. ;)

Fixed cmds-SHORTCUTS undefined message.

Fixed some upper/lower case problems with the new events code.

Fixed PatchHeals. Patch heals, along with the other heals, still ignore the .ini messages, but at least they should cast correctly now!

Added some /squelch commands before the /target and /face commands to eliminate the unsightly errors when your target poofs before the command.

Fixed the /gb renaming ${MasterName} messing up the /assist codes so you couldn't use sn commands after /gb commands. Output channel is still reset on /gb commands, but now sn commands will use /assist ${MasterName}, where ${MasterName} is the first master on your list.

Fixed lag related loot freezes.

Fixed the "Heal" command. Should handle pets and assist master for target if no target specified.

Changelog 2004-07-09

Fixed the below event code to handle caps and changed botshortcut.inc to use the new LoadSetting sub.

Changelog 2004-07-09

Added invite code. If invited to group by master, bot will automatically accept. If invited by someone else, bot will tell the master who invited it.

Added EVENTS section to .ini, and several typical events like EventImDead, EventLoosingInvis, etc. These events take standard shortcut format commands. For instance, if you wanted to recast levitate when it started to fade, you would change:

EventLoosingLevitate=/botsay I'm loosing Levitate.

To:

EventLoosingLevitate=/botsay Recasting levitate.|snt levitate

Added shortcut type to LoadSettings subroutine to help handle the new events.
Added /botsay alias for sending a message to the normal bot channel. Mostly for use with the new Event shortcuts.

Changelog 2004-06-26

Refined the previous change to be less spamarrific.

Changelog 2004-06-23

Increased the .ini default value for CampRadius to 100. If you order the bot to attack, and the distance from the bot to the mob is greater than the CampRadius from your .ini file, the bot will not attack, and will now give you an error message telling you the mob is out of range. This setting is to prevent the bot from charging across zones after warped mobs, etc.

Changelog 2004-06-21

Added on/off toggles "buffing" and "healing". When off, you will not buff or heal respectively. "snt bigbuff on me" type commands will work normally, even if buffing is toggled off. "IsHealer" .ini entry replaced with "DoHeals". Healers must set "DoHeals=1" in your .ini file, or your healer won't heal. ;) Pallies need to "DoHeals" too, by the way.

Changed the LoadSettings subroutine to take a variable type after the variable name to save having to declare the variable separately. New format looks like this:

/call LoadSetting PersonalVar VarType Personal Personalkey Default

You no longer need to /declare the PersonalVar in a separate line. The LoadSetting sub will declare if for you. Also, if the VarType is a string, LoadSetting will create a variable called PersonalVar-DefaultValue so you can check if the value is different from the default value. Thanks to sj_digriz for the formatting help!

Let's welcome back the afk, camp, tell, etc commands, which were removed before. Although the functionality of these commands still existed with /afk, /camp, etc, I found it to be a pain to have to enter the "/" and also to remember which ones needed it and which didn't, so they've been put back in. Thanks sj_digriz!

Added Gate event, so you stop attacking if your target gates.

Added target name to enrage off and on events so pets won't trigger them.

Changed buff refresh behavior when the buff is unsuccessful. If buff doesn't land due to out of range, etc, buff will be recast 2 more times, with a 10 second delay between each try. If still unsuccessful, it will start over again 90 seconds later. If the buff bounces off a higher buff, it will try to land the buff again 2 minutes later.

I also tried to remove some of the spam from the bot if the recipient of the buff isn't in the same zone. Bot will wait patiently and quietly until the buff recipient is back in the same zone.

Fixed a bug with the OOM message not meditating correctly.

Moved FindTraps to botcore instead of botcombat.

Fixed rapid tells to master not appearing by adding a 2 second delay between tells to master. EQ seems to have an anti-spam filter, so tells that are done less than 1 second apart get ignored.

Removed a line from the Agressive routine that prevented you from attacking when attacked if your inventory window was open. Any ideas what the original purpose of this was? Not attack if you were casting an item?

Changed Aggressive check so it will only attack when you are not in combat.

Changed "/if (${Me.Sitting}) /stand" to "/if (!${Me.Standing}) /stand". If the bot is feigned or ducked and master orders attack, bot will stand.

Added DoMelee toggle and DoMelee to .ini settings. If DoMelee is on, you will close and attack when in battle. If off, you will not. Note that DoMelee and DoArchery shouldn't both be true. :P

Combatstatus and Supportstatus replaced with DoMelee and CombatTargetID. "snt spell" without a target name during combat will now target the mob you last commanded the bot to assist or attack. Also, bot will be considerably more "sticky" in battle. If target changes from original mob, but original mob is still in range and not dead or charmed, bot will retarget and engage if DoMelee is on.

I think I've solved the /target or spells hitting pets or mounts with similar names to their masters. Let me know what command you used if you still hit a pet when you meant to hit the master. Thanks Robjer for the pointer to the problem!

Mount has been fixed. Thanks Robjer!

Fixed lootup and lootall. Removed the /assist functionality of lootup. Unless a target corpse is provided in the command, genbot will just loot the closest corpse.

Known issues:

Heal messages from the .ini file don't work.
Task and spell overlap is not handled well. Requesting tasks in the middle of spells may not work.
Multiple genbot initiated heals can exist in the spell queue, so repeated heals may be cast on one char.
If using Windows XP or 2000, genbot performs much better if Performance Options are set to Background Services. Programs setting can cause slow responses, especially with more than one char on a PC.

Future plans:

The ability to equip, cast, and replace items will be included.

Better buff management, including lists of outstanding buffs, the ability to remove 1 buff from the buff list, and the ability to have genbot time and name a buff icon for you.

defend, guard, and protect commands to allow bot to guard an area or attack anything that attacks it's master.


Ways you can help:

As you can see, I have a lot of plans for genbot, but my programming time is limited, and I kinda like to play with my own bots from time to time as well. ;) Here are some tasks that will make genbot even better, and are in search of sponsors:

Maintain the genbot doc to keep it up to date -- Latest revision done by Seagreen! Would someone like to maintain it?

Create an .ini explanation file. Lots of stuff in the .ini files that could use explanation.

Organize and sort the genbot code so it is consistent and easy to find things -- Done by sj-digriz! Thanks!

Create a scheme for organizing the genbot responses to commands throught the ChatOut subroutine. Genbots responses and response priority levels are pretty random right now, depending on who wrote 'em and their mood that day.

Create a Do-equip routine. Parameters should be either "item_name" or "slot item_name". If slot is named, then routine will attempt to equip that item in that slot, and place other item where ever the first item came from. Bonus points if you can make it handle 2HB and 2HS weapons, as well as putting items in bags into inventory slots. If a slot name isn't given, routine should find what slot the item can be equipped in, and equip it for you. Examples of working code that does something similar are available here: and here:

Give me a PM if you're interest in any of these tasks!


Enjoy the new code, and let me know where it's not working as planned!

--Vexix

P.S. Go here for move of the changelog on the previous version: http://macroquest2.com/phpBB2/viewtopic.php?p=54475
Last edited by Vexix on Mon Jul 19, 2004 9:11 am, edited 12 times in total.

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

Post by Vexix » Sun Jun 20, 2004 12:01 pm

genbot.mac

Code: Select all

|genbot.mac 
|Generic bot macro for any class. 
|Version 13.1.5
|Date:07/11/2004
| 
||** 
[genbot] 
version=13.1.5
**|| 
| 

|-------------------------------------------------------------------------
|Includes
|-------------------------------------------------------------------------
#include bothealer.inc 
#include botcombat.inc 
#include botspell.inc 
#include botcore.inc 
#include personal.inc 
#include botshortcut.inc 
#include advpath.inc 

|-------------------------------------------------------------------------
|SUB: Main Program Sub
|-------------------------------------------------------------------------

Sub Main 
   /declare Commands[2,500] string outer 
   /declare Toggles[5,50] string outer 
   /declare TopCommand int outer 1 
   /declare TopToggle int outer 1 
   |----------------------------------------------------------------------
   |Initialize MasterList (characters that can control this bot)
   |Checks to see if list already exists in case a reload is done
   |----------------------------------------------------------------------
   /if (!${Defined[MasterList]}) { 
      /if (!${Defined[Param0]}) { 
         /echo Usage: /macro generic <Master Name1> <Master Name2>... 
         /endmacro 
      } 
      /declare MasterList string global 
   } 
   |----------------------------------------------------------------------
   |clear and rebuild master list if a list is passed
   |----------------------------------------------------------------------
   /if (${Defined[Param0]}) { 
      /varset MasterList | 
      /declare MasterCount int local 
      /for MasterCount 0 to ${Macro.Params} 
         /varset MasterList ${MasterList}${Param${MasterCount}}| 
      /next MasterCount 
   } 
   |----------------------------------------------------------------------
   |Call the Initialize Sub of each include file
   |----------------------------------------------------------------------
   /call Init-Shortcuts 
   /call Init-Core 
   /call Init-Combat 
   /call Init-Spell 
   /call Init-Healer 
   /call Init-Toggles 
   /call Init-Personal 
   |----------------------------------------------------------------------
   |Main program loop performs subs for each include file
   |----------------------------------------------------------------------
   :MainLoop 
   /doevents 
   /if (${DoHeals}) /call HealerMain 
   /if (${CombatTargetID}) /call CombatMain  
   /call CoreMain 
   /call SpellMain 
   /call PersonalMain 
   /goto :MainLoop 

/return 
Last edited by Vexix on Sun Jul 11, 2004 12:35 am, edited 2 times in total.

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

Post by Vexix » Sun Jun 20, 2004 12:02 pm

botcore.inc

Code: Select all

|botcore.inc
|Bot core module.
|Version 13.1.5
|Date:07/11/2004
|
||**
[botcore]
version=13.1.5
**||

#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 Invite "#1# invites you to join a group."
#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 autoinv Do-autoinv
   /call AddCommand CORE camp Do-camp
   /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 chatin Do-chatin
   /call AddCommand CORE cmds Do-cmds
   /call AddCommand CORE consent Do-consent
   /call AddCommand CORE dismount Do-dismount
   /call AddCommand CORE door Do-door
   /call AddCommand CORE duck Do-duck
   /call AddCommand CORE exp Do-exp
   /call AddCommand CORE equip Do-equip
   /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 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 petback Do-petback
   /call AddCommand CORE petguard Do-petguard
   /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 tell Do-tell
   /call AddCommand CORE target Do-target
   /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 AnchorX int outer 0
   /declare AnchorY int outer 0
   /declare BreakOut bool outer FALSE
   /declare CombatTargetID int outer 0
   /declare CommandParam string outer
   /declare CorpseList string outer
   /declare CurrCommand string outer
   /declare FollowTarget string outer
   /declare GenLastXLoc int outer 0
   /declare GenLastYLoc int outer 0
   /declare IsAnchored bool outer FALSE
   /declare LootTooFar int outer 0
   /declare MasterName string outer ${MasterList.Arg[1,|]}
   /declare ObstacleCheck int outer 0
   /declare SubCallName string outer

|Timers
   /declare SitTimer timer outer 0
   /declare ChatOutTimer timer outer 0

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

   /call LoadSetting EventExpGained shortcut EVENTS EventExpGained "None"
   /call LoadSetting EventLoosingLevitate shortcut EVENTS EventLoosingLevitate "/botsay I'm loosing Levitate."
   /call LoadSetting EventLoosingInvis shortcut EVENTS EventLoosingInvis "/botsay I'm loosing invis."
   /call LoadSetting EventLostInvis shortcut EVENTS EventLostInvis "/botsay I'm no longer invis."
   /call LoadSetting EventZoned shortcut EVENTS EventZoned "None"
   /call LoadSetting EventImDead shortcut EVENTS EventImDead "None"

   /squelch /alias /gb /echo genbot
   /squelch /alias /botsay /call ChatOut 1 ${MasterName}

   /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 1
         /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 0
      }
   }
/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 VarType,string SectionName,string KeyName,string DefaultValue)
   /if (${VarType.Equal[string]}) {
      /if (!${Defined[${VarName}-DefaultValue]}) /declare ${VarName}-DefaultValue ${VarType} outer
      /vardata ${VarName}-DefaultValue 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 (!${Defined[${VarName}]} && ${VarType.NotEqual[shortcut]}) /declare ${VarName} ${VarType} outer
      /if (${IniValue.Equal[NOTFOUND]}) {
         /ini ${IniFile} "${SectionName}" "${KeyName}" "${DefaultValue}"
         /if (${VarType.NotEqual[shortcut]}) /varset ${VarName} ${DefaultValue}
      } else /if (${VarType.Equal[shortcut]}) {
         /if (!${IniValue.Lower.Equal[none]}) {
            /if (!${Defined[ShortCuts-${VarName.Lower}-Text]}) /declare ShortCuts-${VarName.Lower}-Text string outer
            /varset ShortCuts-${VarName.Lower}-Text ${Ini[${IniFile},${SectionName},${VarName},NA]}
            /varset cmds-SHORTCUTS ${cmds-SHORTCUTS} ${VarName.Lower}
         }
      } else {
         /varset ${VarName} ${IniValue}
      }
      
   }

/return

Sub CoreMain
   /if (${Me.Combat} && ${Target.Type.Equal[NPC]} && ${AutoEngage}) {
      /varset CombatTargetID ${Target.ID}
   }
   |/if (${Spawn[pc ${MasterName}].NearestSpawn[npc].
   /if (${CombatTargetID}) /return
   /if (${Me.Combat}) /attack off
   /if (${DoTraps}) /call TrapFinder
   /if (${IsAnchored}) {
      /if (${Math.Distance[${AnchorY},${AnchorX}]}>${AnchorRadius}) {
         /call MoveToAnchor
      } else {
         /if (${SitAfterCast} && ${Me.Standing} && !${SitTimer}) /varset SitTimer ${DelayBeforeSit}
      }
      /return
   }
   /if (${advpath}) /call AdvPathPoll 
   /if (${Afollow}) {
      /varset CommandParam ${FollowTarget}
      /call Do-moveto ${FollowTarget}
   }
/return

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

Sub Do-accept
   /squelch /target clear
   /invite
/return

Sub Do-reject
   /squelch /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)
   /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 CombatTargetID ${Target.ID}
      /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-dismount
   /dismount
   /call ChatOut 5 ${MasterName} "I got off my mount."
/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-equip
      /if (${Macro.Params}>1) {
         /for counter 1 to ${Math.Calc[${Macro.Params}-1]}
            /varset CommandText ${CommandText} ${Param${counter}}
         /next counter
         /if {Debug-Core} /echo Do-equip CommandText ${CommandText}
      }
      /declare SlotName string local ${CommandText.Arg[${Math.Calc[${CommandText.Count[ ]}+1]}]}
      /if (${InvSlot[SlotName]} && ${InvSlot[SlotName]}<22) {
         /varset slotName ${SlotName}
         /varset CommandText ${CommandText.Right[-${CommandText.Arg[${Math.Calc[${CommandText.Count[ ]}+1]}].Length}]}

      /if ( !${FindItem[${spellName}].InvSlot} ) {
         /echo Cannot find item: ${spellName}
         /return CAST_UNKNOWNSPELL
      }
      /if ( ${FindItem[${spellName}].InvSlot}>30 ) {
         /varset swapItemBack true
         /if ( ${FindItem[${spellName}].WornSlot[1]} ) {
            /varset slotName ${FindItem[${spellName}].WornSlot[1]}
         } else {
            /varset slotName pack8
         }
         /varset slotID ${InvSlot[${slotName}].ID}
         /varset oldSlotID ${FindItem[${spellName}].InvSlot.ID}
         /autoinventory
         /if ( ${InvSlot[${oldSlotID}].Pack} ) {
      :open_pack
            /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup
            /if ( !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /goto :open_pack
         }
      :pick_up_item
         /if ( ${InvSlot[${oldSlotID}].Pack} && !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup
         /nomodkey /itemnotify ${InvSlot[${oldSlotID}]} leftmouseup
         /if ( !${Cursor.Name.Equal[${spellName}]} ) /goto :pick_up_item
      :exchange_items
         /nomodkey /itemnotify ${slotID} leftmouseup
         /if ( !${Me.Inventory[${slotID}].Name.Equal[${spellName}]} ) /goto :exchange_items
      }

/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 si int local
   /varset CorpseList
   /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
   }
   /for si 1 to ${DeadCount}
      /call ListAppendElement 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 (${Me.Combat}) {
      /call ChatOut 6 ${MasterName} "I'm busy fighting right now.  Ask me to loot again later!"
      /return
   }
   /if (${Defined[Param0]}) {
      /call Target "corpse ${CommandParam}"
   }
   /call Loot
/return

Sub Do-mount
   /if (${Me.Sitting}) /stand
   /if (!${String[ item alt spell slot ].Find[ ${MountItem.Arg[1].Arg[1,-]} ]}) /varset MountItem item ${MountItem} 
   /call AddCast "${MountItem}" "0" buff
   /call ChatOut 5 ${MasterName} "Summoning 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 chat
   /if (${movetomode}==1) {
      /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
   /squelch /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 DOWN
   /keypress LEFT
   /keypress RIGHT
/return

Sub Do-stop
   /dismount
   /varset CombatTargetID 0
   /varset LootTooFar 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
   /squelch /target clear
   /keypress right
/return

Sub Do-target
   /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
   /if (${DebugList.Find[core]}) /echo /assist ${sAssistName}
   /if (${Me.Name.Equal[${sAssistName}]}) {
      /assist ${MasterList.Arg[1,|]}
   } else {
      /assist ${sAssistName}
   }
   /delay 2s ${Target.ID}
   /if (!${Target.ID}) /call ChatOut 3 ${MasterName} "Unable to /assist ${sAssistName}."
/return

Sub ChatOut(int ChatPriority,string ChatTarget,string ChatText)
   /declare GenFor int local

   /if (${ChatPriority}>${Verbosity}) /return
   /if (${Macro.Params}>3) {
      /for GenFor 3 to ${Math.Calc[${Macro.Params}-1]}
         /varset ChatText ${ChatText} ${Param${GenFor}}
      /next GenFor
   }
   /if (${ChatTarget.Equal[GROUP]}) {
      /gsay ${ChatText}
      /return
   }
   /if (${ChatTarget.Equal[${Me.CleanName}]}) {
      /echo ${ChatText}
      /return
   }
   /if (${ChatIn.Equal[tell]}) {
      /if (${ChatOutTimer}) /delay ${ChatOutTimer}
      /varset ChatOutTimer 20
      /tell ${ChatTarget} ${ChatText}
   } else /if (${ChatIn.Equal[Group]}) {
      /gsay ${ChatText}
   } else /if (${ChatIn.Equal[Raid]}) {
      /rsay ${ChatText}
   } else /if (${ChatIn.Equal[Say]}) {
      /if (${ChatOutTimer}) /delay ${ChatOutTimer}
      /varset ChatOutTimer 20
      /say ${ChatText}
   } else /if (${ChatIn.Equal[Channel]}) {
      /if (${ChatOutTimer}) /delay ${ChatOutTimer}
      /varset ChatOutTimer 20
      /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
   }
   /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 chat
      /if (!${Target.ID}) {
         /varset CombatTargetID 0
         /Keypress BACK
         /return
      }
      /if (${Me.Sitting}) /stand
      /squelch /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 chat   Took out since it was stuffing up evacs?
   /if (!${Target.ID}) {
      /varset CombatTargetID 0
      /keypress FORWARD
      /return
   }
   /if (!${Me.Standing}) /stand
   /squelch /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 (!${Me.Speed}) {
      /return
   }
   /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 TrapFinder
   /if (${Me.AbilityReady[Sense Traps]}) /doability "Sense Traps"
/return

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

Sub MoveToAnchor
   /varset GenLastXLoc ${Me.X}
   /varset GenLastYLoc ${Me.Y}
   /varset ObstacleCheck 0
   :AnchorMoveLoop
      /doevents chat
      /if (${CombatTargetID}) {
         /keypress down
         /return
      }
      /if (!${Me.Standing}) /stand
      /face nolook loc ${AnchorY},${AnchorX}
      /if (${Math.Distance[${AnchorY},${AnchorX}]}>${AnchorRadius}) /keypress FORWARD hold
      /if (${Math.Distance[${AnchorY},${AnchorX}]}<=${AnchorRadius}) {
         /keypress FORWARD
         /face nolook away loc ${AnchorY},${AnchorX}
         /keypress Home
         /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} || ${Target.ID}==${Me.ID}) /return
   /if (!${Me.Standing}) /stand
   /squelch /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 "${MasterName}"
   } else /if (${TargetName.Equal[yourself]} || ${TargetName.Equal[${Me.CleanName}]}) {
      /call Target myself
   } else {
      /call Target "${TargetName}"
   }
/return

Sub Target(string sTargetName)
   /squelch /target clear
   /if (${Spawn[pc ${sTargetName} radius ${MaxTargetRange}].ID}) {
      /squelch /target pc ${sTargetName} radius ${MaxTargetRange}
   } else {
      /squelch /target ${sTargetName} radius ${MaxTargetRange}
   }
   /delay 2s ${Target.ID}
   /if (!${Target.ID}) /echo Unable to locate target ${sTargetName} .
/return

Sub ListDelbyArg(string sList,int sArg,string sDiv)
   /if (!${Defined[sDiv]}) /varset sDiv |
   /declare sright int local
   /declare sleft int local
   /declare splaceholder string local
   /vardata ${sList} String[${sDiv}${${sList}}${sDiv}${sDiv}]
   /varset splaceholder ${String[${${sList}}].Arg[${sArg},${sDiv}]}
   /varcalc sleft  ${${sList}.Find[${sDiv}${splaceholder}${sDiv}]}
   /varcalc sright ${sleft}+${String[${splaceholder}${sDiv}].Length}
   /vardata ${sList} String[${${sList}.Left[${sleft}]}${${sList}.Right[-${sright}]}]
   /varset ${sList} ${${sList}.Left[-2].Right[-1]}
   /if (${DebugList.Find[core]}) /echo List ${${sList}} deleted arg ${sArg}
/return

Sub ListReplacebyArg(string sList,string sElement,string sArg,string sDiv)
   /if (!${Defined[sDiv]}) /varset sDiv |
   /vardata ${sList} String[${sDiv}${${sList}}${sDiv}${sDiv}]
   /declare sright int local
   /declare sleft int local
   /declare splaceholder string local
   /varset splaceholder ${String[${${sList}}].Arg[${sArg},${sDiv}]}
   /varcalc sleft  ${${sList}.Find[${sDiv}${splaceholder}${sDiv}]}
   /varcalc sright ${sleft}+${String[${splaceholder}${sDiv}].Length}
   /vardata ${sList} String[${${sList}.Left[${sleft}]}${sElement}${sDiv}${${sList}.Right[-${sright}]}]
   /varset ${sList} ${${sList}.Left[-2].Right[-1]}
   /if (${DebugList.Find[core]}) /echo List ${${sList}} sElement ${sElement} repladed arg ${sArg}
/return

Sub StringReplaceAll(string sList,string oldElement,string newElement)
   /declare GenFor int local
   /declare sright int local
   /declare sleft int local
   /for GenFor 1 to ${${sList}.Length}
      /if (${${sList}.Find[${oldElement}]}) {
         /varset ${sList} |${${sList}}||
         /varcalc sleft  ${${sList}.Find[${oldElement}]}-1
         /varcalc sright ${sleft}+${String[${oldElement}].Length}
         /varset ${sList} ${${sList}.Left[${sleft}]}${newElement}${${sList}.Right[-${sright}]}
         /varset ${sList} ${${sList}.Left[-2].Right[-1]}
      } else {
         /if (${DebugList.Find[core]}) /echo List ${${sList}} oldElement ${oldElement} replaced newElement ${newElement}
         /return
      }
   /next GenFor
   /echo Error in StringReplaceAll
/return

Sub ListDelbyName(string sList,string sName,string sDiv)
   /if (${DebugList.Find[core]}) /echo List ${${sList}}  TO Delete: ${sName}
   /if (!${Defined[sDiv]}) /varset sDiv |
   /vardata ${sList} String[${sDiv}${${sList}}${sDiv}${sDiv}]
   /declare sright int local
   /declare sleft int local
   /varcalc sleft  ${String[${sDiv}${${sList}}${sDiv}].Find[${sDiv}${sName}${sDiv}]}-1
   /varcalc sright ${sleft}+${String[${sName}${sDiv}].Length}
   /vardata ${sList} String[${${sList}.Left[${sleft}]}${${sList}.Right[-${sright}]}]
   /varset ${sList} ${${sList}.Left[-2].Right[-1]}
   /if (${DebugList.Find[core]}) /echo List ${${sList}}  Deleted: ${sName}
/return

Sub ListAppendElement(string sList,string sElement,string sDiv)
   /if (!${Defined[sDiv]}) /varset sDiv |
   /if (${${sList}.Length}) {
      /varset ${sList} ${${sList}}${sDiv}${sElement}
   } else {
      /varset ${sList} ${sElement}
   }
   /if (${DebugList.Find[core]}) /echo List ${${sList}}  Added: ${sElement}
/return


Sub ListPrependElement(string sList,string sElement,string sDiv)
   /if (!${Defined[sDiv]}) /varset sDiv |
   /if (${${sList}.Length}) {
      /varset ${sList} ${sElement}${sDiv}${${sList}}
   } else {
      /varset ${sList} ${sElement}
   }
   /if (${DebugList.Find[core]}) /echo List ${${sList}}  Added: ${sElement}
/return

Sub ListFindStringArg(string sList,string sString,string sDiv)
   /if (!${Defined[sDiv]}) /varset sDiv |
   /declare sReturn int local
   /varcalc sReturn ${${sList}.Left[${${sList}.Find[${sString}]}].Count[${sDiv}]}+1
   /if (${DebugList.Find[core]}) /echo List ${${sList}}  Arg: ${sReturn}
/return ${sReturn}


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

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

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

/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 (${String[|${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
   /squelch /target clear
   /call ChatOut 5 ${MasterName} "Auto follow Off."
/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_ImDead
   /call ExecCommand EventImDead
/return

Sub Event_Invite
   /if (${MasterList.Lower.Find[|${Param1.Lower}|]}) {
      /call Do-accept
   } else {
      /call ChatOut 6 ${MasterName} "${Param1} has invited me to join his group."
      /call ChatOut 9 ${MasterName} "Let me know if I should 'accept' or 'reject' his invitation."
   }
/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 ExecCommand EventLoosingLevitate
/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.Arg[1,-].Equal[ST]}) {
      /if (${DebugList.Find[core]}) /echo ${Me.Name} Calling subroutine ${TimerName.Right[-3]}
      /vardata SubCallName TimerName.Right[-3]
      /if (${SubCallName.Find[-]}) /call StringReplaceAll SubCallName "-" " "
      |/if (${DebugList.Find[core]}) /echo ${Me.Name} Calling subroutine ${SubCallName}
      /call ${SubCallName}
   }
   /if (${TimerName.Equal[SitTimer]}) {
      /if (${Me.Standing} && !${CastStep} && !${Me.Speed}) {
         /sit
      } else {
         /varset SitTimer 2s
      }
   }
   /if (${TimerName.Equal[ChainStunTime]}) {
      /call NextStun
   }
/return

Sub Event_Zoned
   /varset IsAnchored 0
   /keypress FORWARD
   /call ExecCommand EventZoned
/return
Last edited by Vexix on Sun Jul 11, 2004 12:36 am, edited 5 times in total.

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

Post by Vexix » Sun Jun 20, 2004 12:03 pm

botcombat.inc

Code: Select all


|botcombat.inc 
|Bot combat module. 
|Version 13.1.5 
|Date:07/11/2004 
| 
||** 
[botcombat] 
version=13.1.5
**|| 

#event Attacking       "You pierce #*#" 
#event Attacking       "You slash #*#" 
#event Attacking       "You Hit #*#" 
#event Attacking       "You Bash #*#" 
#event ArcheryTooFar   "Your target is too far away, get closer" 
#event DisarmTrap      "You have disarmed #*#" 
#event Enraged         "#*#|${Spawn[id {CombatTargetID}].CleanName}| has become ENRAGED#*#" 
#event FoundFloorTrap  "You sense a trap in this direction." 
#event FoundBoxTrap    "You are certain that #*#" 
#event UnderAttack     "#1# YOU for #*#" 
#event UnderAttack     "#1# to #*# YOU, but #*#" 
#event MobGate         "#*#|${Spawn[id {CombatTargetID}].CleanName}| Gates.#*#" 
#event Offrage         "#*#|${Spawn[id {CombatTargetID}].CleanName}| is no longer enraged#*#" 


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 behind Do-behind 
   /call AddCommand COMBAT disc Do-disc 
   /call AddCommand COMBAT getbehind Do-getbehind 
   /call AddCommand COMBAT hide Do-hide 
   /call AddCommand COMBAT noattack Do-noattack 
   /call AddCommand COMBAT shield Do-shield 
   /call AddCommand COMBAT sneak Do-sneak 
   /call AddCommand COMBAT melee Do-melee 

|Declare Variables 
   /declare EnrageVar bool outer FALSE 
   /declare IsPuller bool outer FALSE 

|Timers 
   /declare InCiteTimer timer outer 

|Load settings 
   /call LoadSetting Aggressive bool Combat BeAggressive 0 
   /call LoadSetting AutoBehind bool Combat AutoBehind 0 
   /call LoadSetting DoMelee bool Combat DoMelee 0 
   /call LoadSetting CampRadius int Combat CampRadius 100 
   /call LoadSetting AutoEngage bool Combat AutoEngage 0 
   /call LoadSetting DoArchery bool Combat DoArchery 0 
   /call LoadSetting DoBackstab bool Combat DoBackstab 0 
   /call LoadSetting DoBash bool Combat DoBash 0 
   /call LoadSetting DoDisarm bool Combat DoDisarm 0 
   /call LoadSetting DoEvade bool Combat DoEvade 0 
   /call LoadSetting DoFrenzy bool Combat DoFrenzy 0 
   /call LoadSetting DoFlyingKick bool Combat DoFlyingKick 0 
   /call LoadSetting DoIncite bool Combat DoIncite 0 
   /call LoadSetting DoKick bool Combat DoKick 0 
   /call LoadSetting DoSlam bool Combat DoSlam 0 
   /call LoadSetting DoTaunt bool Combat DoTaunt 0 
/return 

Sub CombatMain 
   /call Combatcheck 
   /if (!${CombatTargetID}) /return 
   /if (${DoMelee}) { 
      /call RangeSub 
      /if (!${Me.Combat}) /attack on 
   } 
   /call MeleeAbility 
/return 

||||Do Subs 
Sub Do-attack 
   /call StandardTarget "${CommandParam}" 
   /if (${Target.Type.NotEqual[NPC]}) { 
      /varset CombatTargetID 0 
      /return 
   } 
   /varset CombatTargetID ${Target.ID} 
   /if (!${Me.Standing}) /stand 
   /call ChatOut 5 ${MasterName} "Attacking ${Target.CleanName}." 
/return 

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-disc 
   /if (!${Defined[Param0]}) /return 
     /disc ${Param0} 
/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 
   /squelch /face fast 
:noneed 
/keypress FORWARD 
/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-melee 
   /varset CommandParam ${CommandParam.Lower} 
   /if (${CommandParam.Equal[true]} || ${CommandParam.Equal[on]} || ${CommandParam.Equal[1]} || ${CommandParam.Equal[yes]}) { 
      /if (!${DoMelee}) { 
         /varset DoMelee 1 
         /assist on 
      } 
   } else /if (${CommandParam.Equal[false]} || ${CommandParam.Equal[off]} || ${CommandParam.Equal[0]} || ${CommandParam.Equal[no]}) { 
      /if (${DoMelee}) { 
         /varset DoMelee 0 
         /assist off 
      } 
   } 
   /if (${DoMelee}) { 
      /call ChatOut 5 ${MasterName} "I will close and do melee when in combat." 
   } else { 
      /call ChatOut 5 ${MasterName} "I will not close to do melee when in combat." 
   } 
/return 

Sub Do-noattack 
   /varset CombatTargetID 0 
/return 

Sub Do-shield 
   /if ( !${Defined[Param0]} || ${Param0.Equal[me]}) { 
      /shield ${MasterName} 
   } else { 
      /shield ${CommandParam} 
   } 
/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 

||||| Called Subs 

Sub bsclock 
   /if (!${Target.ID}) /return 
   /if (!${Me.Standing}) { 
      /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) { 
      /squelch /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 
   } 
   /squelch /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 
   /squelch /face fast 
/return 

Sub bscounter 
   /if (!${Target.ID}) /return 
   /if (!${Me.Standing}) { 
      /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) { 
      /squelch /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 
   } 
   /squelch /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 
   /squelch /face fast 
/return 

| Assumes that CombatTargetID!=1 and Aggressive==1 check is made before calling 

Sub CheckAggressive(string AggroText) 
   /declare MobName string local ${AggroText.Left[-${AggroText.Arg[${Math.Calc[${AggroText.Count[ ]}+1]}].Length}]} 
   /if (${AggroText.Find[say]} || ${AggroText.Find[group]} || ${AggroText.Find[out of character]} || ${AggroText.Find[shout]} || ${AggroText.Find[guild]}) /return 
   /call Target "npc ${MobName}" 
   /if (${Target.Type.Equal[NPC]}) { 
      /call ChatOut 5 ${MasterName} "I am being attacked by ${Target.CleanName}." 
      /varset CombatTargetID ${Target.ID} 
   } 
/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]}) { 
      /varset CombatTargetID 0 
      /varset AggTemp ${Aggressive} 
      /varset Aggressive 0 
      /call MoveToAnchor 
      /varset Aggressive ${AggTemp} 
    } 
/return 

|Combatcheck 
|Used to check if attack is on and should not be. 
|Usage /call Combatcheck. 
Sub Combatcheck 
   /if (!${Spawn[id ${CombatTargetID}].Type.Equal[npc]}) { 
      /varset CombatTargetID 0 
      /attack off 
      /return 
   } 
   /if (!${Spawn[npc id ${CombatTargetID}].Distance}>${CampRadius}) { 
      /call ChatOut 5 ${MasterName} "Combat Target is out of range!" 
      /varset CombatTargetID 0 
      /attack off 
      /call ChatOut 9 ${MasterName} "Combat range is controlled by your .ini file.  Your current setting is CampRadius=${CampRadius}.  You may want to increase this value." 
      /return 
   } 
   /if (${CastStep}) /return 
   /if (${Target.ID}!=${CombatTargetID}) /call Target "npc id ${CombatTargetID}" 
   /if (${EnrageVar}) /return 
   /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 

| IsAggroed
| Used for checking if an NPC is attacking.someone.  Default is master
|Usage /call MeleeAbility "id of pc to check"
Sub IsAggroed
   /declare MobHeading int local 
   /declare MeHeading int local 
   /declare MiniIterate int local 
   /declare AggroFlag int local 
   /declare AggroID int local 
   /declare PCID int local 
   /if (!${Defined[Param0]}) {
      /varset PCID ${Spawn[${MasterName}].ID}
   } else {
      /varset PCID ${Param0}
   }
   /varset MiniIterate 1 
   /varset AggroFlag 0 
   /varset AggroID 0 
   :CheckNext 
   /varset AggroID ${Spawn[${PCID}].NearestSpawn[${MiniIterate},npc radius ${SitAggroRadiusCheck} zradius 10].ID} 
   /if (${AggroID}>0 && ${Spawn[${AggroID}]) { 
      /varset MobHeading ${Spawn[${AggroID}].Heading.Degrees} 
      /if (${Math.Abs[${Math.Calc[${Spawn[${AggroID}].HeadingTo.Degrees}+180]}]}>=359.99) { 
          /varset MeHeading ${Math.Calc[(${Spawn[${AggroID}].HeadingTo.Degrees}-180)+360]} 
      } else { 
          /varset MeHeading ${Math.Calc[(${Spawn[${AggroID}].HeadingTo.Degrees}+180)+360]} 
      } 
      /if ((${Math.Calc[${MobHeading}+360]}>${Math.Calc[${MeHeading}-15]})&&(${Math.Calc[${MobHeading}+360]}<${Math.Calc[${MeHeading}+15]})) { 
         /return ${Spawn[${AggroID}].ID}
      } 
   }
   /varset MiniIterate ${Math.Calc[${MiniIterate}+1]} 
   /goto :CheckNext 
/return 0


|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}) { 
         /squelch /face fast 
         /doability "Slam" 
      } 
      /if (${DoBash}) { 
         /squelch /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) { 
         /squelch /face fast 
         /doability "Backstab" 
      } 
      /if (${DoFrenzy}) { 
         /squelch /face fast 
         /doability "Frenzy" 
      } 
      /if (${DoKick}) { 
         /squelch /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]}) { 
      /squelch /face fast 
      /doability "Flying Kick" 
   } 
   /if (${DoDisarm} && ${Me.AbilityReady[Disarm]}) { 
      /squelch /face fast 
      /doability "Disarm" 
   } 
   /if (${DoArchery}) { 
      /squelch /face fast 
      /range 
   } 
   /if (${DoIncite} && ${InCiteTimer}<=0) { 
      /squelch /face fast 
      /disc incite 
      /varset InCiteTimer 30s 
   } 
/return 

||||| Events 


Sub Event_ArcheryTooFar 
/return 

Sub Event_Attacking 
   /call CheckPuller 
/return 

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

Sub Event_Enraged 
   /if (${Target.ID}) { 
      /if (${CombatTargetID}) { 
         /varset EnrageVar ${Target.ID} 
         /varset CombatTargetID 0 
      } 
      /varset EnrageVar 1 
   } 
/return 

Sub Event_MobGate 
   /if (${CombatTargetID}) { 
      /varset CombatTargetID 0 
   } 
/return 

Sub Event_Offrage 
   /if (${Target.ID}) { 
      /if (${EnrageVar}) { 
         /varset CombatTargetID ${EnrageVar} 
         /varset EnrageVar 0 
      } 
      /varset EnrageVar 0 
   } 
/return 

Sub Event_UnderAttack(string Line,string Attacker) 
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit} 
   /if (!${CombatTargetID} && ${Aggressive}) /call CheckAggressive "${Attacker}" 
   /call CheckPuller 
   /call ExecCommand EventAttacked 
/return
Last edited by Vexix on Sun Jul 11, 2004 12:36 am, edited 5 times in total.

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

Post by Vexix » Sun Jun 20, 2004 12:04 pm

botspell.inc

Code: Select all


|botspell.inc
|Bot spell module.
|Version 13.1.5
|Date:07/11/2004
|
||**
[botspell]
version=13.1.5
**||
|

#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 CastResist "Your target resisted #*#"
#event CastTooFar "Your target is out of range, get closer!"
#event Collapse "Your gate is too unstable, and collapses."
#event Distracted "You are too distracted to cast a spell now!"
#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 MissedNote "You miss a note, bringing your song to a close!"
#event NoLOS "You cannot see your target."
#event NoMem "You do not seem to have that spell memorized."
#event NoOverWrite "Your spell would not have taken hold on your target."
#event NoTarget "You must first select a target for this spell!"
#event Recovered "You haven't recovered yet..."
#event Recovered "Spell recovery time not yet met."
#event RootOff "Your Immobilize spell has worn off."
#event Sitting "You must be standing to cast a spell."
#event Stunned "You can't cast spells while stunned!"
#event Stunned "You *CANNOT* cast spells, you have been silenced!"

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 buff Do-buff
   /call AddCommand SPELL chainnuke Do-chainnuke
   /call AddCommand SPELL chainstun Do-chainstun
   /call AddCommand SPELL evac Do-evac
   /call AddCommand SPELL loadlist Do-loadlist
   /call AddCommand SPELL mana Do-mana
   /call AddCommand SPELL selfbuff Do-selfbuff
   /call AddCommand SPELL bufflist Do-bufflist
   /call AddCommand SPELL setlompct Do-setlompct
   /call AddCommand SPELL sn Do-sn
   /call AddCommand SPELL snt Do-snt
   /call AddCommand SPELL spellgem Do-spellgem
|/declare Vars
   /declare BuffPtrList string outer
   /declare BuffSelfIconList string outer
   /declare CastInfo string outer
   /declare CastLastResult string outer
   /declare CastName string outer
   /declare CastOldTargetID int outer
   /declare CastQueue string outer
   /declare CastStep int outer
   /declare CastTarget string outer
   /declare CastType string outer
   /declare ChainStunNum int outer
   /declare DoAgain bool outer FALSE
   /declare LastSn string outer NA
   /declare SpellNeedToRemem bool outer 0

|Timers
   /declare CannAATimer timer outer
   /declare ChainStunTime timer outer
   /declare CannTimer timer outer
   /declare CastTimer timer outer
   /declare CTimer timer outer
   /declare LomTimer timer outer
   /declare ST-CheckSelfBuffs timer outer 1
   /declare YaulpTimer timer outer

|Load Settings
   /call LoadSetting BuffSelfList string Spell SelfBuffList "Buffs you wish to maintain on yourself separated with |"
   /call LoadSetting BuffRetryDelay string Spell BuffRetryDelay 5m
   /call LoadSetting CanniSpell string Spell CanniSpell Cannibalize
   /call LoadSetting ChainNuke string Spell ChainNuke "Your Chain Nuke Spells separated with |."
   /call LoadSetting ChainStun string Spell ChainStun "Your Chain Stun Spells separated with |."
   /call LoadSetting DefaultSpellSet string Spell DefaultSpellSet Default
   /call LoadSetting DoBuffs bool Spell DoBuffs 1
   /call LoadSetting DelayBeforeSit string Spell DelayBeforeSit 3s
   /call LoadSetting DoCanni bool Spell DoCanni 0
   /call LoadSetting DoYaulp bool Spell DoYaulp 0
   /call LoadSetting EvacSpell string Spell EvacSpell None
   /call LoadSetting LomMsg string Spell LomMsg "Warning I'm running low on Mana."
   /call LoadSetting RememSpells bool Spell RememSpells 0
   /call LoadSetting ReportLom bool Spell ReportLom 0
   /call LoadSetting SitAfterCast bool Spell SitAfterCast 0
   /call LoadSetting SpellGem int Spell DefaultSpellGem 8
   /call LoadSetting YaulpSpell string Spell YaulpSpell Yaulp


   /if (${BuffSelfList.NotEqual[${BuffSelfList-DefaultValue}]}) {
      /declare ArgNum int local 1
      /for ArgNum 1 to ${Math.Calc[${BuffSelfList.Count[|]}+1]}
         /call RefineCast "${BuffSelfList.Arg[${ArgNum},|]}"
         /varset CommandParam ${Macro.Return}
         /if (${DebugList.Find[spell]}) /echo RefineCast Return ${Macro.Return}
         /if (${CommandParam.NotEqual[0]}) {
            /call CheckForBuffIcon ${Macro.Return.Arg[1,;]} "${Macro.Return.Arg[2,;]}"
            /if (${DebugList.Find[spell]}) /echo CheckForBuffIcon Return ${Macro.Return}
            /if (${Macro.Return}) {
               /call ListAppendElement BuffSelfIconList "${CommandParam}" |
            } else {
               /call AddCast "${CommandParam}" "${Me.Name}" b-0
            }
         }
      /next ArgNum
   }
/return

Sub SpellMain
   /call CastFromQueue
   /if (${DoCanni}) /call CheckCann
   /if (${DoYaulp}) /call CheckYaulp
/return

||||| Do Subs

Sub Do-buff
   /declare BuffName string local
   /declare BuffType string local
   /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}]}) {
         /call Do-SelfBuff "${SpellNameParam}"
         /return
      }
   }
   /call AssignCastTarget "${TargetName}"
   /varset TargetName ${Macro.Return}
   /if (${TargetName.Equal[0]}) {
      /call ChatOut 5 ${MasterName} "I don't understand who to cast that buff on."
      /return
   }
   /if (${DebugList.Find[spell]}) /echo Do-buff "${SpellNameParam}" "${TargetName}"
   /call AddCast "${SpellNameParam}" "${TargetName}" b-0
/return


Sub BuffResult(string BuffType,string BuffCast,string BuffTarget,int Ptr)
   /declare GenFor int local
   /declare BuffSpell int local
   /declare BuffDuration string local 0

   | Find an available pointer for the buff and delete duplicates
   /if (${Ptr}) {
      /call ListDelbyName BuffPtrList ${Ptr} " "
      /goto :gBuffPtrFound
   }
   /for GenFor 1 to ${Math.Calc[${BuffPtrList.Count[ ]}+2]}
      /if (!${String[ ${BuffPtrList} ].Find[ ${GenFor} ]} && !${Ptr}) {
         /varset Ptr ${GenFor}
      }
      /if (${Buff-${BuffPtrList.Arg[${GenFor}]}-Text.Equal[${BuffType};${BuffCast};${BuffTarget}]}) {
         /varset Ptr ${BuffPtrList.Arg[${GenFor}]}
         /call ListDelbyArg BuffPtrList ${GenFor} " "
         /varset ST-BuffRefresh-${Ptr} 0
         /goto :gBuffPtrFound
      }
   /next GenFor
   :gBuffPtrFound
   /if (!${Defined[Buff-${Ptr}-Text]}) /declare Buff-${Ptr}-Text string outer
   /if (!${Defined[Buff-${Ptr}-RetryNum]}) /declare Buff-${Ptr}-RetryNum int outer 0

   /if (${DebugList.Find[spell]}) /echo BuffPtr ${Ptr}

   /if (${CastLastResult.Equal[CAST_Successful]}) {
      /varset Buff-${Ptr}-RetryNum 0
      /if (${Spawn[${BuffTarget}].Name.Equal[${Me.Name}]} || ${BuffTarget.Equal[0]}) {
         /call CheckForBuffIcon ${BuffType} "${BuffCast}"
         /if (${Macro.Return}) {
            /if (!${String[|BuffSelfIconList|].Find[|${BuffType};${BuffCast}|]}) {
               /call ListAppendElement BuffSelfIconList "${BuffType};${BuffCast}" |
            }
            /return
         } else {
         /call ChatOut 8 ${MasterName} "I don't recognize the icon for ${BuffType.Arg[1,-]} ${BuffName}.  Tell me 'timebuff ${BuffType.Arg[1,-]} ${BuffName}' some time when I don't have that buff active, and I'll record the buff and time how long it lasts."
         }
      }
      /if (${String[|${TimedBuffList}].Find[|${BuffSpell};]}) {
         /call ListFindStringArg TimedBuffList "|${BuffSpell};" |
         /varset BuffDuration ${TimedBuffList.Arg[${Macro.Return},|].Arg[2,;]}
         /if (${Spawn[${BuffTarget}].Name.Equal[${Me.Name}]} && ${Me.Buff[${TimedBuffList.Arg[${Macro.Return},|].Arg[3,;]}].ID}) {
            /if (!${String[|${BuffSelfList}|].Find[|${BuffType};${BuffCast}|]}) {
               /call ListAppendElement BuffSelfList "${BuffType};${BuffCast}" |
            }
            /return
         }
      }
      /if (!${BuffDuration}) {
         /if (${BuffType.Arg[1,-].Equal[spell]}) {
            /varset BuffDuration ${Spell[${BuffCast}].Duration.TotalSeconds}s
        } else /if (${BuffType.Arg[1,-].Equal[item]}) {
           /varset BuffDuration ${FindItem[${BuffCast}].Spell.Duration.TotalSeconds}s
        } else /if (${BuffType.Equal[alt]}) {
           /varset BuffDuration ${AltAbility[${BuffCast}].ReuseTime}s
        }
      }
   } else {
      /if (${CastLastResult.Equal[CAST_NoOverWrite]} || ${CastLastResult.Equal[TARGET_NOTEXIST]}) {
         /varset BuffDuration 2m
         /varset Buff-${Ptr}-RetryNum 0
      } else /if (${Buff-${Ptr}-RetryNum}<2) {
         /varcalc Buff-${Ptr}-RetryNum ${Buff-${Ptr}-RetryNum}+1
         /varset BuffDuration 15s
      } else {
         /varset BuffDuration 95s
         /varset Buff-${Ptr}-RetryNum 0
      }
   }
   /if (!${Defined[ST-BuffRefresh-${Ptr}]}) /declare ST-BuffRefresh-${Ptr} timer outer
   /varset ST-BuffRefresh-${Ptr} ${BuffDuration}
   /varcalc ST-BuffRefresh-${Ptr} ${ST-BuffRefresh-${Ptr}}-50
   /if (${DebugList.Find[spell]}) /echo ST-BuffRefresh-${Ptr} ${ST-BuffRefresh-${Ptr}} BuffDuration ${BuffDuration}

   /varset Buff-${Ptr}-Text ${BuffType};${BuffCast};${BuffTarget}
   /call ListAppendElement BuffPtrList ${Ptr} " "
/return

Sub BuffRefresh(int Ptr)
   /call AddCast "${Buff-${Ptr}-Text.Arg[1,;]};${Buff-${Ptr}-Text.Arg[2,;]}" "${Buff-${Ptr}-Text.Arg[3,;]}" b-${Ptr}
/return

Sub Do-SelfBuff
   /if (!${Defined[Param0]}) /return
   /if (${Param0.Equal[off]}) {
      /varset BuffSelfList
      /return
   }
   /if (${DebugList.Find[spell]}) /echo Do-SelfBuff ${CommandParam}
   /call RefineCast "${CommandParam}"
   /if (${Macro.Return.Equal[0]}) /return
   /varset CommandParam ${Macro.Return}
   /if (!${String[|${BuffSelfList}|].Find[|${CommandParam}|]}) {
      /call ListAppendElement BuffSelfList "${CommandParam}" |
   }
/return

sub CheckSelfBuffs
   /declare GenFor int local
   /declare BuffType string local
   /declare BuffName string local
   /declare BuffSpell string local
   /varset ST-CheckSelfBuffs 5s
   /if (${BuffSelfIconList.Length}) {
      /for GenFor 1 to ${Math.Calc[${BuffSelfIconList.Count[|]}+1]}
         /varset BuffType ${BuffSelfIconList.Arg[${GenFor},|].Arg[1,;].Arg[1,-]}
         /varset BuffName ${BuffSelfIconList.Arg[${GenFor},|].Arg[2,;]}
         |/if (${DebugList.Find[spell]}) /echo Sub CheckSelfBuffs BuffSelfIconList ${BuffSelfIconList} BuffType ${BuffType} BuffName ${BuffName}
         /call CheckForBuffIcon ${BuffType} "${BuffName}"
         |/if (${DebugList.Find[spell]}) /echo CheckForBuffIcon Return ${Macro.Return}
         /if (!${Macro.Return}) /call AddCast "${BuffType};${BuffName}" ${Me.Name} b-s
      /next GenFor
   }
/return

Sub CheckForBuffIcon(string BuffType,string BuffCast)
   /declare BuffSpell string local
   /if (${BuffType.Arg[1,-].Equal[spell]}) {
      /varset BuffSpell ${Spell[${BuffCast}].Name}
   } else /if (${BuffType.Arg[1,-].Equal[item]}) {
      /varset BuffSpell ${FindItem[${BuffCast}].Spell.Name}
   } else /if (${BuffType.Equal[alt]}) {
      /varset BuffSpell ${AltAbility[${BuffCast}].Spell.Name}
   }
   /if (${String[|${TimedBuffList}].Find[|${BuffSpell};]}) {
      /call ListFindStringArg TimedBuffList "|${BuffSpell};" |
      /if (${Me.Buff[${TimedBuffList.Arg[${Macro.Return},|].Arg[3,;]}].ID}) {
         /return 1
      } else {
         /return 0
      }
   }
   /if (${Me.Buff[${BuffSpell}].ID}) /return 1
/return 0

Sub Do-bufflist
   /declare GenFor int local
   /call ChatOut 1 ${MasterName} "Buffs I have on myself now:"
   /for GenFor 1 to 15
      /if (${Me.Buff[${GenFor}].ID}) {
         /call ChatOut 1 ${MasterName} "${Me.Buff[${GenFor}].Name} with ${Me.Buff[${GenFor}].Duration.Minutes} minutes ${Me.Buff[${GenFor}].Duration.Seconds} seconds left."
      }
   /next GenFor
   /if (${BuffPtrList.Length}) {
      /call ChatOut 1 ${MasterName} "Buffs I am timing for myself or others:"
      /for GenFor 1 to ${Math.Calc[${BuffPtrList.Count[ ]}+1]}
         /call ChatOut 1 ${MasterName} "${GenFor}. ${Buff-${GenFor}-Text.Arg[1,;]} ${Buff-${GenFor}-Text.Arg[2,;]} for ${Spawn[${Buff-${GenFor}-Text.Arg[3,;]}]} to be cast in ${Math.Calc[${ST-BuffRefresh-${GenFor}}\600].Int} minutes ${Math.Calc[${ST-BuffRefresh-${GenFor}}%600/10].Int} seconds."
      /next GenFor
   } else {
      /call ChatOut 1 ${MasterName} "I am keeping up no other buffs at the moment."
   }
/return


Sub Do-chainnuke
   /declare NukeNum int local 1
   /call StandardTarget "${CommandParam}"
   :ChainNukeLoop
      /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-evac
   /if (${EvacSpell.NotEqual[None]}) /call ChatOut 5 ${MasterName} "Moving to you and casting ${EvacSpell}!"
   /varset CommandParam ${MasterName}
   /call Do-moveto ${MasterName}
   /call Delay 2s
   /if (${EvacSpell.NotEqual[None]}) {
      /if (${DebugList.Find[spell]}) /echo Do-evac "${EvacSpell}" ${Me.Name} heal
      /call AddCast "${EvacSpell}" ${Me.Name} heal
   }
/return

Sub Do-loadlist(string Spellset)
   /if (!${Defined[Spellset]}) /return
   /memspellset ${Spellset}
/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-sn(string newSpell)
   /declare snTarget string local
   /call AssignCastTarget 0
   /varset snTarget ${Macro.Return}
   /if (!${Defined[newSpell]} && ${LastSn.Equal[NA]}) /return
   /if (!${Defined[newSpell]}) /varset CommandParam "${LastSn}"
   /if (${snTarget.Equal[0]}) {
      /return
   }
   /varset LastSn ${CommandParam}
   /if (${DebugList.Find[spell]}) /echo Do-sn "${CommandParam}" "${snTarget}"
   /call AddCast "${CommandParam}" "${snTarget}"
/return

Sub Do-snt
   /if (!${Defined[Param0]}) /return
   /if (${Param0.Equal[on]} && ${LastSn.NotEqual[NA]}) /return
   /declare sntCastText string local ${Param0}
   /declare ParamCount int local 1
   /declare sntTarget string local 0
   /if (${Param0.Equal[on]}) {
      /varset sntCastText ${LastSn}
      /goto :Do-sntTargetStart
   }

   :Do-sntSpellLoop
      /if (${Defined[Param${ParamCount}]}) {
         /if (${Param${ParamCount}.Equal[on]}) /goto :Do-sntTargetStart
         /varset sntCastText ${sntCastText} ${Param${ParamCount}}
         /varcalc ParamCount ${ParamCount}+1
         /goto :Do-sntSpellLoop
      }
   :Do-sntTargetStart
   /varcalc ParamCount ${ParamCount}+1
   /if (${Defined[Param${ParamCount}]}) {
      /varset sntTarget ${Param${ParamCount}}
      /varcalc ParamCount ${ParamCount}+1
      :Do-sntTargetLoop
         /if (${Defined[Param${ParamCount}]}) {
            /varset sntTarget ${sntTarget} ${Param${ParamCount}}
            /varcalc ParamCount ${ParamCount}+1
            /goto :Do-sntTargetLoop
         }
   }
   /if (${sntTarget.Equal[0]}) {
      /if (${CombatTargetID}) {
         /varset sntTarget id ${CombatTargetID}
      } else /if (${Target.ID}) {
         /varset sntTarget ${Target.Type} id ${Target.ID}
      } else {
         /varset sntTarget 0
      }
   } else {
      /call AssignCastTarget "${sntTarget}"
      /varset sntTarget ${Macro.Return}
   }
   /if (${DebugList.Find[spell]}) /echo Do-snt ${sntCastText} ${sntTarget}
   /call AddCast "${sntCastText}" "${sntTarget}"
   /varset LastSn ${sntCastText}
/return

Sub Do-spellgem
   /if (!${Defined[Param0]}) {
      /call ChatOut 3 ${MasterName} "I use 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




|||| Called Subs

Sub AddCast(string AddCastText,string AddCastTarget,string AddCastInfo)
   /declare AddCastType string local
   /if (!${Defined[AddCastTarget]}) /declare AddCastTarget string local ${Target.Name}
   /if (!${Defined[AddCastInfo]}) /declare AddCastInfo string local 0
   /if (!${String[ item spell alt ].Find[ ${AddCastText.Lower.Arg[1,;].Arg[1,-]} ]}) {
      /if (${DebugList.Find[spell]}) /echo AddCastText ${AddCastText}
      /call RefineCast "${AddCastText}"
      /if (${Macro.Return.Equal[0]}) /return
      /varset AddCastText ${Macro.Return}
   }
   /if (${AddCastText.Arg[1,;].Arg[1,-].Equal[spell]}) {
      /if (${String[|pb ae|self|ae pc v2|group v1|].Find[|${Spell[${AddCastText.Arg[2,;]}].TargetType.Lower}|]}) {
         /varset AddCastTarget 0
      }
   } else /if (${AddCastText.Arg[1,;].Arg[1,-].Equal[item]}) {
      /if (${String[|pb ae|self|ae pc v2|group v1|].Find[|${FindItem[${AddCastText.Arg[2,;]}].Spell.TargetType.Lower}|]}) {
         /varset AddCastTarget 0
      }
   }
   /if (!${String[ corpse pc npc pet assist- 0 ].Find[ ${AddCastTarget.Arg[1].Lower} ]}) {
      /call RefineTarget "${AddCastTarget}"
      /varset AddCastTarget ${Macro.Return}
   }
   /if (${DebugList.Find[spell]}) /echo AddCastText ${AddCastText}  AddCastTarget ${AddCastTarget} AddCastInfo ${AddCastInfo}
   /if (!${CastQueue.Find[${AddCastText};${AddCastTarget};${AddCastInfo}]}) {
      /if (!${Defined[AddCastCategory]} || ${AddCastCategory.NotEqual[heal]}) {
         /call ListAppendElement CastQueue "${AddCastText};${AddCastTarget};${AddCastInfo}" |
      } else {
         /call ListPrependElement CastQueue "${AddCastText};${AddCastTarget};${AddCastInfo}" |
      }
   }
   /if (${DebugList.Find[spell]}) /echo CastQueue ${CastQueue}
/return

Sub CastFromQueue
   /declare ArgNum int local 0
   /if (!${CastStep}) {
      /if (!${CastQueue.Length}) /return
      /if (${CastQueue.Find[assist-]}) {
         /call Assist ${MasterName}
         /if (${Target.ID}) {
            /call RefineTarget "${Target.Name}"
            /call StringReplaceAll CastQueue assist- "${Macro.Return}"
         } else {
            /call ChatOut 4 ${MasterName} "Unable to assist you to find a target to cast on."
         }
      }
      :gNextinQueue
      /varcalc ArgNum ${ArgNum}+1
      /if (!${DoBuffs} && ${CastQueue.Arg[${ArgNum},|].Arg[4,;].Arg[1,-].Equal[b]}) /goto :gNextinQueue
      /if (!${CastQueue.Arg[${ArgNum},|].Length}) /return
      /varset CastType ${CastQueue.Arg[${ArgNum},|].Arg[1,;]}
      /varset CastName ${CastQueue.Arg[${ArgNum},|].Arg[2,;]}
      /varset CastTarget ${CastQueue.Arg[${ArgNum},|].Arg[3,;]}
      /varset CastInfo ${CastQueue.Arg[${ArgNum},|].Arg[4,;]}
      /if (${DebugList.Find[spell]}) /echo CastType ${CastType} CastName ${CastName} CastTarget ${CastTarget}
      /varset CastTimer 0
      /varset CastStep 1
      /varset CastOldTargetID 0
   }
   |/if (${DebugList.Find[spell]}) /echo CastType CastName CastStep ${CastType} ${CastName} ${CastStep}
   /if (${CastQueue.Length}) /call Cast
/return

Sub Cast
   /if (${String[ 1 2 3 4 5 6 7 ].Find[ ${CastStep} ]}) {
      |/echo going to sub
      /goto :gCast-${CastStep}
   } else {
      /if (${DebugList.Find[spell]}) /echo CastStep = ${CastStep} -- No corresponding goto found.  Returning.
      /varset CastStep 5
      /return
   }
   | Wait for spell to pop up, stand up, and target correctly.
:gCast-1
   |/if (${DebugList.Find[spell]}) /echo Cast 1 ${CastName}
   /if (${CastTimer}) /return
   /varset CastLastResult CHECKING_Casting
   /if (${Me.Casting.ID}) /return
   /varset CastLastResult CHECKING_Moving
   /if (${CastType.Arg[1,-].Equal[spell]}) {
      /if (${Spell[${CastName}].MyCastTime}>0.1 && ${Me.Moving} && ${Me.Class.Name.NotEqual[Bard]}) {
         /varset CastStep 2
         /return
      }
      /varset CastLastResult CHECKING_SpellMemmed
      /if (!${Me.Gem[${CastName}]}) {
         /varset CastStep 3
         /return
      }
      /varset CastLastResult CHECKING_SpellUp
      /if (!${Me.SpellReady[${CastName}]}) /return
   } else /if (${CastType.Arg[1,-].Equal[item]}) {
      /if (${FindItem[${CastName}].CastTime}>0.1 && ${Me.Moving} && ${Me.Class.Name.NotEqual[Bard]}) {
         /varset CastStep 2
         /return
      }
   }
   /varset CastLastResult CHECKING_Standing
   /if (!${Me.Standing}) {
      /stand
   }
   /if (${SitAfterCast}) /varset SitTimer 1140m
   /varset CastLastResult CHECKING_Target
   | Not accounting for items or alt yet.
   /if (${CastTarget.Equal[0]}) {
      /call ChatOut 5 ${MasterName} "Casting ${CastType.Arg[1,-]} ${CastName}."
      /varset CastTarget 0
   } else {
      /if (!${Spawn[${CastTarget}].ID}) {
         /if (${CastInfo.Arg[1,-].NotEqual[b]} || ${CastInfo.Arg[1,-].Equal[b-0]}) {
            /call ChatOut 3 ${MasterName} "I couldn't find the target: ${CastTarget}"
         }
         /varset CastStep 5
         /varset CastLastResult TARGET_NOTEXIST
         /return
      }
      /if (!${NearestSpawn[${CastTarget} radius ${MaxTargetRange}].ID}) {
         /call ChatOut 3 ${MasterName} "${NearestSpawn[${CastTarget}]} is out of range of ${CastType.Arg[1,-]} ${CastName}."
         /varset CastStep 5
         /varset CastLastResult TARGET_OUTOFRANGE
         /return
      }
      /if (${Target.ID}!=${NearestSpawn[${CastTarget}].ID}) {
         /varset CastOldTargetID ${Target.ID}
         /squelch /target ${CastTarget}
         /delay 2s ${Target.ID}==${NearestSpawn[${CastTarget}].ID}
         /varset CastTimer 5
         /if (${Target.ID}!=${NearestSpawn[${CastTarget}].ID}) {
            /call ChatOut 3 ${MasterName} "Wasn't able to target: ${CastTarget}"
            /varset CastStep 5
            /varset CastLastResult TARGET_CANNOTTARGET
            /return
         }
      }
      /call ChatOut 5 ${MasterName} "Casting ${CastType.Arg[1,-]} ${CastName} on ${Target.CleanName}."
   }

   /if (${CastType.Arg[1,-].Equal[spell]}) {
         /cast "${CastName}"
      } else /if (${CastType.Arg[1,-].Equal[item]}) {
         /cast item "${CastName}"
      } else {
         /alt activate ${AltAbility[${spellName}].ID}
      }
   }

   /varset CastLastResult CAST_StillCasting
   /varset CastStep 4
   /varset CastTimer 0
   /return
   |Stop moving
:gCast-2
   /if (${Me.Moving}) {
      /if (!${CastTimer}) {
         /call ChatOut 3 ${MasterName} "Can't cast since I'm moving."
         /keypress forward
         /keypress back
         /varset CastTimer 8
      }
      /return
   }
   /varcalc CastStep 1
   /varset CastTimer 0
   /return
   | Memorize the spell
:gCast-3
   /if (!${Me.Gem["${CastName}"]}) {
      /if (!${CastTimer}) {
         /varset SpellNeedToRemem 1
         /if (${CastType.Arg[2,-].Length}) {
            /memspell ${CastType.Arg[2,-]} "${CastName}"
            /call ChatOut 6 ${MasterName} "Memorizing spell: ${CastName} in slot ${CastType.Arg[2,-]}."
         } else {
            /memspell ${SpellGem} "${CastName}"
            /call ChatOut 6 ${MasterName} "Memorizing spell: ${CastName} in default slot ${SpellGem}."
         }
         /varset CastTimer 5s
      }
      /return
   }
   /varset CastStep 1
   /varset CastTimer 0
   /return
   | Wait for spell to finish
:gCast-4
   /if (${Me.Casting.ID}) {
      /if (!${Me.Mount.ID} && !${Spawn[${CastTarget} radius ${MaxTargetRange}].ID} && ${CastTarget.NotEqual[0]}) {
         /keypress FORWARD
         /keypress BACK
         /if (!${Me.Ducking}) /keypress DUCK
         /delay 1
         /if (${Me.Ducking}) /keypress DUCK
         /varset CastStep 5
         /call ChatOut 3 ${MasterName} "Interrupted ${CastType.Arg[1,-]}: ${CastName}.  Target ${NearestSpawn[${CastTarget}].CleanName} died, poofed, or came back to life!"
         /varset CastLastResult SPELL_IntentionalInterruption
      }
      /return
   }
   /varcalc CastStep ${CastStep}+1
   /return
   | Wait for cast result
:gCast-5
   /if (${CastTimer.OriginalValue}<>2) {
      /varset CastTimer 2
      /return
   }
   /if (${CastTimer}==0) {
      /varset CastTimer 0
      /varcalc CastStep ${CastStep}+1
   }
   /return
   | Delete old spell as cast and update status to successful unless otherwise.
:gCast-6
   /if (${CastLastResult.Equal[CAST_StillCasting]}) /varset CastLastResult CAST_Successful
   /if (${CastInfo.Arg[1,-].Equal[b]} && ${CastInfo.Arg[2,-].NotEqual[s]}) /call BuffResult ${CastType} "${CastName}" "${CastTarget}" ${CastInfo.Arg[2,-]}
   /if (${CastOldTargetID}) /squelch /target id ${CastOldTargetID} radius ${MaxTargetRange}
   /if (${DebugList.Find[spell]}) /echo CastLastResult ${CastLastResult}
   /if (${RememSpells} && ${SpellNeedToRemem}) {
      /memspellset ${DefaultSpellSet}
      /call ChatOut 6 ${MasterName} "Re-memorizing original spells."
      /varcalc CastStep ${CastStep}+1
      /return
   }
   /call ListDelbyName CastQueue "${CastType};${CastName};${CastTarget};${CastInfo}" |
   /varset CastStep 0
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit}
   /return
   | Wait until spells are rememmed to continue
:gCast-7
   /if (${Window[SpellBookWnd].Open}) /return
   /call ChatOut 6 ${MasterName} "Done memorizing original spells."
   /varset SpellNeedToRemem 0
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit}
   /call ListDelbyName CastQueue "${CastType};${CastName};${CastTarget};${CastInfo}" |
   /varset CastStep 0
/return

Sub AssignCastTarget(string ACTarget)
   /if (!${Defined[ACTarget]} || !${ACTarget.Length} || ${ACTarget.Equal[0]}) {
      /if (${CastStep}==1 || ${Me.Casting.ID}) {
         /return assist-
      } else {
         /call Assist ${MasterName}
         /if (${Target.ID}) {
            /return id ${Target.ID}
         } else {
            /call ChatOut 4 ${MasterName} "Unable to /assist you to find a target to cast on."
            /return 0
         }
      }
   } else /if (${ACTarget.Equal[yourself]} || ${ACTarget.Equal[${Me.CleanName}]}) {
      /return pc ${Me.CleanName}
   } else /if (${ACTarget.Equal[me]} || ${ACTarget.Equal[${MasterName}]}) {
      /return pc ${MasterName}
   }
/return ${ACTarget}

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 && !${CastStep}) {
         /if (${DebugList.Find[spell]}) /echo CheckCann "${CanniSpell}" "${Me.Name}"
         /call AddCast "${CanniSpell}" ${Me.Name} buff
         /varset CannTimer 4s
      }
   }
/return

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

Sub CheckYaulp
   /if (!${Me.Moving} && ${Me.PctMana}<95 && ${YaulpTimer}<=1) {
      /if (${DebugList.Find[spell]}) /echo CheckYaulp "${YaulpSpell}" "${Me.Name}"
      /call AddCast "${YaulpSpell}" ${Me.Name} buff
      /varset YaulpTimer 25s
   }
/return

Sub NextStun
   /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

Sub RefineCast(string RCText)
   /declare RCType string local ${RCText.Arg[1]}
   /declare RCName string local ${RCText.Right[-${RCType.Length}]}
   /if (${String[ gem1 gem2 gem3 gem4 gem5 gem6 gem7 gem8 gem9 ].Find[ ${RCType.Lower} ]}) {
      /varset RCType spell-${RCType.Right[1]}
      /varset RCName ${RCName.Right[-${RCName.Arg[1].Length}]}
   }
   /if (${RCType.Arg[1,-].Equal[spell]}) {
      /if (!${Int[${Me.Book[${RCName}]}]}) {
         /call ChatOut 3 ${MasterName} "Spell: ${RCName} not found in your book."
         /return 0
      }
      /return ${RCType};${Spell[${RCName}]}
   }
   /if (${RCType.Equal[slot]}) {
      /varset RCType item-${RCName.Arg[1]}
      /varset RCName ${RCName.Right[-${RCName.Arg[1].Length}]}
   }
   /if (${RCType.Arg[1,-].Equal[item]}) {
      /if (!${FindItem[${RCName}].InvSlot}) {
         /call ChatOut 3 ${MasterName} "Cannot find item: ${RCText} "
         /return 0
      }
      /return ${RCType};${FindItem[${RCName}]}
   }
   /if (${RCType.Equal[alt]}) {
      /if (!${AltAbility[${RCName}].ID}) {
         /call ChatOut 3 ${MasterName} "Do not understand Alt Ability: ${RCText} "
         /return 0
      }
      /return ${RCType};${AltAbility[${RCName}]}
   }
   /if (!${Me.Book[${RCText}]}) {
      /if (${DebugList.Find[spell]}) /echo Name |${RCText}|
      /call ChatOut 3 ${MasterName} "Spell: ${RCText} not found in your book."
      /return 0
   }
/return spell;${Spell[${RCText}]}

Sub RefineTarget(string RFTarget)
   /if (${RFTarget.Equal[assist-]}) /return assist-
   /if (${NearestSpawn[pc ${RFTarget} radius ${MaxTargetRange}].ID}) {
      /varset RFTarget pc ${NearestSpawn[pc ${RFTarget}].Name}
   } else {
      /varset RFTarget ${NearestSpawn[${RFTarget}].Type} id ${NearestSpawn[${RFTarget}].ID}
   }
/return ${RFTarget}

|||| Events
Sub Event_CastFizzle
   /if (${CastStep}) {
      /varset CastStep 0
      /varset CastLastResult CAST_Fizzled
   }
/return

Sub Event_CastInterrupt
   /if (${CastStep}) {
      /varset CastStep 0
      /varset CastLastResult CAST_Interrupted
   }
/return

Sub Event_CastNoMana
   /if (${CastStep}) {
      /varset CastLastResult CAST_CastNoMana
      /if (${IsPally}) {
         /varset CastLastResult CAST_CastNoMana
         /if (${CastTimer}==0) {
            /call ChatOut 5 "${MasterName} I am OOM!"
            /varset CastTimer 10s
            /return
         }
      }
      /call ChatOut 5 ${MasterName} "OOM. Medding 13 seconds and trying again. "
      /if (!${Me.Sitting} && !${DoMelee}) /sit
      /varset CastTimer 13s
   }
/return

Sub Event_CastResist
   /if (${CastStep}) {
      /varset CastStep 5
      /if (${CastLastResult.Equal[CAST_StillCasting]}) {
         /varset CastLastResult CAST_Resisted
         /call ChatOut 3 ${MasterName} "${Target.CleanName} resisted ${CastType} ${CastName}."
      }
   }
/return

Sub Event_CastTooFar
   /if (${CastStep}) {
      /call ChatOut 3 ${MasterName} "${NearestSpawn[${CastTarget}]} is out of range"
      /varset CastStep 5
      /varset CastLastResult CAST_CastTooFar
   }
/return

Sub Event_Collapse
   /if (${CastStep}) {
      /varset CastStep 0
   }
/return

Sub Event_Distracted
   /if (${CastStep}) {
      /call ChatOut 5 ${MasterName} "I can't cast. I'm too distracted. "
      /varset CastStep 5
      /varset CastLastResult CAST_Distracted
   }
/return

Sub Event_ImmuneRoot
   /if (${CastStep}) {
      /call ChatOut 3 ${MasterName} "Cannot Root or Snare this Target!"
      /varset CastStep 5
      /varset CastLastResult CAST_ImmuneRoot
   }
/return

Sub Event_ImmuneSlow
   /if (${CastStep}) {
      /call ChatOut 3 ${MasterName} "Cannot Slow this Target (Immune)!"
      /varset CastStep 5
      /varset CastLastResult CAST_ImmuneSlow
   }
/return

Sub Event_MissedNote
   /if (${CastStep}) {
      /varset CastStep 0
   }
/return

Sub Event_NoLOS
   /if (${CastStep}) {
      /call ChatOut 3 ${MasterName} "I can't see my target. "
      /varset CastStep 5
      /varset CastLastResult CAST_NoLOS
   }
/return

Sub Event_NoMem
   /if (${CastStep}) {
      /call ChatOut 5 ${MasterName} "That spell is not memed. "
      /varset CastStep 0
      /varset CastLastResult CAST_NoMem
   }
/return

Sub Event_NoOverWrite
   /if (${CastStep}) {
      /call ChatOut 3 ${MasterName} "The spell won't take hold on the target."
      /varset CastStep 5
      /varset CastLastResult CAST_NoOverWrite
   }
/return

Sub Event_NoTarget
   /if (${CastStep}) {
      /call ChatOut 3 ${MasterName} "I don't know what target to cast on. "
      /varset CastStep 5
      /varset CastLastResult CAST_NoTarget
   }
/return

Sub Event_Recovered
      /varset CastStep 0
   /if (${CastStep}) {
      /varset CastLastResult CAST_Recovered
   }
/return

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

Sub Event_Sitting
   /if (${CastStep}) {
      /varset CastStep 0
      /varset CastLastResult CAST_NotStanding
   }
/return

Sub Event_Stunned
   /if (${CastStep}) {
      /call ChatOut 5 ${MasterName} "I'm STUNNED. Waiting a second to try again."
      /varset CastStep 0
      /varset CastTimer 1s
      /varset CastLastResult CAST_Stunned
   }
/return
Last edited by Vexix on Sun Jul 11, 2004 12:38 am, edited 2 times in total.

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

Post by Vexix » Sun Jun 20, 2004 12:04 pm

bothealer.inc

Code: Select all

|bothealer.inc
|Bot healer module.
|Version 13.1.5
|Date:07/11/2004
|
||**
[bothealer]
version=13.1.5
**||

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 heal Do-heal
   /call AddCommand HEALER resetwatch Do-resetwatch
   /call AddCommand HEALER setcasterheal Do-setcasterheal
   /call AddCommand HEALER setcasterhealpct Do-setcasterhealpct
   /call AddCommand HEALER setdefaultheal Do-setdefaultheal
   /call AddCommand HEALER setpatchheal Do-setpatchheal
   /call AddCommand HEALER setpetheal Do-setpetheal
   /call AddCommand HEALER setpethealpct Do-setpethealpct
   /call AddCommand HEALER settankheal Do-settankheal
   /call AddCommand HEALER settankhealpct Do-settankhealpct
   /call AddCommand HEALER watchtarget Do-watchtarget

|declare Vars
   /declare CasterList string outer
   /declare HealTargets[21] int outer 0
   /declare LowHealthCheck int outer 0
   /declare TankList string outer
   /declare WatchTargetCount int outer 0
   /declare WatchTargetIDs[15] int outer 0
   /declare WatchTargets[15] string outer
   /declare WatchWaitCount int outer 0

|Timers
   /declare CastMsgTimer1 timer outer
   /declare CastMsgTimer2 timer outer

|Load Settings
   /call LoadSetting CasterSpell string Healer CasterSpell "Name of heal spell autoheal uses on Non Tanks"
   /call LoadSetting CasterPctHeal int Healer CasterPctHeal 70
   /call LoadSetting DefaultHealSpell string Healer DefaultHealSpell "Name of Default Heal Spell"
   /call LoadSetting HealCasterMsg string Healer HealCasterMsg "Healing %t"
   /call LoadSetting HealPetMsg string Healer HealPetMsg "Healing %t"
   /call LoadSetting HealPets bool Healer HealPets 0
   /call LoadSetting HealTankMsg string Healer HealTankMsg "Big Heal on %t"
   /call LoadSetting DoHeals bool Healer DoHeals 0
   /call LoadSetting IsPally bool Healer IsPally 0
   /call LoadSetting PalGrpPct int Healer PalGrpPct 81
   /call LoadSetting PalHealPct int Healer PalHealPct 81
   /call LoadSetting PallyGroupSpell string Healer PallyGroupSpell "Name of Pally Group Heal Spell"
   /call LoadSetting PallyHealSpell string Healer PallyHealSpell "Name of Pally Heal Spell"
   /call LoadSetting PalHealMsg string Healer PalHealMsg "Healing %t"
   /call LoadSetting PatchHealer bool Healer PatchHealer 1
   /call LoadSetting PatchHealMsg string Healer PatchHealMsg "Patch Healing %t"
   /call LoadSetting PatchSpell string Healer PatchSpell "Name of Patch Heal Spell"
   /call LoadSetting PetPctHeal int Healer PetPctHeal 51
   /call LoadSetting PetSpell string Healer PetSpell "Name of Pet Heal Spell"
   /call LoadSetting ReportAutoHeal bool Healer ReportAutoHeal 1
   /call LoadSetting TankSpell string Healer TankSpell "Name of heal spell autoheal uses on Tanks"
   /call LoadSetting TankPctHeal int Healer TankPctHeal 51

   /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

||||| Do Subs
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-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-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-heal
   /call AssignCastTarget "${CommandParam}"
   /declare HealTarget string local ${Macro.Return}
   |/call ChatOut 3 ${MasterName} "Casting ${DefaultHealSpell} on ${NearestSpawn[${HealTarget}]}."
   /call AddCast "${DefaultHealSpell}" "${HealTarget}" heal
/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-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-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

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-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-watchtarget
   /if (${String[${Param0}].Equal[off]}) {
      /varset WatchTargetCount 0
      /return
   }
   /squelch /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

||||| Called Subs

Sub CastHeal(int TarID,string HealSpell,string castMsg)
   /if (!${CastMsgTimer1}) {
      |/if (${ReportAutoHeal}) /g ${castMsg}
      /varset CastMsgTimer1 50
   }
   /call AddCast "${HealSpell}" "id ${TarID}" "heal"
/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
   /if (!${DoHeals}) /return
   /if (${IsPally}) /return
   /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}) {
         /squelch /target id ${HealTargets[${tempvar}]}
         /delay 5
         /if (${Target.ID}!=${HealTargets[${tempvar}]}) {
            /varcalc BadIDs ${BadIDs}+1
         }
      }
      /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}
            /call CastHeal ${QuickID} "${TankSpell}" "${HealTankMsg}"
         }
      }
      /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}
            /call CastHeal ${QuickID} "${CasterSpell}" "${HealCasterMsg}"
         }
      }
      /if (${HealPets} && ${Spawn[${QuickID}].Class.PetClass} && ${Spawn[${QuickID}].Pet.ID}) {
         /if (${Spawn[${QuickID}].Pet.PctHPs}<${PetPctHeal}) {
            /call CastHeal ${Spawn[${QuickID}].Pet.ID} "${PetSpell}" "${HealPetMsg}"
         }
      }
   /next tempvar
   /if (${CombatTargetID}) /call Target "npc ID ${CombatTargetID}"
   /if (${BadIDs}>0) /call ResetWatchTargets
/return

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

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

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

Sub PallyHeal(int TarID)
   /if (${CombatTargetID}) /return
   /if (${TarID}==${Me.ID}) /target myself
   /if (${TarID}!=${Me.ID}) /squelch /target id ${TarID}
   /g ${PalHealMsg}
   /call AddCast "${PallyHealSpell}" 0 heal
/return

Sub Patchheal(int TarID)
   /if (${CastMsgTimer1}<=0) {
      |/if (${ReportAutoHeal}) /g ${PatchHealMsg}
      /varset CastMsgTimer1 50
   }
   /if (${Me.Gem[${PatchSpell}]}) /call AddCast "${PatchSpell}" "id ${TarID}" "heal"
/return

Sub ResetWatchTargets
   /declare counter int local
   /for counter 1 to ${WatchTargetCount}
      /squelch /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
Last edited by Vexix on Sun Jul 11, 2004 12:39 am, edited 2 times in total.

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

Post by Vexix » Sun Jun 20, 2004 12:05 pm

botshortcut.inc

Code: Select all

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

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 aftercastsit "I will no longer sit after casting." "I will now sit after casting." SitAfterCast FALSE
   /call AddToggle aona "I will Not Attack when Assisting." "I will Attack when Assisting." AttackOnAssist TRUE
   /call AddToggle archery "Archery is set to off." "Archery is set to on." DoArchery TRUE
   /call AddToggle autobehind "I won't position myself behind the mob." "I will position myself behind the mob." AutoBehind FALSE
   /call AddToggle autoengage "I will not engage when attack is on." "I will engage when attack is on." AutoEngage TRUE
   /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 bash "Auto Bash is now off." "Auto Bash is now on." DoBash FALSE
   /call AddToggle backstab "Auto Backstab is now off." "Auto Backstab is now on." DoBackstab FALSE
   /call AddToggle beagg "Aggressive is set to off. " "Aggressive is set to on." Aggressive TRUE
   /call AddToggle bona "I won't move behind on assist." "I will move behind on assist." BehindOnAssist 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 healing "I will not heal anyone unless commanded." "I will watch and cast heal spells as necessary." DoHeals TRUE
   /call AddToggle buffing "I won't cast buffs until commanded." "I will cast buffs." DoBuffs TRUE
   /call AddToggle disarm "Auto Disarm is now off." "Auto Disarm is now on." DoDisarm FALSE
   /call AddToggle evade "Auto Evade is now off." "Auto Evade is now on." DoEvade FALSE
   /call AddToggle flyingkick "Auto FlyingKick is now off." "Auto FlyingKick is now on." DoFlyingKick FALSE
   /call AddToggle frenzy "Auto Frenzy is now off." "Auto Frenzy is now on." DoFrenzy 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 kick "Auto Kick is now off." "Auto Kick is now on." DoKick FALSE
   /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 patchheal "I'm not a patch Healer." "I'm a patch Healer." PatchHealer TRUE
   /call AddToggle petona "I won't send pet in on assist." "I will send pet in on assist." PetOnAssist TRUE
   /call AddToggle puller "I'm not the puller." "I'm the puller." IsPuller TRUE
   /call AddToggle Remem "I won't remem my spellset after casting." "I will remem my spellset after casting." Remem 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 slam "Auto Slam is now off." "Auto Slam is now on." DoSlam FALSE
   /call AddToggle taunt "Auto Taunt is now off." "Auto Taunt is now on." DoTaunt FALSE
   /call AddToggle traps "I will not detect for traps." "I will detect for traps." DoTraps FALSE
   /call AddToggle yaulp "I won't Yaulp for mana." "I will Yaulp for mana." DoYaulp TRUE

   /call AddCommand CORE shortcuts Do-shortcutsinfo

/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
   /if (!${Defined[IniFile]}) /declare IniFile string outer genbot_${Me.CleanName}.ini
   /varset Shortcutlist ${Ini[${IniFile},Shortcuts,-1,Undefined]}
   /if (${Shortcutlist.NotEqual[Undefined]}) {
      :shortcuts
      /if (${Shortcutlist.Arg[${ArgNum},|].Length}) {
         /varset Short ${Shortcutlist.Arg[${ArgNum},|].Lower}
         /call LoadSetting ${Short} shortcut Shortcuts ${Short} None
         /varcalc ArgNum ${ArgNum}+1
         /goto :shortcuts
      }
   } else {
      /ini ${IniFile} Shortcuts default "/echo Put yer shortcuts in your .ini file!"
   }
/return

||||| Do Subs
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


||||| Called Subs

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 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
      }
   }
   /varset newValue ${newValue.Lower}
   /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}
   /if (${ParseText.Find[NameS]} && ${ShortCutCommand.Arg[2].Length}) {
      /vardata CommandParam ParseText
      /call StringReplaceAll CommandParam NameS ${ShortCutCommand.Arg[2]}
      /vardata ParseText CommandParam
   }
   /for si 1 to ${Math.Calc[${ParseText.Count[|]}+1]}
      /call ExecCommand "${ParseText.Arg[${si},|]}"
   /next si
/return
Last edited by Vexix on Sun Jul 11, 2004 1:05 am, edited 3 times in total.

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

Post by Vexix » Sun Jun 20, 2004 12:08 pm

personal.inc

Code: Select all

|personal.inc 
|Personal commands module example. 
|Version 13.1.0
|Date:06/21/2004
| 
||** 
[personal] 
version=13.1.0
**|| 
|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 VarType 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 » Sun Jun 20, 2004 12:09 pm

This space left intentionally blank.

Rassilon
a lesser mummy
a lesser mummy
Posts: 73
Joined: Thu Sep 04, 2003 6:34 pm

Post by Rassilon » Sun Jun 20, 2004 11:45 pm

I'm using the latest MQ and this genbot and on my cleric I tried using the /varset assist so it scans the mobs and heals the ppl it is attacking like I have before but it isn't working and shuts down the macro.

Has anyone else got the normal healing to heal for group members?

Thanks

Daeas
a lesser mummy
a lesser mummy
Posts: 32
Joined: Fri May 07, 2004 1:45 pm

Post by Daeas » Mon Jun 21, 2004 2:49 pm

I to have had couple things happen.

I am sorry for not knowing how to log my MQ window or i would be able to post the error messages for the macro.

I have had issues with the auto-follow command where the bot toons will go flying off in a different direction when the macro fail/stops.

I have also been unable to use the auto heal feature that I was used to with genbot. I tested it under 2 seperate occurances where it would not scan through the group and heal various members with the low hp.

Daeas
a lesser mummy
a lesser mummy
Posts: 32
Joined: Fri May 07, 2004 1:45 pm

Post by Daeas » Mon Jun 21, 2004 3:00 pm

ok i found out how to log the errors from mq to a txt file in my logs. As soon as I get home I will load it up and try and log the error message from the follow command.

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

Post by Vexix » Mon Jun 21, 2004 7:07 pm

As mentioned above, the IsHealer setting in the .ini file has been changed to DoHeals. If you don't have this on, your char won't do heals.

--Vexix

Daeas
a lesser mummy
a lesser mummy
Posts: 32
Joined: Fri May 07, 2004 1:45 pm

Post by Daeas » Mon Jun 21, 2004 7:12 pm

Thanks V... sometimes the obvious escapes me =X

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

Post by Vexix » Mon Jun 21, 2004 9:25 pm

No worries. I pushed that change a bit higher in the change log and highlighted it. Gotta make stuff like that stand out. ;)

--Vexix