Genbot Version 12 MQ2Data Ready

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

Moderator: MacroQuest Developers

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

Genbot Version 12 MQ2Data Ready

Post by LordGiddion » Sat Apr 24, 2004 11:24 pm

Current File Versions:
Genbot.mac 12.10
BotCore.inc 12.10
BotCombat.inc 12.10
BotSpell.inc 12.10
BotHealer.inc 12.10
ShortCuts.inc 12.10
Personal.inc 12.10
GenbotDoc 12.10

Update 04/28/2004 10:00 pm
WARNING WARNING WARNING - NOT BUG TESTED - haven't tested much because of the state of MQ2 but it posted for you
WARNING You'll need to update advPath to 1.24 to use it's functions
WARNING This version is ready for MQ2DataVars make sure you enable MQ2DataVars in your source and re-compile
Lots of bug fixes from the Forums
increased support for advPath function, will be adding more advPath Commands in future updates
Updated to MQ2DataVars
Anchor now end follow, follow now clears anchor
Only 1 Follow command now - see docs on FollowMode
Bot will now respond to it's own echo's as commands
INI entry for DelayBeforeSit is now in [Spell] - sorry makes more sense there
Add New Toggle Checkname (and ini support) - if it's true bot will only respond to commands in group or chat if the command is preceeded with <botname>

Update 04/25/2004 8:00 pm
Fixed the typo is loot function - thnx bob_the_builder
Fixed Some Heal Code - thnx fez_ajer
Please make sure your MQ2 Source is up to date, in trying to make this macro as clean as possible I'm using new features about as fast a Lax adds em.
Added "Main" routines to each Include and moved Calls from genbot to each inc. I plan to clean up code so that in the future you don't need to #include healer, personal, comabt or spell Include if not appropriate for the current toon.
Added command SpellGem This sets the Spell gem that the bot will use when required to memorize a new spell.

Update 4/25/04 10:45 AM
Fixed the timing on re-buffing
Fixed Afollow targeting Pet

Update 4/25 9:00 am
Fixed a typo in the Canni routine thx-HealBot

Update 4/25 8:30 am
Mount Command fixed thx - Fuergrissa
INI Build and Reseting of defaults fixed - xander & Spanky_Monkey
Fixed some bugs in SNT and Buff
Fixed bug with Canniblize thx - healbot
Took out some left over echo's

Update 4/24/04:
Ok posting this now even though I didn't finish all the changes I wanted to do (see future changes) but I added/changed a lot of stuff and I think it's ready to go.

I've tested this pretty well so I can say the casting functions, the attack functions, group and target autoheal all seem to function correctly. I'll be doing more testing throughout the week but too tired to do any more tonight.

Because of how much I changed in this update I would recommend deleteing your genbot_Charname.ini files and letting Genbot rebuild them from scratch.

Added a first pass at official documentation, I tell you we all added a ton of commands to this thing.

Smaller code:
There were chunks of redundant code in the macro that I tightend up by adding some new functions.

Replaced Fire, Lure, Root, Stick, Invis, Lev, Mask, BP, Cloak, Patch, Ear, Thorn, Nuke, Ice, Snare, Buff, GroupBuff, PetBuff, Regen, Hot, Wood, Cure, Slow, Debuff, Cobalt, DCharm, Stuna, DDStuna, DDStunb, MezLow, MezHigh, Mezae, Stunb, and Sepic commands with 8 new sections of the InI detailed bellow (this will be powered by a new .inc shorcuts.inc). These new sections will allow for more customization without losing function.
Example:

Code: Select all

[shortcut spells] 
Nuke=draught of jiva 
Sow=Spirt of wolf 
PLBuff=Resolution|Shield of words 
[shortcut Items] 
Sepic=spear of fate 
[shortcut notarget Spells] 
ITU=Invisibility to undead 
[shortcut notarget items] 
Levi=Pegasus cloak
[shortcut AA]
[shortcut noTarget AA]
[Shortcut Disc]
[shortcut noTarget Disc] 
Using this example this INI would add the command Nuke to this bot and when the bot gets the “nuke” command the bot will cast “draught of jiva” with the same targeting options as the old nuke, ice and etc commands. PLBUFF will cast the spells Resolution and Shield of words on the target(you can add as many spells as you want to any chain seperated by "|"). Sepic would use the item spear of fate with the same casting options as the other spells. ITU would cause the bot to cast the spell “Invisibility to undead” without changing target. Levi would cause the bot to use the item “Pegasus cloak” without changing target.

New commands:
Setvar - for debugging or just general bot function this will change the value of a global variable to the command arguments

Rptvar - Will cause the bot to chatout the value of the requested global variable

Buff - Will cause the bot to cast the specified buff on the selected target, Bot will then remember the target,spell and duration of the buff. Before the buff expires the bot will attempt to refresh the buff on the target i.e. /tell Shamanbot buff Spirt of wolf on monkguy

SetCasterHealPct - Sets the threshold that autoheal uses to heal casters

SetTankHealPct - Sets the threshold that autoheal uses to heal tanks

SetPetHealPct - Sets the threshold that autoheal uses to heal pets

command enhancements:
snt & Sn – changed so that snt & Sn will remember the last spell cast with snt or sn so that on second and subsequent casts of the same spell you don’t need to type out the spells again i.e. /tell shamanbot snt spirt of wolf on rannewbie1 /tell shamanbot snt on rannewbie2

Natural language support
How commands in each file will be modified slightly, the current commands and functions that you are used to will remain as the defaults but you will have the option to change the command sent to the bot without changing the function of the command.
Example:

Code: Select all

/varset botcore-array(1,0) afk 
/varset botcore-array(2,0) Do-afk 
/varset botcore-array(1,1) accept 
/varset botcore-array(2,1) Do-accept 
/varset botcore-array(1,2) reject 
/varset botcore-array(2,2) Do-reject 
in this example if you change the first line to

Code: Select all

/varset botcore-array(1,0) goaway 
then /tell Bot goaway I’m watching TV – will cause the bot to set it’s afk message to “I’m watching TV”

Function Changes:
Removed Hot support from autoheal - I'll be adding this back later but it was buggy at best and could result in the heals being skiped or spaming the heals if you had multiple casters in need of heals.
Singing removed from personal.inc but I am looking at adding some twisting functions to the macro

Door, mount, dismount, random, exp & Autoinv are no longer in personal.inc and are now part of BotCore
AutoBehind, incite, disc, hide, sneak & Shield Functions/Commands moved to BotCombat

setlompct, Canni and Yaulp Functions/Commands no longer in personal.inc and now part of BotSpell

Temp. removed Chain stun

FYI Personal.inc in my release is stripped back down to a stub I expect it to stay this way, I will not post my personal.inc and I ask that other people don't post theirs in this thread. If you must post your personal.inc please post it in a different theard (maybe in the snippetes forum) and provide support for it there.


ToDo:
Finish ChainStun and ChainNuke
Fix HOT Healing Spells
Add Twisting Support
Add function in the IRC Pluging support so that commands can go to specific Bots (without effecting other Chat methods)
Add a function to save current state back into INI, for any values that have been changed during play.
Last edited by LordGiddion on Wed Apr 28, 2004 9:16 pm, edited 6 times in total.

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

Post by LordGiddion » Sat Apr 24, 2004 11:25 pm

Genbot.mac

Code: Select all

|genbot.mac 
|Generic bot macro for any class. 
|Version 12.10
|Date:04/28/2004 9:00 pm
| 
||** 
[genbot] 
version=12.10
**||
| 

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

Sub Main 
   /if (!${Defined[Param0]}) { 
      /echo Usage: /macro generic <Master Name1> <Master Name2>... 
      /endmacro 
   } 
   |setup ini File Reference
   /declare IniFile string Outer genbot_${Me.CleanName}.ini
   |Initialize variables in each include
   /call SetupCoreVars  
   /call SetupSpellVars 
   /call SetupCombatVars 
   /call SetupHealerVars 
   /call SetupPersonalVars 
	|Determine master(s)
	/declare MasterList string outer |
	/declare MasterCount int local
   /for MasterCount 0 to ${Macro.Params}
   	/varset MasterList ${MasterList}${Param${MasterCount}}|
   /next MasterCount
   /echo ${MasterList} 
   /endmacro
   
|||This is where the commands the bot can take are set up 
   /call CoreCommands 
   /call SpellCommands 
   /call CombatCommands 
   /call HealerCommands 
   /call ToggleCommands
   /call BuildShortCuts
   /call PersonalCommands 
   :MainLoop 
   /doevents 
   |Fire tasks in each Include
   /call CoreMain
   /call HealerMain
   /call SpellMain
   /call CombatMain  
   /call PersonalMain 
   /call AdvPathPoll 
   /goto :MainLoop 
/return 

Last edited by LordGiddion on Wed Apr 28, 2004 9:17 pm, edited 2 times in total.

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

Post by LordGiddion » Sat Apr 24, 2004 11:26 pm

BotCore.inc:

Code: Select all

|botcore.inc 
|Bot core module. 
|Version 12.10
|Date:04/28/2004 9:00 pm
| 
||** 
[botcore] 
version=12.10
**||
| 
#chat group 
#chat tell 
#chat chat 

#Event CorpseTooFar "You are too far away to loot that corpse." 
#event FollowOff "You are no longer auto-following" 
#Event Zoned "LOADING, PLEASE WAIT..." 
#Event Appear "You appear." 
#Event Appearing "You feel yourself starting to appear." 
#Event LosingLev "You feel as if you are about to fall" 
#Event SelfEcho "[MQ2] "

Sub CoreCommands 
	/declare BotCoreArray[2][52] string outer
	|For each command
	|1,x Command Phrase to trigger bot - End User change change to suit prefferences
	|2,x Sub Routine to execute in response to command  
   /varset botcorearray(1,1) accept 
   /varset botcorearray(2,1) Do-accept 
   /varset botcorearray(1,2) reject 
   /varset botcorearray(2,2) Do-reject
   /varset botcorearray(1,3) invite 
   /varset botcorearray(2,3) Do-invite 
   /varset botcorearray(1,4) follow 
   /varset botcorearray(2,4) Do-follow 
   /varset botcorearray(1,5) stop 
   /varset botcorearray(2,5) Do-stop
   /varset botcorearray(1,6) moveto 
   /varset botcorearray(2,6) Do-moveto 
   /varset botcorearray(1,7) sit 
   /varset botcorearray(2,7) Do-sit
   /varset botcorearray(1,8) stand 
   /varset botcorearray(2,8) Do-stand 
   /varset botcorearray(1,9) camp 
   /varset botcorearray(2,9) Do-camp 
   /varset botcorearray(1,10) duck 
   /varset botcorearray(2,10) Do-duck 
   /varset botcorearray(1,11) norelay 
   /varset botcorearray(2,11) Do-norelay 
   /varset botcorearray(1,12) say 
   /varset botcorearray(2,12) Do-say 
   /varset botcorearray(1,13) tell 
   /varset botcorearray(2,13) Do-tell 
   /varset botcorearray(1,14) group 
   /varset botcorearray(2,14) Do-group 
   /varset botcorearray(1,15) cmds 
   /varset botcorearray(2,15) Do-cmds
   /varset botcorearray(1,16) target 
   /varset botcorearray(2,16) Do-target
   /varset botcorearray(1,17) notarget 
   /varset botcorearray(2,17) Do-notarget
   /varset botcorearray(1,18) assist 
   /varset botcorearray(2,18) Do-assist 
   /varset botcorearray(1,19) saytarget 
   /varset botcorearray(2,19) Do-saytarget
   /varset botcorearray(1,20) itemcast
   /varset botcorearray(2,20) Do-itemcast 
   /varset botcorearray(1,21) lootup
   /varset botcorearray(2,21) Do-lootup 
   /varset botcorearray(1,22) anchor 
   /varset botcorearray(2,22) Do-anchor
   /varset botcorearray(1,23) trade 
   /varset botcorearray(2,23) Do-trade 
   /varset botcorearray(1,24) yesres 
   /varset botcorearray(2,24) Do-yes 
   /varset botcorearray(1,25) consent 
   /varset botcorearray(2,25) Do-consent
   /varset botcorearray(1,26) reportbuffs 
   /varset botcorearray(2,26) Do-reportbuffs 
   /varset botcorearray(1,27) petattack 
   /varset botcorearray(2,27) Do-petattack 
   /varset botcorearray(1,28) petguard 
   /varset botcorearray(2,28) Do-petguard
   /varset botcorearray(1,29) petback 
   /varset botcorearray(2,29) Do-petback
   /varset botcorearray(1,30) relay 
   /varset botcorearray(2,30) Do-relay 
   /varset botcorearray(1,31) run 
   /varset botcorearray(2,31) Do-run 
   /varset botcorearray(1,32) door 
   /varset botcorearray(2,32) Do-door 
   /varset botcorearray(1,33) verbosity 
   /varset botcorearray(2,33) Do-verbosity
   /varset botcorearray(1,34) chatin 
   /varset botcorearray(2,34) Do-chatin
   /varset botcorearray(1,35) lootall 
   /varset botcorearray(2,35) Do-lootall
   /varset botcorearray(1,36) face 
   /varset botcorearray(2,36) Do-face 
   /varset botcorearray(1,37) autoinv 
   /varset botcorearray(2,37) Do-autoinv 
   /varset botcorearray(1,38) anchorradius 
   /varset botcorearray(2,38) Do-anchorradius
   /varset botcorearray(1,39) rmod 
   /varset botcorearray(2,39) Do-rmod 
   /varset botcorearray(1,40) rset 
   /varset botcorearray(2,40) Do-rset 
   /varset botcorearray(1,41) stay 
   /varset botcorearray(2,41) Do-stay
   /varset botcorearray(1,42) pause 
   /varset botcorearray(2,42) Do-pause
   /varset botcorearray(1,43) reload 
   /varset botcorearray(2,43) Do-reload
   /varset botcorearray(1,44) mount
   /varset botcorearray(2,44) Do-mount
   /varset botcorearray(1,45) dismount
   /varset botcorearray(2,45) Do-dismount
   /varset botcorearray(1,46) random
   /varset botcorearray(2,46) Do-random
   /varset botcorearray(1,47) exp
   /varset botcorearray(2,47) Do-exp
   /varset botcorearray(1,48) Setvar
   /varset botcorearray(2,48) Do-Setvar
   /varset botcorearray(1,49) Rptvar
   /varset botcorearray(2,49) Do-Rptvar
   /varset botcorearray(1,50) afk 
   /varset botcorearray(2,50) Do-afk
	/varset botcorearray(1,51) FollowMode 
   /varset botcorearray(2,51) Do-FollowMode
   /varset botcorearray(1,52) MoveToMode 
   /varset botcorearray(2,52) Do-MoveToMode
