Goto page 1, 2  Next General A dumber dumbed down guide to MQ and MQemu
Reply
A dumber dumbed down guide to MQ and MQemu
Is there a really really really simplified guide somewhere to all this? Without much programing experience, I'm finding the learning curve on this very steep. It really is taking hours of reading to figure this stuff out.

Don't get me wrong, I'm grateful for all the available info. It's just taking a long time to sort this out. I thought perhaps I missed the "getting started guide" somewhere.

I've been reading the Macroquest2 site, wiki, forums, this site, another site's old forums. The answers come slowly. I hate to just ask 101 newbie questions.

Thanks for any direction.

XXI

-------

btw, Here's an idea to make a few bucks. Offer a one-on-one consulting service to help people like me get started with MQ for a small fee.
Tue Jun 15, 2010 2:04 pm
I don't mind doing it for free. The people who donate for gold membership pay for the site and even leave money left over at times for giving away copies of games or donating stuff/cash to peq.

It's hard to find a get started guide cause there are just so many things you can do with MQ. A brief lesson on macroquest tech. The macroquest core. Macroquest.exe is closed source, we can't see how it works BUT it loads mq2main.dll which we do have the code for. Now eq opens and a chunk of memory is reserved for the game to operate it. The memory will load instructions and data into that memory. Some of these instructions a mini programs that do simple repetetuve tasks. Think of jump as an example. There could be a mini program called jump, that when executed just makes the toon jump. There are also memory slots for savng data simply put at 129373 bytes in you will always find your characters name saved(not true just example). At 83738382 bytes in might be the jump program. These have to be executed from within the game. Nothing you do in notpad will effect eq.... They are in seperate memory locations. If you added code into notpad to run jump... It would just crash not being able to find it in it's own memory space.

What macroquest.exe does is grabs eqgame.exe memoryspace and adds some room to it, and pushes mq2main.dll in it. NOW if we put a "jump" into mq2main.dll it will make you jump.

It's not quite that easy though.... Jump won't be named jump... It would just be called by it's location.... Maybe 18181818bytes in. So "call 18181818" would be what you see in the code. Same thing with where your hp are saved, or your name, the program to open doors or sit. The next step the developers took was to observe how the game worked.... Everytime I jump it calls 18181818 so maybe that's the jump routine. Through a ton of work they've mapped out much of eq's code and given the tools in mq2main to access that stuff easily. Then they made mq2main able to load other dll files into eq. Like mq2map.

Being that the way it works is directly hooked in you could in essence do ANYTHING the game
can do, and being that you can load additional thngs into eq you can even do things the game
can't.

If one wanted to download a speech sdk and integrate it into a dll file and make the spoken word "jump" call the "jump" routine they could.

Being that you are limited by your imagination to get started what do you want to do? Botting 6 could use 0 plugins or 20. There is a huge learning curve and the best way to tackle it is 1 plugin at a time. Some are ambient like mq2map just displays spawns on the map. Some are just to be used in macros for the most part like mq2netbots. Some gve you commands to use like mq2moveutils. Some help you bot like mq2eqbc.

The best thing I could suggest is write a simple follow macro, I can help you. Then play
with each of the major plugins for a few minutes and you'll start to get the idea of how thy mesh together. How eqbc hooks up to netbots to share toons data and send remote commands added by mq2moveutils while watching it all take place on mq2map.

What do you want to do today?
Tue Jun 15, 2010 2:33 pm
Project Lead
Ok, I'm in front of the PC now, I can believe I typed that much crap out on my phone. Here is the low down on some of the plugins, and tools here.

MQ2MoveUtils. This has a few commands to help you move your toons around. Locally on each toon there is a /stick command that makes your toon move towards a target. Almost similar in function to /follow. There is also a camp function that lets you set follow on an arbitrary point in a dungeon. When a mob dies, or /stick is dropped the toon will return to this point. There are several modifiers that let you specify how they should follow... such as how close to get... if they should stay behind the target (for rogue), and my alterations to it let you specify if the toon is tanking.

