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

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Thu Apr 29, 2004 6:34 pm

omper wrote:also it will cause crash ..
Gee, that's helpful... where at? what file and what line? Any idea?

Some kind of description of what happened would help.

omper
a ghoul
a ghoul
Posts: 110
Joined: Sat Dec 06, 2003 10:46 pm

Post by omper » Thu Apr 29, 2004 7:11 pm

if i put patchheal=1 and healer=1 then crash.. best i can figure

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Thu Apr 29, 2004 7:11 pm

omper wrote:if i put patchheal=1 and healer=1 then crash.. best i can figure
THat's a good start... helps narrow it down alot

bollox
orc pawn
orc pawn
Posts: 17
Joined: Tue Oct 28, 2003 2:14 pm

botcore.inc Event_Chat

Post by bollox » Thu Apr 29, 2004 7:37 pm

Small syntax error prevents genbot from grabbing incoming commands:

Code: Select all

Sub Event_Chat (string ChatType,string ChatSender,string ChatText)
should be:

Code: Select all

Sub Event_Chat(string ChatType,string ChatSender,string ChatText)
..there shouldn't be a space between "Event_Chat" and the opening parenthesis.

This type of error is duplicated throughtout the macro.

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: botcore.inc Event_Chat

Post by wassup » Thu Apr 29, 2004 7:57 pm

bollox wrote:Small syntax error prevents genbot from grabbing incoming commands:

Code: Select all

Sub Event_Chat (string ChatType,string ChatSender,string ChatText)
should be:

Code: Select all

Sub Event_Chat(string ChatType,string ChatSender,string ChatText)
..there shouldn't be a space between "Event_Chat" and the opening parenthesis.