/return 

Sub TellCmds-core 
   /declare counter int local 0
   /declare cmds local 
   /for counter 0 to ${botcorearray.Size[2]}
      /varset cmds ${cmds}${botcorearray(1,${counter})}, 
   /next counter 
   /call ChatOut 2 ${MasterName} "${cmds}" 
/return 

Sub SetupCoreVars  
   /declare AnchorX int outer 0
   /declare AnchorY int outer 0
   /declare IsAnchored bool outer FALSE
   /declare LootTooFar int outer 0
   /declare MasterName string outer ${MasterList.Arg[1,|]}
   /declare MyLastXLoc int outer 0
   /declare MyLastYLoc int outer 0
   /declare ObstacleCheck int outer 0
   /declare RangeMin int outer 10
   /declare RangeMax int outer 12
   /declare FastRange int outer 14
   /declare FastMin int outer 6
   /declare FollowTarget string outer 
   /declare Afollow int outer 0
   /declare FollowMode int outer 1
   /declare MoveToMode int outer 1
   /declare CheckName bool outer FALSE
   /declare Relaytells bool outer TRUE
   /declare BreakOut bool outer FALSE
   /declare Combatstatus bool outer FALSE
   /declare ListenGroup bool outer FALSE
   /declare ListenChat bool outer FALSE
   /declare AttackOnAssist bool outer FALSE
   /declare BehindOnAssist bool outer FALSE
   /declare PetOnAssist bool outer FALSE
   /declare Verbosity int outer 9
   /declare ChatIn string outer Tell
   /declare ChatInChannel int outer 
   /declare IgnGroupList string outer 
   /declare ListenChan string outer 
   /declare AnchorRadius int outer 10
   /declare Supportstatus bool outer
   /declare CurrCommand string outer 
   /declare CommandParam string outer
   /declare advpath bool outer 
   /declare MountItem string outer
   
|Timers 
   /declare SitTimer timer 

   /varset RangeMin ${Ini[${IniFile},Core,RangeMin,99999]}
   /if (${RangeMin}==99999) { 
      /ini ${IniFile} Core RangeMin 10 
      /varset RangeMin 10
   } 
   /varset RangeMax ${Ini[${IniFile},Core,RangeMax,99999]}
   /if (${RangeMax}==99999) { 
      /ini ${IniFile} Core RangeMax 12 
      /varset RangeMax 12 
   } 
   /varset FastRange ${Ini[${IniFile},Core,FastRange,99999]} 
   /if (${FastRange}==99999) { 
      /ini ${IniFile} Core FastRange 14 
      /varset FastRange 14 
   } 
   /varset FastMin ${Ini[${IniFile},Core,FastMin,99999]}
   /if (${FastMin}==99999) { 
      /ini ${IniFile} Core FastMin 6 
      /varset FastMin 6 
   } 
   /varset Relaytells ${Ini[${IniFile},Core,Relaytells,1]}
   /if (${Relaytells}==1) { 
      /ini ${IniFile} Core Relaytells 1 
      /varset Relaytells 1 
   } 
   /varset ListenGroup ${Ini[${IniFile},Core,ListenGroup,1]} 
   /if (${ListenGroup}==1) { 
      /ini ${IniFile} Core ListenGroup 1 
      /varset ListenGroup 1 
   } 
   /varset ListenChat ${Ini[${IniFile},Core,ListenChat,0]}
   /if (${ListenChat}==0) { 
      /ini ${IniFile} Core ListenChat 0 
      /varset ListenChat 0 
   } 
   /varset ListenChan ${Ini[${IniFile},Core,ListenChan,NotFound]}
   /if (${ListenChan.Equal[NotFound]}) { 
      /ini ${IniFile} Core ListenChan "Listen channel" 
      /varset ListenChan "Listen channel" 
   } 
   /varset AttackOnAssist ${Ini[${IniFile},Core,AttackOnAssist,0]}
   /if (${AttackOnAssist}==0) { 
      /ini ${IniFile} Core AttackOnAssist 0 
      /varset AttackOnAssist 0 
   } 
   /varset BehindOnAssist ${Ini[${IniFile},Core,BehindOnAssist,0]}
   /if (${BehindOnAssist}==0) {  
      /ini ${IniFile} Core BehindOnAssist 0 
      /varset BehindOnAssist 0 
   } 
   /varset PetOnAssist ${Ini[${IniFile},Core,PetOnAssist,0]}
   /if (${PetOnAssist}==0) { 
      /ini ${IniFile} Core PetOnAssist 0 
      /varset PetOnAssist 0 
   } 
   /varset Verbosity ${Ini[${IniFile},Core,Verbosity,99999]}
   /if (${Verbosity}==99999) { 
      /ini ${IniFile} Core Verbosity 9 
      /varset Verbosity 9 
   } 
   /varset ChatIn ${Ini[${IniFile},Core,ChatIn,NotFound]}
   /if (${ChatIn.Equal[NotFound]}) {  
      /ini ${IniFile} Core ChatIn Tell
      /varset ChatIn Tell 
   } 
   /varset ChatInChannel ${Ini[${IniFile},Core,ChatInChannel,0]}
   /if (${ChatInChannel}=0) { 
      /ini ${IniFile} Core ChatInChannel 0
      /varset ChatInChannel 0
   } 
   /varset MountItem ${Ini[${IniFile},Core,MountItem,NotFound]}
   /if (${MountItem.Equal[NotFound]}) {  
      /ini ${IniFile} Core MountItem "Name of Bridle or Drum" 
      /varset MountItem "Name of Bridle or Drum" 
   }
   /varset AnchorRadius ${Ini[${IniFile},Core,AnchorRadius,99999]} 
   /if (${AnchorRadius}==99999) { 
      /ini ${IniFile} Core AnchorRadius 6 
      /varset AnchorRadius 6 
   } 
   /varset IgnGroupList ${Ini[${IniFile},Core,IgnoreInGroup,NotFound]}
   /if (${IgnGroupList.Equal[NotFound]}) { 
      /ini ${IniFile} Core IgnoreInGroup "duck|say|tell|group|cmds|trade|run|backstab|taunt|evade|slam|bash|kick|flyingkick|disarm|traps|puller||" 
      /varset IgnGroupList "duck|say|tell|group|cmds|trade|run|backstab|taunt|evade|slam|bash|kick|flyingkick|disarm|traps|puller||" 
   } 
   /varset FollowMode ${Ini[${IniFile},Core,FollowMode,1]} 
   /if (${FollowMode}==1) { 
      /ini ${IniFile} Core FollowMode 1
      /varset FollowMode 1
   } 
   /varset MoveToMode ${Ini[${IniFile},Core,MoveToMode,1]} 
   /if (${MoveToMode}==1) { 
      /ini ${IniFile} Core MoveToMode 1
      /varset MoveToMode 1
   }
   /varset CheckName ${Ini[${IniFile},Core,CheckName,0]} 
   /if (${CheckName}==0) { 
      /ini ${IniFile} Core CheckName 0
      /varset CheckName FLASE
   }
   /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) { 
	      /declare FaceFastini int local 
	      /varset FaceFastini ${Ini[${IniFile},advpath,FaceFast,99999]} 
	      /if (${FaceFastini}==99999) { 
	         /ini ${IniFile} advpath FaceFast 1 
	         /varset FaceFastini 1 
      	} 
	      /declare SpeedSenseini int local 
	      /varset SpeedSenseini ${Ini[${IniFile},advpath,SpeedSense,99999]}
	      /if (${SpeedSenseini}==99999) { 
	         /ini ${IniFile} advpath SpeedSense 15 
	         /varset SpeedSenseini 15 
	      } 
	      /declare FollowDistanceini int local 
	      /varset FollowDistanceini ${Ini[${IniFile},advpath,FollowDistance,99999]}
	      /if (${FollowDistanceini}==99999) { 
	         /ini ${IniFile} advpath FollowDistance 20 
	         /varset FollowDistanceini 20 
	      } 
	      /declare SilentFlagini int local 
	      /varset SilentFlagini ${Ini[${IniFile},advpath,SilentFlag,99999]} 
	      /if (${SilentFlagini}==99999) {
	         /ini ${IniFile} advpath SilentFlag 1 
	         /varset SilentFlagini 1 
	      } 
            /echo Advanced pathing v(${advpathv}) enabled. 
            /varset advpath TRUE 
            /call InitAPFVars ${FaceFastini} ${SpeedSenseini} ${FollowDistanceini} 
            /varset SilentFlag ${SilentFlagini}
      } else { 
         /echo Minimum advpath.inc v(1.24) required - you have v(${advpathv}) 
         /echo Advanced pathing found, but too old. Update it! 
         /varset advpath FALSE 
      } 
   } 
/return 

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

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

Sub Event_SelfEcho (string EchoText)
	/varset MasterName ${Me.ClearName}
	/call ExecCommand ${EchoText}
/return

Sub ExecCommand (string CommandText)
   /declare CommandLen int local
   /declare counter int local
   /varset CurrCommand ${CommandText.Arg[1]}
   /varcalc CommandLen ${CommandText.Length}+1
   /varset CommandParam
   /if (${CommandText.Length} > ${CommandLen}) /varset CommandParam ${CommandText.Right[-${CommandLen}]}
   
   /if (${Defined[botcorearray]}) {
   	/for counter 0 to ${botcorearray.Size[2]}
   		/if (${CurrCommand.Equal[${botcorearray(1,${counter})}]}) {
   			/call ${botcorearray(2,${counter})} ${CommandParam}
   		}
   	next counter
   }
   /if (${Defined[botcombatarray]}) {
   	/for counter 0 to ${botcombatarray.Size[2]}
   		/if (${CurrCommand.Equal[${botcombatarray(1,${counter})}]}) {
   			/call ${botcombatarray(2,${counter})} ${CommandParam}
   		}
   	next counter
   }
   /if (${Defined[botspellarray]}) {
   	/for counter 0 to ${botspellarray.Size[2]}
   		/if (${CurrCommand.Equal[${botspellarray(1,${counter})}]}) {
   			/call ${botspellarray(2,${counter})} ${CommandParam}
   		}
   	next counter
   }
   /if (${Defined[botHealarray]}) {
   	/for counter 0 to ${botHealarray.Size[2]}
   		/if (${CurrCommand.Equal[${botHealarray(1,${counter})}]}) {
   			/call ${botHealarray(2,${counter})} ${CommandParam}
   		}
   	next counter
   }
   /if (${Defined[botTogglearray]}) {
   	/for counter 0 to ${botTogglearray.Size[2]}
   		/if (${CurrCommand.Equal[${botTogglearray(1,${counter})}]}) {
   			/call SetToggle ${counter} ${CommandParam}
   		}
   	next counter
   }
   /if (${Defined[shortcutsarray]}) {
   	/for counter 0 to ${ShortCuts}
   		/if (${CurrCommand.Equal[${shortcutsarray(1,${counter})}]}) {
   			/call ShortCut ${counter} ${CommandParam}
   		}
   	next counter
   }
   /if (${Defined[BotPersonalsarray]}) {
   	/for counter 0 to ${BotPersonalsarray.Size[2]}
   		/if (${CurrCommand.Equal[${BotPersonalsarray(1,${counter})}]}) {
   			/call ${BotPersonalsarray(2,${counter})} ${CommandParam}
   		}
   	next counter
   }
