genbot.mac Generic Bot macro for any class. V8 with ini

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

Moderator: MacroQuest Developers

KhaosWolf
a lesser mummy
a lesser mummy
Posts: 41
Joined: Wed Sep 10, 2003 11:34 pm

How in the world...

Post by KhaosWolf » Mon Oct 27, 2003 10:32 pm

Im sorry but i just DONT get how to use this whole bot thing, I mean make it do what I want of course :? .

Sorry if when you read this you say "What a fuckin moron!" lol but i seriously just dont get how to make botgen do specific things I want it to do. Anyhelp would be appreciated, thanks.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Re: How in the world...

Post by grimjack » Mon Oct 27, 2003 11:09 pm

KhaosWolf wrote:Im sorry but i just DONT get how to use this whole bot thing, I mean make it do what I want of course :? .

Sorry if when you read this you say "What a fuckin moron!" lol but i seriously just dont get how to make botgen do specific things I want it to do. Anyhelp would be appreciated, thanks.
Ok lets say the master is Johndoe and the bot is Janedoe.

Start the bot on janedoe like this.
/macro genbot.mac johndoe

Now go to the macroquest macro directory and edit genbot_Janedoe.inc

Put all the settings you want in there and restart the bot on Janedoe.

from Johndoe: /msg janedoe sit
Janedoe should sit

from Johndoe: /msg janedoe stand
Janedoe should stand

from johndoe:/msg janedoe cmds core
Janedoe should reply with a list of core commands.

/msg janedoe cmds spell
Janedoe should reply with a list of spell commands.

/msg janedoe cmds
Janedoe should reply with a list of modules you can ask a cmds list on.

From there you can figure out what each command does and experiment with it (I suggest while by yourself and in a newbie zone). Once you get the hang of it use it anywhere you want.


Thanks
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

theafkxper
a hill giant
a hill giant
Posts: 207
Joined: Sun Sep 08, 2002 6:41 pm

Post by theafkxper » Tue Oct 28, 2003 12:06 am

Undies wrote:Expecting a bot to understand the nuances of monk pulling is certainly asking too much so it needs a manual mode where it does nothing at all until told.
/mqpause does the trick very well

Wishbringer
Contributing Member
Contributing Member
Posts: 230
Joined: Thu Nov 14, 2002 7:00 am

Post by Wishbringer » Tue Oct 28, 2003 4:57 am

Hi Grimjack

You use for targeting bot itself following code:

Code: Select all

else /if "@Param1"=="yourself" {
      /press F1
      /if n $char(id)!=$target(id) /press F1
} else /if "@Param1"=="$char(name)" {
      /press F1
      /if n $char(id)!=$target(id) /press F1
}
wasn't there a call like?:

Code: Select all

/target myself
so you can avoid targeting pet by accident

example:

Code: Select all

else /if "@Param1"=="yourself" /target myself
else /if "@Param1"=="$char(name)" /target myself
another question now:
You use following code for targeting:

Code: Select all

      /declare ParamString local
      /declare ParamCount local
      /varset ParamCount 2
      /varset ParamString "@Param1"
      :Do-xxxParamLoop
         /if $defined(Param$int(@ParamCount))==TRUE {
            /varcat ParamString " @Param$int(@ParamCount)"
            /varadd ParamCount 1
            /goto :Do-xxxParamLoop
         }
      /target @ParamString
 
if calling sub with more than one target following will happen:
/call Do-nuke "Pawn" "Centurion" "Legionaire"
->ParamString=="Pawn" --- before loop
->ParamString=="Pawn @Param2" aka "Pawn Centurion" --- first loop
->ParamString=="Pawn Centurion @Param3" aka "Pawn Centurion Legionaire" --- second loop
/target "Pawn Centurion Legionaire"??? aka /target "Pawn"
so why loop?

or is it only for surnames and titles?
/call Do-nuke an ork pawn
/call Do-nuke Sir Graham Silverleaf

but then in sub Event_Chat in botcore.inc there is only one param delivered aka @Param2 of Event_Chat...
hm, after all i am abit confused about quotes and param-delivery *grin*

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

Post by LordGiddion » Tue Oct 28, 2003 1:01 pm

The loop is for pulling in names with spaces, IE giant skeleton vs skeleton - obviously in cases where the target is expected to be a PC the loop is over kill. Like /t bot snt Ice Comet on Giant Skeleton