MQ2EQBC/EQBCS.exe. If you've ever used IRC this is similar. alot of people choose to send commands to their toons via chat, group say, tells, etc. It is horribly insufficient. MQ2IRC was the first solution and let you log each toon into an IRC chat channel. It also had its shortcomings as IRC chat servers set limitations on clients per IP... spamming.. and other things. Running your own IRC was a partial solution but it failed to be easy to setup. EQBC was the answer. EQBCS.exe is the server. You start it on any ONE of your PCs. Each toon connects to that PC using MQ2EQBC. You know have a SUPER efficient chat protocol between toons that stays on your local network. It also figured in parts of MQ2MasterMind which allowed you to send remote commands to your toon. So EQBC is MasterMind and IRC rolled into one, with upgrades. You are on Jim, and want Bob to sit. Type "/bc bob //sit" bob recieves the message and executes the command as if you typed it in his window.

MQ2Exchange. Gives you a set of commands to easily move items around your inventory. I don't remember the syntax off hand but basically you tell it an item, and the slot you want it to go to... "/equip Celestial Fists hands" and it just pops there. Old methods required you to have your inventory window open and simulated mouse clicks.

MQ2Cast. Gives you a set of commands that makes casting spells and items easily.

MQ2Netbots. This hooks up to EQBC. Each instance sends information about its toon, and receives information about other toons. So Jim turns this on and starts spamming information to Bob about his HP, location, mana... all types of data that bob wouldn't normally have access to, and it all happens silently off screen. The information is accessed using variables like "/say ${NetBots[Bob].MaxHPs}" (dont count on that syntax being correct).

MQ2EmuNetAdvPath. This plugin records the location information sent out by netbots. When you target one of your toons and hit /netfollow they follow them, but they aren't really following them directly. They are following the recorded location points broadcast by mq2netbots. This basically makes a recorded path and follows it. The old method relied on just running forward while always facing the target. This means if you ran around the cliff in overthere the follower would probably fall in. If you use /netfollow and run in a circle 20 times and then run north, the follower will run the exact same 20 circles then run north even if you are 30 or 40 seconds ahead of them. This is in the gold area.

MQ2EmuSMS. This adds an INI file that you set your cellphone number and carrier, and then in game you type "/sms text me", "text me" pops up on your phone as a text message. This CAN be slow, its not the software its how quickly you carrier responds to the text message and pushes it to your phone. I typically receive mine within a second or two. When I first tested it I did about 50 of them and they all showed up quickly. About 2 hours after I tested it 1 stragler came in WAY late though. This is in the gold area.

MQ2NetHeals. This lets you send/receive information about players health, disease counters, poison counters, etc similar in the way mq2netbots does. It also uses netbots data and gives you access to some cool variables. (i've never used it so don't take my word on it). Stuff like "${NetHeal.LowestHP} might return the name of the toon in your group who has the lowest life.

MQ2Map. This lets you put mobs and other things on the build in EQ map.

MQ2EmuBotMan. This is a bot managing program. It gives you several window tiling options and displays your background toons as tiled thumbnail windows, the foreground toon fills up a predefined space which is usually larger than the thumbnail areas. It lets you define the clipping distance background/foreground toons can see to free up processing power for smoother botting. It also lets you use variables as your window title. Set your window title to "${Me.Name} ${Me.PctHPs}%" and your window titles would be like "Bob 79%", "Jim 22%", etc. This is in the gold area.

