• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - Giving time to arrive at location

Joined
Mar 12, 2019
RedCents
1,973¢
Just wondering if there might be a better way to write this. The intent is to nav to a loc then not do anything else until the char gets to the location. Once at the loc, move on the to next line in the macro.


Code:
    /echo Moving to the exit now
    /nav locyx -163.58 1069.97
    :runningexit
    /if (${Math.Distance[-163.58 1069.97]} > 10) {
        /goto :runningexit
    }
    /delay 3s
    /echo at the exit now
 
Just wondering if there might be a better way to write this. The intent is to nav to a loc then not do anything else until the char gets to the location. Once at the loc, move on the to next line in the macro.


Code:
    /echo Moving to the exit now
    /nav locyx -163.58 1069.97
    :runningexit
    /if (${Math.Distance[-163.58 1069.97]} > 10) {
        /goto :runningexit
    }
    /delay 3s
    /echo at the exit now
Make it a function so it's reusable imho.
The highlighted lines are part of another macro but you can either choose to use them or not. You would have to make your own combat Sub.

[CODE highlight="3-15"]Sub NavToLoc(int Y,int X,int Z)
/while (${Math.Distance[${Me.Y}, ${Me.X}, ${Me.Z}: ${Y}, ${X}, ${Z}]} > 15) {
/if (${Me.XTarget[1].ID}) {
/if (${Navigation.Active}) {
/nav stop
}

/call Combat
}

/if (${Me.Combat} && !${Me.XTarget[1].ID}) {
/squelch /attack off
/squelch /target clear
}

/if (!${Navigation.Active}) {
/if (${Navigation.PathExists[loc ${Y} ${X} ${Z}]}) {
/nav loc ${Y} ${X} ${Z}
}
}

/delay 1
}

|We've arrived.
/if (${Navigation.Active}) {
/nav stop
}
/return[/CODE]
 
Thanks all for the input

Thanks CTWN, that's perfect.
It is a lot better then what I was doing above. I had all my loc's like the above and after then 10th one, I was like there has to be a better way.

@aquietone lol I can barely copy and paste stuff for a macro and make sense of it. Lua even more foreign to me... lol
 
Try this. This doesn't need any timers. This example uses a target but can be changed to a location.

repeat
until mq.TLO.Target.Distance() < 6
 
Question - Giving time to arrive at location

Users who are viewing this thread

Back
Top
Cart