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

I don't suppose something can be added to the compile to turn off these new features (just till all these macs get fixed up)... Kinda sucks only having a week to fix all this (now only 4 days) before the next live patch :(
 
The parser isnt buggy you cannot use variables that way anymore.

The easiest way is to check if the variable is defined before asking for it example sub buffload does.
/if (${BuffLoaded}) /return

Simple fix is
/if (${Defined[BuffLoaded]}) {
/if (${BuffLoaded}) /return
}
These are the minor issues though the major ones will require entire rewrites of how bot.mac handles stuff because you simply cannot use a variable in a line before its declared or it will break the macro.
 
The parser isnt buggy you cannot use variables that way anymore.

The easiest way is to check if the variable is defined before asking for it example sub buffload does.
/if (${BuffLoaded}) /return

Simple fix is
/if (${Defined[BuffLoaded]}) {
/if (${BuffLoaded}) /return
}
These are the minor issues though the major ones will require entire rewrites of how bot.mac handles stuff because you simply cannot use a variable in a line before its declared or it will break the macro.

Yeah. I've got most of the basic stuff fixed already, hunting down those kinds of issues will take a while. Turning on #warning at the top of the macro is what causes the extra strange behavior I was mentioning.

The way this macro does a lot of things boggles my mind when I get in to it. Definitely not how someone who is used to more structured programming would go about it, but it's clever in it's own way.

I was trying to avoid checking Defined - more comparisons is more CPU cycles, so I changed the way all those works to predefined booleans set to false in the load sub.

Anyhow, I have to pack 3 bedrooms today. If I make good progress, I'll try to hack at it more when I'm done.
 
I spent half the day yesterday and understanding why he wrote certain things the way he did baffles me.
 
I spent half the day yesterday and understanding why he wrote certain things the way he did baffles me.
Because reasons. It was hodgepodged for some of it and others had a purpose to minimize updates I would have to make. By focusing all the declares to a centralized point it minimized the amount of updates that would be required... in theory. What i did not anticipate was eqmule changing how declares themselves would work. In fairness, I did stop work on bot.mac back in almost 2012 and was working on mq2bot. Had I just gotten the requested feedback for that, this would be a moot conversation as you would all just use that instead. Turns out nobody provides feedback until something breaks though.

Back to fixing this though.. i imagine what you could do instead of check for defined is just define all those variables at start, set them to 0, and then do a /if (!${BuffLoaded}) /call BuffLoad

Then repeat that ad nauseum.
 
I spent half the day yesterday and understanding why he wrote certain things the way he did baffles me.
Because reasons. It was hodgepodged for some of it and others had a purpose to minimize updates I would have to make. By focusing all the declares to a centralized point it minimized the amount of updates that would be required... in theory. What i did not anticipate was eqmule changing how declares themselves would work. In fairness, I did stop work on bot.mac back in almost 2012 and was working on mq2bot. Had I just gotten the requested feedback for that, this would be a moot conversation as you would all just use that instead. Turns out nobody provides feedback until something breaks though.

Back to fixing this though.. i imagine what you could do instead of check for defined is just define all those variables at start, set them to 0, and then do a /if (!${BuffLoaded}) /call BuffLoad

Then repeat that ad nauseum.

Ya that was my theory in fixing all the declare issues is to just define everything as 0 at the start.
 
I spent half the day yesterday and understanding why he wrote certain things the way he did baffles me.

The same is true of anyone's code. Especially when you are first rolling out a new capability.

One of my favorite sayings from a prof:

First time coding proves it can be done.
Second time coding you learn there was still a lot you don't know.
Third time coding you have something that is pretty solid.
 
I spent half the day yesterday and understanding why he wrote certain things the way he did baffles me.

The same is true of anyone's code. Especially when you are first rolling out a new capability.

One of my favorite sayings from a prof:

First time coding proves it can be done.
Second time coding you learn there was still a lot you don't know.
Third time coding you have something that is pretty solid.

Yeah, came to say the same thing. I'm not disparaging those before me, apologies if it seems that way. I can tell it was hodgepodged together over time, you're going to have spaghetti in 8000 lines of code, it's just bound to happen. All you can do is clean it up over time =) With this macro language and features like having variables as part of other variable names, it makes following some logic hard, it's just how it is.
 
Wasn't trying to be negative about how its written. Just expressing my frustration trying to fix the bugs because you have to understand why something is doing it that way so you dont break it more.
 
Wasn't trying to be negative about how its written. Just expressing my frustration trying to fix the bugs because you have to understand why something is doing it that way so you dont break it more.
lolz dude i dont care, i dont get butthurt. i was also just expressing my frustration that people are still using this macro rather than provide meaningful feedback to mq2bot because it can do so much more than the macro. this macro should have died in 2014. i stopped the mq2bot update after literally 0 people expressed interest and i dont even play the game so why bother. it is still just sitting partially done on my github. it literally lets you define any custom things you want and prioritize any spells and do everything the macro can do plus more while simultaneously being ~20 faster response but i couldnt even get a single person to test it. so.. ya.
 
Im always willing to test it. I prefer plugins over macros.


Sent from my iPhone using Tapatalk
 
I stopped the mq2bot update after literally 0 people expressed interest and I dont even play the game so why bother. it is still just sitting partially done on my github. it literally lets you define any custom things you want and prioritize any spells and do everything the macro can do plus more while simultaneously being ~20 faster response but I couldn't even get a single person to test it. so.. ya.

