Macro Bot.mac Updates and Bug Fixes by [40oz]

So I've been looking over the bulk of the code here on Bot40.mac and found that there are many many many more issues with /next than I had originally thought. This will require a great many changes that will likely take a bit of time for me to sort out. there was no consistency with how the /next was used. In some places it uses a /goto :keyword command, in others it's simply /next var with no preceding code (which is what i originally looked for).

I had originally did a search of the entire document for /next and anywhere it was (Somecondition) /next var I would change it to /continue or /break appropriately.

Now what I hadn't accounted for was
/if (Somecondition) {
/next var
}

or
/if (Somecondition) /goto :nextRoot

or
/if (Somecondition) {
/goto :nextVar
}

Additionally, in the DoT routine I'm finding that I'm being told I do not have a spell that I do in fact have, and have memmed. I'm trying to find the cause. Likely a /next issue, but I won't be certain until I get some of those issues sorted.

All this means is I've found a great deal more broken code, but I know how to fix it. But it will take time.
 
Last edited:
Thank you in advance for you work on this macro its just way to powerful to abandon
 
Thank you in advance for you work on this macro its just way to powerful to abandon

While MQ2Bot is certainly powerful in and of itself. I don't know enough about it to work with it or add to it. Which is ultimately going to be better than this. For now I don't mind working with what I can.
 
Some fixes put in place. Try it. let me know if it fixes anything. To many things were changed in for loops to really make a list. So I made a comment with my name next to each change.

** 2017-10-1 - Chatwiththisname
** - Changed a lot more lines to get rid of /goto commands and replaced with
** appropriate /continue or /break as per previous corrections. As opposed to noting
** line numbers I've added a note with my name in it for easy location for using find
** as line numbers change as code is edited. There is 135 /goto commands, 244 /next commands,
** 498 :keywords and over 9000 lines of code. I may have missed something. But I'm not sure.

Hopefully some more things are working better. Keep me up to date on what is and isn't working if at all possible. These are generalized fixes not focused on fixing any one particular part of the macro. This is more bringing the code in line with the changes to /for /next /continue /break, with the happy side effect that it fixes things that were previously broken. This may fix issues with Aura's for shamans, it may also break it as according to Poly the error is random for those characters and my fix was targeted at shamans. I did not put a note next to that code but I know where it is. I've been running this in conjunction with my pull.mac (personal beta version not ready for release) and it has run without error for some hours.

On that note, my eyes hurt, my wife wants me to watch TV with her and I need a beer.

~Chat
 

Attachments

  • bot40.mac
    507.9 KB · Views: 6
Last edited:
I don't think there is technically anything wrong with /got to being used to skip an iteration is there? I saw many of those, but i left them as they seemed to be working fine.
 
I don't think there is technically anything wrong with /got to being used to skip an iteration is there? I saw many of those, but i left them as they seemed to be working fine.

I don't think there is anything wrong with them being used. But there is a specific command that does the same thing and for the sake of conventions I've changed it as I felt it was appropriate to. I reviewed the code before making a change however and the /goto that did not just skip a single iteration (jumped completely out of 3 nested for loops for example) were left in place.
 
Additionally, I've just reproduced the Aura error mentioned previously. No such 'string' member "Name".

The odd thing about it is that it can be produced on a shaman, but not on a shadowknight or a berserker.

I literally typed it into the /echo and got the error on the shaman, but type the same thing into the box on a shadowknight and berserker and didn't get it. Interesting :-x

Nightmare and Poly, can you confirm classes that encountered this issue.

Already implemented a fix for Shaman, need any other classes relevant to the bug. In the mean time I'm going to contact EQMule about this issue as his change is what is potentially wrong. This is an MQ2 TLO and datatype structure issue and not the fault of the code here.

Yes, my issue was on a shaman, so that fix should get it done. I will try to test tomorrow.
 
Thanks for the assist all; I'm finally done traveling / moving and back in Japan. I can hopefully start assisting more on this tomorrow unless Job search stuff comes up.

Looks like poly and chat have made some excellent progress. I'll start by reviewing their changes and continuing from the newest bot40 in this post.
 
Thanks for the assist all; I'm finally done traveling / moving and back in Japan. I can hopefully start assisting more on this tomorrow unless Job search stuff comes up.

Looks like poly and chat have made some excellent progress. I'll start by reviewing their changes and continuing from the newest bot40 in this post.

I made more changes for undeclared variables to include spellroutines.inc just haven't submitted it. The root routine is broken and was trying to get it working. Not sure that all changes are good so didn't submit.

Also, the DoT routine for shaman works but tells me incorrectly that i don't have the spell. Probably a spot where i /continue when i should have left a /goto skip in place.
 