/return 

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

Sub Detectobst 
   /if ( ${MyLastXLoc}==${Me.X} && ${MyLastYLoc}==${Me.Y} ) /call Hitobst 5 
   /varset MyLastXLoc ${Me.X} 
   /varset MyLastYLoc ${Me.Y}
/return 

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

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

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

sub LootAll 
   :LootAllCycle 
   /if (${Me.Combat}) /return 
   /if (!${Target.ID}) /target corpse radius 100 
   /if (!${Target.State.Equal[DEAD]}) /return  
   /call Loot
   /goto :LootAllCycle 
/return 

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

Sub Fastback 
   /varset ObstacleCheck 0 
   /varset MyLastXLoc ${Me.X}
   /varset MyLastYLoc ${Me.Y}
   :fastbackloop 
	   /doevents 
	   /if (!${Target.ID}) { 
	      /varset Combatstatus 0 
	      /Keypress FORWARD 
	      /if (${Me.Combat}) /attack off 
	      /return 
	   } 
	   /if (${Me.Sitting}) /stand 
	   /face fast 
	   /if (${Target.Distance}<${FastMin}) /Keypress BACK hold 
	   /if (${Target.Distance}>=${FastMin}) { 
	      	/Keypress FORWARD 
	      	/return 
	   	}  
   /if (${ObstacleCheck}>=8) { 
      /if ((${MyLastXLoc}==${Me.X})&&(${MyLastYLoc}==${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 MyLastXLoc ${Me.X}
      /varset MyLastYLoc ${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 MyLastXLoc ${Me.X} 
   /varset MyLastYLoc ${Me.Y} 
   :fastmoveloop 
   /doevents 
   /if (!${Target.ID}) { 
      /varset Combatstatus 0 
      /keypress down  
      /if (${Me.Combat}) /attack off  
      /return 
   } 
   /if (${Me.Sitting}) /stand  
   /face fast 
   /if (${Target.Distance}>${FastRange}) /keypress up hold 
   /if (${Target.Distance}<=${FastRange}) { 
      /keypress down 
      /return 
   } 
   /if (${ObstacleCheck}>=30) { 
      /call Detectobst 
      /varset ObstacleCheck 0 
   } 
   /if (${Target.Distance}>=${Math.Calc[${FastRange}*3]}) /varcalc ObstacleCheck ${ObstacleCheck}+1 
   /goto :fastmoveloop 
/return 

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

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

Sub Event_Zoned 
   /varset IsAnchored 0 
   /keypress FORWARD 
/return 

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

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

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

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

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

Sub StandardTarget (string TargetName)
	/if (!${Defined[TargetName]}) { 
      /assist ${MasterName} 
   } else /if (${TargetName.Length}==0) {
   	/assist ${MasterName} 
   } else /if (${TargetName.Equal[me]}) { 
      /target pc ${MasterName} 
   } else /if (${TargetName.Equal[yourself]}) { 
      /target myself 
   } else /if (${TargetName.Equal[${Me.CleanName}]}) { 
      /target myself 
   } else { 
      /target ${TargetName}
   } 
/return
		
||||||||||||Do-subs 

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

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

Sub Do-assist (string AssistName)
   /varset Supportstatus 1 
   /if (!${Defined[AssistName]}) { 
      /assist ${MasterName} 
   } else /if (${AssistName.Equal[me]}) { 
      /assist ${MasterName} 
   } else /if (${AssistName.Equal[yourself]}) { 
      /return
   } else /if (${AssistName.Equal[${Me.CleanName}]}) { 
      /return
   } else { 
      /assist ${CommandParam}
   } 
   /call Delay 5 
   /if (!${Target.ID}) { 
      /call ChatOut 5 ${MasterName} "I failed to get a target." 
   } else { 
      /call ChatOut 5 ${MasterName} "My target is now ${Target.CleanName}." 
      /if (${AttackOnAssist}) /varset Combatstatus 1 
      /if (${BehindOnAssist}) /call do-getbehind 
      /if (${PetOnAssist}) {
      	/if (${Me.Sitting}) /Stand  
		   /call Delay 5 
		   /pet attack 
		   /call Delay 5 
		   /if (${SitAfterCast}==1 && ${Me.Standing}) /sit 
      }
   } 
/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-notarget 
   /target clear 
/return 

Sub Do-relay 
   /varset Relaytells 1 
/return 

Sub Do-norelay 
   /varset Relaytells 0 
/return 

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

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

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

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

Sub Do-accept 
   /target clear 
   /invite 
/return 

Sub Do-reject 
   /target clear 
   /disband 
/return 

Sub Do-invite (string TargetName)
	/if (!${Defined[Param0]}) { 
		/assist ${MasterName}  
   } else /if (${TargetName.Equal[me]}) { 
   	/target pc ${MasterName}
   } else /if (${TargetName.Equal[yourself]}) { 
      /return
   } else /if (${TargetName.Equal[${Me.CleanName}]}) { 
      /return
   } else { 
      /target pc ${CommandParam} 
   } 
   /call ChatOut 3 ${MasterName} "Inviting ${Target.CleanName}." 
   /invite 
/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-stop 
   /dismount 
   /varset Supportstatus 0 
   /varset BreakOut 1 
   /varset LootTooFar 1 
   /varset SpellFail 1 
   /varset Afollow 0 
   /if ((${advpath})&&(${FollowFlag})) /call StopFunction 
   /varset FollowTarget "NULL" 
   /call ChatOut 5 ${MasterName} "Stopping." 
   /keypress LEFT
   /keypress RIGHT 
   /keypress DUCK 
   /keypress DUCK 
   /target clear 
   /keypress right 
/return 

Sub Do-stay 
   /varset Afollow 0 
   /varset FollowTarget "NULL" 
   /if ((${advpath})&&(${FollowFlag})) /call StopFunction 
   /keypress LEFT
   /keypress RIGHT
/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-pause 
      /if (${advpath}) { 
         /if (!${PauseFlag}) { 
         	/call ChatOut 5 ${MasterName} "Pausing." 
      	} else { 
         	/call ChatOut 5 ${MasterName} "Unpausing." 
      	} 
      	/call PauseFunction 
      } 
/return 

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

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

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

Sub Do-moveto (string TargetName)
   /if (${Me.Sitting}) /stand
   /varset ObstacleCheck 0 
   /varset MyLastXLoc ${Me.X}
   /varset MyLastYLoc ${Me.Y}
   /if (!${Defined[Param0]}) { 
		/assist ${MasterName}  
		/call Delay 5 
      /varset CommandParam ${Target.CleanName}
   } else /if (${String[${Param0}].Equal[me]}) { 
   	/target ${MasterName}
   	/varset CommandParam ${Target.CleanName}
   } else /if (${TargetName.Equal[yourself]}) { 
      /return
   } else /if (${TargetName.Equal[${Me.CleanName}]}) { 
      /return
   } else { 
      /target ${CommandParam} 
   }  
   /if (!${Target.ID}) /return 
   /doevents 
   /if (${MoveToMode}==1) {
	   /if (${Supportstatus}) /return 
	   /call RangeSub 
   }
   /if (${MoveToMode}==2) {
	   /call GotoFunction "${Target.Y}" "${Target.X}" "${Target.Z}"
   }
/return 

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

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

Sub Do-lootup 
   /if (!${Defined[Param0]}) { 
      /assist ${MasterName} 
   } else {  
      /target ${CommandParam} 
   } 
   /call Delay 5 
	/call Loot 
/return 

Sub Do-lootall 
   /if (!${Defined[Param0]}) { 
      /assist ${MasterName} 
   } else {  
      /target ${CommandParam} 
   } 
   /call Delay 5 
	/call LootAll 
/return 

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

Sub Do-petguard 
   /pet guard here 
/return 

Sub Do-petback 
   /pet back off 
/return 

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

Sub Do-consent (string TargetName)
	/if (!${Defined[TargetName]}) { 
		/assist ${MasterName} 
		/call Delay 5 
      /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-reportbuffs  
   /declare myBuffs string local Buffs:
   /declare counter int local
	/for counter 0 to 15
   	 /varcat myBuffs " ${Me.Buff[${$counter}]}"
   /next tempvar
   /call ChatOut 1 ${MasterName} "${myBuffs}"
/return 

Sub Do-run  
   /keypress ctrl+r 
/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-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-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-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-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}
   } 
   /if (${FollowMode}==1) {
   	/target FollowTarget
   	/delay 1s
   	/varset Afollow TRUE
   }
   /if (${FollowMode}==2) { 
      /call FollowFunction "${FollowTarget}" 
      
   } 
   /if (${FollowMode}=3) {
   	/target FollowTarget
   	/delay 1s
   	/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-Door 
   /doort 
   /face door 
   /keypress u 
/return 

Sub Do-autoinv 
   /autoinventory 
/return 

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

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

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

Sub Do-exp 
   /call ChatOut 5 ${MasterName} "I am at ${Me.PctExp} percent exp. 
/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-Rptvar
	/if (!${Defined[Param0]}) /return
	/call ChatOut 5 ${MasterName} "${Param0} is equal to ${${Param0}}"
/return

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

Sub Do-MoveToMode
	/if (${Defined[Param0]) /return
	/varset MoveToMode ${Param0}
/return
Last edited by LordGiddion on Wed Apr 28, 2004 9:19 pm, edited 6 times in total.

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

Post by LordGiddion » Sat Apr 24, 2004 11:27 pm

Botcombat.inc

Code: Select all

|botcombat.inc 
|Bot combat module. 
|Version 12.10
|Date:04/28/2004 9:00 pm
| 
||** 
[botcombat] 
version=12.10
**||
| 
#Event Enraged "has become ENRAGED" 
#Event Offrage "is no longer enraged" 
#Event FoundFloorTrap "You sense a trap in this direction" 
#Event FoundBoxTrap "You are certain that" 
#Event DisarmTrap "You have disarmed" 
#Event GettingHit " YOU for " 
#Event AttackedMiss " YOU, but " 
#Event Slash "You slash" 
#Event Hit "You Hit" 
#Event Bash "You Bash" 
#Event Pierce "You pierce" 
#Event ArcheryTooFar "Your target is too far away, get closer" 

Sub CombatCommands
	/declare botcombatarray[2][7] string outer
   |For each command
	|1,x Command Phrase to trigger bot - End User change change to suit prefferences
	|2,x Sub Routine to execute in response to command
   /varset botcombatarray(1,0) attack 
   /varset botcombatarray(2,0) Do-attack
   /varset botcombatarray(1,1) noattack 
   /varset botcombatarray(2,1) Do-noattack 
   /varset botcombatarray(1,2) getbehind 
   /varset botcombatarray(2,2) Do-getbehind
   /varset botcombatarray(1,3) behind 
   /varset botcombatarray(2,3) Do-behind 
   /varset botcombatarray(1,4) disc 
   /varset botcombatarray(2,4) Do-disc
   /varset botcombatarray(1,5) shield 
   /varset botcombatarray(2,5) Do-shield
   /varset botcombatarray(1,6) hide 
   /varset botcombatarray(2,6) Do-hide
   /varset botcombatarray(1,7) sneak 
   /varset botcombatarray(2,7) Do-sneak
   /varset ArrayComb 7 
/return 

Sub TellCmds-combat 
   /declare counter int local 0
   /declare cmds local 
   /for counter 0 to ${botcombatarray.Size[2]}
      /varset cmds ${cmds}${botcombatarray(1,${counter})}, 
   /next counter 
   /call ChatOut 2 ${MasterName} "${cmds}" 
/return 

Sub SetupCombatVars 
   /declare DoTraps bool outer FALSE
   /declare DoKick bool outer FALSE
   /declare DoBackstab bool outer FALSE
   /declare DoTaunt bool outer FALSE
   /declare DoEvade bool outer FALSE
   /declare DoSlam bool outer FALSE
   /declare DoBash bool outer FALSE
   /declare DoFlyingKick bool outer FALSE 
   /declare DoDisarm bool outer FALSE 
   /declare DoArchery bool outer FALSE 
   /declare EnrageVar bool outer FALSE 
   /declare Aggressive bool outer FALSE 
   /declare DoFrenzy bool outer FALSE
   /declare IsPuller bool outer FALSE 
   /declare AutoEngage bool outer FALSE 
   /declare AutoBehind bool outer FALSE
   /declare DoIncite bool outer FALSE
   /declare InCiteTimer timer outer
   
   /varset DoBackstab ${Ini[${IniFile},Combat,DoBackstab,0]} 
   /if (${DoBackstab}==0) {  
      /ini ${IniFile} Combat DoBackstab 0 
      /varset DoBackstab 0 
   } 
   /varset DoTaunt ${Ini[${IniFile},Combat,DoTaunt,0]} 
   /if (${DoTaunt}==0) { 
      /ini ${IniFile} Combat DoTaunt 0 
      /varset DoTaunt 0 
   } 
   /varset DoEvade ${Ini[${IniFile},Combat,DoEvade,0]}
   /if (${DoEvade}==0) {  
      /ini ${IniFile} Combat DoEvade 0 
      /varset DoEvade 0 
   } 
   /varset DoFrenzy ${Ini[${IniFile},Combat,DoFrenzy,0]}
   /if (${DoFrenzy}==0) {  
      /ini ${IniFile} Combat DoFrenzy 0 
      /varset DoFrenzy 0 
   } 
   /varset DoSlam ${Ini[${IniFile},Combat,DoSlam,0]} 
   /if (${DoSlam}==0) { 
      /ini ${IniFile} Combat DoSlam 0 
      /varset DoSlam 0 
   } 
   /varset DoBash ${Ini[${IniFile},Combat,DoBash,0]}
   /if (${DoBash}==0) {  
      /ini ${IniFile} Combat DoBash 0 
      /varset DoBash 0 
   } 
   /varset DoKick ${Ini[${IniFile},Combat,DoKick,0]} 
   /if (${DoKick}==0) {  
      /ini ${IniFile} Combat DoKick 0 
      /varset DoKick 0 
   } 
   /varset DoFlyingKick ${Ini[${IniFile},Combat,DoFlyingKick,0]} 
   /if (${DoFlyingKick}==0) { 
      /ini ${IniFile} Combat DoFlyingKick 0 
      /varset DoFlyingKick 0 
   } 
   /varset DoDisarm ${Ini[${IniFile},Combat,DoDisarm,0]} 
   /if (${DoDisarm}==0) { 
      /ini ${IniFile} Combat DoDisarm 0 
      /varset DoDisarm 0 
   } 
   /varset DoTraps ${Ini[${IniFile},Combat,DoTraps,0]} 
   /if (${DoTraps}==0) {  
      /ini ${IniFile} Combat DoTraps 0 
      /varset DoTraps 0 
   } 
   /varset DoArchery ${Ini[${IniFile},Combat,DoArchery,0]}
   /if (${DoArchery}==0) {  
      /ini ${IniFile} Combat DoArchery 0 
      /varset DoArchery 0 
   } 
   /varset Aggressive ${Ini[${IniFile},Combat,Aggressive,0]} 
   /if (${Aggressive}==0) {  
      /ini ${IniFile} Combat Aggressive 0 
      /varset Aggressive 0 
   } 
   /varset AutoEngage ${Ini[${IniFile},Combat,AutoEngage,0]} 
   /if (${AutoEngage}==0) {  
      /ini ${IniFile} Combat AutoEngage 0 
      /varset AutoEngage 0 
   } 
   /varset AutoBehind ${Ini[${IniFile},Combat,AutoBehind,0]} 
   /if (${AutoBehind}==0) {  
      /ini ${IniFile} Combat AutoBehind 0 
      /varset AutoBehind 0 
   }
   /varset DoIncite ${Ini[${IniFile},Combat,DoIncite,0]} 
   /if (${DoIncite}==0) {  
      /ini ${IniFile} Combat DoIncite 0 
      /varset DoIncite 0 
   }
/return 

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

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


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

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

|MeleeAbility 
|Used to do melee abilities if vars are set to. 
|Usage /call MeleeAbility 
Sub MeleeAbility 
   /if (${Me.Casting.ID}) /return 
   /if (((${DoBash})&&(${Me.AbilityReady[Bash]}))&&(${Me.Standing})) {
   	/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))&&(${Me.Standing})) { 
      /face fast
      /doability "Backstab" 
   } 
   /if (((${DoSlam})&&(${Me.AbilityReady[Slam]}))&&(${Me.Standing})) { 
      /face fast
      /doability "Slam" 
    } 
   /if (((${DoEvade})&&(${Me.AbilityReady[Hide]}))&&(${Me.Standing})) { 
      /attack off 
      /doability "Hide" 
      /attack on 
   } 
   /if (((${DoTaunt})&&(${Me.AbilityReady[Taunt]}))&&(${Me.Standing})) /doability "Taunt" 
   /if (((${DoKick})&&(${Me.AbilityReady[Kick]}))&&(${Me.Standing})) { 
      /face fast
      /doability "Kick" 
   } 
   /if (((${DoFlyingKick})&&(${Me.AbilityReady[Flying Kick]}))&&(${Me.Standing})) { 
      /face fast
      /doability "Flying Kick" 
   } 
   /if (((${DoDisarm})&&(${Me.AbilityReady[Disarm]}))&&(${Me.Standing})) { 
      /face fast 
      /doability "Disarm" 
   } 
   /if (((${DoFrenzy})&&(${Me.AbilityReady[Frenzy]}))&&(${Me.Standing})) { 
      /face fast
      /doability "Frenzy" 
   } 
   /if ((${DoArchery})&&(${Me.Standing})) { 
      /face fast
      /range 
   } 
   /if (${DoIncite} && ${InCiteTimer}<=0) {
   	/face fast
   	/disc incite 
   	/varset InCiteTimer 30s
   }
/return 

Sub bscounter 
   /if (!${Target.ID}) /return 
   /if (${Me.Sitting}) /stand 
   /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))&&(${Me.Standing})) { 
      /face fast
      /doability "Backstab" 
   } 
   /if (!${Target.ID}) { 
      /keypress strafe_right 
      /return 
   } 
   /if (${Target.Distance}>20) { 
      /keypress strafe_right 
      /call RangeSub 
      /return 
   } 
   /if (${Target.Distance}<4) { 
      /keypress strafe_right  
      /call RangeSub 
      /return 
   } 
   /face 
   /if (((${Me.Heading.Degrees}>=180)&&(${Math.Calc[${Me.Heading.Degrees}-180]}<=${Target.Heading.Degrees}))&&(${Me.Heading.Degrees}>${Math.Calc[${Target.Heading.Degrees}+22.5]})) /goto :MoreCounter 
   /if (((${Me.Heading.Degrees}<=180)&&(${Target.Heading.Degrees}<=180)&&(${Me.Heading.Degrees}>${Math.Calc[${Target.Heading.Degrees}+25]})) /goto :MoreCounter 
   /if (((${Me.Heading.Degrees}>=180)&&(${Target.Heading.Degrees}<=180)&&(${Math.Calc[${Me.Heading.Degrees}-157.5]}<${Math.Calc[${Target.Heading.Degrees}+180]})) /goto :MoreCounter 
   /keypress strafe_right 
   /face  
/return 

Sub bsclock 
   /if (!${Target.ID}) /return 
   /if (${Me.Sitting}) /stand 
   /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)&&(${Me.Standing})) { 
      /face fast
      /doability "Backstab" 
   } 
   /if (!${Target.ID}) { 
      /keypress strafe_left 
      /return 
   } 
   /if (${Target.Distance}>20) { 
      /keypress strafe_left 
      /call RangeSub 
      /return 
   } 
   /if (${Target.Distance}<4) { 
      /keypress strafe_left 
      /call RangeSub 
      /return 
   } 
   /face  
   /if (((${Target.Heading.Degrees}>=180)&&(${Math.Calc[${Target.Heading.Degrees}-180]}<=${Me.Heading.Degrees}))&&(${Me.Heading.Degrees}<${Math.Calc[${Target.Heading.Degrees}-22.5]})) /goto :MoreClock 
   /if ((${Target.Heading.Degrees}<=180)&&(${Me.Heading.Degrees}<${Math.Calc[${Target.Heading.Degrees}-22.5]})) /goto :MoreClock 
   /if (((${Target.Heading.Degrees}>=180)&&(${Me.Heading.Degrees}<=180))&&(${Math.Calc[${Me.Heading.Degrees}-22.5]}>${Math.Calc[${Target.Heading.Degrees}-360]})) /goto :MoreClock 
   /keypress strafe_left 
   /face fast
/return 

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

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


Sub Event_Pierce 
   /call CheckPuller 
/return 

Sub Event_Slash 
   /call CheckPuller 
/return 

Sub Event_Bash 
   /call CheckPuller 
/return 

Sub Event_Hit 
   /call CheckPuller 
/return 

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

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

      } 
      /varset EnrageVar 0 
   } 