EQBCHud. This is a stand alone program. It logs into EQBCS.exe and listens to the netbots data being transmitted. It parses it and displays it graphically. It also gives you a set of customizable hotkeys. An example of this would be setting a hotkey to "/bc ${CharName} //sit" each toon would get an instance of this under their name. Their own name would get filled into ${charname}. So you click Bob's sit button and it sends "/bc bob //sit" out over EQBC. So... each toon would have their own sit button. These buttons could send whatever you want. There is also a set of commands for watching mobs. There is a specific layout to these commands that needs to be figured into a macro, but once its setup you can see up to 12 toons in the window fighting up to 12 mobs at once. I used to raid using this and effectively 12 boxed the maidens and crazed norrathians trials in HoH. Its difficult to get running, but once its up its amazingly powerful. There are plans to integrate it into the game in the future to make for a faster setup, but its a large undertaking and a ways out.

MQ2EmuDB. This comes with a microsoft access database. The database is built using PEQ's database. There is some information about mobs that isn't available to the player such as if the mob is immune to fear... stuff like that. With this you have a variable structure that lets you pull up the information in a macro by querying the PEQ database. An example (as usual dont trust my syntax) would be ${EmuMob[Lord Doljonijiarnimorinar].first.ImmuneFear} would return a true or false. In the case of false... you might have your necros macro fear the mob. In the case of true you would have them skip fear. This is handy... but hasn't been very popular. It CAN be overloaded. Too many queries going on at once will bog down your games frame rate. The number is high though. Only a certain number of macro lines get run on each frame of the game, so you'd have to totally pack your macro with database queries to effect game play. Using it in MQ2Hud in a ton of spots WILL bog down gameplay because ALL of the hud values get calculated on each EQ frame.

MQ2Hud. This gives you the ability to display variables on the EQ screen. You have an INI file where you type in the values you want to see, such as "${Me.TargetOfTarget} or something like that. Then you would always have a display on the screen of your targets target. I only used this once years ago and don't have alot of background on it.

MQ2ChatWnd. This creates the macroquest chat window that all that MQ crap spams through.

MQ2Track. This gives all players the ability to do tracking like a ranger does.

There are SO many more you could go on an on. There are TONS that I haven't included in my compile.

SO... those are alot of the capabilities...

There are TONS of macros you can use that capitalize on those abilities. You can grab a ready made macro and run it.... you could set up an army of hotkeys... you could write your own. I would very very highly suggest you write your own macro.

Start simple... just a command you send to your guys to follow you, and maybe a command to make them attack a mob, maybe another command to tell you caster to heal you.

After you get that working.... you will have learned 90% of the macroing syntax, there isn't alot to it, it just looks rough.

Read this:
http://mqemulator.net/forum2/viewtopic.php?t=63

that will show you the majority of the syntax. Once you have that basic syntax and an idea of what the existing plugins are capable of make an informed decision about how you want your setup to run, what plugins, tools you want to tap into, and then I can start helping you step your way through learning it.

There are some out of the box solutions. I have maudbot up in the gold area, it should mostly continue working even if you don't decide to keep your membership. I will say it was never designed to release it was mostly put up to demonstrate how the EQBCHud worked as it relies on it heavily and is coded to interact with it.

http://mqemulator.net/forum2/viewtopic.php?t=175

that will gives some background on the macro and the commands to run it as well as how it taps into EQBC hud. There are some screenshots of EQBC hud loaded with data in that thread too. If you want into on EQBC hud look into the EQBChud forum in the gold section. There aren't alot of posts in there so just poke through them.

I'm here if you need me.
Tue Jun 15, 2010 9:08 pm
Project Lead
I'm still reading through your reply but I wanted to say AWESOME. Exactly what I needed. Will have questions soon...
Wed Jun 16, 2010 10:55 am
Again, thank you for that detailed post.

First question, can I plug in pretty much any MQ2 macro? For example, could I go to the MacroQuest2 forums and plug in any macro off those forums, or is the EQemu build different in some way??


There may be simple ways to do these, so I'll ask before trying to reinvent the wheel. 3 simple things come to mind that I'd like to do with MQ are:

1. Auto target, then attack (and face) mobs that are attacking me.
use: when I'm running through Lguk for example and pull a train of agros that can't hurt me anyways, but I have to sit there hitting F8, Attack over and over. It would be cool to have something to do that for me. It needs to start upon activation and stop on hotkey or after nothing is attacking any more.

2. Auto Loot gems or other specified items. When gathering those trains of low lvl mobs, I'd like to hit a key and loot them all of specific items. So if I was collecting crushbone belts, I could pull a dozen orcs, hit hotkey 1, then autoloot the belts.

3. I'd like to fully automate a cleric to heal the group and med as needed. Ideally it should be smart enough to NOT heal right on pull (thus pulling agro to the cleric).

Are any of these already in the build (I use Titanium_Full from your site).

Thanks
Wed Jun 16, 2010 2:45 pm
Yes, for the most part you can plug in any macro. The most common plugins are in the titanium Full build. Anything with "MQ2Emu" prefix is written by mqemulator, so macros from other sites wouldn't do anything with them. Also... from time to time commands and syntax may vary slightly. For example, when a 9th spell slot was added, macros that scanned only 8 slots to see if you had complete heal memmed wouldn't see it in slot 9 and might try to memorize it... I don't know if that really happened, but thats the kind of thing you run into sometimes. So shorty answer... Usually.

It is pretty hard to get by using macros unless you have at least a basic knowledge of how they work, and the most common syntax.

1. Yes, this could be done. Most macro writers use an assist command, or ambient assist. For example, you pull 4 mobs, target one, punch it for a few minutes, then say "/g assist", the guys target you, assist, turn attack on, and /stick. Others will just automatically assist you if they see you have a target and your attack is on. Those two broad ideas are the general basis of attack macros, but the details and methods can vary greatly. For example, in maudbot, I believe the command goes like "/bc ATTACK,<target>,<attacker>". This way if you want Jim on a rat, and bob on a frog, you /bc ATTACK,rat,jim and /bc ATTACK,frog,bob".

Taking any one of those routines, you could easily pull the part the does the actual fighting and keep it. Then take the portion that receives the command, and rewrite it to just target mobs that are near by and bop em.

2. This can also be done, but writing macro's to deal with any kind of windows is very tedious. /target the corpse, make sure its close enough to loot, right click it, etc, etc. Look into /window. and /notify. The window command will list the names of the games windows. Lets say the window is LW_Loot_Window. Then "/window LW_Loot_Window" will then list all the controls in the window... you may see something like LW_Slot_1, that would be slot 1. Each slot is a button. So you'd then /notify each slot with a left click up, that would pick the item up. Then you'd have to check the item on your cursor to see if its name matches the item you want. If not delete. Its important to loot everything, even things you don't want because leaving an item, means leaving a corpse, leaving a corpse means constructing a method in your program of tracking which corpses you've looted and which you haven't (and thats nasty). A better way to track is to just see if a corpse exists. If it turns out its the item you want i believe there is an /autoinventory command or something similar in mq2moveutils. Then you'd have to use /window again to track down the name of the done looting button. code that into a /notify to left click the done button. I seem to remember something similar to this in the past, but I don't have any info on it. It may be a job for google.

3.

http://mqemulator.net/forum2/viewtopic.php?t=259

That is a cleric macro 420 posted awhile back, i've never used it, he probably has some words about it in that thread. Also you can read through the "#event" lines at the top of the macro and they will give you an idea of the spoken commands you can do to control the toon. The #event line is how you tell the macro to capture certain phrases and run code.

Maudbot also has a heal routine in it, with some basic macro knowledge you could pluck it out and use it. I don't know that I have seen a macro that tracks how long you have a mob engaged before healing.

