• 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 --->

more questions (1 Viewer)

dobey

Member
Joined
Jun 18, 2006
RedCents
10¢
I am trying to find out how to record my location when I start my macro, and then to check my location in the macro and if it is the location I was at when starting then do XXX.

tried something like this but I just dont know enough to do this right yet:


Rich (BB code):
#event myloc "XXX XXX XXX"

Sub Main
    /declare myloc  bool    outer   FALSE

:dostuff
    /if (!${myloc}) /goto :dostuff
    /varset myloc FALSE
    /DO SOME CRAP HERE
    /return


Sub Event_myloc
    /varset myloc TRUE
/return
 
I would strongly recommend using the MacroQuest2 Manual.
You seem to have the gist of it, and yet not. It's as if you're just looking at a macro and then trying to throw something together from those. Doing that will work, as long as you know what the various parts actually do, or know where to find more information about it. Use the MacroQuest2 Manual for that, or even the MacroQuest2 Wiki the information that can be found on those ressources are invaluable to learning how to write macros.

Anyway, since it's impossible to land at EXACTLY the same spot as when you started a macro, unless you're warping to that spot, the best way to make it happen is to check if you're within a certain distance of the location. Distance is part of the Math TLO (type:math).
Every "variable" in MQ2 macro language is accessed by finding the correct TLO (Top Level Object) and find the variable or function you need within that TLO (read the manual, good for reference as well). For example, to find your own location, you'd have to access the 'Me' TLO, which has access to the character types and spawn types. In this case the client can also know the Y, X, Z of a spawn as well as yourself (character), so we'll look under the spawn type for this. You would for example not be able to know what spells another person has memmed in their spell gems, so figuring that out would be under your own "character" type.

Here's an example that should do what you ask.
Rich (BB code):
Sub Main
    /declare MyLoc[3]   float   outer
    /varset MyLoc[1] ${Me.Y}
    /varset MyLoc[2] ${Me.X}
    /varset MyLoc[3] ${Me.Z}

    :Loop
        /echo Doing stuff while not at the starting location..
    /if (${Math.Distance[${MyLoc[1]}, ${MyLoc[2]}]} > 10) /goto :Loop

    /echo Seems we're back at our starting location..
/return
 
Thanks again. I have only been trying to write my own macros for about two weeks. Still very new, I can look at a macro now and see what it is supposed to do, and I have been looking at the macroquest manual, it just has a huge amount of information and I get lost easy there still. Learning fast though, and you guys are helping me alot! I really apreciate it.
 
ok in a test I used it like this:

Rich (BB code):
Sub Main
    /declare MyLoc[3]   float   outer
    /varset MyLoc[1] ${Me.Y}
    /varset MyLoc[2] ${Me.X}
    /varset MyLoc[3] ${Me.Z}

:Loop
    /if (${Math.Distance[${MyLoc[1]}, ${MyLoc[2]}]} > 10) {
       /call Warp
    }
    /goto :Loop




Sub Warp
        /warp loc [${MyLoc[1]}, ${MyLoc[2]}, ${MyLoc[3]}]
        /echo YOU MOVED!
        /return

so if I run away from the start loc is warps me back. works perfect except that the MyLoc[1] gets reset to 0 everytime. if I run it on the loc 0 it works fine, any ideas why?
 
LOL I got it (just needed more coffee), had bad brackets on the /warp line. With

Rich (BB code):
 /warp loc ${MyLoc[1]}, ${MyLoc[2]}, ${MyLoc[3]}

works perfect.
 
more questions

Users who are viewing this thread

Back
Top