Chat_event is designed so Param2 contains the whole chat string including spaces. When we pass @Param2 to other routines the nature of MQ Macro results in the Param being broken up into multiple Params. Which 75% of the time is what we want it to do. We could call do-Command "@Param2" and then the command would get the whole string as 1 parameter, then we'd have to use $arg to pull out the peices. Easier to do just ignore Param0 (which is always the command itself) and parse or concat what we need.

Wishbringer
Contributing Member
Contributing Member
Posts: 230
Joined: Thu Nov 14, 2002 7:00 am

Post by Wishbringer » Tue Oct 28, 2003 2:04 pm

thx for info!

RogerWilco
a ghoul
a ghoul
Posts: 86
Joined: Thu Aug 28, 2003 4:05 am

Post by RogerWilco » Tue Oct 28, 2003 5:20 pm

i've been trying to search for it in my log file but I got an error when the bot tried to lootall in the botcore.inc... still trying to find it....


plus I noticed that the reportlom seems to not be working properly, atleast for me, I have it set to =1 in my bot.ini file

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Update:

Post by grimjack » Tue Oct 28, 2003 7:23 pm

Tracked down the previous heal problem. On top of the ini problem there is some problems with
/if $char(book,"@SpellName")=="NULL" /varset Fail 1
On some spells it returns NULL when it shouldn't. It was breaking heals for druids as well as sn and snt on some spells. Once removed all druid heals worked with new code.

Files updated:
botspell.inc
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

RogerWilco
a ghoul
a ghoul
Posts: 86
Joined: Thu Aug 28, 2003 4:05 am

Post by RogerWilco » Wed Oct 29, 2003 8:37 am

ok found the error in my log

on doing lootall:

Code: Select all

Ending macro: Couldn't find label :LootAllCycle2
botcore.inc@386 (LootAll): /goto :LootAllCycle2
botcore.inc@836 (Do-lootall): /call LootAll
botcore.inc@206 (Event_Chat): /call Do-@Commands(1,@tempvar) @Param2
Genbot.mac@64 (Main): :MainLoop
Cleared the following: Timers Vars Arrays
 The current macro has ended.

when doing a lootup I get this messege and the bot does not loot:


New Setting: Never display requestor for looting no-drop items.
You told Master, 'Looting The Spirit of Decay.'
New Setting: Always display loot requestor for no-drop items.



was looking in the Botcore.inc

Code: Select all

sub LootAll 
   /declare counter local 
   :LootAllCycle 
   /if $combat==TRUE /return 
   /if "$target()"=="FALSE" { 
      /target corpse radius 100 
   } 
   /if $target(state)!=DEAD /return 
   /press down 
   /press down 
   /call Rangesub 
   /varset LootTooFar 0 
   /varset LootSlot 0 
   /lootn never 
   /loot 
   /varset counter 0 
   :CoreWaitLoot2 
      /delay 5 
      /doevents 
      /varadd counter 1 
      /if @BreakOut==1 /goto :donelooting2 
      /if n @counter>12 /goto :donelooting2 
   /if $corpse()!=TRUE /goto :CoreWaitLoot2 
   /msg @MasterName Looting %t. 
   :lootloop2 
   /if n @LootSlot==10 /goto :donelooting2 
   /if n @LootTooFar==1 /goto :donelooting2 
   /if $corpse(empty)==TRUE /goto :donelooting2 
   /click right corpse @LootSlot 
   /varset counter 0 
   :CursorLootWait2 
   /doevents 
   /if n @BreakOut==1 /goto :donelooting2 
   /delay 2 
   /varadd counter 1 
   /if n @counter>12 /goto :donelooting2 
   /if "$cursor()"!="TRUE" /goto :CursorLootWait2 
   /varadd LootSlot 1 
   /goto :lootloop2 
   :donelooting2 
   /lootn always 
   /varset LootSlot 0 
   /press esc 
   /press esc 
   /press esc 
 [color=darkred]  /goto :LootAllCycle2 [/color]
/return 


is that suppost to be:

Code: Select all

 /goto :LootAllCycle 

also was wondering

Code: Select all

Sub Do-lootall 
   /varset CmdArrayNum 0 
   /if $defined(Param1)==FALSE { 
      /assist @MasterName 
   } else { 
      /declare ParamString local 
      /declare ParamCount local 
      /varset ParamCount 2 
      /varset ParamString "@Param1" 
      :Do-lootupParamLoop 
         /if $defined(Param$int(@ParamCount))==TRUE { 
            /varcat ParamString " @Param$int(@ParamCount)" 
            /varadd ParamCount 1 
            /goto :Do-lootupParamLoop 
         } 
      /target @ParamString 
   } 
   /delay 5 