Last edited:
Please note to any users that see this post. I could not find a place to msg 40oz my unsubmitted work privately and thus some debug messages and unverified changes exists inside of this .mac and .inc file.

If you choose to download this and run it, there is no promise that it works any better than my previous submission, or that you will enjoy the luxuries of the spam that comes with it. This copy includes the uncommented #Warning for the location of undeclare variables and -will- pause while in use unless you comment it out at the top of the macro below the comments using | which is Shift+\ above your enter key.

To 40oz. Please find my changes indicated with Ctrl+F to search for Chatwiththisname in both the spellroutines.inc and bot40.mac
DoT routine informs me that I don't have the spells identified inside of my characters .ini while playing shaman. This occurs regardless of which spells I choose. However, the macro carries on to cast said DoT's as if the statements saying I didn't have them were never given.

I randomly get spammed with

Code:
MyCharactersName - [2017/10/01 23:03:26] [MQ2] 3465 MyCharactersName - Feet Like Cat
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL
MyCharactersName - [2017/10/01 23:03:26] [MQ2] Removing NULL NULL

Update: Verified it has something to do with Buffqueue sub near 4659. Though I have no idea what it is doing. If I don't have the spell on myself it doesn't appear to attempt to do this portion of the sub or buff. If I have it on myself I get spammed with that message.

Update: Finally got it to parse the information. It now cycles through characters and determines that they do or do not have the buff. But still spams information and never actually casts the buff on them. Echos were added to various buff subs to let me know what sub it was in. I left that there for future testing. It will spam you.

Code:
/echo Removing ${Spawn[${BuffArray[${i},1]}]} ${BuffSpellName${BuffArray[${i},2]}}

I did not comment my name or the fix for the Aura 'string' 'Name' error message. That code is located at 4024-4026. Alternately, here is the code to search for

Code:
/if (!${Me.Class.ShortName.Equal[SHM]}) {
		/if (${Me.Aura[1].Name.Length} && !${Me.AltAbility[Spirit Mastery]} && !${Me.AltAbility[Auroria Mastery]}||${Me.Aura[2].Name.Length}||${AuraDelay}||${NeedLoad}) /return
	} else /if (${Me.Aura[1].Length} && !${Me.AltAbility[Spirit Mastery]} && !${Me.AltAbility[Auroria Mastery]}||${Me.Aura[2].Length}||${AuraDelay}||${NeedLoad}) /return

I've changed all instances of /face fast to /face

I fixed my fix for the shaman aura error. I was using /if () { /somecode } else /somecode instead of /if () {/Somecode} else {/somecode} and it was causing a sub to overflow into another sub on non shaman characters.

Added ~
Code:
/if (!${Defined[${CurrentSub}Loaded]}) /declare ${CurrentSub}Loaded bool outer FALSE
|**Defined the variable if it hasn't been defined to fix a /varset failed, variable not found issue. ~Chatwiththisname~ 10/02/2017**|


to begining of Feign Death sub and Lifetap subs to fix /varset fail issue. May only be present on new file creation, but fixed the issue none the less.

Modified the section that checks to make sure an ini entry is present and informs you that it is missing or filled out incorrectly to check and see if the INI entry is at least present in the INI file and if not adds the entry automatically.

Code:
BuffSpellName1=----------------------
BuffSpellIcon1=----------------------
BuffSpellGem1=----------------------
BuffAlias1=----------------------

is what it looks like in your INI after running with missing INI entries.

You still get the message that it is missing or filled out incorrectly, but at least it's in the INI for you to edit. The dashes were used so that it wouldn't return NULL on check, and to make it easy to find the INI as an entry that needs to be changed to something custom.

Code:
/echo [${SubName}] ${SubName}${SpellLoad2Cats.Arg[${SubOptions.Arg[${i},|]},|]}${x}= is missing or not filled out correctly
				|**Code to automatically generate missing INI Entry if it doesn't exist, add to see if it is present first. ~Chatwiththisname~ 10/02/2017**|
				/if (${Ini[MyIni,${SubName},${SubName}${SpellLoad2Cats.Arg[${SubOptions.Arg[${i},|]},|]}${x}]} == NULL) {
				    /ini "MyIni" "${SubName}" "${SubName}${SpellLoad2Cats.Arg[${SubOptions.Arg[${i},|]},|]}${x}" "----------------------"
				    /echo [${SubName}] ${SubName}${SpellLoad2Cats.Arg[${SubOptions.Arg[${i},|]},|]}${x}= was added to the INI. 
				}
				/mqlog ${Me.Class} -  [${SubName}] ${SubName}${SpellLoad2Cats.Arg[${SubOptions.Arg[${i},|]},|]}${x}= is missing or not filled out correctly

Changed

Code:
/echo Errors found in MyIni. See messages above or look in \mq2\logs\ThisMac.log for errors encountered.

