Goto page 1, 2  Next General Trying to Learn this thing...
Reply
Trying to Learn this thing...
so I'm a bit lost trying to figure out these macroquest thing, anyone mind giving me the noobs version of how to?

I want simple stuff, autofollow (close range), autoattack/autoabilities, melee cleric W/ bash, heal (name1-6) on command for my 6box, that kinda thing.
_________________
~Xanatos Nemos, Master of Shadows
Sat Apr 04, 2009 11:20 am
I recommend starting by getting a VIP Acount, Here and at MQ2 Forums
(I'm poor as dirt and I still found 10$)
Then Downloading Notepad++ or TextEdit or UltraEdit and getting http://www.macroquest2.com/wiki/index.php/Text_Editors a syntax file.

I also recommend reading

http://macroquest2.com/phpBB2/viewtopic.php?t=7044
and
http://macroquest2.com/phpBB2/viewtopic.php?t=14927

And http://www.macroquest2.com/wiki/index.php/Macro_Reference.

And to even help you even more.

More +
#Turbo 40
Sub Main
:Loop
/if (${Me.Combat} && ${Me.AbilityReady[Kick]}) /doability "Kick"
/goto :Loop
/return


If you can't figure it out from there, I recommend ModBot.
Tho you'll still have to edit it for it to work.

Good luck.
Sat Apr 04, 2009 4:28 pm
Project Member (Retired)
Yes, what spaz said.

Take that snipet of code, make a text document and paste it in. Put it in the macro directory, and name it test.mac.

Then when in game type "/mac test" (you need macroquest loaded)

Go into combat and you will see that your kick button will automatically go down over and over.

Also if you check out the macro forum there is a tutorial on writing a very basic macro. http://mqemulator.net/forum2/viewtopic.php?t=63
_________________
Give me your land!
Sat Apr 04, 2009 7:33 pm
Co-Founder (Retired)
hey, thanks for posting that syntax file link, i had never seen that before =P
_________________
Give me your land!
Sat Apr 04, 2009 7:39 pm
Co-Founder (Retired)
- TheConquistador
hey, thanks for posting that syntax file link, i had never seen that before =P


You learn something new everyday. =)
It is the most useful think I've found.
Sat Apr 04, 2009 7:58 pm
Project Member (Retired)
Xanatos, if you can give me some semi-thorough feedback on the site, the search sections and such, things you'd like to see added, things that are poorly formatted... whatever you can think of. I'll set you up with a couple weeks of membership to check out the pay software if you like.

I'm always eager to get feedback from people to help make improvements.
_________________
Give me your land!
Sat Apr 04, 2009 8:07 pm
Co-Founder (Retired)
one huge improvement would be a 'startup' guide for folks like me who dont even know what macro is or how to use it, the for dummies version, if you will. it could explain something like how to download macroquest, how to run it in game, with some starter macros to do something like that autokick you showed me...

but in regards to that, will that test.mac with that line kick for just my warrior? or flying kick for my monk too? i eventually hope to automate all 6toons to melee, including war kick, monk Flying kick, berserker frenzy, and cleric bash how do i run macroquest to run the script? do i have to do it on all 6 toons or just 1?

ill keep thinkin bout some other ideas i can come up with for the site, thanks for the help so far!
_________________
~Xanatos Nemos, Master of Shadows
Mon Apr 06, 2009 11:24 am
it will only do regular kick. And yes you will have to run a macro on each character.
_________________
Give me your land!
Mon Apr 06, 2009 11:49 am
Co-Founder (Retired)
how do i run the macro?
_________________
~Xanatos Nemos, Master of Shadows
Mon Apr 06, 2009 2:57 pm
there is a macro directory to paste it into. Then in game type /mac test