[color=darkred]/call LootAll[/color] 
/return 
what is the purpose of /call LootAll???
Last edited by RogerWilco on Wed Oct 29, 2003 12:00 pm, edited 1 time in total.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Update:

Post by grimjack » Wed Oct 29, 2003 11:53 am

Added behind command which uses a GJ enhanced version of Jays strafing code.
Added autoinv command.
Cleaned up movement code. Made the original getbehind detect if it's stuck and stop trying if it is.
Added rmod command as requested.
Added rset command to change all your range values. Syntax is:
/msg botname <fastmin> <rangemin> <rangemax> <fastrange>
Added FastBack sub to move backwards faster when target is under FastMin range.
Updated RangeSub.
Fixed looting.
Updated MoveToAnchor to face the guys away from anchor once they reach it.

Files Updated:
botcore.inc
botcombat.inc
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Update:

Post by grimjack » Wed Oct 29, 2003 12:49 pm

Tweaked some of the behind code so for when the mob is in motion.

Updated the personal.inc file too. Many new things here including autobehind for those extra lazy rogues. Use caution with autobehind, I have not got aggro with it yet. It shouldn't be as odd looking with the strafe code.
Files updated:
botcore.inc
botcombat.inc
personal.inc


Thanks
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

RogerWilco
a ghoul
a ghoul
Posts: 86
Joined: Thu Aug 28, 2003 4:05 am

Post by RogerWilco » Wed Oct 29, 2003 1:21 pm

Still not getting LoM report to master but I did notice something

in Personal.inc

Code: Select all

Sub Do-setlompct 
   /if $defined(Param0)==FALSE /return 
[color=red]   /varset LomPct @Param0 [/color]
   /call ChatOut 3 @MasterName "I'll let you know if I get below @LomPct percent mana" 
/return 
shouldn't that be:

Code: Select all

  /varset LomPct @Param1 


also maybe I am not understanding this but

Code: Select all

Sub CheckMana 
   /if @LomTimer>0 { 
      /if $char(mana,pct)<@LomPct { 
         /call ChatOut 5 @MasterName "@LomMsg" 
         /varset LomTimer 2m 
but where is

Code: Select all

@LomTimer

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

Post by LordGiddion » Wed Oct 29, 2003 1:51 pm

2 New Ini settings as per a request by a friend of mine, these when set will cause the bot to anchor and set puller on, on startup. The anchor can be set without puller, but puller still will not set unless an anchor has been set either manually or by AutoAnchor.
in Botcore.inc

Code: Select all

/declare AutoAnchor Local
   /varset AutoAnchor $ini(@IniFile,"Core",AutoAnchor) 
   /if "@AutoAnchor"=="NOTFOUND" { 
      /ini "@IniFile" Core AutoAnchor 0 
   }else /if AutoAnchor==1 {
      /varset IsAnchored 1 
      /varset AnchorX $char(y) 
      /varset AnchorY $char(x)
   }
and in combat.inc

Code: Select all

/declare AutoPuller Local
   /varset AutoPuller $ini(@IniFile,"Combat",AutoPuller) 
   /if "@AutoPuller"=="NOTFOUND" { 
      /ini "@IniFile" Combat AutoPuller 0 
   }else /if AutoPuller==1 {
      /if @IsAnchored==1 {
         /varset IsPuller 1 
      }      
   }

Xfactor
orc pawn
orc pawn
Posts: 15
Joined: Tue Sep 23, 2003 11:34 am

small bug

Post by Xfactor » Wed Oct 29, 2003 6:29 pm

Code: Select all

Sub ResetWatchTargets 
   /declare counter local 
   /for counter 1 to @WatchTargetCount 
   /target PC @WatchTargets(@counter) 
   /delay 25 
   /if $target(name)==@WatchTargets(@counter) { 
      /varset WatchTargetIDs(@counter) $target(id) 
   }else { 
      /call ChatOut 5 [color=red]@MasterNamee[/color] I failed to target @WatchTargets(@counter). 
   } 
/return 
Should remove that extra e on the end of it.

mackster
a ghoul
a ghoul
Posts: 95
Joined: Mon Sep 09, 2002 3:02 pm

Post by mackster » Thu Oct 30, 2003 9:40 am

I have a request if anyone wants to give it a shot:

Could you make a "defensive" command that if your bot is a caster who can root, and is being attacked, they will /dismount, cast root until it sticks and then back out of melee range of the mob they rooted, and then resume normal operation?

Something like this would be handy, have had my bot die a few times due to adds heh.