On vacation now, but I return on 9/25 and run most classes. Glad to test anything you put together when I get back. MQ2Bot is an amazing plugin as it stands.
 
I stopped the mq2bot update after literally 0 people expressed interest and I dont even play the game so why bother. it is still just sitting partially done on my github. it literally lets you define any custom things you want and prioritize any spells and do everything the macro can do plus more while simultaneously being ~20 faster response but I couldn't even get a single person to test it. so.. ya.

On vacation now, but I return on 9/25 and run most classes. Glad to test anything you put together when I get back. MQ2Bot is an amazing plugin as it stands.
The original post about a rewrite is here Giving away the magic sauce - mq2bot rework source code github and i feel like i had some more information somewhere. My intent was to have an open source version of it that the community could contribute to but it didnt pan out that way and i lost motivation. I basically got it to detecting everything and allowing you to specify spells to use a la bot.mac but i didnt copy over the routines to actually check for each spells nor write in the code to cast said spells because mq2cast is a no-go due to lack of information sharing that will need to be inside the plugin to access. That link has the github info but here it is again. mq2/MQ2Bot at master * PeteSampras/mq2 * GitHub im happy to work with anyone that actually wants to build out the plugin. a lot of the remaining code would be copy/paste from the current mq2bot so it closer to completion than the code would make you believe.
 
I remember the birth of mac bot, good times. Its probably the case that in reference to both plugin and macro they both worked so well (well enough) that people used them and any flaws they just dealt with them.

I just came back and the bot plugin is definatly a diamond.

simultaneously being ~20 faster response

now that is sexy
 
if his butt is not hurting hes not having fun, just saying
 
Like Pete, I've quit playing the game and any coding I do is purely beneficial to the community. Sadly, I don't have near the skill in programming as Pete does, as I'm just now taking my first C++ class. I'd be happy to help with the code however I can, but without direction I'd be just as lost as any typical user. I've recently covered the topic of struct's and classes for C++.

Also an unfortunate/fortunate thing depending on how you look at it, my class on C++ isn't just about C++. It also covers unix, including compilation in Unix. So any source I create must work in both windows and Unix. As Unix is a new concept for me it has added an additional challenge to my coding. Something I make in C++ may work in VS but not in g++ compilation. So I have to go the extra mile to make sure everything is done correctly for cross platform compilation.

I have downloaded the GIT and pending any homework I have to complete this semester I will look over it. However, some more refined direction on what is needed to be done would be awesome as I can treat it as an assignment and research specific portions of coding to help me with anything I create/add to the functionality. I don't think I am ready to try and understand the monster that is MQ2Bot.cpp in its entirety.

~Chat
 
Last edited:
Like Pete, I've quit playing the game and any coding I do is purely beneficial to the community. Sadly, I don't have near the skill in programming as Pete does, as I'm just now taking my first C++ class. I'd be happy to help with the code however I can, but without direction I'd be just as lost as any typical user. I've recently covered the topic of struct's and classes for C++.

Also an unfortunate/fortunate thing depending on how you look at it, my class on C++ isn't just about C++. It also covers unix, including compilation in Unix. So any source I create must work in both windows and Unix. As Unix is a new concept for me it has added an additional challenge to my coding. Something I make in C++ may work in VS but not in g++ compilation. So I have to go the extra mile to make sure everything is done correctly for cross platform compilation.

I have downloaded the GIT and pending any homework I have to complete this semester I will look over it. However, some more refined direction on what is needed to be done would be awesome as I can treat it as an assignment and research specific portions of coding to help me with anything I create/add to the functionality. I don't think I am reading to try and understand the monster that is MQ2Bot.cpp in its entirety.

~Chat
I knew zero C++ prior to creating mq2bot. Literally knowing anything is more than i had. I just looked at other plugins for reference and googled/asked htw. I still only know enough to write that specific plugin. i can plan out how i would like things to function but coding them is sometimes problematic because I dont always know what is going to cause issues/crashes. i've never used C++ outside of mq2.
 
Like Pete, I've quit playing the game and any coding I do is purely beneficial to the community. Sadly, I don't have near the skill in programming as Pete does, as I'm just now taking my first C++ class. I'd be happy to help with the code however I can, but without direction I'd be just as lost as any typical user. I've recently covered the topic of struct's and classes for C++.

Also an unfortunate/fortunate thing depending on how you look at it, my class on C++ isn't just about C++. It also covers unix, including compilation in Unix. So any source I create must work in both windows and Unix. As Unix is a new concept for me it has added an additional challenge to my coding. Something I make in C++ may work in VS but not in g++ compilation. So I have to go the extra mile to make sure everything is done correctly for cross platform compilation.

I have downloaded the GIT and pending any homework I have to complete this semester I will look over it. However, some more refined direction on what is needed to be done would be awesome as I can treat it as an assignment and research specific portions of coding to help me with anything I create/add to the functionality. I don't think I am reading to try and understand the monster that is MQ2Bot.cpp in its entirety.

~Chat
I knew zero C++ prior to creating mq2bot. Literally knowing anything is more than i had. I just looked at other plugins for reference and googled/asked htw. I still only know enough to write that specific plugin. i can plan out how i would like things to function but coding them is sometimes problematic because I dont always know what is going to cause issues/crashes. i've never used C++ outside of mq2.

I apologize this is a bit off topic, but this made me wonder, what language script language is used by mq2?
 
Well I have been refusing to update MQ2 because I am so dependent on this macro. But if there is a patch this week from Daybroke, then I am fucked... so I hope and pray the fix is available this week.