/end will turn it off
_________________
Give me your land!
Mon Apr 06, 2009 3:33 pm
Co-Founder (Retired)
how do i load macroquest to be able to /mac test?
_________________
~Xanatos Nemos, Master of Shadows
Mon Apr 06, 2009 4:38 pm
can i just replace the word Kick in that code with Flying Kick, Frenzy, or Bash to apply it to other toons? and can i load up the code all in one macro and just load it on each toon, or must i create 4 seperate macros and load each their own macro?
_________________
~Xanatos Nemos, Master of Shadows
Mon Apr 06, 2009 5:20 pm
You CAN use the same one on each toon. When I first started writing I had seperate macro's for each toon. Once I figured it out I put it all into one macro and used an INI file to set what parts of the macro were activated for what toon.

The /doability command actually activates hotkeys based on the name. So if you don't have a hotkey set to "Kick" then it wont do anything.

As far as bash, backstab, slam, yes you can swap out the words typically, just make sure you have an ability key set on the toon so it will work. I have had trouble in the past using "Flying Kick". I wanna say the workaround I figured out what "/doability 1" then I had to make sure flying kick was set on the first hotkey.

If you are familiar with coding then some of the typical structures you should be familiar with are loops. There is no real loop structure so in macro's we have to use goto. So a loop would look like this:

More +

:LoopStart

/goto :LoopStart


A print statement to print to your MQ chat window looks like this

More +

/echo hello world!


a single line conditional

More +

/if (TRUE) /echo hello world!


a multi line conditional
More +

/if (TRUE) {
  /echo hello world!
  /echo the weather is nice
}


a variable declaration

More +

/declare i boolean


setting a variable

More +

/varset i TRUE


a variable by itself is a by reference... the pointer. To call a variable by value do it as follows:
More +

/echo ${i}


a conditional loop
More +

:Loop
/varset i TRUE
/if (${i}) /goto :Loop


A subroutine

More +

Sub Myroutine

/echo hello world!

/return


an event (based off chat)

More +

#event invite "#1# invites you to join a group."

sub Event_invite   
   /invite
   /echo Joining ${Param1}'s group!
/return




here is a fast example of an auto meele macro... im typing this out now so don't trust I get it all right


More +


#event kill "#*# tells the group, 'Kill #1#'"

Sub Main
/declare atk boolean outer FALSE
/declare atktarget string outer "default"

Loop:
/if (${atk}) {
  |target your mob
  /target ${atktarget}
  |face it
  /face fast
 
  | if your distance from target is greater than 10
  /if  (${Target.Distance}>10) {
    |hold forward key
    /kepress forward hold
    |hold it for 1 second OR until distance <= 10
    /delay 1s ${Target.Distance}<=10
    |release forward key
    /keypress forward
  }

  |turn attack on if it isnt already
  /if (!${Me.Combat}) /attack on

  |if target doesnt exist it must be dead...
  /if (!${Spawn[${atktarg}].ID}) {
    /varset atk FALSE
    /attack off
  }
}
/goto :Loop
/return

Sub Event_kill
  /varset atk TRUE
  /varset atktarget ${Param1}
/return


This is REALLY basic just to give you an idea. You probably don't want to actually run that. Its got visible errors in it... The one I typically use just for the loop section is about 150 lines of crap.

If you want to use someone elses stuff I would suggest getting a copy of spaztics stuff or modbot or something like that.

If you want to write all your own stuff start off small. Figure out how to write a macro that makes your toons sit to meditate when not casting or running around. From there do something like an autofollow. auto attack... nothing to fancy till you get your feet wet.

After that you'll want to start exploring some of the plugins that are out there. Things like moveutils and eqbc. Some of these come with EXTREMELY powerful botting tools built in. Things where you can target a mob and type "/stick behind" and it will automatically run to the mobs back and stay on its back no matter where it moves.
[/code]
_________________
Give me your land!
Mon Apr 06, 2009 6:15 pm
Co-Founder (Retired)
i'd like to get some basic things up and going, but what you just said, i didnt' understand 90% of it.
_________________
~Xanatos Nemos, Master of Shadows
Tue Apr 07, 2009 12:14 am
#1 Paste this into a file called hail.mac in your macro folder.
#2 Run macroquest
#3 log a toon in
#4 type /mac hail
#5 hit your hail hotkey, or say Hail, shout Hail, something like that

