• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->

The Basics of... (1 Viewer)

Joined
Jun 28, 2006
RedCents
Would anyone know where i can find the basics of creating macros? ive seen peoples macro codes and it makes sense to me i just dont understand some stuff. I find it very interesting creating macros, and if theres a post that helps out with macro's id like to know where it is. If anyone can point it out for me id greatly appreciate it. Redcentage too =] thank you
 
more like creating functions for high end raid mobs, wanting the macro to do stuff for me, like what devlin did with hatchet. id be interested in working on macros for high end raid mobs.. PS TY Stoic..
-------
O.O the guide is speaking a different language haha
 
Ok so let me use this as an example... This is the slipgear macro. I just dont understand the beginning paragraph where it says :loopstar, :waitforit, /doevents, /doevents, /goto :waitforit , and /return. then Sub indz.. anyone mind explaining that ?
Rich (BB code):
|( @ )( @ )'s
|
|*  1st attempt at a Macro...  Hopefully when I am done, this will do at least most of the slipgear quest for you. To make this work, you will need to hail slipgear and follow text and get all the missions. Then make a hotkey < /echo You have entered Corathus Creep > Also, i do not yet know how to /zone, so you will have to make the zones yourself.
Easy as pie for non-invis classes, just be a rogue shroud, hide/sneak. *|

#turbo
#event cc "#*#You have entered Corathus Creep#*#"
#event tu "#*#You have entered The Undershore#*#"
#event sf "#*#You have entered Stoneroot Falls#*#"
#event ri "#*#You have entered Ruins of Illsalin#*#"
#event th "#*#You have entered The Hive#*#"
#event ef "#*#You have entered Guild Lobby#*#"
|Change to bind zone............^^^^^^^^^^

Sub Main
|Wait for the hotkey to start the macro.


:loopstart
:waitforit
/doevents
/doevents
/goto :waitforit
/return

Sub indz
:begin 
/delay 15s

Sub event_cc

/delay 15s
/warp loc -702.77, 260.47, -44.82
/delay 5s
/warp loc 61.54, 82.68, -24.07
/delay 5s
/warp loc -143.70, 1524.56, -86.23
/delay 5s
/warp loc -670.05, 1139.16, -28.10
/delay 5s
/warp loc -306.61, 933.71, -55.59
/return


|Zone to Undershore

Sub event_tu

/delay 15s
/warp loc 182.32, -663.30, -2.99
/delay 5s
/warp loc 1163.67, -435.02, 9.24
/delay 5s
/warp loc -900.74, 629.90, -1.00
/delay 5s
/warp loc -554.11, -762.87, 54.37
/delay 5s
/warp loc 728.06, 107.08, 0.67
/delay 5s
/warp loc 838.30, 586.54, 135.12
/return


|Zone to Stoneroot Falls

Sub event_sf

/delay 15s
/warp loc -928.40, -1514.39, 15.07
/delay 5s
/warp loc -975.02, -30.47, 54.20
/delay 5s
/warp loc -363.53, -1480.83, 4.38
/delay 5s
/warp loc 190.68, -1090.32, -67.22
/delay 5s
/warp loc 454.62, -1800.23, 14.05
/return


|Zone to Ruins of Illsalin

Sub event_ri

/delay 15s
/warp loc -1374.47, -58.68, -34.29
/delay 5s
/warp loc -404.73, 329.07, -129.78
/delay 5s
/warp loc -1933.15, 295.49, 67.72
/delay 5s
/warp loc -2267.19, -464.17, 111.81
/delay 5s
/warp loc -199.08, -639.76, 89.11
/delay 5s
/warp loc -923.76, -538.51, 110.68
/return


|Zone to Ruins of The Hive

Sub event_th

/delay 15s
/warp loc -1261.73, 498.71, 47.53
/delay 5s
/warp loc -418.87, 482.43, 47.46
/delay 5s
/warp loc -543.28, 541.37, 54.90
/delay 5s
/warp loc 173.00, 650.00, 219.00
/delay 5s
/warp loc -37.73, 1183.32, 254.42
/delay 5s
/warp loc -250, 1360, 15
/delay 5s
/warp succor
/return