This type of error is duplicated throughtout the macro.
You sure about that? I only found your instance of a space between the sub name and the (. Didn't find it anywhere else.

fez_ajer
a ghoul
a ghoul
Posts: 106
Joined: Fri Apr 23, 2004 6:44 pm
Location: If I was up your ass you'd know where I was...

Yup, there's a good number of them...

Post by fez_ajer » Thu Apr 29, 2004 8:29 pm

If the whitespace between the Sub name and the parenthesized argument list is a problem I counted a good 10-15 of them scattered throughout the .inc files. I should be able to test in-game in an hour or so.

My files are modified so the line numbers are slightly off:

Code: Select all

botcombat.inc(319): Sub CheckAggressive (string AggroText) 
botcore.inc(348): Sub Event_Chat (string ChatType,string ChatSender,string ChatText) 
botcore.inc(371): Sub Event_SelfEcho (string EchoText) 
botcore.inc(376): Sub ExecCommand (string CommandText) 
botcore.inc(462): Sub Hitobst (int HoldTime) 
botcore.inc(670): Sub Event_timer (string TimerName,string OldValue) 
botcore.inc(705): Sub StandardTarget (string TargetName) 
botcore.inc(733): Sub Do-assist (string AssistName) 
botcore.inc(830): Sub Do-invite (string TargetName) 
botcore.inc(924): Sub Do-moveto (string TargetName) 
botcore.inc(1020): Sub Do-consent (string TargetName) 
botcore.inc(1055): Sub Do-verbosity (int NewVerbosity) 
botcore.inc(1073): Sub Do-rmod (int RangeMod) 
botcore.inc(1082): Sub Do-rset (int NewFastMin,int NewRangeMin,int NewRangeMax,int NewFastRange) 
botcore.inc(1097): Sub Do-anchorradius (int NewRadius) 
bothealer.inc(285): Sub CastHeal (int TarID,string HealSpell,string castMsg) 
bothealer.inc(310): Sub Patchheal (int TarID) 
bothealer.inc(330): Sub PallyHeal (int TarID) 
botspell.inc(196): Sub SpellSub (string SpellName) 
botspell.inc(449): Sub Do-sn (string newSpell) 
botspell.inc(465): Sub Do-loadlist (string Spellset) 
- Fez

bollox
orc pawn
orc pawn
Posts: 17
Joined: Tue Oct 28, 2003 2:14 pm

Typo: botcore.ini: Event_SelfEcho

Post by bollox » Thu Apr 29, 2004 9:11 pm

botcore.ini: in function Event_SelfEcho

Code: Select all

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

Code: Select all

${Me.ClearName}
To

Code: Select all

${Me.CleanName}
Last edited by bollox on Thu Apr 29, 2004 9:25 pm, edited 3 times in total.

bollox
orc pawn
orc pawn
Posts: 17
Joined: Tue Oct 28, 2003 2:14 pm

Syntax error: botcore.ini: Sub ExecCommand

Post by bollox » Thu Apr 29, 2004 9:14 pm

botcore.ini: in function Sub ExecCommand:

Code: Select all

next counter
needs a preceding "/":

Code: Select all

/next counter
Last edited by bollox on Thu Apr 29, 2004 9:24 pm, edited 1 time in total.

bollox
orc pawn
orc pawn
Posts: 17
Joined: Tue Oct 28, 2003 2:14 pm

Syntax: botcore.ini: Do-reportbuffs

Post by bollox » Thu Apr 29, 2004 9:23 pm

botcore.ini: in function Do-reportbuffs:

Code: Select all

       /varcat myBuffs " ${Me.Buff[${$counter}]}"
Needs to have the extra "$" removed from before "counter":

Code: Select all

       /varcat myBuffs " ${Me.Buff[${counter}]}"
AND

Code: Select all

       /next tempvar
Needs to be:

Code: Select all

       /next counter

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: Yup, there's a good number of them...

Post by wassup » Thu Apr 29, 2004 9:33 pm

fez_ajer wrote:If the whitespace between the Sub name and the parenthesized argument list is a problem I counted a good 10-15 of them scattered throughout the .inc files. I should be able to test in-game in an hour or so.

My files are modified so the line numbers are slightly off:

Code: Select all

botcombat.inc(319): Sub CheckAggressive (string AggroText) 
botcore.inc(348): Sub Event_Chat (string ChatType,string ChatSender,string ChatText) 
botcore.inc(371): Sub Event_SelfEcho (string EchoText) 
botcore.inc(376): Sub ExecCommand (string CommandText) 
botcore.inc(462): Sub Hitobst (int HoldTime) 
botcore.inc(670): Sub Event_timer (string TimerName,string OldValue) 
botcore.inc(705): Sub StandardTarget (string TargetName) 
botcore.inc(733): Sub Do-assist (string AssistName) 
botcore.inc(830): Sub Do-invite (string TargetName) 
botcore.inc(924): Sub Do-moveto (string TargetName) 
botcore.inc(1020): Sub Do-consent (string TargetName) 
botcore.inc(1055): Sub Do-verbosity (int NewVerbosity) 
botcore.inc(1073): Sub Do-rmod (int RangeMod) 
botcore.inc(1082): Sub Do-rset (int NewFastMin,int NewRangeMin,int NewRangeMax,int NewFastRange) 
botcore.inc(1097): Sub Do-anchorradius (int NewRadius) 
bothealer.inc(285): Sub CastHeal (int TarID,string HealSpell,string castMsg) 
bothealer.inc(310): Sub Patchheal (int TarID) 
bothealer.inc(330): Sub PallyHeal (int TarID) 
botspell.inc(196): Sub SpellSub (string SpellName) 
botspell.inc(449): Sub Do-sn (string newSpell) 
botspell.inc(465): Sub Do-loadlist (string Spellset) 
Yes, that is a problem...

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: Syntax error: botcore.ini: Sub ExecCommand

Post by wassup » Thu Apr 29, 2004 9:42 pm

bollox wrote:botcore.ini: in function Sub ExecCommand:

Code: Select all

next counter
needs a preceding "/":

Code: Select all

/next counter
Yeah, found those and corrected.

fez_ajer
a ghoul
a ghoul
Posts: 106
Joined: Fri Apr 23, 2004 6:44 pm
Location: If I was up your ass you'd know where I was...

another couple...

Post by fez_ajer » Thu Apr 29, 2004 10:04 pm

(Editing this as I find things...)

botcore.inc line 356 (approx)

Code: Select all

/if (${CheckName} && ${ChatText.Arg[1].NotEqual[${Me.CleanName}]}[color=red])[/color] /return
botcore.inc line 362 (approx)

Code: Select all

/if [color=red]([/color]${IgnGroupList.Find[${ChatText.Arg[1]}]}[color=red])[/color] /return
botcore.inc line 1131 (approx)

Code: Select all

/if (${FollowMode}=[color=red]=[/color]3) {
I believe all of the counter for loops in ExecCommand should start at 1 instead of zero. That makes execcommand look like this:

Code: Select all

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 [color=red]1[/color] to ${botcorearray.Size[2]} 
         /if (${CurrCommand.Equal[${botcorearray[1,${counter}]}]}) { 
            /call ${botcorearray[2,${counter}]} ${CommandParam} 
         } 
      /next counter 
   } 
   /if (${Defined[botcombatarray]}) { 
      /for counter [color=red]1[/color] to ${botcombatarray.Size[2]} 
         /if (${CurrCommand.Equal[${botcombatarray[1,${counter}]}]}) { 
            /call ${botcombatarray[2,${counter}]} ${CommandParam} 
         } 
      /next counter 
   } 
   /if (${Defined[botspellarray]}) { 
      /for counter [color=red]1[/color] to ${botspellarray.Size[2]} 
         /if (${CurrCommand.Equal[${botspellarray[1,${counter}]}]}) { 
            /call ${botspellarray[2,${counter}]} ${CommandParam} 
         } 
      /next counter 
   } 
   /if (${Defined[botHealarray]}) { 
      /for counter [color=red]1[/color] to ${botHealarray.Size[2]} 
         /if (${CurrCommand.Equal[${botHealarray[1,${counter}]}]}) { 
            /call ${botHealarray[2,${counter}]} ${CommandParam} 
         } 
      /next counter 
   } 
   /if (${Defined[botTogglearray]}) { 
      /for counter [color=red]1[/color] to ${botTogglearray.Size[2]} 
         /if (${CurrCommand.Equal[${botTogglearray[1,${counter}]}]}) { 
            /call SetToggle ${counter} ${CommandParam} 
         } 
      /next counter 
   } 
   /if (${Defined[shortcutsarray]}) { 
      /for counter [color=red]1[/color] to ${ShortCuts} 
         /if (${CurrCommand.Equal[${shortcutsarray[1,${counter}]}]}) { 
            /call ShortCut ${counter} ${CommandParam} 
         } 
      /next counter 
   } 
   /if (${Defined[BotPersonalsarray]}) { 
      /for counter [color=red]1[/color] to ${BotPersonalsarray.Size[2]} 
         /if (${CurrCommand.Equal[${BotPersonalsarray[1,${counter}]}]}) { 
            /call ${BotPersonalsarray[2,${counter}]} ${CommandParam} 
         } 
      /next counter 
   } 
/return 
The paladin heal sub should probably look more like this:

Code: Select all

Sub PalHealChk 
   /declare tempvar int local 1 
   /if (!${IsPally}) /return 
   /if (!${IsHealer}) /return 
   /for tempvar 1 to ${Group} 
      /doevents 
      /if ((${Group[${tempvar}].PctHPs}<${PalHealPct})&&(${Group[${tempvar}].State.NotEqual[DEAD]})) /call PallyHeal ${Group[${tempvar}].ID} 
   /next tempvar 
/return 
the current pally heal sub does not work at all.

more follow problems:

botcore.inc lines 1122 & 1131 (approx)

Code: Select all

/target [color=red]${[/color]FollowTarget[color=red]}[/color]
botcore.inc line 1124 (approx)

Code: Select all

/varset Afollow [color=red]1[/color]
afollow problems were in FastMove and FastBack. They should read as follows:

Code: Select all

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

Lastly, some not-to-be-named dumbass requested an addition to the PetOnAssist code to keep dress-wearing freaks from getting thwapped. The lousy code he recommended should be:

Code: Select all

      /if (${PetOnAssist}) { 
         /if (!${Me.Standing}) /stand 
         /call Delay 5 
         /pet attack 
         /call Delay 5 
         /if ((${SitAfterCast})&&(!${Me.Sitting})) /varset SitTimer ${DelayBeforeSit}
      } 
so that the caster doesn't sit right after sending the pet in and get thwapped anyway. In case anyone is wondering, the dumbass is me :)
Last edited by fez_ajer on Thu Apr 29, 2004 11:30 pm, edited 8 times in total.
- Fez

bollox
orc pawn
orc pawn
Posts: 17
Joined: Tue Oct 28, 2003 2:14 pm

Consistancy

Post by bollox » Thu Apr 29, 2004 10:29 pm

I've noticed quite a bit of discrepancies for the command array naming scheme: typos and capitalization errors. In the interest of preventing confusion, perhaps we should adhere to "<modulename>Array" as reference. (i.e. bothealer.inc's command array would be defined as "BotHealerArray", botspell.inc -> BotSpellArray, etc)

Draimen
a lesser mummy
a lesser mummy
Posts: 69
Joined: Sun Jan 25, 2004 3:13 pm

Post by Draimen » Thu Apr 29, 2004 10:57 pm

Made all the changes so far.

Upon running macro I get: DoCommand-Couldn't parse 'next counter'

a few times.

I tell my bot to sit and get errors on lines botcore.inc: 385, 364, and genbot.mac 51

I stopped running it there.

fez_ajer
a ghoul
a ghoul
Posts: 106
Joined: Fri Apr 23, 2004 6:44 pm
Location: If I was up your ass you'd know where I was...

You missed a couple Drai

Post by fez_ajer » Thu Apr 29, 2004 11:08 pm

There are a batch of:

Code: Select all

[color=red]/[/color]next counter
Lines that need fixing. Look about 4 posts up. I've also been editing my post as I find more issues. I've got most things running now (I think) but I still haven't taken a bot-group into combat.
- Fez