You should get a response in the macroquest window, something like "[MQ2] YOU SAID HAIL!"

More +
event test "#*#Hail#*#"

Sub Main
  Loop:
    /delay 1
  /goto Loop:
/return

Sub event_test
  /echo YOU SAID HAIL!
/return


This uses sub routines and events to do this. A subroutine is a portion of code that can be easily rerun in a bunch of places. I like to think of coding in mechanical terms when explaining it. A subroutine is like a piece of machinery that always does the same thing no matter where you put it. It has a basic idea like... DC current in, spark out. It always performs the same task no matter where you put it. A reusable tool. You go to a store needing to create a spark for some project... say your making a propane powered tiki torch in your back yard. The store is full of objects, "subroutines" that do all sorts of things. You have a set of things you can put into it... as long as you get the desired thing out, a spark or a small flame. Some of the things you can put in are manpower, electricity, propane, maybe sunlight. You hunt and peck and find a cigarette lighter... man power and butane in, fire out. You find a sparkplug... electricity in, spark out. A magnifying glass... sunlight & propane in, fire out.

To put this back into coding terms I'll use the example of cubing a number.
There are main parts to a subroutine and its use. they are the
#1 Routine declaration
#2 Routine interior
#3 the return
#4 the call
#5 return value


Lets start by writing the subroutine using #1-#3

The routine declaration:
More +
Sub CubeMe(int RootNumber)

"Sub" tells the program that is reading your macro that you are about to create a subroutine. This should always be the first word.

"CubeMe" is the name of your routine, it is how you will be referencing it, this will make sence later, just accept for now that you have to give your routine a unique name.

"( )" The parenthasis and interior of them are optional. Some subroutines don't need an input into them, if they do need an input then you can name the inputs and say what type of input they are here.

"int RootNumber" This is where you are naming the input and saying what type it is. Its type is "int", Integer because you are going to send it a number. "RootNumber" is the name of the place you are going to store that number.



Now, lets add the enterior
More +

Sub CubeMe(int RootNumber)
  /declare CubedNumber int local
  /varcalc CubedNumber ${RootNumber}*${RootNumber}*${RootNumber}


"/declare CubedNumber int local" We need a place to temporarily hold the answer once we do this. They keyword to create a place in memory to hold a value is "/declare" Then you name the memory location "CubedNumber" Tell it what type, "int" which mean integer again. And optionally tell it the scope of the spot. "local" scope deals with where your variable exists. Local means "CubedNumber" will only exist in THIS routine. If you tried to access it anywhere else int he program you would get an error. You will learn more about this later as you get better at coding.

"/varcalc CubedNumber ${RootNumber}*${RootNumber}*${RootNumber}" We need to calculate the number and save it to the new memory spot. We can do this with 1 command. "/varcalc" This just tells it you are about to calculate and save a number. Then you give it the slot of memory you want to save it in "CubedNumber" and then you give it the meat and potatoes to calculate the number. which is the multiplying the root number by itself 3 times.


So we got our stuff IN, we Calculated it, now we need to push it back out.
More +

Sub CubeMe(int RootNumber)
  /declare CubedNumber int local
  /varcalc CubedNumber ${RootNumber}*${RootNumber}*${RootNumber}
/return ${CubedNumber}


"/return" is how you tell it that its the end of your routine and your ready to send back the value, then you just put the value in after it. So that pretty much completes the subroutine.

Now we need to use it.
When a macro is running it always jumps to a particular routine first, the ones named "Main" so lets add that.

More +

Sub Main

/return


Sub CubeMe(int RootNumber)
  /declare CubedNumber int local
  /varcalc CubedNumber ${RootNumber}*${RootNumber}*${RootNumber}