/return 

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

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

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

Sub Event_GettingHit 
   /call CheckAggressive "${Param0}"
/return 

Sub Event_AttackedMiss 
   /call CheckAggressive "${Param0}" 
/return 

Sub Event_ArcheryTooFar 
/return 

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

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

Sub Do-getbehind 
   /varset ObstacleCheck 0 
   /varset MyLastXLoc ${Me.Y} 
   /varset MyLastYLoc ${Me.X} 
   /varset Combatstatus 1 
   /if (!${Target.ID}) { 
      /assist ${MasterName} 
      /call Delay 5 
   } 
   /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}>=20) { 
      /if (${MyLastXLoc}==${Me.Y} && ${MyLastYLoc}==${Me.X}) { 
         /keypress FORWARD 
         /return 
      } 
      /varset MyLastXLoc ${Me.Y} 
      /varset MyLastYLoc ${Me.X} 
      /varset ObstacleCheck 0 
   } 
   /varcalc ObstacleCheck ${ObstacleCheck}+1  
   /doevents 
   /face nolook loc ${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.Degrees}]}*10]},${Math.Calc[${Target.X}+${Math.Sin[${Target.Heading.Degrees}]}*10]} 
   /if (${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.Degrees}]}*10]},${Math.Calc[${Target.X}+${Math.Sin[${Target.Heading.Degrees}]}*10]}]}>1) /goto :gobehindloop 
   /keypress FORWARD 
   /face  
:noneed 
/keypress FORWARD 
/return 


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

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

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

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

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

Sub Do-sneak 
   /doability Sneak 
   /call Delay 2s 
   /if (${Me.AbilityReady[Sneak]}) {
   	/call ChatOut 5 ${MasterName} "I'm not sneaking atm" 
   } else {
   	/call ChatOut 5 ${MasterName} "I'm sneaking" 
   }
/return 
Last edited by LordGiddion on Wed Apr 28, 2004 9:20 pm, edited 3 times in total.

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

Post by LordGiddion » Sat Apr 24, 2004 11:27 pm

BotSpell.inc

Code: Select all

|botspell.inc 
|Bot spell module. 
|Version 12.10
|Date:04/28/2004 9:00 pm
| 
||** 
[botspell] 
version=12.10
**||
| 
#event Collapse "Your gate is too unstable, and collapses." 
#event RootOff "Your Immobilize spell has worn off." 
#event NoLOS "You cannot see your target." 
#Event CastStart "You begin casting" 
#Event CastFizzle "Your spell fizzles!" 
#Event CastInterrupt "Your spell is interrupted." 
#Event CastNoMana "Insufficient Mana to cast this spell" 
#Event CastTooFar "Your target is out of range, get closer!" 
#Event Recovered "You haven't recovered yet..." 
#Event CastResist "Your target resisted " 
#Event Distracted "You are too distracted to cast a spell now!" 
#Event NoTarget "You must first select a target for this spell!" 
#Event Sitting "You must be standing to cast a spell." 
#Event NoMem "You do not seem to have that spell memorized." 
#Event Stunned "You can't cast spells while stunned!" 
#event MissedNote "You miss a note, bringing your song to a close!" 


Sub SpellCommands 
	/declare botspellarray[2][9] string outer
   |For each command
	|1,x Command Phrase to trigger bot - End User change change to suit prefferences
	|2,x Sub Routine to execute in response to command
   /varset botspellarray(1,0) sn 
   /varset botspellarray(2,0) Do-sn
   /varset botspellarray(1,1) mana 
   /varset botspellarray(2,1) Do-mana
   /varset botspellarray(1,2) evac 
   /varset botspellarray(2,2) Do-evac
   /varset botspellarray(1,3) loadlist 
   /varset botspellarray(2,3) Do-loadlist
   /varset botspellarray(1,4) snt 
   /varset botspellarray(2,4) Do-snt
   /varset botspellarray(1,5) setlompct 
   /varset botspellarray(2,5) Do-setlompct
   /varset botspellarray(1,6) chainnuke 
   /varset botspellarray(2,6) Do-ChainNuke
   /varset botspellarray(1,7) chainstun 
   /varset botspellarray(2,7) Do-ChainStun
   /varset botspellarray(1,8) Buff 
   /varset botspellarray(2,8) Do-Buff
   /varset botspellarray(1,9) spellgem 
   /varset botspellarray(2,9) Do-SpellGem
