Giving away the magic sauce - mq2bot rework source code github

PeteSampras

Your UI is fucking you. Stop using it.
Joined
Dec 12, 2007
Messages
3,956
Reaction score
49
Points
38
BLUF: my github with my mq2bot rework and some other stuff https://github.com/PeteSampras/MQ2Bot


Status Board/roadmap: GitKraken Glo



I have been in the process of updating mq2bot for awhile now. I've gone back and forth how I want to lay it out and I know there is probably some interest in how to write plugins or to see how things are done. I am by no means an expert but I have created a github to store some of my code as I build out the plugin. I will likely keep posting until i get to a version 1.0 though i can't say i would post continued updates to it as those are often done by htw and housed in the mmobugs compile. He puts in a ton of work updating plugins and once he starts maintaining the plugin, it is as much his as mine because I just can't do what he does. I don't actually play EQ (haven't in years) so I am really just doing this to learn c/c++ more. When i first started mq2bot i knew absolutely no code, in the couple years I have at least learned a few tricks and want to change how the bot works to be more flexible, more powerful, reduce/remove crashes, and have a much smaller size/memory impact. The initial portions of the rework say all of this is going to be accomplished.

To that end, I am always open to ideas on how to build a better mousetrap. So if others are interested in looking at the code for ideas or suggestions, by all means have a go at it. I already know I will have to do a whole bunch of string changes due to the most recent patch so I am likely holding off any coding for the next couple days.

Some very generic basics of building a bot that I need to build out:
Things I can do
People, places, things I can I do things to
Mechanism to do these things

So what have I actually done? Hint: not a lot because i have wafered back and forth on data standardization.
I have built out some core functions and structures to find and store spells/AAs/disc/items and some routines that I will need to use later down the road. It will detect the old mq2bot "AA", "Disc", and "Heal" sections and even flow through a routine to check AAs on a non-existant target. It will detect, categorize, and prioritize spells on the fly as you mem or de-mem them. If the spell is something it wants to use it is "Added", if it doesnt plan on automatically using it, it will just say "Detected".

Current commands:

/plugin mq2botbeta - loads the plugin
/bot - turns on the plugin
/botlist - list all the AAs, spells, disc it currently plans on using from the sections i mentioned previously.
/bot populate spell - populates ini for sample spell setup


Whats left: Basically everything but I can copy/paste a lot of code from the current mq2bot and just modify it some.

What's next:
1. spawns. the structure is in place, now i need to store the info for things i want to buff/heal (group, maybe xtarget, maybe netbots, maybe pets get their own), and stuff i want to hurt (NPCs that have appeared on my xtarget somewhere probably). Once i can store and set that information for the existing routines, i can move to the next thing.
2. mechanism to use my skills. i ripped a bunch of mq2cast and mq2casttimer code and placed it in the .cpp, i also have some select code in the other .cpps that are relevant. I think it might actually work with how i have it set up already, but i plan to make changes anyway. my goal is to pre-check as much info as i can when i first load the spell so that i can avoid countless rechecks until the very last moment. i absolutely must ingest mq2cast or a cast handling mechanism to internally track what has been cast. mq2bots timers have never functioned correctly because of this issue.
3. all the other misc routines and settings and one-offs. most of those will be copy/paste from the existing mq2bot code because of how unique they were and if it aint broke, dont fix it.

This is almost certainly going to take months to accomplish because i play too much dota and really only code when i get in the mood, which is a couple hours every other day currently. However, once I get an example of everything complete, it will be copy and replace for each Create and Check routine for the most part thanks to the uniformity of how I am setting everything up.

Feel free to ask questions about how something works, provide feedback on this post, via PM, or in IRC. I know there are only a handful of people interesting in coding plugins so I don't really expect this thread to have much traction but I figured I would at least offer it up.
 
Last edited:
  • Like
Reactions: direbrother
Renji updated the code to make this compatible with our current compile and has offered to help finish this out if people are interested in an updating mq2bot. The code currently only loads spells basically (it does more than that but let's just say it does that). As long as people provide feedback, i will work on the code. As you can see this post got 0 feedback after almost 3 years so I don't expect it, but hey who knows. This plugin is mq2botbeta until it would someday replace mq2bot. Also, as it gets further along it will replace mq2bot commands and whatnot so aliases may change. mq2bot and mq2botbeta can't be used at the same time and i may just have it automatically unload mq2bot if you try to run this to avoid conflicts. You need to update the plugin with latest version in compile. Your current version is just a dupe of mq2bot.



/plugin mq2botbeta to test spell loading for feedback.
 
Last edited:
I forgot to mention. This is currently how the spells should look in ini using /bot populate spell command. This is what lets you specify spells to use, priority, and order. If you specify the spell there then that is the order it uses. You only have to specify the name and whatever other settings you'd like. You dont need every portion if you dont want them to be other than default.


Sample:
Code:
SpellTotal=17
Spell0Name=Skullfreeze Rk. II
Spell0If=1
Spell0Gem=7
Spell0ForceCast=0
Spell0Use=1
Spell0StartAt=70
Spell0StopAt=0
Spell0NamedOnly=0
Spell0Priority=100
Spell1Name=Bucolic Harvest Rk. II
Spell1If=1
Spell1Gem=8
Spell1ForceCast=0
Spell1Use=1
Spell1StartAt=80
Spell1StopAt=0
Spell1NamedOnly=0
Spell1Priority=99
Spell2Name=Ethereal Weave Rk. II
Spell2If=1
Spell2Gem=1
Spell2ForceCast=0
Spell2Use=1
Spell2StartAt=99
Spell2StopAt=0
Spell2NamedOnly=0
Spell2Priority=45
Spell3Name=Ethereal Incandescence Rk. II
Spell3If=1
Spell3Gem=2
Spell3ForceCast=0
Spell3Use=1
Spell3StartAt=99
Spell3StopAt=0
Spell3NamedOnly=0
Spell3Priority=45
Spell4Name=Magmatic Vent Rk. II
Spell4If=1
Spell4Gem=3
Spell4ForceCast=0
Spell4Use=1
Spell4StartAt=99
Spell4StopAt=0
Spell4NamedOnly=0
Spell4Priority=45
Spell5Name=Telanaga
Spell5If=1
Spell5Gem=4
Spell5ForceCast=0
Spell5Use=1
Spell5StartAt=99
Spell5StopAt=0
Spell5NamedOnly=0
Spell5Priority=45
Spell6Name=Claw of the Flamewing Rk. II
Spell6If=1
Spell6Gem=5
Spell6ForceCast=0
Spell6Use=1
Spell6StartAt=99
Spell6StopAt=0
Spell6NamedOnly=0
Spell6Priority=45
Spell7Name=Claw of the Icewing Rk. II
Spell7If=1
Spell7Gem=11
Spell7ForceCast=0
Spell7Use=1
Spell7StartAt=99
Spell7StopAt=0
Spell7NamedOnly=0
Spell7Priority=45
Spell8Name=Frenzied Devastation
Spell8If=1
Spell8Gem=alt
Spell8ForceCast=0
Spell8Use=1
Spell8StartAt=99
Spell8StopAt=0
Spell8NamedOnly=0
Spell8Priority=30
Spell9Name=Arcane Destruction
Spell9If=1
Spell9Gem=alt
Spell9ForceCast=0
Spell9Use=1
Spell9StartAt=99
Spell9StopAt=0
Spell9NamedOnly=0
Spell9Priority=30
Spell10Name=Improved Twincast
Spell10If=1
Spell10Gem=alt
Spell10ForceCast=0
Spell10Use=1
Spell10StartAt=99
Spell10StopAt=0
Spell10NamedOnly=0
Spell10Priority=30
Spell11Name=Silent Casting
Spell11If=1
Spell11Gem=alt
Spell11ForceCast=0
Spell11Use=1
Spell11StartAt=99
Spell11StopAt=0
Spell11NamedOnly=0
Spell11Priority=30
Spell12Name=Arcane Fury
Spell12If=1
Spell12Gem=alt
Spell12ForceCast=0
Spell12Use=1
Spell12StartAt=99
Spell12StopAt=0
Spell12NamedOnly=0
Spell12Priority=30
Spell13Name=Fundament: First Spire of Arcanum
Spell13If=1
Spell13Gem=alt
Spell13ForceCast=0
Spell13Use=1
Spell13StartAt=99
Spell13StopAt=0
Spell13NamedOnly=0
Spell13Priority=30
Spell14Name=Fundament: Third Spire of Arcanum
Spell14If=1
Spell14Gem=alt
Spell14ForceCast=0
Spell14Use=1
Spell14StartAt=99
Spell14StopAt=0
Spell14NamedOnly=0
Spell14Priority=30
Spell15Name=Fundament: Second Spire of Arcanum
Spell15If=1
Spell15Gem=alt
Spell15ForceCast=0
Spell15Use=1
Spell15StartAt=99
Spell15StopAt=0
Spell15NamedOnly=0
Spell15Priority=30
Spell16Name=Twincast
Spell16If=1
Spell16Gem=10
Spell16ForceCast=0
Spell16Use=1
Spell16StartAt=100
Spell16StopAt=0
Spell16NamedOnly=0
Spell16Priority=0
Additionally, i dont think the compile actually merged so here is a temporary .dll that will work with the compile from 30 Dec 2018. It wont work after next eq patch, whenever that is.
 
Last edited:
Do you have to use the Rk. ### in the config file or does it find the rank automatically so as you update spells it continues to work?
 
Hey Pete, tried to use the beta. /botlist comes up as an invalid command. Also where should it dump the .ini if you use /bot populate spell. I'm afraid it might not be working as well.
 
Do you have to use the Rk. ### in the config file or does it find the rank automatically so as you update spells it continues to work?
Currently have to set exact rank and capitalization. Might be able to change that later.
 
Hey Pete, tried to use the beta. /botlist comes up as an invalid command. Also where should it dump the .ini if you use /bot populate spell. I'm afraid it might not be working as well.
Goes in [MQ2Bot] section with the rest of the stuff atm. I can post the latest version i have, but /botlist should definitely work if its loaded.


Also spun off the repo onto its own for clarity sake. It is now at GitHub - PeteSampras/MQ2Bot with Renji added as a contributor. He has been fixing my broken code.
 
Last edited:
Cool, it's working, I must have done something wrong prior. thanks man
 
picked this back up and have been working on it a couple weeks. refactored a ton of stuff and am now focusing on making sure all lines of buffs are detected. Could use help from people as i dont have anyone above level 100 and i only have a few classes. Therefore, I cannot verify if spells are detecting that should. If people are willing to help, please download the attachment.


/plugin mq2botbeta
/bot
/botlist
/plugin mq2botbeta unload


Then just take a screenshot of your mq2 window or send me a log. There will be a lot of information displayed, the piece i am looking for is what is displayed immediately after loading at the very front of the information. The other data is still useful if it is wrong.
unknown.png


What i want to know is if what is detected is correct or if there are other spells that you think should be detecting that are used to buff other people for long duration spells. I am not checking for things you cast in fights that are short term. I will get to those soon enough. Thanks for any help in advance.


EDIT: this plugin is also in the normal compile, it just might not always be as up to date as whatever latest version is. MMOBugs doesnt push a new compile for this plugin alone.


EDIT2: removing attachment since compile was just updated with latest version.
 
Last edited:
I have several maxed 100 plus toons if you need me to pull stuff for you.
 
Hi just coming back and never used MQ2Bot. I planned on switching to it and learning how it functions. Is Beta being worked on at all? Should I use it instead and help with the feedback or is it not functional enough yet? I am happy to support with feedback either way, just looking for direction on getting my team going 1st.
 
MQ2BotBeta is not being worked on by anyone currently to my knowledge. Updates are being added into MQ2Bot still though.