Genbot.mac 12.38 -- Updated 6/4/2004

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

Moderator: MacroQuest Developers

Tweaker
decaying skeleton
decaying skeleton
Posts: 1
Joined: Thu Jun 03, 2004 4:34 am

Post by Tweaker » Thu Jun 03, 2004 4:36 am

I am noticing an issue with string arrays and .Find[] method. botshortcuts don't seem to be working with 6/2 MQ2. The rest of the macro seems to be working fine, healing and following, but when you execute a command in the shortcut section all the /if blah.Find[something] are returning NULL.

Anyone else seeing this?

Thanks,

ok, just found this update:

http://macroquest2.com/phpBB2/viewtopic.php?t=7619
Last edited by Tweaker on Thu Jun 03, 2004 4:50 am, edited 2 times in total.

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

Post by grimjack » Thu Jun 03, 2004 4:41 am

Vexix wrote:Fez,

The cleric thing is prolly because he's attacking current target, and has no memory of what he was fighting before.

--Vexix
At one time the heal subs would place the current target's id in a variable before targeting the person that needed to be healed and re-target using the id (if the id still exsisted) at the end of the sub. It's a simple solution but it works.

On a side note, it would be nice to see someone come up with a credits section for genbot. At the very least, the original author and the people who have kept the project going should probably be mentioned somewhere.

Thanks
GrimJack
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

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

Post by Vexix » Thu Jun 03, 2004 8:47 am

Tweaker -- You're right. Genbot shortcuts, selfbufflist, and routines are broken with the last patch. I've noted it at the top of this thread.

Grimjack! Wow, thanks for the background on the code.

The credits idea is a great one. I've just now realized that you were the original author of genbot. . .? I've only been using MQ2 for about a month now, so I have no sense of history at all. Here's what I can fill in:

Genbot Credits:

Version 0-? Created and developed by Grimjack
Version ?-? Other people did things.
Version 10? Lord Giddeon maintained the code and did. . .?
Version 11? Fez_Ajer worked on the code for a while?
Version 12 Lord Giddeon maintained genbot and did some other stuff.
Version 12.35 - Current Vexix Updated the code and introduced generalized shortcuts.

Anyone have any more details to fill in? I'd love to be able to give a few notable achievements for the contributors in addition to version numbers. We can add it into genbot.mac or append it to the doc file.

I'll take a look at the botheal section after I finish redoing the spellcode. To be honest, it's the only section I haven't read through yet.

Fez -- Thanks for the spell cast code. I've read through a couple of others as well, and am patching them together while stripping out the /delays.

Seagreen -- Awesome!!! Thanks for updating the documentation. It makes genbot much more useful. I also appreciate the section about commands which will be removed in the future. I hadn't thought about this, but as I'm going through the code, it will be good to take out some of the stuff that doesn't add value anymore. Can I ask you to maintain the doc file? I'd like to break the documentation into a run-time commands and a .ini file explanation, kind of like the .ini explanation with AFNuke. I have a few minor additions for your documentation, and then I'll post it at the top of this thread.

Other things I'd love some assistance on:

Grim, Fez, or anyone else -- Can you tell me what the intent was behind the ChatOut priority levels? At this point, I'm not even sure if big numbers are high priority, or low numbers. Some kind of a guide to what kind of ChatOut statements should be given what priority would be very helpful.

If someone would help document the code to give more feedback for people who have ChatOut priority set for lots of tell, that would be great. I'd like genbot to give a response to all tells with some kind of results or feedback, and often it's just silent.

Anyone want to help sort out the code so it's a bit easier to find things? In particular, I'd like to have this kind of order for all the botxxxx.inc files:

Init code
xxxxmain loop.
Do-command code, like Do-Sit
Code called by do-command code, such as Target, Loot, or SpellSub
Events

Then, if things could be ordered within those sections themselves, that would be great as well. In particualr botcore has a million Do-subs, and in no particular order I can see. Alphabetical would be great.

I'd like to change the processing of the command lines to take all the text as one parameter and parse that with .Find and .Arg instead of having to cycle through the various Param0, Param1, etc. I think it'll be faster, and should read a little easier as well. Anyone interested in helping with the coding for the various called subs?

If you'd like to lend a hand with any of the above, PM me the touched up code, and I'll post it in.

Ok, well, genbot isn't working with the latest patch, so I'll get back to working on a more responsive spell cast!

Thanks to any who are interested in helping!

--Vexix

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...

Post by fez_ajer » Thu Jun 03, 2004 12:40 pm