/return 

Sub TellCmds-spell 
   /declare counter int local 0
   /declare cmds local 
   /for counter 0 to ${botcombatarray.Size[2]}
      /varset cmds ${cmds}${botcombatarray(1,${counter})}, 
   /next counter 
   /call ChatOut 2 ${MasterName} "${cmds}" 
/return 

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

Sub SetupSpellVars 
   /declare DefaultSpellSet string outer 
   /declare EvacSpell string outer 
   /declare DoAgain bool outer FALSE
   /declare StartCast bool outer FALSE
   /declare SpellSlot int outer 
   /declare CastTime int outer 
   /declare SitAfterCast bool outer FALSE
   /declare LastSn string outer NA  
   /declare ReportLom bool outer FALSE
   /declare LomMsg string outer
   /declare DoCanni bool outer FALSE
   /declare DoYaulp bool outer FALSE
   /declare CanniSpell string outer
   /declare YaulpSpell string outer
   /declare ChainNuke string outer
   /declare ChainStun string outer
   /declare ChainStunNum string outer
   /declare IsBard bool outer FALSE
   /declare SelfBuffList string outer
   /declare SpellFail bool outer FALSE
   /declare DelayBeforeSit string outer 3s
   /declare Remem bool outer FALSE
   /declare BuffList[50][5] string outer
   /declare SelfBuff[15][5] string outer
   /declare BuffListCount int outer 0
   /declare SpellGem int outer
   /declare CTimer timer outer
   /declare OOMtimer timer outer 
   /declare LomTimer timer outer
   /declare CannTimer timer outer
   /declare CannAATimer timer outer
   /declare YaulpTimer timer outer
   /declare ChainStunTime timer outer
   /declare BuffListAdvance timer outer
   
   /varset DelayBeforeSit ${Ini[${IniFile},Core,DelayBeforeSit,NotFound]}
   /if (${DelayBeforeSit.Equal[NotFound]}) {  
      /ini ${IniFile} Core DelayBeforeSit 3s 
      /varset DelayBeforeSit 3s 
   } 
   /varset SpellGem ${Ini[${IniFile},Spell,SpellGem,99999]} 
   /if (${SpellGem}==99999) {
      /ini ${IniFile} Spell SpellGem 8 
      /varset SpellGem 8 
   } 
   /varset SitAfterCast ${Ini[${IniFile},Spell,SitAfterCast,0]} 
   /if (${SitAfterCast}==0) {
      /ini ${IniFile} Spell SitAfterCast 0 
      /varset SitAfterCast 0 
   } 
   /varset DefaultSpellSet ${Ini[${IniFile},Spell,DefaultSpellSet,NotFound]}
   /if (${DefaultSpellSet.Equal[NotFound]}) { 
      /ini ${IniFile} Spell DefaultSpellSet "default" 
      /varset DefaultSpellSet "default" 
   } 
   /varset EvacSpell ${Ini[${IniFile},"Spell",EvacSpell,NotFound]}
   /if (${EvacSpell.Equal[NotFound]}) { 
      /ini ${IniFile} Spell EvacSpell "NONE" 
      /varset EvacSpell "NONE" 
   } 
   /varset ReportLom ${Ini[${IniFile},Spell,ReportLom,0]} 
   /if (${ReportLom}==0) {
      /ini ${IniFile} Spell ReportLom 0 
      /varset ReportLom 0 
   } 
   /varset LomMsg ${Ini[${IniFile},Spell,LomMsg,NotFound]}
   /if (${LomMsg.Equal[NotFound]}) {
      /ini ${IniFile} Spell LomMsg "Warning I'm running low on Mana."
      /varset LomMsg "Warning I'm running low on Mana."
   } 
   /varset CanniSpell ${Ini[${IniFile},Spell,CanniSpell,NotFound]}
   /if (${CanniSpell.Equal[NotFound]}) {
      /ini ${IniFile} Spell CanniSpell "Your Canniblize spell." 
      /varset CanniSpell "canniblize"
   } 
   /varset DoCanni ${Ini[${IniFile},Spell,DoCanni,0]} 
   /if (${DoCanni}==0) {
      /ini ${IniFile} Spell DoCanni 0 
      /varset DoCanni 0 
   } 
   /varset YaulpSpell ${Ini[${IniFile},Spell,YaulpSpell,NotFound]}
   /if (${YaulpSpell.Equal[NotFound]}) {
      /ini ${IniFile} Spell YaulpSpell "Your Yaulp spell."
      /varset YaulpSpell "Yaulp"
   } 
   /varset DoYaulp ${Ini[${IniFile},Spell,DoYaulp,0]} 
   /if (${DoYaulp}==0) {
      /ini ${IniFile} Spell DoYaulp 0 
      /varset DoYaulp 0 
   } 
   /varset ChainStun ${Ini[${IniFile},Spell,ChainStun,NotFound]}
   /if (${ChainStun.Equal[NotFound]}) {
      /ini ${IniFile} Spell ChainStun "Your Chain Stun Spells sperate with |."
      /varset ChainStun "NA"
   } 
   /varset ChainNuke ${Ini[${IniFile},Spell,ChainNuke,NotFound]}
   /if (${ChainNuke.Equal[NotFound]}) {
      /ini ${IniFile} Spell ChainNuke "Your Chain Nuke Spells sperate with |."
      /varset ChainNuke "NA"
   } 
   /varset SelfBuffList ${Ini[${IniFile},Spell,SelfBuff,NotFound]}
   /if (${SelfBuffList.Equal[NotFound]}) {
      /ini ${IniFile} Spell SelfBuff "Buffs you wish to maintain of yourself sperated with |."
      /varset SelfBuffList "NA"
   } 
   /varset IsBard ${Ini[${IniFile},Spell,IsBard,0]} 
   /if (${IsBard}==0) {
      /ini ${IniFile} Spell IsBard 0 
      /varset IsBard 0 
   } 
   /varset Remem ${Ini[${IniFile},Spell,RememSpellSet,0]} 
   /if (${Remem}==0) {
      /ini ${IniFile} Spell RememSpellSet 0 
      /varset Remem 0 
   } 
/return 

|SpellSub 
|Main spell casting sub. 
|Used to handle all spell casting.  Auto mems spells and handles fizzles. 
|Will need to set the DefaultSpellSet var to your default spell set. 
| 
|Usage /call SpellSub "spellname" 
| 
Sub SpellSub (string SpellName)
   /if (${SpellName.Equal[NA]}) /return 
   /varset SpellFail 0 
   /if (${SitAfterCast}) /varset SitTimer 1140m 
   |/if (${Target.Distance}>${Spell[${SpellName}].Range}) { 
   |   /if (${Spell[${SpellName}].Range}>0) { 
   |      /varset SpellFail 1 
   |      /call ChatOut 3 ${MasterName} "Too far away. " 
   |      /varset CTimer 0 
   |      /return 1 
   |   } 
   |} 
   /if (${Me.Sitting}) /stand 
   /varset Remem 0 
   /if (!${IsBard}) { 
      /if (${Me.Moving}) { 
            /keypress FORWARD 
            /keypress BACK 
            /call Delay 1s 
      } 
      :WaitForStop 
      /doevents 
      /if (${BreakOut}) /return 
      /if (${Me.Moving}) { 
      		/echo moving
            /call Delay 1s 
            /goto :WaitForStop 
      } 
   } 
   /if (${IsBard}) /stopsong 
   |Check if character Knows the Spell requested

   /if (${Me.Book[${SpellName}]}<1) {
   	/call ChatOut 5 ${MasterName} "Don't know the spell ${SpellName} so failing to cast"
   	/goto :SpellFail
   }
   |Check if Spell is mem'd on a gem
   /if (!${Me.Gem[${SpellName}]}) {
   	/call ChatOut 3 ${MasterName} "memorizing the spell ${SpellName}"
   	/memspell ${SpellGem} "${SpellName}"
   	:MemWait 
   		/if (${BreakOut}) /return
   		/call Delay 1
   		/if (!${Me.Gem[${SpellName}]}) /goto :MemWait
   }
   /varset SpellSlot ${Me.Gem[${SpellName}]}
   /doevents 
   /if (${SpellFail}) /goto :SpellFail
   |Check if spell is ready to cast
   /if (!${Me.SpellReady[${SpellSlot}]}) {
   	/echo waiting on refresh
   	:refreshwait 
   		/if (${BreakOut}) /return
      	/call Delay 1 
      	/if (!${Me.SpellReady[${SpellSlot}]}) /goto :refreshwait 
   }
   /varset CastTime ${Spell[${SpellName}].MyCastTime.Int}
   /if (!${IsBard}) /varcalc CastTime ${CastTime}+1 
   :BeginCast 
   /varset SpellFail 0 
   /varset DoAgain 0 
   /varset StartCast 0 
   /call WaitForStart 
   :TimerLoop 
   /doevents 
   /if ((${IsBard})&&(${Combatstatus})) /call RangeSub 
   /if (${DoAgain}) /goto :BeginCast 
   /if (${SpellFail}) /goto :SpellFail
   /if (${CTimer}>0) /goto :TimerLoop 
   /if (${IsBard}) { 
      /call Delay 1 
   } else { 
      /call Delay 2 
   } 
   /doevents 
   /if (${DoAgain}) /goto :BeginCast 
   /if (${Remem}) { 
      /memspellset ${DefaultSpellSet} 
      :loadsploop 
      /call Delay 5 
      /if (${Window[SpellBookWnd].Open}) /goto :loadsploop 
   } 
	/return 0 
	:SpellFail
	/varset SpellFail 0 
   /if (${Remem}) { 
      /memspellset ${DefaultSpellSet} 
      :loadsploop 
      /call Delay 5 
      /if (${Window[SpellBookWnd].Open}) /goto :loadsploop  
   } 
   /if ((${Me.Standing})&&(${SitAfterCast})) /sit
/return 1

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

Sub Event_CastStart 
   /varset StartCast 1 
/return 

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

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

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

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

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

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

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

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

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

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

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

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

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

Sub Event_Collapse 
   /varset DoAgain 1 
/return 

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

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

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

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

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

Sub NextStun
	/if (!${Target.ID}) /return
	/if (${BreakOut}) /return
/return

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

Sub Do-sn (string newSpell)
   /assist ${MasterName} 
   /call Delay 10 
   /if ( !${Defined[newSpell]} && ${LastSn.Equal[NA]}) /return  
   /if (!${Defined[Param0]}) /varset CommandParam "${LastSn}"  
   /call ChatOut 1 "${MasterName}" "Casting ${CommandParam}  on ${Target.CleanName}" 
   /call SpellSub "${CommandParam}" 
   /varset LastSn ${CommandParam}
/return 

Sub Do-mana 
   /target myself 
   /call ChatOut 2 ${MasterName} "${Me.PctMana}m" 
   /press esc 
/return 

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

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

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

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

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

Sub Do-ChainNuke
	/call StandardTarget "${CommandParam}"
	/if (${BreakOut}) /return
/return

Sub Do-ChainStun
	/call StandardTarget "${CommandParam}"
	/varset ChainStunNum 1
	/call NextStun
/return

Sub Do-Buff
	/if (!${Defined[Param0]}) /return
	/if (${Param0.Equal[on]}) /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}]}) /return
	/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 
		} 
  	/call StandardTarget "${TargetName}" 
   /call Delay 5 
   /if (!${Target.ID}) { 
      /call ChatOut 5 ${MasterName} "I failed to get a target." 
      /return 
   } 
   /call SpellSub "${SpellNameParam}"
   /if (${Macro.Return}==0) {
   	/declare NewBuff local
   	/varset NewBuff ${BuffListCount}
   	/varcalc NewBuff ${NewBuff}+1
   	/varset BuffList(${NewBuff},1) "${Target.CleanName}"
   	/varset BuffList(${NewBuff},2) "${SpellName}Param"
   	/varset BuffList(${NewBuff},3) ${Spell[${SpellNameParam}].Duration.TotalSeconds}
   	/varset BuffListCount ${NewBuff}
   	/varset BuffListAdvance 5s
   }
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit}    
/return

Sub Do-SpellGem
	/if (!${Defined[Param0]}) {
      /call ChatOut 3 ${MasterName} "I Gem ${SpellGem} when I need to mem new spells." 
      /return 
   } 
   /varset SpellGem ${Param0}
   /call ChatOut 3 ${MasterName} "I will now use Gem ${SpellGem} when I need to mem new spells."
/return
Last edited by LordGiddion on Wed Apr 28, 2004 9:22 pm, edited 6 times in total.

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

Post by LordGiddion » Sat Apr 24, 2004 11:28 pm

Bothealer.inc