to

Code:
/echo Errors found in MyIni. See messages above or look in \\mq2\\logs\\ThisMac.log for errors encountered.

It was treating the \ as escape codes and truncating the message.

Who made this note.
Code:
	| I'm hacking all these in for the changes on the 20170912 of MQ2.  The right way to fix this will take way longer
	|findme|

What variables did you "hack" declares for. While I realize this note is to yourself and it may have got the program moving, knowing what was actually done would be helpful in making corrections in those areas.

Nevermind, I see that you put the message above and below about 50 or so ghetto declared variables. I'm now going to delete them and put them in the correct locations as they appear with errors. Mostly checks to see if a routine has been loaded.

Update: This is what is left of those variables.

Code:
/declare Pulling bool outer FALSE

	/if (!${Defined[XTargetRadiusList]}) /declare XTargetRadiusList int outer
	/declare AmIPuller bool outer FALSE
	/if (!${Defined[FadeUseAtMyHP]}) /declare FadeUseAtMyHP int outer 0
	/if (!${Defined[FeignDeathUseAtMyHP]}) /declare FeignDeathUseAtMyHP int outer 0
	/if (!${Defined[FeignDeathStandAtMyHP]}) /declare FeignDeathStandAtMyHP int outer 0
	
	/declare DotTotal int outer ${Ini[Bot_${Me.CleanName}_${MacroQuest.Server}_${Me.Class}.ini,Dot,DotTotal,0]}
	/declare RootTotal int outer ${Ini[Bot_${Me.CleanName}_${MacroQuest.Server}_${Me.Class}.ini,Root,RootTotal,1]}
	/declare RootAdds bool outer ${Ini[Bot_${Me.CleanName}_${MacroQuest.Server}_${Me.Class}.ini,Root,RootAdds,T]}
	/declare DebuffTotal int outer ${Ini[Bot_${Me.CleanName}_${MacroQuest.Server}_${Me.Class}.ini,Debuff,DebuffTotal,0]}
	/declare DebuffAdds bool outer ${Ini[Bot_${Me.CleanName}_${MacroQuest.Server}_${Me.Class}.ini,Debuff,DebuffAdds,FALSE]}

That doesn't mean that they need to be defined. Just means that I'm not sure if they are defined in the correct location.

To Whom it may concern.
/declare DotTotal int outer ${Ini[Bot_${Me.CleanName}_${MacroQuest.Server}_${Me.Class}.ini,Dot,DotTotal,0]}

is not the same as

/declare DotTotal int outer ${Ini[Bot_${Me.CleanName}_${MacroQuest.Server}_${Me.Class}.ini,Dot,DotTotal]}

There is an additional parameter in the top box. Unless that checks for a value and if it doesn't find one returns the final parameter then I cannot see a reason for it. I feel like it would set it to 0, or do nothing at all. Either way I cringe when I see it :)

This is my last update tonight. It's spam town for the likes of anyone that uses it. You can do a CTRL+F and look for the word Test to find and remove the echos. Trying to fix the buff routine. More work to remove the echos for release that I don't care to address. Also don't forget to remove #warning


There are now 95 separate entries with my name on it. Hopefully it doesn't take 40oz to long to catch up to what I've done. Got classes the rest of the week. Good luck all.


To everyone else, you've been warned :)
 

Attachments

  • Spell_routines.inc
    67.9 KB · Views: 9
  • bot40.mac
    517.7 KB · Views: 7
Last edited:
To Whom it may concern.
/declare DotTotal int outer ${Ini[Bot_${Me.CleanName}_${MacroQuest.Server}_${Me.Class}.ini,Dot,DotTotal,0]}

is not the same as

/declare DotTotal int outer ${Ini[Bot_${Me.CleanName}_${MacroQuest.Server}_${Me.Class}.ini,Dot,DotTotal]}

There is an additional parameter in the top box. Unless that checks for a value and if it doesn't find one returns the final parameter then I cannot see a reason for it. I feel like it would set it to 0, or do nothing at all. Either way I cringe when I see it :)

That was me that put that line. I'm not sure what you are getting at, according to the wiki, the "0" will set DotTotal to zero if no entry is found in the INI. Is that not what we want? "DotTotal" is used somewhere, even if you have dots turned off in your INI, so I set to zero if it doesn't fine it in the INI.

I'm not a programmer, already said that. I waited 2 weeks after this change went live and it seemed like no one was working on it, so I tried to give it a go.
 
To Whom it may concern.
/declare DotTotal int outer ${Ini[Bot_${Me.CleanName}_${MacroQuest.Server}_${Me.Class}.ini,Dot,DotTotal,0]}

is not the same as