Sub Event_ef 
/echo sorry i don't know how or why but you died.
/circle off
/twist off
/delay 45s
/sit on
/camp desktop 
/q
/endmacro 
/return


|zone yourself out, gate, whatever.. die mebee?



Sub GMcheck  
 	/if (${Spawn[gm].ID}) {  
 		/echo Gm detected  
 		/beep 
 		/beep 
 		/beep  
 		/q 
 		/endmac 
 		/unload 
 		/q  
 	}  
/return
 
That is the sub main that section is where the macro does the loop for the main part of the macro. Basicaly macro is set up like:

Title

Declares

Sub Main
commands
sub calls
end main

subs

end

Those :loops are basicaly there for other subs to call looks like /goto loops they are used to be able to recirculate the flow of the macros. the /doevents makes a call to check all the listed events in the macro.

Rich (BB code):
#event cc "#*#You have entered Corathus Creep#*#"
#event tu "#*#You have entered The Undershore#*#"
#event sf "#*#You have entered Stoneroot Falls#*#"
#event ri "#*#You have entered Ruins of Illsalin#*#"
#event th "#*#You have entered The Hive#*#"
#event ef "#*#You have entered Guild Lobby#*#"
are the declaring of the events. /doevents checks to make sure if any of those events were fired. They are fired through text #*# denoted text not cared about only the text wanted is the text between #*#text wanted#*#. If someone was to send this person a tell... Stoic tells you," hey retard You have entered Guild Lobby lalalwhatever" it would fire the event if it was checking tells as well as normal text.

Sub indz doesnt look to be called by anything maybe he was just being clever saying Sub ends shrug.
 
Rich (BB code):
#event cure #*#Your skin turns stony.#*#

 |Zit.mac - Bakidood
 | Cures yourself from Zithule DeathTouch

Sub Main
:loop
 /doevents
/goto :loop

---------------------------------
Zithule DeathTouch
---------------------------------
Sub Event_cure
	/delay 3s
	/cast 2
             /g I am curing myself !
/return


This make sense?
 
Last edited:
i think you need to to put quotes around your event trigger. (also changed you group msg to an echo, because having a macro talk to your group isnt a great idea.
and for clarity, i would set it up like this

Rich (BB code):
|Zit.mac - Bakidood
| Cures yourself from Zithule DeathTouch

#Event Cure "#*#Your skin turns stony.#*#"

Sub Main
:loop
 /doevents
/goto :loop

---------------------------------
Zithule DeathTouch
---------------------------------
Sub Event_cure
	/delay 3s
	/cast 2
             /echo I am curing myself !
/return
 
Okay...

":loop" is a point of reference. Think of it like a bookmark. Then, when you want your macro to go back to that "bookmark", you can use the "/goto" command to "/goto :loop", and take you to that bookmark.

Declares...hmm. Declares are telling the macro that something is there, how to deal with it, what to look for, etc. What an "#event" does is watch for that exact phrase to be parsed in the text. Until that phrase is found, the event's status is false. When that phrase is found, the phrase's status goes to true. When you /doevents, the macros check to see which events are true, then does the events associated with them...for #event blah, you would have Sub event_blah, which would contain the code to be executed when event blah was fired, then /doevents was done.

Other types of declares are things like "strings", "ints", etc. A "string" is a string of letters and spaces...ie, a sentence, name, etc..."Jack walks down the street" is a string, as is "Jack". An "int" is an integer, like "563242492342348957239586234986234896234" or "5". If you did something like "/declare kinkysex int local 69"...the /declare would create the "kinkysex" variable in the macro, and you could access whatever value you gave it with "${kinkysex}"....so...you could "/echo ${kinkysex}" to /echo 69. The "local" that was in there told the macro that that variable was ONLY defined for this one macro, and when the macro ended, the variable and it's value aren't to be saved. If, instead of "local", you put "global", that variable would be available to any other macro that you ran later, until you shut MQ down, or to that same macro again. This is useful when you have a macro that will change the value to something else later on. To change the value or string of a variable after declaring it, use the "/varset" command. IE, you could change the value of kinkysex from 69 to 37 with "/varset kinkysex 37".

*edit* Let me know if that clears anything up. I'm available to help you if needed, just post here.
 
Also, to show you an example; Instead of running off #Events, it can run off of /if's!

Rich (BB code):
|Zit.mac - Bakidood revised to run off of /if's - Devlin
| Cures yourself from Thuuli's Death Touch


Sub Main
:loop
/doevents
/if (${Me.Buff[Spreading Stone].ID}) /call Cure
/goto :loop

---------------------------------
Zithule DeathTouch
---------------------------------
Sub cure
	/delay 3s
	/cast 2
        /echo I am curing myself !
/return



That way, if it see's that you have the buff " Spreading Stone " it will go to cure it..

Just another way!



Oh, and me being anal and all; The trigger for that is wrong, it's actually
Rich (BB code):
 Your movements become stiff.
;)
 