To track how long you have it engaged you'd have to intervene somehow... for example... a simple "heal on/off" command would put your cleric to rest until you were ready for them to engage. Coding that much logic into a macro will get you in trouble. Macro's only execute a certain number of lines of code per frame of EQ. If you've got a slow frame rate, your macro run slow... the higher the density of your logic the slower your macro will go. The more elaborate you try to make the logic the more problems and unexpected situations you will run into. The first time I setup a system to heal things I decided to set certain % to heal each group member, elaborate ways to heal, make camps, move, all sorts of fancy stuff. I could drop some serious targets with very little intervention. First time I raided with people my toons were overwriting other peoples buffs when they didn't want them. Not healing other group members cause I didn't set a heal % for necros. All kinds of crap.

If your faced with wanting to put a big chunk of logic in to handle certain situations... instead make a hotkey.


As far as any of this behaviour being in the titanium full build, it won't be. Very little behaviour is caused by any plugins. Since people want to tailor behavior to play stile the plugins only come with tools, commands, variables, and then the player chooses or writes a macro to accomplish the desired behavior.


I think it would be wise to start with the heal macro... you get alot of bang for your buck out of a really simple heal macro. A follow macro is spectacular too, and very easy to write.
Wed Jun 16, 2010 4:44 pm
Project Lead
Wow, great info. Thank you very much.

I understand the limitations better now, I agree the Hotkey thing would be best to fine tune behavior. Heal macro will be my first project.

I'm not sure what you mean by building a Follow macro. /Stick seems to be perfect, I don't think I could improve upon it.

Question: How do I turn OFF a macro once it is running?

more questions to come :)
Thu Jun 17, 2010 7:14 am
Ok, I think I found some answers...

/endmac
stops the current macro, correct?