Code: Select all

|bothealer.inc 
|Bot healer module. 
|Version 12.10
|Date:04/28/2004 9:00 pm
| 
||** 
[bothealer] 
version=12.10
**||
| 
Sub HealerCommands 
	/declare botspellarray[2][10] string outer
   |For each command
	|1,x Command Phrase to trigger bot - End User change change to suit prefferences
	|2,x Sub Routine to execute in response to command
   /varset botHealarray(1,0) settankheal 
   /varset botHealarray(2,0) Do-settankheal 
   /varset botHealarray(1,1) setcasterheal 
   /varset botHealarray(2,1) Do-setcasterheal
   /varset botHealarray(1,2) setdefaultheal 
   /varset botHealarray(2,2) Do-setdefaultheal
   /varset botHealarray(1,3) heal 
   /varset botHealarray(2,3) Do-heal
   /varset botHealarray(1,4) setpetheal 
   /varset botHealarray(2,4) Do-setpetheal
   /varset botHealarray(1,5) watchtarget 
   /varset botHealarray(2,5) Do-watchtarget
   /varset botHealarray(1,6) resetwatch 
   /varset botHealarray(2,6) Do-resetwatch
   /varset botHealarray(1,7) setpatchheal 
   /varset botHealarray(2,7) Do-setpatchheal 
   /varset botHealarray(1,8) setcasterhealpct
   /varset botHealarray(2,8) Do-setcasterhealpct
   /varset botHealarray(1,9) settankhealpct
   /varset botHealarray(2,9) Do-settankhealpct
   /varset botHealarray(1,10) setpethealpct
   /varset botHealarray(2,10) Do-setpethealpct
/return 

Sub TellCmds-healer 
   /declare counter int local 0
   /declare cmds local 
   /for counter 0 to ${botcombatarray.Size[2]}
      /varset cmds ${cmds}${botcombatarray(1,${counter})}, 
   /next counter 
   /call ChatOut 2 ${MasterName} "${cmds}" 
/return 

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

Sub SetupHealerVars 
   /declare HealPetMsg string outer 
   /declare PetPctHeal int outer 81
   /declare HealPets bool outer FALSE
   /declare PetSpell string outer 
   /declare CasterPctHeal int outer 81  
   /declare TankPctHeal int outer 51
   /declare PalGrpPct int outer 81
   /declare PalHealPct int outer 81
   /declare PalHealGrpMsg string outer 
   /declare PalHealMsg string outer 
   /declare HealCasterMsg string outer 
   /declare HealTankMsg string outer
   /declare ReportAutoHeal bool outer TRUE
   /declare PallyHealSpell string outer 
   /declare PallyGroupSpell string outer 
   /declare DefaultHealSpell string outer 
   /declare TankSpell string outer 
   /declare CasterSpell string outer 
   /declare IsHealer bool outer FALSE
   /declare IsPally bool outer FALSE
   /declare TankList string outer 
   /declare CasterList string outer 
   /declare LowHealthCheck int outer 0
   /declare CastMsgTimer1 timer outer
   /declare CastMsgTimer2 timer outer
   /declare WatchTargets[15] string outer 
   /declare WatchTargetIDs[15] int outer 0
   /declare WatchTargetCount int outer 0
   /declare WatchWaitCount int outer 0
   /declare HealTargets[21] int outer 0
   /declare PatchHealer bool outer TRUE
   /declare PatchSpell string outer 
   /declare PatchHealMsg string outer 

   /varset IsHealer ${Ini[${IniFile},Healer,IsHealer,0]} 
   /if (${IsHealer}==0) {  
      /ini ${IniFile} Healer IsHealer 0 
      /varset IsHealer 0 
   } 
   /varset IsPally ${Ini[${IniFile},Healer,IsPally,0]}
   /if (${IsPally}==0) { 
      /ini ${IniFile} Healer IsPally 0 
      /varset IsPally 0 
   } 
   /varset ReportAutoHeal ${Ini[${IniFile},Healer,ReportAutoHeal,1]}
   /if (${ReportAutoHeal}==1) { 
      /ini ${IniFile} Healer ReportAutoHeal 1 
      /varset ReportAutoHeal 1 
   } 
   /varset HealPets ${Ini[${IniFile},Healer,HealPets,0]}
   /if (${HealPets}==0) { 
      /ini ${IniFile} Healer HealPets 0 
      /varset HealPets 0 
   } 
   /varset PatchHealer ${Ini[${IniFile},Healer,PatchHealer,1]} 
   /if (${PatchHealer}==1) { 
      /ini ${IniFile} Healer PatchHealer 1 
      /varset PatchHealer 1 
   } 
   /varset TankSpell ${Ini[${IniFile},Healer,TankSpell,NotFound]}
   /if (${TankSpell.Equal[NotFound]}) {
      /ini ${IniFile} Healer TankSpell "Name of heal spell autoheal uses on Tanks" 
      /varset TankSpell "NA" 
   } 
   /varset CasterSpell ${Ini[${IniFile},Healer,CasterSpell,NotFound]}
   /if (${CasterSpell.Equal[NotFound]}) {
      /ini ${IniFile} Healer CasterSpell "Name of heal spell autoheal uses on Non Tanks" 
      /varset CasterSpell "NA" 
   } 
   /varset DefaultHealSpell ${Ini[${IniFile},Healer,DefaultHealSpell,NotFound]}
   /if (${DefaultHealSpell.Equal[NotFound]}) {
      /ini ${IniFile} Healer DefaultHealSpell "Name of Default Heal Spell" 
      /varset DefaultHealSpell "NA" 
   } 
   /varset PetSpell ${Ini[${IniFile},Healer,PetSpell,NotFound]}
   /if (${PetSpell.Equal[NotFound]}) {
      /ini ${IniFile} Healer PetSpell "Name of Pet Heal Spell" 
      /varset PetSpell "NA" 
   } 
   /varset PatchSpell ${Ini[${IniFile},Healer,PatchSpell,NotFound]}
   /if (${PatchSpell.Equal[NotFound]}) {
      /ini ${IniFile} Healer PatchSpell "Name of Patch Heal Spell" 
      /varset PatchSpell "NA" 
   } 
   /varset HealCasterMsg ${Ini[${IniFile},Healer,HealCasterMsg,NotFound]}
   /if (${HealCasterMsg.Equal[NotFound]}) {
      /ini ${IniFile} Healer HealCasterMsg "Healing %t" 
      /varset HealCasterMsg "Healing %t" 
   } 
   /varset HealTankMsg ${Ini[${IniFile},Healer,HealTankMsg,NotFound]}
   /if (${HealTankMsg.Equal[NotFound]}) {
      /ini ${IniFile} Healer HealTankMsg "Big Heal on %t" 
      /varset HealTankMsg "Big Heal on %t" 
   } 
   /varset HealPetMsg ${Ini[${IniFile},Healer,HealPetMsg,NotFound]}
   /if (${HealPetMsg.Equal[NotFound]}) {
      /ini ${IniFile} Healer HealPetMsg "Healing %t" 
      /varset HealPetMsg "Healing %t" 
   } 
   /varset PalHealMsg ${Ini[${IniFile},Healer,PalHealMsg,NotFound]}
   /if (${PalHealMsg.Equal[NotFound]}) {
      /ini ${IniFile} Healer PalHealMsg "Healing %t" 
      /varset PalHealMsg "Healing %t" 
   } 
   /varset PatchHealMsg ${Ini[${IniFile},Healer,PatchHealMsg,NotFound]}
   /if (${PatchHealMsg.Equal[NotFound]}) {
      /ini ${IniFile} Healer PatchHealMsg "Patch Healing %t" 
      /varset PatchHealMsg "Patch Healing %t" 
   } 
   /varset PallyGroupSpell ${Ini[${IniFile},Healer,PallyGroupSpell,NotFound]}
   /if (${PallyGroupSpell.Equal[NotFound]}) {
      /ini ${IniFile} Healer PallyGroupSpell "Name of Pally Group Heal Spell" 
      /varset PallyGroupSpell "NA" 
   } 
   /varset PallyHealSpell ${Ini[${IniFile},Healer,PallyHealSpell,NotFound]}
   /if (${PallyHealSpell.Equal[NotFound]}) {
      /ini ${IniFile} Healer PallyHealSpell "Name of Pally Heal Spell" 
      /varset PallyHealSpell "NA" 
   } 
   /varset CasterPctHeal ${Ini[${IniFile},Healer,CasterPctHeal,99999]}
   /if (${CasterPctHeal}==99999) { 
      /ini ${IniFile} Healer CasterPctHeal 70 
      /varset CasterPctHeal 70 
   } 
   /varset TankPctHeal ${Ini[${IniFile},Healer,TankPctHeal,99999]}
   /if (${TankPctHeal}==99999) { 
      /ini ${IniFile} Healer TankPctHeal 51 
      /varset TankPctHeal 51 
   } 
   /varset PalGrpPct ${Ini[${IniFile},Healer,PalGrpPct,99999]} 
   /if (${PalGrpPct}==99999) {
      /ini ${IniFile} Healer PalGrpPct 81 
      /varset PalGrpPct 81 
   } 
   /varset PetPctHeal ${Ini[${IniFile},Healer,PetPctHeal,99999]} 
   /if (${PetPctHeal}==99999) { 
      /ini ${IniFile} Healer PetPctHeal 51 
      /varset PetPctHeal 51 
   } 
   /varset PalHealPct ${Ini[${IniFile},Healer,PalHealPct,99999]}
   /if (${PalHealPct}==99999) {
      /ini ${IniFile} Healer PalHealPct 81 
      /varset PalHealPct 81 
   }   
   /varset TankList ${Ini[${IniFile},Healer,TankList,NotFound]}
   /varset CasterList ${Ini[${IniFile},Healer,CasterList,NotFound]}
   /if (${TankList.Equal[NotFound]} && ${CasterList.Equal[NotFound]}) { 
         /ini ${IniFile} Healer TankList "Warrior|Shadow Knight|Paladin|Monk|Beastlord|Ranger|Shaman|Berserker" 
         /ini ${IniFile} Healer CasterList "Necromancer|Wizard|Enchanter|Magician|Rogue|Druid|Cleric|Bard" 
         /ini ${IniFile} Healer  
      } 
   } 
/return 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sub Do-resetwatch 
   /call ResetWatchTargets 
/return 

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

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

Sub Do-setpethealpct
	/if (!${Defined[Param0]}) {
      /call ChatOut 3 ${MasterName} "I heal non tanks at ${PetPctHeal} %." 
      /return 
   } 
   /varset PetPctHeal ${Param0} 
   /call ChatOut 3 ${MasterName} "I heal non tanks at ${PetPctHeal} %." 
/return
Last edited by LordGiddion on Wed Apr 28, 2004 9:23 pm, edited 3 times in total.

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

Post by LordGiddion » Sat Apr 24, 2004 11:29 pm

Shortcuts.inc

Code: Select all

|shortcuts.inc 
|Module for linking Custom Commands to Character spells and items
|Includes Variable Toggling function as well
|Version 12.10
|Date:04/28/2004 9:00 pm
| 
||** 
[shortcuts] 
version=12.10
**||