Very nice explanation Thez , redcents when it lets me coming your way. Can you just explain the last paragraph with a better example? I became really lost on last paragraph :P Does the seru macro use declare strings and integers? Because i noticed it has a pause when a KOS mob wanders near the examiner, which causes the character to stay in its place until the mob wanders away from the examiner.. is that wat they use ?
 
Devlin <---

Rich (BB code):
/if (${Me.Buff[Spreading Stone].ID}) /call Cure

Me > checks yourself
Buff > checks your buff bar
[Spreading Stone] > Buff its looking for?
if it becomes a true event it moves to /call cure which goes to

Rich (BB code):
Sub cure
	/delay 3s
	/cast 2
        /echo I am curing myself !
/return

am i correct?
 
thez said:
Okay...

":loop" is a point of reference. Think of it like a bookmark. Then, when you want your macro to go back to that "bookmark", you can use the "/goto" command to "/goto :loop", and take you to that bookmark.

Declares...hmm. Declares are telling the macro that something is there, how to deal with it, what to look for, etc. What an "#event" does is watch for that exact phrase to be parsed in the text. Until that phrase is found, the event's status is false. When that phrase is found, the phrase's status goes to true. When you /doevents, the macros check to see which events are true, then does the events associated with them...for #event blah, you would have Sub event_blah, which would contain the code to be executed when event blah was fired, then /doevents was done.

Other types of declares are things like "strings", "ints", etc. A "string" is a string of letters and spaces...ie, a sentence, name, etc..."Jack walks down the street" is a string, as is "Jack". An "int" is an integer, like "563242492342348957239586234986234896234" or "5". If you did something like "/declare kinkysex int local 69"...the /declare would create the "kinkysex" variable in the macro, and you could access whatever value you gave it with "${kinkysex}"....so...you could "/echo ${kinkysex}" to /echo 69. The "local" that was in there told the macro that that variable was ONLY defined for this one macro, and when the macro ended, the variable and it's value aren't to be saved. If, instead of "local", you put "global", that variable would be available to any other macro that you ran later, until you shut MQ down, or to that same macro again. This is useful when you have a macro that will change the value to something else later on. To change the value or string of a variable after declaring it, use the "/varset" command. IE, you could change the value of kinkysex from 69 to 37 with "/varset kinkysex 37".

*edit* Let me know if that clears anything up. I'm available to help you if needed, just post here.


If you're still confused with all them varsets and int's and globalt's and declares and stuff.. here is an example of it in a macro.