Also, am I correct in assuming that you can only run one macro at a time?
(which you could just combine your macro's into one to cover all the functions you want, right).
Thu Jun 17, 2010 8:40 am
Ok, I'm attempting to read through the cleric macro you linked me to:
http://mqemulator.net/forum2/viewtopic.php?t=259

Most of it makes some sort of sense, the code language is pretty logical.

How do I interact with this macro? What type of code am I looking for that would tell me the in-game inputs I enter to make the macro do things?

It looks like this macro uses an IRC server. Is that required, or can I use it without one?

Thanks again for helping me with my questions.
Thu Jun 17, 2010 11:01 am
I think even /end works.

1 macro at a time yes.

#event sit "#1# tells the group, 'sit'"

sub event_sit {
/sit
}

that first line creates the net to capture the chat. #1# is a wildcard but will also save the value there as ${Param1}. For example to echo who told you to sit you could add in the following line to the sub program code

/say ${Param1} told me to sit.

#*# is a wildcard to but doesn't save th value it replaces.



The differences in irc/eqbc/groupsay are pretty easy to alter. Most of the diffrences are in the chat events. I'm guEsing at the formating of chat txt but basically the alteration may look somehing like

#event sit "[mq2irc] #*# said 'sit'"
to
#event sit "<#*#> sit"

or like in the example up top if you want group tell. Multiple events can call sit. You could leave the irc event in and add eqbc as well and just call both "#event sit" if either format of message came throguh both would call "sub event_sit"

maudbot uses eqbc so you could hop in that code and look at the events. They are always up top. They gt run parses first then the macro handler automatically calls "sub main". That's the "entry point"

alternatively you could just hop in the game and send some text on eqbc to see how it's formatted when rcieved. Do a "/bc" to speak in eqbc. It works just like other social channels, say, shout, ooc, etc.

The heal code in maudbot is in canheal.Inc I think.
Thu Jun 17, 2010 12:34 pm
Project Lead
The follow macro would just be something like

#event follow "#1# said, 'follow'"

sub event_follow {
/target ${Param1}
/delay 1s
/if ($Param1.Equal[${Target}]} /netfollow (or /stick, /follow, whatever)
}

that would make all of your toons follow you. A similar command would be setup to stop them.
Thu Jun 17, 2010 12:52 pm
Project Lead
Sorry for all the horrible mispellings and questionable syntax above. So much stuff is blocked at work, including my site that I have to do most stuff on my phone. I finally sat down and typed this up on my PC, and i'll email it to my phone. This SHOULD work out of the box with no syntax errors for you.
 
below is a more elaborate follow macro. It was designed to use with the EQBC hud, but it should function in game with some hotkeys also. There is a FOLLOW command.
 
to make ALL of your toons follow you type on a hotkey
/bc FOLLOW,${Me},All
 
to make them stop,
/bc STOP,All
 
If your on brian, and you want jim to follow bob, and bob to follow you (for whatever reason)
/bc FOLLOW,bob,jim
/bc FOLLOW,brian,bob
 
to make jim stop
/bc STOP,jim
 
The code has a ton of error handling. It makes sure the follow target exists, makes sure you can target it, and confirms alot of things so you don't get unexpected results. The first line that gets executed is :Loop. The program will basically just sit in an infinite loop doing nothing untill you tell it to turn follow off and on. All macros need a loop in sub main. If the /return on sub main gets executed the macro ends. If you were to take the loop out and turn this on it would basically end instantly.
 
More +

#event follow "<1> FOLLOW,#3#,#2#"
#event stop "<1> STOP,#2#"
 
 
sub Main
                :Loop
                                /doevents
                /goto :Loop
/return
 
 
                sub Event_follow
 
                                |IS THIS FOR ME?
                                /if (!${Param2.Equal[${Me}]}&&!${Param2.Equal[All]}) /return
 
                                |CANT FOLLOW MYSELF
                                /if (${Param3.Equal[${Me}]}) /return
                               
                                |IS MY TARGET IN ZONE?
                                /if (!${Spawn[${Param3} PC].ID}) /return
 
 
                                |CLEAR MY TARGET
                                /target clear
                                /delay 2s !${Target.ID}
                                /if (${Target.ID}) {
                                                /bc I can't clear my current target
                                                /return
                                                }
                               
                                |GET MY TARGET
                                /target PC ${Param3}
                                /delay 2s ${Target.Name.Equal[${Param3}]}
                                /if (${Target.Name.NotEqual[${Param3}]}) {
                                                /bc I can't find my follow target
                                                /return
                                                }
 
                                |TURN NETFOLLOW ON
                                /netfollow on
                                /delay 2s ${NetAdvPath.Following}
                                /if (!${NetAdvPath.Following}) {
                                                /bc I can't turn NetAdvPath on
                                                /return
                                                }
                               
                                |DOUBLE CHECK PLUGIN GOT RIGHT TARGET
                                /if (${NetAdvPath.Monitor.Name.NotEqual[${Param3}]}) {
                                                /bc Plugin seems to have wrong target
                                                /netfollow off
                                                /return
                                                }
 
                                |BROADCAST FOLLOW
                                /bc Following ${Param3}.             
                }
                /return
 
 
                sub Event_stop
                                |IS THIS FOR ME?
                                /if (!${Param2.Equal[${Me}]}&&!${Param2.Equal[All]}) /return
                               
                                |STOP FOLLOWING
                                /if (${NetAdvPath.Following}) /netfollow off
 
                                |IF MOVING THEN STOP
                                /if (${Me.Moving}) {
                                                /keypress forward
                                                /keypress back
                                                /keypress strafe_left
                                                /keypress strafe_right
                                                }
                /return

 
a side note for the /delay command.
/delay 1s ${Me.Sitting}
Would read like "Pause for one second, OR until I am sitting, then continue"
 
so:
More +

                                |GET MY TARGET
                                /target PC ${Param3}
                                /delay 2s ${Target.Name.Equal[${Param3}]}
                                /if (${Target.Name.NotEqual[${Param3}]}) {
                                                /bc I can't find my follow target
                                                /return
                                                }

 