Sub ToggleCommands
	/declare botTogglearray[5][29] string outer 
	|For each Variable that has a TRUE/FALSE State
	|Each Command can be toggled by 1/0 or TRUE/FALSE
	|1,x Command to force Toggle - End User change change to suit prefferences
	|2,x Phrase returned by the bot when value is FALSE
	|3,x Phrase returned by the bot when value is TRUE
	|4,x Variable to be changed by the command
	|5,x If TRUE Command will return Variable State when no Param Present
   |    If FALSE Command Will Toggle Variable State when no Param Present
   /varset botTogglearray(1,0) listengroup 
   	/varset botTogglearray(2,0) "I will ignore Group Chat."
   	/varset botTogglearray(3,0) "I will listen in Group Chat."
   	/varset botTogglearray(4,0) ListenGroup
   	/varset botTogglearray(5,0) TRUE
   /varset botTogglearray(1,1) aona 
   	/varset botTogglearray(2,1) "I will Not Attack when Assisting."
   	/varset botTogglearray(3,1) "I will Attack when Assisting."
   	/varset botTogglearray(4,1) AttackOnAssist
   	/varset botTogglearray(5,1) TRUE
   /varset botTogglearray(1,2) bona 
   	/varset botTogglearray(2,2) "I won't move behind on assist."
   	/varset botTogglearray(3,2) "I will move behind on assist."
   	/varset botTogglearray(4,2) BehindOnAssist
   	/varset botTogglearray(5,2) TRUE
   /varset botTogglearray(1,3) petona 
   	/varset botTogglearray(2,3) "I won't send pet in on assist."
   	/varset botTogglearray(3,3) "I will send pet in on assist."
   	/varset botTogglearray(4,3) PetOnAssist
   	/varset botTogglearray(5,3) TRUE
   /varset botTogglearray(1,4) ListenChat 
   	/varset botTogglearray(2,4) "I will ignore Chat"
   	/varset botTogglearray(3,4) "I will listen in Chat"
   	/varset botTogglearray(4,4) ListenChat
   	/varset botTogglearray(5,4) TRUE
	/varset botTogglearray(1,5) kick 
   	/varset botTogglearray(2,5) "Auto Kick is now off." 
   	/varset botTogglearray(3,5) "Auto Kick is now on."
   	/varset botTogglearray(4,5) DoKick 
   	/varset botTogglearray(5,5) FALSE
   /varset botTogglearray(1,6) flyingkick  
   	/varset botTogglearray(2,6) "Auto FlyingKick is now off."
   	/varset botTogglearray(3,6) "Auto FlyingKick is now on."
   	/varset botTogglearray(4,6) DoFlyingKick 
   	/varset botTogglearray(5,6) FALSE
   /varset botTogglearray(1,7) disarm  
   	/varset botTogglearray(2,7) "Auto Disarm is now off."
   	/varset botTogglearray(3,7) "Auto Disarm is now on."
   	/varset botTogglearray(4,7) DoDisarm 
   	/varset botTogglearray(5,7) FALSE
   /varset botTogglearray(1,8) traps  
   	/varset botTogglearray(2,8) "I will not detect for traps."
   	/varset botTogglearray(3,8) "I will detect for traps."
   	/varset botTogglearray(4,8) DoTraps  
   	/varset botTogglearray(5,8) FALSE
   /varset botTogglearray(1,9) taunt  
   	/varset botTogglearray(2,9) "Auto Taunt is now off." 
   	/varset botTogglearray(3,9) "Auto Taunt is now on" 
   	/varset botTogglearray(4,9) DoTaunt 
   	/varset botTogglearray(5,9) FALSE
   /varset botTogglearray(1,10) backstab   
   	/varset botTogglearray(2,10) "Auto Backstab is now off."
   	/varset botTogglearray(3,10) "Auto Backstab is now on." 
   	/varset botTogglearray(4,10) DoBackstab 
   	/varset botTogglearray(5,10) FALSE
   /varset botTogglearray(1,11) frenzy  
   	/varset botTogglearray(2,11) "Auto Frenzy is now off." 
   	/varset botTogglearray(3,11) "Auto Frenzy is now on." 
   	/varset botTogglearray(4,11) DoFrenzy 
   	/varset botTogglearray(5,11) FALSE
   /varset botTogglearray(1,12) evade  
   	/varset botTogglearray(2,12) "Auto Evade is now off." 
   	/varset botTogglearray(3,12) "Auto Evade is now on." 
   	/varset botTogglearray(4,12) DoEvade 
   	/varset botTogglearray(5,12) FALSE
   /varset botTogglearray(1,13) slam  
   	/varset botTogglearray(2,13) "Auto Slam is now off." 
   	/varset botTogglearray(3,13) "Auto Slam is now on." 
   	/varset botTogglearray(4,13) DoSlam 
   	/varset botTogglearray(5,13) FALSE
   /varset botTogglearray(1,14) bash  
   	/varset botTogglearray(2,14) "Auto Bash is now off." 
   	/varset botTogglearray(3,14) "Auto Bash is now on." 
   	/varset botTogglearray(4,14) DoBash 
   	/varset botTogglearray(5,14) FALSE
   /varset botTogglearray(1,15) beagg   
   	/varset botTogglearray(2,15) "Aggressive is set to off."  
   	/varset botTogglearray(3,15) "Aggressive is set to on." 
   	/varset botTogglearray(4,15) ${Aggressive} 
   	/varset botTogglearray(5,15) TRUE
   /varset botTogglearray(1,16) puller   
   	/varset botTogglearray(2,16) "I'm not the puller."  
   	/varset botTogglearray(3,16) "I'm the puller." " 
   	/varset botTogglearray(4,16) IsPuller  
   	/varset botTogglearray(5,16) TRUE
   /varset botTogglearray(1,17) autoengage   
   	/varset botTogglearray(2,17) "I will not engage when attack is on." 
   	/varset botTogglearray(3,17) "I will engage when attack is on." 
   	/varset botTogglearray(4,17) AutoEngage  
   	/varset botTogglearray(5,17) TRUE
   /varset botTogglearray(1,18) archery   
   	/varset botTogglearray(2,18) "Archery is set to off."  
   	/varset botTogglearray(3,18) "Archery is set to on"  
   	/varset botTogglearray(4,18) DoArchery  
   	/varset botTogglearray(5,18) TRUE
   /varset botTogglearray(1,19) aftercastsit   
   	/varset botTogglearray(2,19) "I will no longer sit after casting."  
   	/varset botTogglearray(3,19) "I will now sit after casting."  
   	/varset botTogglearray(4,19) ${SitAfterCast} 
   	/varset botTogglearray(5,19) FALSE
   /varset botTogglearray(1,20) autoheal
   	/varset botTogglearray(2,20) "Let me know when people need heals."  
   	/varset botTogglearray(3,20) "I'll watch for heals."  
   	/varset botTogglearray(4,20) IsHealer   
   	/varset botTogglearray(5,20) TRUE
   /varset botTogglearray(1,21) autohealpets    
   	/varset botTogglearray(2,21) "I will not heal the pets."  
   	/varset botTogglearray(3,21) "I will heal the pets."  
   	/varset botTogglearray(4,21) HealPets   
   	/varset botTogglearray(5,21) TRUE
   /varset botTogglearray(1,22) patchheal    
   	/varset botTogglearray(2,22) "I'm not a patch Healer."  
   	/varset botTogglearray(3,22) "I'm a patch Healer."  
   	/varset botTogglearray(4,22) PatchHealer   
   	/varset botTogglearray(5,22) TRUE
   /varset botTogglearray(1,23) reportlom    
   	/varset botTogglearray(2,23) "I won't tell you when I'm low on Mana."  
   	/varset botTogglearray(3,23) "I'll let you know when I'm low on Mana."  
   	/varset botTogglearray(4,23) reportlom   
   	/varset botTogglearray(5,23) FALSE
   /varset botTogglearray(1,24) autobehind    
   	/varset botTogglearray(2,24) "I won't position myself behind the mob."  
   	/varset botTogglearray(3,24) "I will position myself behind the mob."  
   	/varset botTogglearray(4,24) AutoBehind   
   	/varset botTogglearray(5,24) FALSE
   /varset botTogglearray(1,25) incite
   	/varset botTogglearray(2,25) "I won't use the incite discipline when in combat."
   	/varset botTogglearray(3,25) "I will use the incite discipline when in combat."  
   	/varset botTogglearray(4,25) DoIncite   
   	/varset botTogglearray(5,25) FALSE
   /varset botTogglearray(1,26) yaulp
   	/varset botTogglearray(2,26) "I won't Yaulp for mana."
   	/varset botTogglearray(3,26) "I will Yaulp for mana."  
   	/varset botTogglearray(4,26) DoYaulp   
   	/varset botTogglearray(5,26) True
   /varset botTogglearray(1,27) canni
   	/varset botTogglearray(2,27) "I won't eat myself for mana."
   	/varset botTogglearray(3,27) "I will eat myself for mana."  
   	/varset botTogglearray(4,27) DoCanni   
   	/varset botTogglearray(5,27) TRUE
   /varset botTogglearray(1,28) Checkname
   	/varset botTogglearray(2,28) "I will respond to all commands."
   	/varset botTogglearray(3,28) "I will only respond to commands that are addressed to me."  
   	/varset botTogglearray(4,28) CheckName   
   	/varset botTogglearray(5,28) TRUE
   /varset botTogglearray(1,29) Remem
   	/varset botTogglearray(2,29) "I won't remem my spellset after casting."
   	/varset botTogglearray(3,29) "I will remem my spellset after casting."  
   	/varset botTogglearray(4,29) Remem   
   	/varset botTogglearray(5,29) TRUE	
/return

Sub BuildShortCuts
	/declare shortcutsarray[4][100] string outer
	/declare ArrayShortcuts int outer 0
	/declare Shortcutlist string local
	/declare ArgNum int local 0
	/declare Short string local 0
	/declare SectionNum int local 0
	/declare SectionLabel string local 0
	/declare SetType int local 0
	/declare Targeted bool local False
	
	/for SectionNum 1 to 8  
		/if (${SectionNum}==1) {
			/varset SectionLabel "shortcut spells"
			/varset SetType 1
			/varset Targeted TRUE
		}
		/if (${SectionNum}==2) {
			/varset SectionLabel "shortcut Items"
			/varset SetType 2
			/varset Targeted TRUE
		}
		/if (${SectionNum}==3) {
			/varset SectionLabel "shortcut AA"
			/varset SetType 3
			/varset Targeted TRUE
		}
		/if (${SectionNum}==4) {
			/varset SectionLabel "Shortcut Disc"
			/varset SetType 4
			/varset Targeted TRUE
		}
		/if (${SectionNum}==5) {
			/varset SectionLabel "shortcut notarget Spells"
			/varset SetType 1
			/varset Targeted FALSE
		}
		/if (${SectionNum}==6) {
			/varset SectionLabel "shortcut notarget items"
			/varset SetType 2
			/varset Targeted FALSE
		}
		/if (${SectionNum}==7) {
			/varset SectionLabel "shortcut noTarget AA"
			/varset SetType 3
			/varset Targeted FALSE
		}
		/if (${SectionNum}==8) {
			/varset SectionLabel "shortcut noTarget Disc"
			/varset SetType 4
			/varset Targeted FALSE
		}
		/varset ArgNum 1
		/varset Shortcutlist ${Ini[${IniFile},${SectionLabel},-1,NULL]}
		/if (${Shortcutlist.NotEqual[NULL]}) {
			:shortcuts
			/if (${Shortcutlist.Arg[${ArgNum},|].Length}) {
				/varcalc ArrayShortcuts ${ArrayShortcuts}+1
				/varset Short ${Shortcutlist.Arg[${ArgNum},|]}
				|add Command
				/varset shortcutsarray(1,${ArrayShortcuts}) ${Short}
				|Add Spell Command Fires
				/varset shortcutsarray(2,${ArrayShortcuts}) ${Ini[${IniFile},${SectionLabel},${Short},NA]}
				|Set To True for Targeted Spell
				/Varset shortcutsarray(3,${ArrayShortcuts}) ${Targeted}
				|Set to Type 1 For Spell
				/Varset shortcutsarray(4,${ArrayShortcuts}) ${SetType}
				/varcalc ArgNum ${ArgNum}+1
				/goto :shortcuts
			}
		} 
	/next SectionNum
/return

Sub TellCmds-shortcuts 
   /declare counter int local 
   /declare cmds string local  
   /for counter 0 to ${botTogglearray.Size[2]}
      /varset cmds ${cmds}${botTogglearray(1,${counter})} 
   /next counter 
   /for counter 1 to ${ArrayShortcuts.Size[2]} 
   	/varset cmds ${cmds}${shortcutsarray(1,${counter})} 
   /next counter 
   /call ChatOut 2 ${MasterName} "${cmds}" 
/return 

Sub SetToggle
	/if (!${Defined[Param1]} && ${botTogglearray(5,${Param0})}) {
		/if (${${botTogglearray(4,${Param0})}}) {
			/call ChatOut 9 ${MasterName} "${botTogglearray(3,${Param0})}"
		} else {
			/Call ChatOut 9 ${MasterName} "${botTogglearray(2,${Param0})}"
		}
		/return
	}
	/if ( !${Defined[Param1]} && !${botTogglearray(5,${Param0})}) {
		/declare Param1 Local
		/if (${${botTogglearray(4,${Param0})}}) {
			/varset Param1 0
		} else {
			/varset Param1 1
		}
	}
	/varset ${botTogglearray(4,${Param0})} ${Param1}
	/if (${${botTogglearray(4,${Param0})}}) {
		/call ChatOut 9 ${MasterName} "${botTogglearray(3,${Param0})}"
	} else {
		/Call ChatOut 9 ${MasterName} "${botTogglearray(2,${Param0})}"
	}
/return

Sub ShortCut
	/declare CastText local
	/declare ArgNum Local
	/varset ArgNum 1
	/if (${shortcutsarray(3,${Param0})}) {
		/target clear
		/call StandardTarget "${CommandParam}"
		:targetCheck
			/if (${BreakOut}) /return
			/call delay 1
			/if (!${Target.ID}) /goto :targetCheck
	}
	:ShortCutCast
		/varset CastText "${shortcutsarray(2,${Param0}).Arg[${ArgNum},|]}"
		/if (${shortcutsarray(4,${Param0})}==1) /call Spellsub "${CastText}"
		/if (${shortcutsarray(4,${Param0})}==2) /cast item "${CastText}"
		/if (${shortcutsarray(4,${Param0})}==3) /alt activate "${CastText}"
		/if (${shortcutsarray(4,${Param0})}==4) /disc "${CastText}"
		/varcalc ArgNum ${ArgNum}+1
	/if (${shortcutsarray(2,${Param0}).Arg[${ArgNum},|].Length}) /goto :ShortCutCast
	/if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit}  