This is in the begining of the macro..
Rich (BB code):
/declare InString string outer 
/declare OutString string outer 
/varset InString "URYYB"
---later on in a sub---
Rich (BB code):
/declare i int
 
 /for i 1 to ${InString.Length}
     /if (${InString.Mid[${i},1].Equal[A]}) /varset OutString ${OutString}N
     /if (${InString.Mid[${i},1].Equal}) /varset OutString ${OutString}O
     /if (${InString.Mid[${i},1].Equal[C]}) /varset OutString ${OutString}P
     /if (${InString.Mid[${i},1].Equal[D]}) /varset OutString ${OutString}Q
     /if (${InString.Mid[${i},1].Equal[E]}) /varset OutString ${OutString}R
     /if (${InString.Mid[${i},1].Equal[F]}) /varset OutString ${OutString}S
     /if (${InString.Mid[${i},1].Equal[G]}) /varset OutString ${OutString}T
     /if (${InString.Mid[${i},1].Equal[H]}) /varset OutString ${OutString}U
     /if (${InString.Mid[${i},1].Equal}) /varset OutString ${OutString}V
     /if (${InString.Mid[${i},1].Equal[J]}) /varset OutString ${OutString}W
     /if (${InString.Mid[${i},1].Equal[K]}) /varset OutString ${OutString}X
     /if (${InString.Mid[${i},1].Equal[L]}) /varset OutString ${OutString}Y
     /if (${InString.Mid[${i},1].Equal[M]}) /varset OutString ${OutString}Z
     /if (${InString.Mid[${i},1].Equal[N]}) /varset OutString ${OutString}A
     /if (${InString.Mid[${i},1].Equal[O]}) /varset OutString ${OutString}B
     /if (${InString.Mid[${i},1].Equal[P]}) /varset OutString ${OutString}C
     /if (${InString.Mid[${i},1].Equal[Q]}) /varset OutString ${OutString}D
     /if (${InString.Mid[${i},1].Equal[R]}) /varset OutString ${OutString}E
     /if (${InString.Mid[${i},1].Equal}) /varset OutString ${OutString}F
     /if (${InString.Mid[${i},1].Equal[T]}) /varset OutString ${OutString}G
     /if (${InString.Mid[${i},1].Equal}) /varset OutString ${OutString}H
     /if (${InString.Mid[${i},1].Equal[V]}) /varset OutString ${OutString}I
     /if (${InString.Mid[${i},1].Equal[W]}) /varset OutString ${OutString}J
     /if (${InString.Mid[${i},1].Equal[X]}) /varset OutString ${OutString}K
     /if (${InString.Mid[${i},1].Equal[Y]}) /varset OutString ${OutString}L
     /if (${InString.Mid[${i},1].Equal[Z]}) /varset OutString ${OutString}M
     /if (${InString.Mid[${i},1].Equal[" "]}) /varset OutString ${OutString}_ 
 /next i
 /return

---later on in a different sub---
Rich (BB code):
/popup ${OutString}
/return

So basically it would declade what it's trying to decrypt.. then it would check the letters and decrypte them using the /if's and /varset's and then /popup what it decrypted ( the OutString ).. the InString i entered would decrypt to " /popup Hello "



Hope this helped, and cleared some things up! :)



PS: Yes you are correct! :)
 
I'm not sure which seru macro you mean. Think of declares as "saving" a value of a type that you tell it to. If you say that it's a string, then it saves the value you give it as those letters with a meaning. If you say int, then it saves the numbers you give as a number with a value as a number. To have the macro go back to the value that you "saved" in your declare, you use the name that you gave it. The macro then replaces that name with whatever value, string or int or whatever, that you gave it.

example:
Rich (BB code):
|ex.mac --- the | prevents the macro from reading this line

#event woot "#*#woot#*#"

Sub main
| every macro must have a Sub main. This is what the macro does, and where it finishes

/declare kinkysex int global 69
/declare nastysex int global 37
:loop
/doevents
/delay 1s
/goto :loop
/return
| at the end of every sub, there must be a /return, to mark it as ending.

sub event_loop
/if (${kinkysex}==${nastysex}) {
/echo Ooooooooooooooooooooh kinkynasty!
/endmac
}
else {
/varset kinkysex ${nastysex}
/echo Kink...nasty?
}
/return
|in subs that aren't the Sub main, the /return tells the macro to then return to where it was in the main macro.

That explain any more?
 
Kinkysex = 69.

Think of every name as just that...nothing that has any meaning, just something that can be replaced for the value you give it, and only there because it's easier to separate everything out.
 
Yes. But when you did that, you'd need to do some extra stuff if you wanted your string to equal something else...because MQ doesn't just parse strings to equal strings. So if you set kinkysex to boob and nastysex to butt, then to see if they were equal, you'd have to do something like this:
Rich (BB code):
/if (${String[${kinkysex}].Find["${nastysex}"]}>0)
 