I think we may have skipped v11 :)

As for my contributions, I've really actually done very little except test and post fixes during the MQ2Data changeover.
- Fez

sj_digriz
a lesser mummy
a lesser mummy
Posts: 40
Joined: Wed Jun 02, 2004 9:10 am
Contact:

Post by sj_digriz » Thu Jun 03, 2004 2:17 pm

I started moving the do commands alphabetically. I then figured I like to keep associated do commands together. Is that ok, or do you want just alpha order.

ex: This is how I put it which is obviously not alpha.

Do-rmod
Do-rset
Do-Rptvar

ex: alpha would have these seperated by many other do's.

do-dismount
do-mount

gus
a lesser mummy
a lesser mummy
Posts: 70
Joined: Fri Apr 09, 2004 11:58 pm

Post by gus » Fri Jun 04, 2004 12:24 am

Unable to get my bots to respond to /tells, debug in Event_Chat in botcore.inc does not show /tell events arriving. I also tried creating a #event for Tell as well, but no luck there.

For reference, IRC works, group works. Not sure on channels, don't use them.

--gus

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

Post by grimjack » Fri Jun 04, 2004 4:08 am

Vexix wrote: Version 0-? Created and developed by Grimjack
Version ?-? Other people did things.
Version 10? Lord Giddeon maintained the code and did. . .?
Version 11? Fez_Ajer worked on the code for a while?
Version 12 Lord Giddeon maintained genbot and did some other stuff.
Version 12.35 - Current Vexix Updated the code and introduced generalized shortcuts.
My last release was 8.8. Lasher took over after that from what I can find. After that I didn't pay much attention for a while.
Other things I'd love some assistance on:

Grim, Fez, or anyone else -- Can you tell me what the intent was behind the ChatOut priority levels? At this point, I'm not even sure if big numbers are high priority, or low numbers. Some kind of a guide to what kind of ChatOut statements should be given what priority would be very helpful.
Chatout was originaly conceived by LordG and sent to me in a PM of some changes he had made. I liked it so I made a few tweaks and put it in place so here is what I remember. ChatOut calls that where less than the current verbosity setting(a variable in the INI and something that could be set on the fly) would be ignored. This would allow a user to make the bot more or less chatty on the fly. Lower the verbosity, less messages get through. Raise the verbosity more messages get through. That's about as good as I can explain it.
Anyone want to help sort out the code so it's a bit easier to find things? In particular, I'd like to have this kind of order for all the botxxxx.inc files:

Init code
xxxxmain loop.
Do-command code, like Do-Sit
Code called by do-command code, such as Target, Loot, or SpellSub
Events
Hehe good luck with this one. This was a constant battle I had with myself when I did this. It always seems like somehow it gets all jumbled with time(probably due to my lack of consistant orginisational skills).

Thanks
GrimJack
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

draco
a ghoul
a ghoul
Posts: 145
Joined: Thu Jan 29, 2004 7:06 pm
Contact:

I volunteer

Post by draco » Fri Jun 04, 2004 8:30 am

I'll look over some of the to-do's. Since, I steal from this code. so much in my private macros. I would certainly be willing to maintain it. I do agree that do command should be ordered by commonality of purpose.

BTW, Thanks Grimjack. Basically, I learned to macro using your examples. When I came to MQ in March. I had 2 core macros I followed. Grimjack's Hunter and (Lasher's) Genbot v9.x. Well, now I know you where behind this as well.

/kneel
/thank

Draco

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

Post by Vexix » Fri Jun 04, 2004 11:24 am

Seagreen500 -- Your updated genbotdoc is now posted. I made a few changes.

I've removed the bit about /echo genbot entirely. Can't imagine why anyone wouldn't just type /gb instead.

The lootup command worked a little differently than described. Genbot has no memory of "last target," so it actually loots the named target or your target if no corpse name given.

I added camp into the soon-to-be-obsolete list.

Can you work on the .ini explanation doc, or is someone else interested in doing that?

sj-digriz -- Thanks for the help with sorting the code!!!

Draco -- Thanks. If there is any of the to-do's you like to step up to, please let me know.

gus -- Try saving all the files again, and possibly erasing and recreating your .ini file. /tells are working fine with the posted code.

Fez -- Bug fixes and testing are a big help, actually. ;)

Grimjack -- I've added a first cut at a credits list into genbotdoc. Here's what it looks like:
Genbot Credits and History:

Version 0-8.8 Genbot created and developed by Grimjack
Version 8.8-? Lasher took over the code.
Version ?-12.34 Lord Giddeon maintained the code. Fez_Ajer did some trouble-shooting and code fixes.
Version 12.35 - Current Vexix Updated the code and introduced generalized shortcuts.
--Vexix

sj_digriz
a lesser mummy
a lesser mummy
Posts: 40
Joined: Wed Jun 02, 2004 9:10 am
Contact:

Post by sj_digriz » Fri Jun 04, 2004 11:33 am

I finished re-ordering BotCore.inc

Almost done with BotSpell and BotHealer.

When the upcoming BotSpell changes and the re-ordered versions are posted, I will take them again and see if I can create better functional sections with more comments.

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

Post by grimjack » Fri Jun 04, 2004 11:45 am

Vexix wrote:The lootup command worked a little differently than described. Genbot has no memory of "last target," so it actually loots the named target or your target if no corpse name given.
At one time there was 2 commands for looting, lootup and lootall. Lootup would loot the target named or the target of the master, lootall would attempt to loot all npc corpses in a radius.

Thanks
GrimJack
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

Dulapore
a lesser mummy
a lesser mummy
Posts: 67
Joined: Thu Feb 26, 2004 4:39 am

Post by Dulapore » Fri Jun 04, 2004 12:52 pm

The Remem function isn't working due to it being explicitly set. Just remove the text in red below.

Code: Select all

Sub SpellSub(string SpellName) 
   /if ((${Me.Casting.ID} || ${CTimer}>0) && !${IsBard}) /return 1 
   /if (${SpellName.Equal[NA]}) /return 1 
   /varset SpellFail 0 
   /if (${SitAfterCast}) /varset SitTimer ${DelayBeforeSit} 
   /If (${Target.Distance}>${Spell[${SpellName}].Range} && ${Spell[${SpellName}].Range}>0) { 
      /varset SpellFail 1 
      /call ChatOut 7 ${MasterName} "Too far away. " 
      /varset CTimer 0 
      /return 1  
   } 
   /if (${Me.Sitting}) /stand 
[color=red]   /varset Remem 0 [/color]
To allow Private Msg's via IRC, which is how I give direct commands with, you would add the following in botcore.inc.

Code: Select all

.
.
#Event IRCMsg "[#1#(msg)] #2#"
.
.
.
Sub Event_IRCMsg(string IRCText,string IRCSender) 
      /if (${MasterList.Find[|${IRCSender}|]}) { 
      /declare NameLength int local ${IRCSender.Length} 
         /varcalc NameLength ${NameLength}+7 
         /varset IRCText ${IRCText.Right[-${NameLength}]} 
    /call ExecCommand "${IRCText}" 
      /return 
I think that could be cleaned up by using the value of #2#, but it keeps in line with the other functions.

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...

Post by fez_ajer » Fri Jun 04, 2004 1:22 pm

Vex: Just to letcha know, I snuck some minor changes into that botspell.inc that I sent you. Some are ok for inclusion with the current botspell. The one I can think of off the top of my head is a change in CheckYaulp which allows you to have Pally bot's yaulp as well as clerics.
- Fez

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

Post by Vexix » Mon Jun 07, 2004 11:13 am

I'm busily cranking away at the next version of genbot, with spells broken down into discrete steps and put into a spell queue. I'm working on putting items and alt abilities into the same stack now as well. Will hopefully have it up this week.

I think you'll like some of the new capabilities. ;)

Grimjack, Fez, or Lord Giddeon,

Could one of you let me know the rationale behind SelfBuffInt array? It seems to basically create a countdown for the buffs to be checked? I'm thinking replacing it with the 5 second timer, and then checking all buffs each time, since I don't think the processor time to check all buffs will be that high.

--Vexix

sj_digriz
a lesser mummy
a lesser mummy
Posts: 40
Joined: Wed Jun 02, 2004 9:10 am
Contact:

Post by sj_digriz » Mon Jun 07, 2004 11:39 am

Vexix wrote:Could one of you let me know the rationale behind SelfBuffInt array? It seems to basically create a countdown for the buffs to be checked? I'm thinking replacing it with the 5 second timer, and then checking all buffs each time, since I don't think the processor time to check all buffs will be that high.

--Vexix
I'm already having fps issues running genbot. Whenever I start it my fps drops in half and the screen seems to granulate. This is not a crap machine (XP Pro, 1gigRAM, 2100+, GeForce 4600). Is anyone else having this? Not sure if switching to the 5 sec countdown wille exagerate that problem.

SJ