/declare DotTotal int outer ${Ini[Bot_${Me.CleanName}_${MacroQuest.Server}_${Me.Class}.ini,Dot,DotTotal]}

There is an additional parameter in the top box. Unless that checks for a value and if it doesn't find one returns the final parameter then I cannot see a reason for it. I feel like it would set it to 0, or do nothing at all. Either way I cringe when I see it :)

That was me that put that line. I'm not sure what you are getting at, according to the wiki, the "0" will set DotTotal to zero if no entry is found in the INI. Is that not what we want? "DotTotal" is used somewhere, even if you have dots turned off in your INI, so I set to zero if it doesn't fine it in the INI.

I'm not a programmer, already said that. I waited 2 weeks after this change went live and it seemed like no one was working on it, so I tried to give it a go.

Never noticed that entry in the wiki. Probably a good idea to give it a default value if none is found. As an added step we should also assign that default value to the ini so that it's not returning null in the future. This makes me cringe no more :)
 
Chatwiththisname - I'm just sitting down now to start cranking on this. No clue how far I'll get, but I'm starting with seeing difference from where I left off and your newest file here with the debug in it, then I'll continue from there.

Do we have a master list of still outstanding issues anywhere? I saw poly had a list at one point.

edit:

Attached are versions with I think everyone's changes in them. I've moved a bunch of stuff to Debug 3 that should have been there instead of an echo, as well as removed a lot of echos that were either commented out or unnecessary. There's still a couple of embedded comments with notes on them that need addressing.

I started taking apart the Buff code since it's pretty broken. Didn't get too far. It seems to me like it's way over-complicated, but that's likely because I don't understand the full flow of it yet. I'm still not sure what what each of the 7 Buff Subs do yet, let alone all the Globals and Timers that are defined. I'll make that my focus until I can get it working.

Then after that, HealSingle is broken, if someone else hasn't looked at it I will.
 

Attachments

  • bot40.mac
    488.9 KB · Views: 10
  • Spell_routines.inc
    68 KB · Views: 6
Last edited:
Chatwiththisname - I'm just sitting down now to start cranking on this. No clue how far I'll get, but I'm starting with seeing difference from where I left off and your newest file here with the debug in it, then I'll continue from there.

Do we have a master list of still outstanding issues anywhere? I saw poly had a list at one point.

edit:

Attached are versions with I think everyone's changes in them. I've moved a bunch of stuff to Debug 3 that should have been there instead of an echo, as well as removed a lot of echos that were either commented out or unnecessary. There's still a couple of embedded comments with notes on them that need addressing.

I started taking apart the Buff code since it's pretty broken. Didn't get too far. It seems to me like it's way over-complicated, but that's likely because I don't understand the full flow of it yet. I'm still not sure what what each of the 7 Buff Subs do yet, let alone all the Globals and Timers that are defined. I'll make that my focus until I can get it working.

Then after that, HealSingle is broken, if someone else hasn't looked at it I will.


HealSingle was working for my shaman to an extent. Sometimes it chain interupts itsself.

The buff subs are wild. It's over my head as well. I had considered rewriting it all together myself.
 
Last edited:
FYI

To make my life easier, I've thrown this in to a git repository so I could more easily diff and track changes over time.

If you want access to make pull requests and such against this, so we can all collaborate like real coders, have an account on bitbucket.org and send me a PM with your account name, I'll add you to the repo.

I didn't know if it'd be okay to make it a public repo, since this code is distributed with MMOBugs stuff.
 
FYI

To make my life easier, I've thrown this in to a git repository so I could more easily diff and track changes over time.

If you want access to make pull requests and such against this, so we can all collaborate like real coders, have an account on bitbucket.org and send me a PM with your account name, I'll add you to the repo.

I didn't know if it'd be okay to make it a public repo, since this code is distributed with MMOBugs stuff.

I have a Git jessebevil (Jesse Bevil) * GitHub
 
As a side note I use 32 bit Notepad++ with the compare plugin to see differences without the git. I understand it's easier with those, just saying what I use for now.

bot40 is my copy, bot402 is a copy I downloaded originally from nightemare.

As a side note. I've messaged PeteSampras and requested he look at the Buff code in its existing setup. He's agreed to take a look, but he doesn't do in game things. So I'm assisting with my test characters. I'll let you know if we find a fix.

So I decided to compare Bot40 to Bot. Turns out there are 74 instances of /call cast but there is no Sub Cast. This will be much needed changes to a lot of our casting routines I hope.
 

Attachments

  • compare.bmp
    5.9 MB · Views: 8
  • call cast.bmp
    5.9 MB · Views: 5
Last edited:
Sub cast is in spell routines.inc

Im in hospital now... new baby etc. So stuck using phone.
 
40oz. I made a post a few pages back with a complete list of what i had working... not working..... not tested etc