Genbot v13.3.7 [Updated 04/19/05]

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

Moderator: MacroQuest Developers

Charisa
a hill giant
a hill giant
Posts: 165
Joined: Tue Apr 06, 2004 5:38 pm

Post by Charisa » Thu Jul 21, 2005 6:40 pm

God its so good to have this back, it might be old kludged together technollogy and there may be better scripts but its like my old tennis shoes that I won't get rid of till the souls fall off the bottom.

That said wonder how hard it would be to conver the routines that were done over in VIP some time back :) Hmmm....guesss I can compare the old genbot and the new one and figure out the proper syntaxes unless someone has done this alread

Slackro
a lesser mummy
a lesser mummy
Posts: 46
Joined: Sun Apr 17, 2005 2:30 pm

Post by Slackro » Fri Jul 22, 2005 10:34 am

Charisa wrote:That said wonder how hard it would be to conver the routines that were done over in VIP some time back :) Hmmm....guesss I can compare the old genbot and the new one and figure out the proper syntaxes unless someone has done this alread
I wasn't aware of any Genbot updates made in VIP, since the devs don't seem to touch it. Could you IM me a link? I'd like to see what your talking about.

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Fri Jul 22, 2005 10:48 am

There was/is an extension for genbot in VIP which allows you to write your own custom events for genbot to make it act more like advbot/raiddruid does (AKA it allows you to automate some functions instead of having to manually having to tell your bots to buff, attack, debuff, etc)

But in using it, you'd have to have some working knowledge of making your own macros.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

Slackro
a lesser mummy
a lesser mummy
Posts: 46
Joined: Sun Apr 17, 2005 2:30 pm

Post by Slackro » Fri Jul 22, 2005 11:35 am

A_Druid_00 wrote:There was/is an extension for genbot in VIP which allows you to write your own custom events for genbot to make it act more like advbot/raiddruid does (AKA it allows you to automate some functions instead of having to manually having to tell your bots to buff, attack, debuff, etc)

But in using it, you'd have to have some working knowledge of making your own macros.
Honestly I don't even remember where I got the version I have been hacking away at forever, it may even have originally been from ViP and I just don't remember, but hasn't genbot always had a section for adding your own personalized subs and events?

Looking at the code in this very thread I see (from genbot.mac):

Code: Select all

|Things that you want to happen every loop through the macro go in this sub.
Sub IndividualMain

   |/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
So what is this new functionality you are referring to?

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Fri Jul 22, 2005 11:40 am

Possibly, its been so long since I even bothered to look at anything related to GenBot's internals that I honestly don't remember. I believe the part you're referring too is a watered down version of the botroutines. Not 100% sure though, go mining the VIP macros section, it can't be too far down.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Fri Jul 22, 2005 12:09 pm