That would:
target a PC named ${Param3}
wait 2 seconds or until my targets name equals ${Param3}
then after 2 seconds if my targets name still does not equal ${Param3}
notify EQBC clients that i can't find my follow target
and leave the follow routine
 
! means NOT
&& means AND
|| means OR
 
More +
/if (!${Param2.Equal[${Me}]}&&!${Param2.Equal[All]}) /return

 
that would read, IF Param2 does NOT equal me AND param2 does NOT equal "All" then leave the follow routine. That effectively cancels the follow if the command wasn't addressed to your name, or "All".
 
Try to read through it and see how it all works, if you have question about the syntax let me know.
Thu Jun 17, 2010 1:21 pm
Project Lead
I'm starting to get it... more and more. Still studying what you've given me.

Lemme try this idea for starters. I'm sure I have some syntax wrong, please let me know on the F8 thing.

|This is a macro for us zone crashers who want to pull 30 mobs
|and kill them without pressing a key.
|This is written for my melee class running through low lvl kos
|zones where I don't want to bother with FD and wait.

:startloop
/keypress "F8"
If (${Target.Type.Equal[""]})) /goto :startloop
/autoattack on
:killingit
If (!${Target.Type.Equal[""]})) /goto :startloop
/goto :killingit
Thu Jun 17, 2010 3:29 pm
variables are the most confusing part. Every variable has a type. we'll use an integer. Say MyInt. comparing integers looks like this

/if (${MyInt}==5) /say i'm 5
/if (${MyInt}!=5) /say i'm NOT five
/if (${MyInt}<5>=5) /say i'm greater than or equal to five

you can ONLY compare numbers, and true/false values this way

Look at the "int" type (integer) here:
http://www.macroquest2.com/includes/wassup/manual.php#immint

You can see the 4 sub items.
float Float The number as a float (instead of 123, this will give 123.0)
string Hex The hex value of the integer
int Reverse Endianness reversed
To String

so for example Reverse is a sub variable of any int.
I've never used this... its either the number printed backwards, or 60 would turn to 40, 400 would turn to 600.. 333 would turn to 667 etc. Not sure. Anyway. We'll say it turns 54 to 45.

/varset MyInt 54
/say ${MyInt.Reverse}

that would say 45(or whatever)

Now if you look at that table.. Reverse is ALSO an "int" so the following would be perfectly legal.

/say ${MyInt.Reverse.Reverse.Reverse.Reverse}

The "ToString" value is the default. Its what happens when you don't specify a sub item. So when you type ${MyInt} you basically just told it ${MyInt.ToString}

SO... lets look at the type string now. This will show how we get around the problem of only being able to compare numbers.

http://www.macroquest2.com/includes/wassup/manual.php#refstring

I'll be using parent and child verbage. MyInt would be the parent. Reverse would be a child. The string type has the following child.

bool Equal[text]

When you fire that off MQ compares the string where "text" is and compares it to the string of the parent. the "bool" type is boolean(true of false)

/varset MyName "Bob"
/say ${MyName.Equal[Bob])

would say "true"

These parent and child relationships can be huge endless hierarchies of relationships.

A TLO, or Top Level Object is a predefined variable, there are a few dozen of them. Me, Spawn, Target, NearestSpawn, Math, etc. Lets take a look at Target.

http://www.macroquest2.com/includes/wassup/manual.php

At the top are some tables, the top table has the TLOs in it. Find "Target" and click it. That will link you to a section that tells you its type, and a description. Underneath it it will tell you what types it is. (stuff can be multiple types at once, its wierd, think ${Me} is both a character, but also a regular spawn like everything else)

Target is of the "spawn" type. You can click the "spawn" link right there or go back to the tables up top and find it.

You should now be viewing a list of the children of "spawn". One of the children is Race, with a type of "race", hit the table again and navigate to the race section.

int ID
string Name

Target something and you can do a /say ${Target.Race.Name.Equal[Human]}