For my pet.mac, which I use for many several classes...make a necropet.mac with Lost Soul, etc, changing the names. That's a very simple use...without much difficulty, this could be changed so that I could /echo the pet spell, haste spell, and shrink spell, then have those cast. The declares make the code a lot more...hmm...general, and less cluttered-looking.

Rich (BB code):
Sub main
/declare petspell string global Lost Soul
/declare pethaste string global Glyph of Darkness
/declare petshrink string global Tiny Companion

/if (${Me.Pet.ID}) {
	/echo Already have a pet!!!
	/return
	}
/echo Makepet online...
/sss temp 456
/memorize "${pethaste}|3" "${petspell}|5" "${petshrink}|6"

:pet
/if (!${Me.SpellReady[${petspell}]}) {
	/delay 1s
	/goto :pet
	}
/if (${Me.SpellReady[${petspell}]}) /casting "${petspell}|5" -maxtries|3 -setin|petfocus

:castingpet
/delay 1s
/if (!${Me.Pet.ID} && !${Me.Casting.ID}) /goto :pet
/if (!${Me.Pet.ID} && ${Me.Casting.ID}) /goto :castingpet

:shrink
/if (!${Me.SpellReady[${petshrink}]}) {
	/delay 1s
	/goto :shrink
	}
/if (${Me.SpellReady[${petshrink}]}) /casting "${petshrink}|6" -recast|1 -maxtries|3

:castingshrink
/delay 1s
/if ((!${Me.Pet.Height}==0.96) && (!${Me.Casting.ID})) /goto :shrink
/if ((!${Me.Pet.Height}==0.96) && (${Me.Casting.ID})) /goto :castingshrink

:haste
/if (!${Me.SpellReady[${pethaste}]}) {
	/delay 1s
	/goto :haste
	}
/if (${Me.SpellReady[${pethaste}]} && !${Me.PetBuff[${pethaste}]}) /casting "${pethaste}|3" -maxtries|3

:castinghaste
/delay 1s
/if (!${Me.PetBuff[${pethaste}]} && !${Me.Casting.ID}) /goto :haste
/if (!${Me.PetBuff[${pethaste}]} && ${Me.Casting.ID}) /goto :castinghaste

:testit
/if (!${Me.Pet.ID}) {
	/echo Pet failed
	/mac pet
	}
/if (!${Me.Pet.Height}==0.96) /echo Shrink Failed
/if (!${Me.PetBuff[${pethaste}]}) /echo Haste Failed
/ssm temp
/delay 10s
/ssd temp
/return
 
ahh i get it now =) thx bro... also
Rich (BB code):
:pet
/if (!${Me.SpellReady[${petspell}]}) {
	/delay 1s
	/goto :pet
	}
/if (${Me.SpellReady[${petspell}]}) /casting "${petspell}|5" -maxtries|3 -setin|petfocus
/goto : pet , doesnt that keep trying to repeat casting your pet spell ?
 
PHP:
:pet
/if (!${Me.SpellReady[${petspell}]}) {
	/delay 1s
	/goto :pet
	}

The ! at the front equates to not. So it would only enter that if when the spell is not ready.
 
When the spell isn't ready, it waits 1s, then checks again until it is ready. When it's ready, it casts the spell, then moves on to check if the next spell is ready.
 
Using the code below as a starting point...

Rich (BB code):
|Zit.mac - Bakidood revised to run off of /if's - Devlin
| Cures yourself from Thuuli's Death Touch


Sub Main
:loop
/doevents
/if (${Me.Buff[Spreading Stone].ID}) /call Cure
/goto :loop

---------------------------------
Zithule DeathTouch
---------------------------------
Sub cure
	/delay 3s
	/cast 2
        /echo I am curing myself !
/return


How would I modify it to check everyone in the group and cure when necessary? If it can be done without Laa that would be great but that is ok if I need the Laa's.
 
TBH, I've never really messed around with that particular LAA. I don't know if MQ has the language for that or not...go check the Wiki. Once you figure out how to actually check the buffs using the LAA, I can do the rest easily.
 
Inspect Buffs:
This ability allows group members to target other group members and inspect their buffs.

There are 2 levels of this LAA

I will try to find out more tonight...
 
The Basics of...

Users who are viewing this thread

Back
Top