/return
Last edited by LordGiddion on Wed Apr 28, 2004 9:25 pm, edited 2 times in total.

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

Post by LordGiddion » Sat Apr 24, 2004 11:31 pm

personal.inc

Code: Select all

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


Sub PersonalCommands 
	|/declare BotPersonalsarray [2][1]
   |For each command
	|1,x Command Phrase to trigger bot - End User change change to suit prefferences
	|2,x Sub Routine to execute in response to command
   |/varset BotPersonalsarray (1,0) CommandName
   |/varset BotPersonalsarray (2,0) CommandFunction
/return 

Sub SetupPersonalVars
	|Declare you variables here and Set their Defaults
	|/declare PersonalValue string outer
	|/Declare AnotherValue int outer default
	|INI Values 
   |/varset PersonalValue "${Ini[${IniFile},Personal,PersonalValue,NotFound)" 
   |/if (${PersonalValue.Equal[NOTFOUND]}) {
   |	/ini ${IniFile} Personal PersonalValue "Example Value" 
   |  /varset PersonalValue "Default Value"
   |}   
/return 

Sub TellCmds-personal 
   /declare counter int local 0
   /declare cmds local 
   /for counter 0 to ${BotPersonalsarray.Size[2]}
      /varset cmds ${cmds}${BotPersonalsarray(1,${counter})}, 
   /next counter 
   /call ChatOut 2 ${MasterName} "${cmds}" 
/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

Last edited by LordGiddion on Wed Apr 28, 2004 9:27 pm, edited 1 time in total.

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

Post by LordGiddion » Sat Apr 24, 2004 11:31 pm

GenbotDoc.txt

Code: Select all

|GenbotDoc.txt 
|Manual for the Generic bot macro
|Version 12.10
|Date:04/28/2004 9:00 pm
| 
||** 
[genbotDoc] 
version=12.10
**||
| 

Welcome to Genbot, probably the easiest way to 2 box or to multibox multiple characters in Everquest.

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

By default your Bot will respond to any command the master character /tells him.

By changing the values of ListenGroup, ListenChat or sending the commands listenGroup, listenChat you can start the Bot listening for command sent either in Group or in a Chat Channel. The Bot will still only respond to characters on it's list of Masters but will do it these other channels.

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

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

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

Explination of commands your bot will understand
Core:
	afk Will cause the bot to turn on /afk you can also send a message you want the bot to put on the afk line

   accept Cause the bot to accept the current group invite
 
	reject Cause the bot to reject the current group invite

	invite Cause the bot to invite it's current target to group
 
	follow Causes the Bot to Follow the master or his designated target (see FollowMode)
 
	stop Forces the bot to stop what ever it's doing

	moveto commands the bot to move, options are ME, a location, or to a target (see MoveToMode)

	sit Makes the Bot sit

	stand Makes the Stand

	camp Causes the bot to camp out

	duck Commands the bot to duck

	norelay Stops the Bot from repeating tells to it's master

	say Commands the bot to /say what you tell it to

	tell Commands the bot to /tell what you tell it to first part of the command parameters should be the tell target

	group Commands the bot to /gsay what you tell it to

	cmds Causes the bot to return a list of available commands

	target Causes the bot to change it's target, the params can be Me (targets master) Yourself (bot targets itself) or by Target name

	notarget Causes the bot to clear it's target

	assist Causes the Bot to Assist the master, how the bot acts when assisting is controlled by toggles later in the docs

	saytarget The Bot will tell you what it's currently Targeting

	itemcast Causes the bot to trigger the specified Item
 
	lootup Commands the bot to loot the current Target if it's a corpse
 
	anchor Causes the bot to remember it's current location and return there between fights

	trade Commands the Bot to hit the Trade button in a trade window

	yesres Commands the bot to hit Yes on a confrim box

	consent Commands the bot to give consent

	reportbuffs Causes the Bot to tell it's master a list of currently active buffs

	petattack Commands the Bot to execute it's /pet attack command

	petguard Commands the Bot to execute it's /pet guard command

	petback Commands the Bot to execute it's /pet back command
	
	relay Starts the bot resending tells to it's master

	run Causes the Bot to Toggle the run setting

	door Causes the bot to attempt to open the closest door

	verbosity Changes what level chat the bot actual sends to the master

	chatin Changes what channel the bot will use for replying to the master

	lootall Causes the bot to attempt to loot all corpses arround it

	face Causes the Bot to face it's current Target

	autoinv Commands the Bot to execute it's /autoinv command

	anchorradius Sets how close the Bot must be to it's achor location before it stops moving

	rmod causes the bot to change relative distances in combat

	rset Changes the range settings the Bot uses for combat
 
	stay Causes the bot to stop following

	pause Pauses the advanced follow command

	reload Causes the bot to re-init the macro

	mount Causes the Bot to get on to it's mount

	dismount Causes the Bot to /Dismount

	random Causes the Bot to /ran 

	exp Commands the Bot to Reply with it's current Exp percent

	Setvar Sets a Var to new setting

	Rptvar Commands the Bot to Reply with the current value of a variable
	
	FollowMode Sets what how the bot Follows 1 = is Combat mode, 2 = AdvPathFollow, 3 = EQ's /follow
	
	MoveToMode Sets how the bot movesto 1 = is noraml Genbot Anchor type, 2 = AdvPathGoto
	
	CheckName if set to true bot will only respond to commands in group or chat if the command is preceeded with <botname>

Combat:	
	attack Commands the Bot to start attacking
	
	noattack Commands the Bot to Stop attacking
   
	getbehind Commands the Bot to move behind the specified Target

	behind Commands the Bot to move behind it's current Target
 
	disc Commands the Bot to fire the specified /Disc

	shield Commands the Bot to /shield it's master

	hide Commands the Bot to use it's Hide ability

	sneak Commands the Bot to use it's Sneak ability
	 
Spell:
	sn Commands the Bot to cast the specified spell on master's current Target

	mana Commands the Bot to reply with it's current Mana

	evac Commands the Bot to move to it's master and cast it's evac spell
	
	loadlist Commands the Bot to load a spell list

	snt Commands the Bot to cast <spell> ON <target>

	setlompct Sets what level of mana the bot conciders Low Mana for reporting 

	chainnuke Commands the Bot to start chaining Nukes on <target>

	chainstun Commands the Bot to start chaining Stuns on <target>

	Buff Commands the Bot to cast buff <spell> ON <target>, Bot will remember the Buff and Target and will automatically refresh it
	
	SpellGem This sets the Spell gem that the bot will use when required to memorize a new spell.
	
Healer:
	settankheal Set what spell the Bot uses to heal Tanks

	setcasterheal Set what spell the Bot uses to heal Casters

	setdefaultheal Set what spell the Bot uses to for the heal command

	heal Commands the Bot to heal <target>

	setpetheal Set what spell the Bot uses to heal Pets

	watchtarget Causes the bot to monitor the hit points of <target> Needs to have autoheal on if target should be healed

	resetwatch Causes the Bot to reaquire the ID's of it's targets, good to execute after zoning

	setpatchheal Set what spell the Bot uses to Patch heal
 
	setcasterhealpct Set what HP level a caster should be down to for the Bot to fire it's heal

	settankhealpct Set what HP level a Tank should be down to for the Bot to fire it's heal

	setpethealpct Set what HP level a Pet should be down to for the Bot to fire it's heal

Toggles:
	listengroup Controls if the bot will listen for commands in the group Channel
  
	aona Controls if the bot will attack when ordered to assist
   	
	bona Controls if the bot will attempt to attack from behind when ordered to assist
   	
	petona Controls if the bot will send in it's pet when ordered to assist
   	
	ListenChat Controls if the bot will listen for commands in the Chat Channel
   	
	kick Controls if the bot will use kick during fighting
   	
	flyingkick  Controls if the bot will use flyingkick during fighting
   	
	disarm  Controls if the bot will use Disarm during fighting
   	
	traps  Controls if the bot will attempt to find and disarm traps
   	
	taunt  Controls if the bot will use Taunt during fighting
   	
	backstab Controls if the bot will use backstab during fighting
   	
	frenzy  Controls if the bot will use frenzy during fighting
   	
	evade  Controls if the bot will use Hide during fighting
   	
	slam  Controls if the bot will use Slam during fighting
   	
	bash  Controls if the bot will use Bash during fighting
   	
	beagg Controls if the bot will automatically fight back when attacked
   	
	puller Controls if the bot will return to it's anchor point when attacked
   	
	autoengage Controls if the bot will close and engage when in combat
   	
	archery   Controls if the bot will use archery during fighting
   	
	aftercastsit   Controls if the bot will sit after casting spells
   	
	autoheal Controls if the bot will automatically use heals on group and watch targets
   	
	autohealpets  Controls if the bot will automatically use heals on pets

	patchheal Controls if the bot will automatically patch heal targets below half their heal percent 

	reportlom Controls if the bot will automatically report when it's Low on Mana

	autobehind Controls if the bot will automatically attempt to fight behind all targets during combat   

	incite Controls if the bot will use incite during fighting

	yaulp Controls if the bot will automatically use Yaulp when low on Mana

	canni Controls if the bot will automatically use Canninbalize when low on Mana

Last edited by LordGiddion on Wed Apr 28, 2004 9:29 pm, edited 2 times in total.

Diggler
> Oid
Posts: 120
Joined: Thu Oct 09, 2003 3:28 pm
Location: Lexington, KY

Post by Diggler » Sun Apr 25, 2004 12:12 am

Thanks for posting yours bro, my job is done here now. GL with this massive macro =)

User avatar
Seagreen500
crash test
Posts: 47
Joined: Mon Nov 10, 2003 1:04 am

Post by Seagreen500 » Sun Apr 25, 2004 12:36 am

Hey Diggler,


I know without the work you did, I would've stopped looking at GenBot weeks ago.

I've gotta say, its a sweet macro.

Thanks to all that invested time into it.



Seagreen

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

Post by Fuergrissa » Sun Apr 25, 2004 2:02 am

Hey Diggler great job on getting the old genbot working when we all needed it.

THANK YOU

and a great Thank you to Lord Giddion for the new one.

xander
a lesser mummy
a lesser mummy
Posts: 33
Joined: Thu Apr 22, 2004 11:40 pm

Post by xander » Sun Apr 25, 2004 2:26 am

Looks like your ini file doesn't put all the possible values in when it builds a new one. So far i've noticed ChatIn, and ChatInChannel were missing.
Xander

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

couple of small issues im sure

Post by Fuergrissa » Sun Apr 25, 2004 3:02 am

mount does not work, old mountup does nothing, the mount returns an error stating it cant find D0-Mount, camp does not work dismounts but ends there, also i cant get any shortcuts to work other than root here is an example of my ini file genbot_toon.ini

Code: Select all

TankList=Warrior|Shadow Knight|Paladin|Monk|Beastlord|Ranger|Shaman
CasterList=Necromancer|Wizard|Enchanter|Magician|Rogue|Druid|Cleric|Bard
=
[shortcut spells] 
Root=Instill
buff=armor of faith
[shortcut Items] 
[shortcut notarget Spells] 
[shortcut notarget items]  
[shortcut AA] 
[shortcut noTarget AA] 
[Shortcut Disc] 
[shortcut noTarget Disc]
now root works fine but i cannot get buff to work, also the mule never retunrs any text to me whatsoever.

great bot and im sorry if i have not just done something simple.

Spanky_Monkey
a ghoul
a ghoul
Posts: 103
Joined: Wed Feb 19, 2003 3:10 pm

this seems flawed

Post by Spanky_Monkey » Sun Apr 25, 2004 5:50 am

I noticed some but not all of our genbot_name.ini things get reset... so I looked and this might be flawed

Code: Select all

   /varset ReportAutoHeal ${Ini[@IniFile,Healer,ReportAutoHeal,0]} 
   /if (!@ReportAutoHeal) { 
      /ini "@IniFile" Healer ReportAutoHeal 1 
      /varset ReportAutoHeal 1 
   } 
If reportautoheal=0 doesn't that also evaluate to the same as the line being there? isin't !@reportautoheal the same as having a zero so it resets it to 1 even though I just don't want to report heals? I dunno might be wrong but that is the problem I am seeing, I want less spam, heh I know my cleric bot will not go out of mana so I don't worry about seeing em. I also play the entire set of bots from the cleric so I know when heals are going.