A whole lot of work gets done using variables. Even some math can be accomplished using the Math TLO.

So... all that out of the way... I probably should have hit you with that stuff first. I just so very rarely touch macros, its been years now since i've written one.

doing multiple /goto statements is usually frowned upon, it can get messy and confusing and is hard to maintain at times. I always prefered to set a big chunk of code that can run through over and over. The code sets and checks flags to find out what its supposed to do. For long elaborate processes instead of a true/false flag I may set a "step" flag... ie. step = 1, step = 2, etc. Being that the ENTIRE loop gets run over and over and over. If you wanted to have potion handling in your main loop it would get executed even while you are in combat mode... or follow mode... etc.

Consider the following (excuse my syntax)
More +

/declare attacking bool global
/declare following bool global
/declare atktarget string global

Sub Main
:loop
  |if there is a skeleton near me, set flags to kill it
  /if (${NearestSpawn[range 100 "skeleton"].ID}) {
     /varset atacking true
     /varset atktarget ${NearestSpawn[range 100 "skeleton"].Name}
  }

  |now i can use "attacking" as a flag to know if i'm on something
  |so i can choose to only run my follow code while not attacking
  /if (${following} && !${attacking}) {
     |do some follow crap /netfollow or whatever
  }

  /if (${attacking}) {
     |if the mob is gone just turn "attacking" off
     /if (!$Spawn[${atktarget}].ID}) /varset attacking false
     /else {
       |do my attacking stuff /stick, /attack on, whatever
     }
  }

  |if i'm not follow and not attacking... maybe I could meditate
  /if (!${attacking} && !${following) && !${Me.Sitting}) /sit

  |if I put potion handling here, it would always happen
  |cause my program ALWAYS executes this loop even when i'm
  |in combat, following, meditating, whatever
/goto :loop
/return


if you set 10 or 15 flags... you can get some really awesome /if statements going and very clean logic. I used to have 4 clerics, I would put them in a rotation, so I had a "rot" flag. In almost EVERY condition in my loop I could put a "&& !${rot}" to make sure my cleric never did anything while in a rotation unless it was like drinking a potion or refreshing the tanks Divine Aura.

Some people will argue about this method... Its always worked amazing for me. Your toon is always running the WHOLE macro instead of just being jammed into one static part of it.
Thu Jun 17, 2010 5:42 pm
Project Lead
This is the main loop from maudbot... the /calls call a little piece of code that do each of the sections. Its the same thing I spoke about above, just broken up into several subprograms. The subprograms don't have loops... so when you jump into /call attackcheck, it doesnt stay there, it just checks some things, sets flags, and jumps back out into this main loop again. Never staying gone for more than a few seconds. So basically... I have a subprogram that makes sure you're still connected to EQBC... potion handling... these things can always be checked every second or two no matter what the toon is doing. It would really suck to be stuck in an attack loop and EQBC has a hickup and disconnects. You'd be screwed till the mob died. Same with potions, Canni... whatever.


More +
   :Loop
      |RUNS SHAMAN CANNI AT <70> 20 LIFE
      /if (${Me.Class.Name.Equal[Shaman]}&&${Me.PctMana}<70>20) /call Cast "Cannibalize IV" gem6 0

      |MAKE SURE IM IN BOTCHAT STILL
      /call bccheck
      
      |SEE IF IM FIGHTING
      /if (${canfight}) /call attackcheck
      
      |SEE IF I NEED TO MED
      /if (${cancast}) /call medscript
      
      |CHECK MY BUFFS
      /call buffcheck

      |SEE IF I NEED A POTION USED
      /call potcheck

      |SEE IF MY GROUPIES NEED A HEAL
      /if (${canheal}) /call healscript


      /doevents
   /goto :Loop
Thu Jun 17, 2010 5:46 pm
Project Lead
Goto page 1, 2  Next General A dumber dumbed down guide to MQ and MQemu
Reply