/return ${CubedNumber}


So if you were to run that piece of code it wouldnt do a single thing. It starts at sub main... then goes to /return and that is the end. Any time you hit a /return it means that routine is DONE as explained earlier. Well the MAIN routine is basically your entire macro so if it hits the /return for sub main then it ends.

So.. lets calculate a number.
More +

Sub Main
/call CubeMe 2
/echo ${Macro.Return}
/return


Sub CubeMe(int RootNumber)
  /declare CubedNumber int local
  /varcalc CubedNumber ${RootNumber}*${RootNumber}*${RootNumber}
/return ${CubedNumber}


We added a "/call" this tells it you want to run a subroutine. Then you give it the name of the routine you wanna run "CubeMe" and any values you want to send with spaces in between. We only set it up to recieve 1 value so we are sending it a "2" and thats it.

That 2 gets sent to the routine, the routine saves the two in a memory slot name "RootNumber". Then it creates another memory slot named "CubedNumber". Then it cubes RootNumber and saves it in the "CubedNumber" memory slot. Then it /returns it.

When something gets return in this language it gets saved to a predefined memory slot, "Macro.Return" So the /call sends the "IN" data in, and the "OUT" data gets saved to Macro.Return. So now we can print it out to the EQ screen using the "/echo" command which works kinda like /say or /shout but its totally private to your toon. So we just can /echo ${Macro.Return}.

The next line is the /return for sub main so the program would at this point end.

To understand the reason we do this, i will elaborate this a little bit.
More +

Sub Main
/call CubeMe 2
/echo ${Macro.Return}
/call CubeMe 3
/echo ${Macro.Return}
/call CubeMe 4
/echo ${Macro.Return}
/call CubeMe 5
/echo ${Macro.Return}
/call CubeMe 6
/echo ${Macro.Return}
/call CubeMe 7
/echo ${Macro.Return}
/call CubeMe 8
/echo ${Macro.Return}
/call CubeMe 9
/echo ${Macro.Return}
/call CubeMe 10
/echo ${Macro.Return}
/return


Sub CubeMe(int RootNumber)
  /declare CubedNumber int local
  /varcalc CubedNumber ${RootNumber}*${RootNumber}*${RootNumber}
/return ${CubedNumber}

This will print out the cubes for 2-10

It only took 2 extra lines of code to run the routine each place I wanted to use it. Now imagine that the routine was 5000 lines long and did a huge complex operation like the routines that run your graphics processors on your computer. You could in essence rerun that 5000 lines of code by just putting in 2 lines.

To further illustrate the importance lets look at how to do it without using a routine.


More +

Sub Main
  /declare CubedNumber int local
  /varcalc CubedNumber ${2}*${2}*${2}
  /echo ${CubedNumber}
  /varcalc CubedNumber ${3}*${3}*${3}
  /echo ${CubedNumber}
  /varcalc CubedNumber ${4}*${4}*${4}
  /echo ${CubedNumber}
  /varcalc CubedNumber ${5}*${5}*${5}
  /echo ${CubedNumber}
  /varcalc CubedNumber ${6}*${6}*${6}
  /echo ${CubedNumber}
  /varcalc CubedNumber ${7}*${7}*${7}
  /echo ${CubedNumber}
  /varcalc CubedNumber ${8}*${8}*${8}
  /echo ${CubedNumber}
  /varcalc CubedNumber ${9}*${9}*${9}
  /echo ${CubedNumber}
  /varcalc CubedNumber ${10}*${10}*${10}
  /echo ${CubedNumber}

/return


Now that we have the two examples... one WITH and one WITHOUT the routine. Imagine that you wanted to make it square the number instead. WITH the subroutine you'd only have to change 1 line. WITHOUT you'd have to change 10 lines.
_________________
Give me your land!
Wed Apr 08, 2009 8:39 pm
Co-Founder (Retired)
Goto page 1, 2  Next General Trying to Learn this thing...
Reply