Here, I did the digging for you. Took me less than 3 minutes without using the search feature (It's not like 4 pages of macros is a lot):
http://www.macroquest2.com/phpBB2/viewtopic.php?t=7560
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

Vandil
decaying skeleton
decaying skeleton
Posts: 2
Joined: Fri Jul 22, 2005 11:06 pm

Post by Vandil » Fri Jul 22, 2005 11:13 pm

Hey im having a very odd issue wiht Genbot atm, when i have it running i have no problems with it healing or doign the jobs i ask but whenever i have it running and someone sends my cleric a tell she sends ALL the master info to them like "Casting Complete healing on %T" and continues to send them tells until i notice and send her a tell on my main bringing tells back to me. I dont know if it makes them a master when this happens but i would assume since she sends tells to them it does. Any help is appreciated.

Here is my Genbot files.

--------------------------------------------------------------------
|genbot.mac
|Personal commands module example.
|Version 13.4.0
|Date:07/08/2005
|
||**
[individual]
version=13.4.0
**||

| Use this file to add in character or task specific routines or commands
| That will not apply to all of your characters. Use botcommon.inc for
| your own routines and commands that you want all of your bots to be able
| to use.

| Since this mac calls all of the other .inc files, feel free to change the
| name to botname1.mac or time.mac or tradeskill.mac or whatever according
| to how you customize it.


| Change "bot_" below to specify a different .ini file.
| Useful if you want to make separate files for different activities for the
| same character.

#define INI_FILE_PREFIX bot_

#include botmain.inc

|Define your personal Events Here
|#Event EExample "Explain it to me again"

Sub Init-Individual

|/call AddCommands Command_Phrase1 <Command_Phrase2> <Command_Phrase3> . . .
| Command_Phrase - what the master will type to invoke the command
| Put in as many command phrases as you like on the same line.
| The subroutine called will be Command-Command_Phrase1, etc.
| example: /call AddCommands sit stand moveto
| with subroutines called Command-sit, Command-stand, and Command-moveto

|/call AddToggle Command ToggleDefaultValue|noini return|toggle "PhraseOff" "PhraseOn" <callsub>
|
| example: /call AddToggle sitaftercast off return "I will no longer sit after casting." "I will now sit after casting." callsub
|
| Command switch a Toggle - End User change change to suit prefferences
| The actual name of the toggle variable will be ${Toggle-ToggleName}.
| In our example, this would be ${Toggle-sitaftercast}
| ToggleDefaultValue should be whatever you want the default value to be.
| This value will be entered into the ini file, under the Command name.
| If noini is used, then no .ini entry will be created, and the default
| will be set to FALSE.
| return will return the toggle setting when no param is given
| toggle will toggle the toggle setting when no param is given
| PhraseOff returned by the bot when value is FALSE
| PhraseOn returned by the bot when value is TRUE
| callsub - optional - if entered, SetToggle will call ToggleCommand subroutine
| (ex. Sub Toggle-sitaftercast) after setting the toggle and before outputting
| the result

|/declare PersonalValue string outer
|/declare AnotherValue int outer default

|INI Values
|/call LoadSetting PersonalVar VarType Personalkey "Default Value"
| Declares and initializes variable PersonalVar by reading from the .ini key
| called PersonalKey
| If no PersonalKey entry in .ini file, or entry is blank, "Default Value"
| is entered in .ini file.
| Valid VarTypes are string, int, bool, and event.

/return

|Things that you want to happen every loop through the macro go in this sub.
Sub IndividualMain

|/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
---------------------------------------------------------------------------
|botmain.inc
|Generic bot macro for any class.
|Version 13.4.0
|Date:07/08/2005
|
||**
[genbot]
version=13.4.0
**||
|

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

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

Sub Main
/declare GenFor int local
/declare SectionName string outer
|----------------------------------------------------------------------
|Initialize MasterList (characters that can control this bot)
|Checks to see if list already exists in case a reload is done
|----------------------------------------------------------------------
/if (!${Defined[MasterList]}) {
/if (!${Defined[Param0]}) {
/echo Usage: /macro generic <Master Name1> <Master Name2>...
/endmacro
}
/declare MasterList string outer
}
|----------------------------------------------------------------------
|clear and rebuild master list if a list is passed
|----------------------------------------------------------------------
| /if (${Defined[Param0]}) {
| /for GenFor 0 to ${Macro.Params}
| /call ListAppendElement MasterList ${Param${GenFor}} " "
| /next GenFor
| }
|----------------------------------------------------------------------
|Call the Initialize Sub of each include file
|----------------------------------------------------------------------
/declare SectionsList string outer Core Combat Spell Healer Shortcuts Common Individual
/for GenFor 1 to ${Math.Calc[${SectionsList.Count[ ]}+1]}
/declare cmds-${SectionsList.Arg[${GenFor}]} string outer
/next GenFor

/for GenFor 1 to ${Math.Calc[${SectionsList.Count[ ]}+1]}
/varset SectionName ${SectionsList.Arg[${GenFor}]}
/call Init-${SectionName}
/next GenFor

| Setting SectionName to blank let's SetToggle routine know it can talk again.
/varset SectionName
|----------------------------------------------------------------------
|Main program loop performs subs for each include file
|----------------------------------------------------------------------
:MainLoop
/doevents
/if (${Toggle-doheal}) /call HealerMain
/if (${CombatTargetID}) /call CombatMain
/call CoreMain
/call SpellMain
/call CommonMain
/call IndividualMain
/goto :MainLoop

/return


|-------------------------------------------------------------------------
| SHORTCUT SUBROUTINES
|-------------------------------------------------------------------------

|----------------------------------------------------------------------
| Init-Shortcuts: to load in shortcuts from the .ini file
|----------------------------------------------------------------------

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

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

|----------------------------------------------------------------------
| Command-shortcuts: to list available shortcuts
|----------------------------------------------------------------------


Sub Command-shortcuts
/declare myvar string local
/varset myvar ${cmds-Shortcuts.Lower}
/if (${Defined[Param0]}) {
/if (${myvar.Find[ ${Param0.Lower} ]}) {
/call ChatOut 3 "Shortcut ${Param0} does: ${ShortCuts-${Param0}-Text}"
} else {
/call ChatOut 3 "I don't know the shortcut ${Param0}."
}
} else {
/call ChatOut 3 "${cmds-Shortcuts}"
/call ChatOut 3 "Type: shortcuts name_of_shortcut for more information on any particular shortcut.
}
/return

|----------------------------------------------------------------------
| Init-Shortcuts: execute a shortcut
|----------------------------------------------------------------------

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

/varset Name ${ShortCutCommand.Arg[1].Lower}
/varset ParseText ${ShortCuts-${Name}-Text}
/if (${ParseText.Find[NameS]} && ${ShortCutCommand.Arg[2].Length}) {
/vardata CommandParam ParseText
/call StringReplaceAll CommandParam NameS "${ShortCutCommand.Right[${Math.Calc[-${ShortCutCommand.Arg[1].Length}-1]}]}"
/vardata ParseText CommandParam
}
/for GenFor 1 to ${Math.Calc[${ParseText.Count[|]}+1]}
/call ExecCommand "${ParseText.Arg[${GenFor},|]}"
/next GenFor
/return


|-------------------------------------------------------------------------
| INITIALIZATION CONTROL SUBROUTINES
|-------------------------------------------------------------------------

|----------------------------------------------------------------------
| AddCommands: add a command
|----------------------------------------------------------------------

Sub AddCommands
/declare myvar string local
/varset myvar ${cmds-${SectionName}}
/declare GenFor int local
/for GenFor 0 to ${Math.Calc[${Macro.Params}-1]}
|/echo addcommands_routine
|/echo ${Param${GenFor}}
/if (!${myvar.Find[ ${Param${GenFor}} ]}) {
/call ListAppendElement cmds-${SectionName} ${Param${GenFor}} " "
}
/next GenFor
/return

|----------------------------------------------------------------------
| AddToggle: add a toggle command and load initial setting from .ini
|----------------------------------------------------------------------

Sub AddToggle(string Name,string TogDefault,string TogType,string OffText,string OnText,string CallSub)
/declare Setting string local
/if (!${Defined[Toggle-${Name}]}) {
/declare Toggle-${Name} bool outer
/declare Toggle-${Name}-OffText string outer
/declare Toggle-${Name}-OnText string outer
/declare Toggle-${Name}-ToggleType string outer
/declare Toggle-${Name}-CallSub bool outer
}
/varset Toggle-${Name}-OffText ${OffText}
/varset Toggle-${Name}-OnText ${OnText}
/varset Toggle-${Name}-ToggleType ${TogType}
/if (${CallSub.Lower.Equal[callsub]}) {
/varset Toggle-${Name}-CallSub TRUE
} else {
/varset Toggle-${Name}-CallSub FALSE
}
/if (${TogDefault.Equal[noini]}) {
/varset Toggle-${Name} FALSE
} else {
/call LoadSetting ${Name} toggle ${Name} ${TogDefault}
}
/call ListAppendElement cmds-${SectionName} ${Name} " "
/return

|----------------------------------------------------------------------
| SetToggle: set the value of the .ini and repeat current setting
|----------------------------------------------------------------------

Sub SetToggle(string Name,string newValue)
/declare OutputString string local
/declare myvar string local
/varset myvar " true on 1 yes "

| If no argument and Toggle is a toggle type, toggle it.
/if (!${Defined[newValue]}) {
/if (${Toggle-${Name}-ToggleType.Equal[toggle]}) {
/if (${${Toggle-${Name}}) {
/declare newValue string local 0
} else {
/declare newValue string local 1
}
} else {
/declare newValue string local ${${Toggle-${Name}}
}

| If it has an argument, set according to argument, and clear newValue.
} else {
/varset newValue ${newValue.Lower}
/if (${myvar.Find[ ${newValue} ]}) {
/varset Toggle-${Name} 1
/varset newValue
} else {
/varset myvar " false off 0 no "
/if (${myvar.Find[ ${newValue} ]}) {
/varset Toggle-${Name} 0
/varset newValue
}
}
}

| Call the extended function sub if indicated.
/if (${Toggle-${Name}-CallSub}) {
/call Toggle-${Name} ${newValue}
}

| If we're still initializing, don't output the setting.
/if (${SectionName.Length}) /return

| Find the appropriate response string for new toggle setting.
| Using CommandParam for the output string just cuz I'm too lazy
| to declare another outer string.
/if (${Toggle-${Name}}) {
/varset CommandParam ${Toggle-${Name}-OnText}
} else {
/varset CommandParam ${Toggle-${Name}-OffText}
}

| Replace any @'s with $'s for runtime values.
/if (${CommandParam.Count[@]}) {
/call CollapseParams CommandParam
/varset CommandParam ${Macro.Return}
}

| Say what you've come to say.
/call ChatOut 6 "${CommandParam}"
/return

|----------------------------------------------------------------------
| LoadSetting: load a variable value from the .ini file
|----------------------------------------------------------------------

Sub LoadSetting(string VarName,string VarType,string KeyName,string DefaultValue)
/declare RealSection string local ${SectionName.Upper}
/if (${VarType.Equal[shortcut]} || ${VarType.Equal[event]}) {
/varset RealSection ${VarType.Upper}S
}

| Initialize the .ini file.
/if (!${Defined[IniFile]}) {
/declare IniFile string outer INI_FILE_PREFIX${Me.CleanName}.ini
}

| Read value from .ini file
/declare IniValue string local ${Ini[${IniFile},${RealSection},${KeyName},NOTFOUND]}
| If no .ini value, use the DefaultValue
/if (${IniValue.Equal[NOTFOUND]}) {
/ini ${IniFile} "${RealSection}" "${KeyName}" "${DefaultValue}"
/varset IniValue ${DefaultValue}
}

| If it's a string, set the varname-DefaultValue variable
/if (${VarType.Equal[string]}) {
/if (!${Defined[${VarName}-DefaultValue]}) {
/declare ${VarName}-DefaultValue ${VarType} outer
}
/vardata ${VarName}-DefaultValue DefaultValue

|If it's a shortcut, then set the shortcut var and add to the list of shortcuts
} else /if (${VarType.Equal[shortcut]} || ${VarType.Equal[event]}) {
/if (!${IniValue.Lower.Equal[none]}) {
/if (!${Defined[ShortCuts-${VarName.Lower}-Text]}) {
/declare ShortCuts-${VarName.Lower}-Text string outer
}
/varset ShortCuts-${VarName.Lower}-Text ${IniValue}
/call ListAppendElement cmds-Shortcuts ${VarName.Lower} " "
}
/return

| If it's a toggle, then use SetToggle sub to give the value.
} else /if (${VarType.Equal[toggle]}) {
/call SetToggle ${VarName.Lower} ${IniValue}
/return
}

| Must be not a shortcut nor a toggle, since not /returned yet.
/if (!${Defined[${VarName}]}) {
/declare ${VarName} ${VarType} outer
}
/varset ${VarName} ${IniValue}
/return

|----------------------------------------------------------------------
| CollapseParams: replace @'s with $'s to evaluate datavars at runtime
|----------------------------------------------------------------------

Sub CollapseParams(string Parms)
/declare GenFor int local
/declare stemp string local
/declare sint int local

|/echo Parms ${Parms} ${${Parms}}

/varset sint ${${Parms}.Count[@]}
|/if (Debug) /echo name ${Name} schar @ sint ${sint}
/if (${sint}) {
/varset stemp ${${Parms}.Arg[${Math.Calc[${sint}+1]},@]}
|/if (Debug) /echo stemp ${stemp}
/for GenFor ${sint} downto 1
|/if (Debug) /echo In for loop
/if (${${Parms}.Arg[${GenFor},@].Length}) {
/varset stemp ${${Parms}.Arg[${GenFor},@]}$${stemp}
} else {
/varset stemp $${stemp}
}
/next GenFor
} else {
/varset stemp ${${Parms}}
}
|/echo new result ${stemp}
/return ${stemp}
---------------------------------------------------------------------------
|botcore.inc
|Bot core module.
|Version 13.4.0
|Date:07/08/2005
|
||**
[botcore]
version=13.4.0
**||

#chat chat
#chat group
#chat tell

#event Appear "You appear."
#event Appearing "You feel yourself starting to appear."
#event CorpseTooFar "You are too far away to loot that corpse."
#event EscKey "You no longer have a target."
#event ExpGained "#*#You gain#*#experience#*#"
#event FollowOff "You are no longer auto-following#*#"
#event ImDead "You have been slain by#*#"
#event Invite "#1# invites you to join a group."
#event IRCSAY "<#1#> #2#"
#event IRCMSG "<#1#/#*#> #2#"
#event LosingLev "You feel as if you are about to fall"
#event SelfEcho "[MQ2] Genbot #*#"
#event Zoned "LOADING, PLEASE WAIT..."
#Event AltTell "#1# told you, '#2#"
#Event AltTell "#1# tells you,#*#, '#2#"

Sub Init-Core
|For each command
|/call AddCommand "Command Section" "Command Phrase" "Called Sub"
|Command Section - where the command will be listed in response to the cmd phrase
|Command Phrase to trigger bot - End User can change to suit prefferences
|Called Sub - Routine to execute in response to Command Phrase
/call AddCommands accept afk autoinv anchor anchorradius assist
/call AddCommands autoinv camp chatin cmds consent dismount door duck
/call AddCommands exp equip face follow followmode group invite
/call AddCommands lootall lootup mount moveto movetomode notarget
/call AddCommands pause petattack petback petguard random reject
/call AddCommands reload rmod rptvar run say saytarget setvar shortcuts sit stand
/call AddCommands stay stop tell target trade verbosity yesres
/call AddCommands buff chainnuke chainstun evac loadlist
/call AddCommands mana selfbuff bufflist setlompct sn snt spellgem
/call AddCommands heal resetwatch setcasterheal setcasterhealpct
/call AddCommands setdefaultheal setpatchheal setpetheal setpethealpct
/call AddCommands settankheal settankhealpct watchtarget

|Declare Vars
/declare advpath bool outer
/declare Afollow int outer 0
/declare AnchorLoc string outer 0
/declare BreakOut bool outer FALSE
/declare CombatTargetID int outer 0
/declare CommandParam string outer
/declare CorpseList string outer
/declare CurrCommand string outer
/declare FollowTarget string outer
/declare IsAnchored bool outer FALSE
/declare LootTooFar int outer 0
/declare MasterName string outer ${MasterList.Arg[1, ]}
/declare MoveToDest string outer
/declare MoveToRange string outer 0

/declare ObstacleCheck int outer 0
/declare SubCallName string outer
/declare TalkToSelf bool outer

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

/call LoadSetting AnchorRadius int AnchorRadius 6
/call LoadSetting ChatIn string ChatIn Tell
/call LoadSetting ChatInChannel string ChatInChannel "Channel Name"
/call AddToggle checkname off return "I will respond to all commands." "I will only respond to commands that are addressed to me."
/call LoadSetting CorpseRadius int MaxLootRadius 50
/call LoadSetting followmode int followmode 1
/call LoadSetting IgnGroupList string IgnGroupList duck|say|tell|group|cmds|trade|run|backstab|taunt|evade|slam|bash|kick|flyingkick|disarm|traps|puller||
/call LoadSetting ListenChan string ListenChan Name_of_channel
/call AddToggle listenchat on return "I will ignore Chat" "I will listen in Chat."
/call AddToggle listengroup on return "I will ignore Group Chat." "I will listen in Group Chat."
/call LoadSetting MountItem string MountItem "Name of Bridle or Drum"
/call LoadSetting MaxTargetRange int MaxTargetRange 250
/call LoadSetting movetomode int movetomode 1
/call AddToggle relaytells on return "I will not relay tells to my master." "I will relay tells to my master."
/call AddToggle trap off return "I will not detect for traps." "I will detect for traps."
/call LoadSetting Verbosity int Verbosity 9
/call LoadSetting DebugList string DebugList "None"

/varset SectionName advpath

/call LoadSetting FaceFastini int FaceFast 1
/call LoadSetting SilentFlagini int SilentFlag 1
/call LoadSetting SpeedSenseini int SpeedSense 15
/call LoadSetting FollowDistanceini int FollowDistance 20

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

/assist off

/squelch /alias /gb /echo genbot
/squelch /alias /botsay /call ChatOut 1
/squelch /alias /then /multiline ; /varset DidThenClause 1 ; /call ExecCommand

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

Sub CoreMain
|Check Protect
/if (${Toggle-protect}) {
/declare MobID int local ${Spawn[pc ${MasterName}].NearestSpawn[npc radius ${MeleeRadius} zradius 10].ID}
/if (!${MobID}) {
/varset MobID ${Spawn[pc ${MasterName}].NearestSpawn[pet radius ${MeleeRadius} zradius 10].ID
/if (!${Spawn[id ${MobID}].Master.Type.Equal[npc]}) /varset MobID 0
}
/if (${MobID} && ${CombatTargetID}!=${MobID}) {
/call CheckIsLookingAt ${MobID} ${Spawn[${MasterName}].ID}
/if (${Macro.Return}) {
/call CheckNeverKill ${MobID}
/if (${Macro.Return}) {
/call Target "id ${MobID}"
/varset CombatTargetID ${MobID}
/call ExecCommand EventProtect ${Spawn[id ${CombatTargetID}].CleanName}
}
}
}
}
/if (${MoveToDest.Length}) /call MoveTo
/if (${Me.Combat} && (${Target.Type.Equal[NPC]} || ${Target.Master.Type.Equal[npc]}) && ${Toggle-autoengage} && ${Target.Distance}<${MeleeMaxRadius}) {
/varset CombatTargetID ${Target.ID}
} else /if (${CombatTargetID}) {
/return
} else /if (${Me.Combat}) /attack off
/if (${Toggle-trap} && ${Me.AbilityReady[Sense Traps]}) /doability "Sense Traps"
/if (${IsAnchored}) {
/if (${Math.Distance[${AnchorLoc}]}>${AnchorRadius}) {
/if (!${MoveToDest.Length} && !${CombatTargetID}) /call MoveTo "${AnchorLoc}"
} else {
/if (${Toggle-sitaftercast} && ${Me.Standing} && !${SitTimer}) /varset SitTimer ${DelayBeforeSit}
|Check Guard
/if (${Toggle-guard} && ${Spawn[npc radius ${GuardRadius}].ID}) {
/call CheckNeverKill ${NearestSpawn[npc radius ${GuardRadius}].ID}
/if (${Macro.Return}) {
/call Target "id ${NearestSpawn[npc radius ${GuardRadius}].ID}"
/varset CombatTargetID ${NearestSpawn[npc radius ${GuardRadius}].ID}
/call ExecCommand EventGuard ${NearestSpawn[npc radius ${GuardRadius}].CleanName}
}
}
}
/return
}
/if (${Toggle-guard}) /call ExecCommand guard off
/if (${advpath}) /call AdvPathPoll
/if (${Afollow} && !${NearestSpawn[${FollowTarget} radius FollowDistanceini].ID}) {
/call MoveTo "${FollowTarget}"
}
/return

||||||||||||Command-subs

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

Sub Command-reject
/squelch /target clear
/disband
/return

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

Sub Command-anchor
/if (!${IsAnchored}) {
/varset IsAnchored 1
/varset AnchorLoc ${Me.Y},${Me.X}
/varset Afollow 0
/varset FollowTarget NULL
/if (${advpath} && ${FollowFlag}) /call StopFunction
/keypress left
/keypress right
/call ChatOut 5 "Created anchor at Loc: ${AnchorLoc}."
/return
}
/if (${IsAnchored}) {
/varset IsAnchored 0
/call ChatOut 5 "Removed Anchor."
}
/return

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

Sub Command-assist(string AssistName)
/if (!${Defined[AssistName]}) {
/call Assist "${MasterName}"
} else /if (${AssistName.Equal[me]}) {
/call Assist "${MasterName}"
} else /if (${AssistName.Equal[yourself]}) {
/return
} else /if (${AssistName.Equal[${Me.CleanName}]}) {
/return
} else {
/call Assist "${CommandParam}"
}
/if (!${Target.ID}) {
/call ChatOut 5 "I failed to get a target."
} else {
/call ChatOut 5 "My target is now ${Target.CleanName}."
/varset CombatTargetID ${Target.ID}
/if (${Toggle-petona}) {
/if (${Me.Sitting}) /Stand
/call Delay 5
/pet attack
/call Delay 5
/if (${Toggle-sitaftercast} && ${Me.Standing}) /varset SitTimer ${DelayBeforeSit}
}
}
/call ExecCommand assistcall
/return

Sub Command-autoinv
/autoinventory
/return

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

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

Sub Command-cmds
/if (${Defined[Param0]} && ${SectionsList.Find[${Param0}]}) {
/call ChatOut 2 "${cmds-${Param0.Left[1].Upper}${Param0.Right[-1].Lower}}"
/return
} else {
/call ChatOut 3 "Must specify one of ${SectionsList}"
}
/return

Sub Command-consent(string TargetName)
/if (!${Defined[TargetName]}) {
/call Assist "${MasterName}"
/varset CommandParam ${Target.CleanName}
/consent ${Target.CleanName}
} else /if (${TargetName.Equal[me]}) {
/call ChatOut 3 "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 "I gave consent to ${CommandParam}"
/return

Sub Command-dismount
/dismount
/call ChatOut 5 "I got off my mount."
/return

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

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

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

Sub Command-equip
/if (${Macro.Params}>1) {
/for counter 1 to ${Math.Calc[${Macro.Params}-1]}
/varset CommandText ${CommandText} ${Param${counter}}
/next counter
/if {Debug-Core} /echo Command-equip CommandText ${CommandText}
}
/declare SlotName string local ${CommandText.Arg[${Math.Calc[${CommandText.Count[ ]}+1]}]}
/if (${InvSlot[SlotName]} && ${InvSlot[SlotName]}<22) {
/varset slotName ${SlotName}
/varset CommandText ${CommandText.Right[-${CommandText.Arg[${Math.Calc[${CommandText.Count[ ]}+1]}].Length}]}

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

/return

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

Sub Command-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 (${Spawn[${FollowTarget}].ID}) {
/call ChatOut 5 "I am now following ${Spawn[${FollowTarget}].CleanName}."
} else {
/call ChatOut 5 "Unable to follow ${FollowTarget}."
/call StopFunction
/varset Afollow 0
/return
}
/if (${followmode}==1) {
/varset Afollow 1
}
/if (${followmode}==2) {
/call FollowFunction "${Spawn[${FollowTarget}].CleanName}"
}
/if (${followmode}==3) {
/follow
}
/return

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

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

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

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

Sub Command-lootup
/if (${Me.Combat}) {
/call ChatOut 6 "I'm busy fighting right now. Ask me to loot again later!"
/return
}
/if (${Defined[Param0]}) {
/call Target "corpse ${CommandParam}"
}
/call Loot
/return

Sub Command-mount
/declare myvar string local
/varset myvar " item alt spell slot "
/if (${Me.Sitting}) /stand
/if (!${myvar.Find[ ${MountItem.Arg[1].Arg[1,-]} ]}) /varset MountItem item ${MountItem}
/call AddCast "${MountItem}" "0" buff
/call ChatOut 5 "Summoning my mount."
/return

Sub Command-moveto
/if (!${CommandParam.Find[,]}) {
/if (${movetomode}==1) {
/call MoveTo "${CommandParam}"
}
/if (${movetomode}==2) {
/call GotoFunction "${CommandParam.Arg[1,]}" "${CommandParam.Arg[2,]}"
}
/return
}
/if (!${Defined[TargetName]}) {
/call Assist "${MasterName}"
/varset CommandParam ${Target.CleanName}
} else /if (${TargetName.Equal[me]}) {
/call Target "${MasterName}"
/varset CommandParam ${Target.CleanName}
} else /if (${TargetName.Equal[yourself]} || ${TargetName.Equal[${Me.CleanName}]}) {
/return
} else {
/if (${Spawn[${CommandParam}].ID}) /call ChatOut 3 "Destination for moveto not recognized. Try a pc or npc name, or a loc in the form: y,x, such as -100,300"
/return
}
/if (${movetomode}==1) {
/call MoveTo "${CommandParam}"
}
/if (${movetomode}==2) {
/call GotoFunction "${Spawn[${CommandParam}].Y}" "${Spawn[${CommandParam}].X}" "${Spawn[${CommandParam}].Z}"
}
/return

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

Sub Command-notarget
/squelch /target clear
/return

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

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

Sub Command-petback
/pet back off
/return

Sub Command-petguard
/pet guard here
/return

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

Sub Command-reload
/call ChatOut 5 "Reload initiated."
/mac genbot
/return

Sub Command-rmod(int RangeMod)
/if (!${Defined[RangeMod]}) /return
/varcalc MeleeRange ${MeleeRange}+${RangeMod}
/call ChatOut 3 "New melee range is ${MeleeRange}"
/return

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

Sub Command-run
/keypress ctrl+r
/return

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

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

Sub Command-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 "${Param0} is now equal to ${${Param0}}"
/return

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

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

Sub Command-stay
/varset Afollow 0
/varset MoveToDest
/varset FollowTarget NULL
/if ((${advpath})&&(${FollowFlag})) /call StopFunction
/keypress DOWN
/keypress left
/keypress right
/return

Sub Command-stop
/if (${Me.Mount.ID}) /dismount
/varset CombatTargetID 0
/varset LootTooFar 1
/varset Afollow 0
/varset MoveToDest
/varset CastQueue
/if (${advpath}) /call StopFunction
/varset FollowTarget NULL
/call ChatOut 5 "Stopping."
/keypress left
/keypress right
/keypress DUCK
/keypress DUCK
/keypress forward
/keypress back
/squelch /target clear
/keypress right
/return

Sub Command-target
/call StandardTarget "${CommandParam}"
/call ChatOut 5 "My target is now ${Target.CleanName}."
/return

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

Sub Command-trade
/call ChatOut 5 "Clicking trade."
/notify TradeWnd TRDW_Trade_Button LeftMouseUp
/call Delay 3
/return

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

Sub Command-yesres
/call ChatOut 5 "Clicking yes for res."
/notify ConfirmationDialogBox Yes_Button leftmouseup
/call Delay 3
/return


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

Sub Assist(string sAssistName)
/squelch /target clear
/if (${DebugList.Find[core]}) /echo /assist ${sAssistName}
/assist ${sAssistName}
/delay 2s ${Target.ID}
/if (!${Target.ID}) /call ChatOut 3 "Unable to /assist ${sAssistName}."
/return

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

/if (${ChatPriority}>${Verbosity}) /return
/if (${Macro.Params}>2) {
/for GenFor 2 to ${Math.Calc[${Macro.Params}-1]}
/varset ChatText ${ChatText} ${Param${GenFor}}
/next GenFor
}
/if (${MasterName.Equal[GROUP]}) {
/gsay ${ChatText}
/return
}
/if (${TalkToSelf}) {
/echo ${ChatText}
/return
}
/if (${ChatIn.Equal[tell]}) {
/if (${ChatOutTimer}) /delay ${ChatOutTimer}
/varset ChatOutTimer 20
/tell ${MasterName} ${ChatText}
} else /if (${ChatIn.Equal[Group]}) {
/gsay ${ChatText}
} else /if (${ChatIn.Equal[Raid]}) {
/rsay ${ChatText}
} else /if (${ChatIn.Equal[Say]}) {
/if (${ChatOutTimer}) /delay ${ChatOutTimer}
/varset ChatOutTimer 20
/say ${ChatText}
} else /if (${ChatIn.Equal[Channel]}) {
/if (${ChatOutTimer}) /delay ${ChatOutTimer}
/varset ChatOutTimer 20
/chat #${ChatInChannel} ${ChatText}
} else /if (${ChatIn.Equal[IRC]}) {
/i say ${ChatText}
}
/return

Sub ExecCommand(string CommandText)
|/echo in execcommand: ${CommandText}
/declare GenFor int local
/declare DidThenClause bool local 0
/declare ElseClause string local
/declare myvar string local

/if (${Macro.Params}>1) {
/for GenFor 1 to ${Math.Calc[${Macro.Params}-1]}
/varset CommandText ${CommandText} ${Param${GenFor}}
/next GenFor
}
/if (${CommandText.Left[3].Lower.Equal[/if]}) {
/if (${CommandText.Find[/else]}) {
/varset ElseClause ${CommandText.Right[-${Math.Calc[${CommandText.Find[/else ]}+5]}]}
/varset CommandText ${CommandText.Left[${Math.Calc[${CommandText.Find[/else ]}-1]}]}
|/echo docommand ${CommandText}
/docommand ${CommandText}
/if (!${DidThenClause}) {
/call ExecCommand "${ElseClause}"
}
} else {
/docommand ${CommandText}
}
/return
}
/if (${CommandText.Left[1].Equal[/]}) {
/docommand ${CommandText}
/return
}
/varset CurrCommand ${CommandText.Arg[1]}
/if (${CommandText.Arg[2].Length}) {
/varset CommandParam ${CommandText.Right[-${CurrCommand.Length}]}
} else {
/varset CommandParam
}
|/echo CurrCommand = ${CurrCommand}

/if (${Defined[cmds-Routines]}) {
|/echo cmds-routines defined
/varset myvar ${cmds-Routines.Lower}
/if (${myvar.Find[ ${CurrCommand.Lower} ]}) {
/echo doing routines ${CommandText}
/call Routine "${CommandText}"
/return
}
}

/if (${Defined[cmds-Shortcuts]}) {
|/echo cmds-shortcuts = ${cmds-Shortcuts}
/varset myvar ${cmds-Shortcuts.Lower}
|/echo myvar = ${myvar}
|/echo CurrCommand = ${CurrCommand.Lower}
|/echo myvarfind = ${myvar.Find[ ${CurrCommand.Lower} ]}
/if (${myvar.Find[ ${CurrCommand.Lower} ]}) {
/echo doing ShortCut ${CommandText}
/call ShortCut "${CommandText}"
/return
}
|/echo command not found in shortcuts
}

/if (${Defined[Toggle-${CurrCommand.Lower}]}) {
/echo doing Toggle ${CurrCommand} ${CommandParam}
/call SetToggle ${CurrCommand.Lower} ${CommandParam}
/return
}
|/declare myvar2 string local ${GenFor}
|/declare myvar3 string local ${SectionList}
/varset myvar ${cmds-${SectionsList.Arg[${GenFor}]}}
|/echo myvar = ${myvar}
|/varset myvar ${cmds-${myvar3.Arg[${myvar2}]}
/for GenFor 1 to ${Math.Calc[${SectionsList.Count[ ]}+1]}
/if (${SectionsList.Arg[${GenFor}].NotEqual[Shortcuts]} && ${SectionsList.Arg[${GenFor}].NotEqual[Shortcuts]}) {
/if (${myvar.Find[ ${CurrCommand} ]}) {
/echo doing Command ${CurrCommand} ${CommandParam}
/call Command-${CurrCommand} ${CommandParam}
/return
}
}
/next GenFor

/return

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

Sub MoveTo
/if (${Defined[Param0]}) {
/varset MoveToDest ${Param0}
/if (${MoveToDest.Equal[me]}) /varset MoveToDest ${Spawn[pc ${MasterName}].ID}
/if (${Defined[Param1]}) {
/varset MoveToRange ${Param1}
} else {
/varset MoveToRange ${AnchorRadius}
}
}
/if (${CastStep}) /return
/if (!${Me.Standing}) /stand
/declare MoveDist int local
/declare DistGoal int local
/declare CheckObstacle int local 0
/varset LastLoc ${Me.Y},${Me.X}
:MoveLoop
/if (${MoveToDest.Find[,]}) {
/face nolook loc ${MoveToDest}
/varset DistGoal ${AnchorRadius}
/varcalc MoveDist ${Math.Distance[${MoveToDest}]}
} else /if (!${Spawn[${MoveToDest}].ID} || ${Spawn[${MoveToDest}].ID}==${Me.ID} || ${MoveToDest.Find[Null]}) {
/varset MoveToDest
/return
} else {
/squelch /face fast id ${Spawn[${MoveToDest}].ID}
/varset DistGoal ${MeleeRange}
/varcalc MoveDist ${Math.Distance[${Spawn[${MoveToDest}].Y},${Spawn[${MoveToDest}].X}]}
}
/if (${MoveDist}>${DistGoal}) {
/keypress forward hold
} else {
/if (${MoveToDest.Equal[${CombatTargetID}]} && ${MoveDist}<${MeleeRange}-5) {
/keypress back hold
/delay 5 (${Math.Distance[${Spawn[${MoveToDest}].Y},${Spawn[${MoveToDest}].X}]}>${MeleeRange}-2)
/keypress back
}
/keypress forward
/if (${MoveToDest.Equal[${AnchorLoc}]}) {
/face nolook away loc ${AnchorLoc}
/keypress Home
}
/varset MoveToDest
/return
}
|/if (!${CheckObstacle.OriginalValue}) /varset CheckObstacle 3
/varcalc CheckObstacle ${CheckObstacle}+1
/if (${CheckObstacle}>5) {
/varset CheckObstacle 0
/if (${Math.Distance[${LastLoc}:${Me.Y},${Me.X}]}<0.1) {
/call Hitobst 5
/return
}
/if (${MoveDist}-${Math.Distance[${LastLoc}:${Me.Y},${Me.X}]}>${DistGoal}+100) {
/return
}
/varset LastLoc ${Me.Y},${Me.X}
}
/goto :MoveLoop
/return

Sub Hitobst(int HoldTime)
/if (!${Me.Speed}) {
/keypress forward
/return
}
/keypress forward
/keypress back hold
/delay 2s
/keypress back
/if (${Math.Rand[2]}) {
/keypress right hold
/delay ${HoldTime}
/keypress right
} else {
/keypress left hold
/delay ${HoldTime}
/keypress left
}
/keypress forward hold
/delay 2s
/keypress forward
/keypress left
/keypress right
/return

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

Sub Target(string sTargetName)

| Check if intended target already targetted.
/if (${Target.ID} && ${Spawn[${sTargetName}].ID}==${Target.ID} && (!${Spawn[pc ${sTargetName}].ID} || ${Target.Type.Equal[pc]})) /return
/squelch /target clear
/if (${Spawn[pc ${sTargetName} radius ${MaxTargetRange}].ID}) {
/squelch /target pc ${sTargetName} radius ${MaxTargetRange}
} else {
/squelch /target ${sTargetName} radius ${MaxTargetRange}
}
/delay 2s ${Target.ID}
/if (!${Target.ID}) /echo Unable to locate target ${sTargetName}.
/return

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



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

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

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

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


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

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


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

Sub Event_Appear
/call ExecCommand EventLostInvis
/return

Sub Event_Appearing
/call ExecCommand EventLoosingInvis

/return

Sub Event_Chat(string ChatType,string ChatSender,string ChatText)
|/echo event_chat
/declare myvar string local
/echo master = ${MasterList.Lower}
|/echo chattype = ${ChatType}
|/echo chatsender = ${ChatSender}
|/echo chattext = ${ChatText}

/if (!${ChatType.Equal[GROUP]} && !${ChatType.Equal[${ListenChan}]}&& !${ChatType.Equal[TELL]}) {
/return
}
/if (${ChatType.Equal[GROUP]} && !${Toggle-listengroup}) /return
/if (${ChatType.Equal[${ListenChan}]} && !${Toggle-listenchat}) /return
/if (${ChatType.Equal[${ListenChan}]} || ${ChatType.Equal[GROUP]}) {
/if (${ChatText.Arg[1].Equal[${Me.CleanName}]}) {
/declare NameLength int local ${Me.CleanName.Length}
/varcalc NameLength ${NameLength}+1
/varset ChatText ${ChatText.Right[-${NameLength}]}
} else {
/if (${Toggle-checkname}) /return
/varset myvar |${IgnGroupList}|
/if (${myvar.Find[|${ChatText.Arg[1]}|]}) /echo command not found /return
}
}
/varset myvar ${MasterList.Lower}
|/echo masterlist.lower = ${myvar}
| /if (${myvar.Find[ ${ChatSender.Lower} ]}) {
|/echo found master in chat
/varset MasterName ${ChatSender}
/varset TalkToSelf 0
/call ExecCommand "${ChatText}"
/return
}
/echo didn't find master in chat
/if (${Toggle-relaytells} && ${ChatType.Equal[TELL]}) {
/if (${Spawn[npc ${ChatSender} radius 100].ID} || ${Spawn[${ChatSender}].Master.ID}==${Me.ID}) /return
/call ChatOut 1 "${ChatSender} told me: ${ChatText}"
}
/return

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

Sub Event_EscKey
/call Command-stop
/return

Sub Event_ExpGained
/call ExecCommand EventExpGained
/return

Sub Event_FollowOff
/squelch /target clear
/call ChatOut 5 "Auto follow Off."
/return

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

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

Sub Event_ImDead
/call ExecCommand EventImDead
/return

Sub Event_Invite
/declare myvar string local ${MasterList.Lower}
/if (${myvar.Find[ ${Param1.Lower} ]}) {
/call Command-accept
} else {
/call ChatOut 6 "${Param1} has invited me to join his group."
/call ChatOut 9 "Let me know if I should 'accept' or 'reject' his invitation."
}
/return

Sub Event_IRCSAY(string IRCText,string IRCSender)
/declare myvar string local ${MasterList.Lower}
/if (${myvar.Find[ ${IRCSender.Lower} ]}) {
/declare NameLength int local ${IRCSender.Length}
/varcalc NameLength ${NameLength}+2
/varset IRCText ${IRCText.Right[-${NameLength}]}
/if (${IRCText.Arg[1].Equal[${Me.CleanName}]}) {
/varset NameLength ${Me.CleanName.Length}
/varcalc NameLength ${NameLength}+1
/varset IRCText ${IRCText.Right[-${NameLength}]}
}
/varset MasterName ${IRCSender}
/call ExecCommand "${IRCText}"
/return
}
/return

Sub Event_IRCMSG(string IRCText,string IRCSender,string Command)
/declare myvar string local ${MasterList.Lower}
/if (${myvar.Find[ ${IRCSender.Lower} ]}) {
/varset MasterName ${IRCSender}
/call ExecCommand "${Command}"
}
/return

Sub Event_LosingLev
/call ExecCommand EventLoosingLevitate
/return

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

Sub Event_timer(string TimerName,string OldValue)
/if (${TimerName.Arg[1,-].Equal[ST]}) {
/if (${DebugList.Find[core]}) /echo ${Me.Name} Calling subroutine ${TimerName.Right[-3]}
/vardata SubCallName TimerName.Right[-3]
/if (${SubCallName.Find[-]}) /call StringReplaceAll SubCallName "-" " "
|/if (${DebugList.Find[core]}) /echo ${Me.Name} Calling subroutine ${SubCallName}
/call ${SubCallName}
}
/if (${TimerName.Equal[SitTimer]}) {
/if (${Me.Standing} && !${CastStep} && !${Me.Speed}) {
/sit
} else {
/varset SitTimer 2s
}
}
/if (${TimerName.Equal[ChainStunTime]}) {
/call NextStun
}
/return

Sub Event_Zoned
/varset IsAnchored 0
/keypress forward
/call ExecCommand EventZoned
/return

Sub Event_AltTell(string line, string sender, string text)
/call Event_Chat TELL "${sender}" "${text.Left[-1]}"
/return
---------------------------------------------------------------------------------

mamba666
a lesser mummy
a lesser mummy
Posts: 49
Joined: Fri Aug 15, 2003 11:47 am

Post by mamba666 » Sat Jul 23, 2005 11:00 am

Vandil,
That is exactly why i started using IRC. I started having bots relay tells to people other than master. I posted somehwat of a fix if you use IRC because then tells just get relayed to IRC reguardles sof who sent the tell.

There is a problem with it setting master to whatver member or channel that was first sent to the bot. The problem lies in botcore.inc concerning chat sub.

Frank25
a ghoul
a ghoul
Posts: 136
Joined: Thu Aug 12, 2004 6:38 am

Post by Frank25 » Sat Jul 23, 2005 12:11 pm

with all the posts here i've managed to get genbot working again where it takes orders from IRC , it buffs, follows etc.

The only thing that doesnt' seem to work is the attack function.
When i issue an "attack ${Target}" command normally the bot would aquire and attack range/cqb..

now it just sits there and doesn't respond.

Anyone have an idea what that could be ?

mamba666
a lesser mummy
a lesser mummy
Posts: 49
Joined: Fri Aug 15, 2003 11:47 am

Post by mamba666 » Sat Jul 23, 2005 12:13 pm

Frank25
Use the command assist. It is exactly the same. I had the same problem. I just say in IRC assist and my guys attack and my casters with pets send their pets in.

Vandil
decaying skeleton
decaying skeleton
Posts: 2
Joined: Fri Jul 22, 2005 11:06 pm

Post by Vandil » Sat Jul 23, 2005 1:33 pm

well i fixed the problem for myself in a cheesy way... i just set her up in a channel to talk and BS ect ect instead of tells. So yeah anyone and thier buddy can get her to buff them but they gtta know the right commands so its not to bad. So long as people arnt in my channel they dont see the spam =p

it works... thats all i care about =P

Process
a lesser mummy
a lesser mummy
Posts: 73
Joined: Fri Jun 25, 2004 5:30 pm

Post by Process » Thu Aug 04, 2005 11:09 am

I tried the fixes posted here, but to no avail. Can someone post a version that works with IRC? I'm so paranoid about using tells.

Process

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Thu Aug 04, 2005 11:15 am

Whoever has a working copy should just make a new post and keep it up to date. There's so many fixes/tweaks posted among the various genbot posts now, it's too convoluted for most people to make sense of them.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

Charisa
a hill giant
a hill giant
Posts: 165
Joined: Tue Apr 06, 2004 5:38 pm

Post by Charisa » Mon Aug 08, 2005 3:02 am

I would post mine but i think alot of people just want genbot to die ;)

I don't use IRC to relay my commands so I have no input on that fix but I have everything else along with botroutines working as near as I can tell so far :)

If someone desperately wants it send me a PM.

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Mon Aug 08, 2005 8:23 am

Charisa wrote:I would post mine but i think alot of people just want genbot to die ;)
I'd rather see it resurrected by a competent macro author, honestly. It was a good bot program back in the day. But, it's going to take more than a just a janitor to clean it up to its former glory.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]