Page 1 of 2

Location 120 feet in front of you

Posted: Sat Nov 06, 2004 9:36 pm
by EQBot_man
I did some trig to take inputs based on your location, your heading, and the direction you are looking and this math will give you the location of the point 120 feet from the directiion you are looking:
I added lots of spaces. You don't need the spaces but it made it easier to keep track of the parentheses while I was making the code. You can leave the spaces in. Its not "code" persay, but I've put the information you want to look at in code and /code.

Code: Select all

Y point = ${Math.Calc[  ${Me.Y}+${Math.Calc[ (120 * ${Math.Cos[${Math.Calc[${Me.Look}/128*90]}]}) * ${Math.Cos[90- ${Math.Calc[   90-${Me.Heading.Degrees}   ]}]}     ]}	]}  

X point = ${Math.Calc[  ${Me.X}-${Math.Calc[ (120 * ${Math.Cos[${Math.Calc[${Me.Look}/128*90]}]}) * ${Math.Sin[90- ${Math.Calc[   90-${Me.Heading.Degrees}   ]}]}     ]}	]} 

Z point= ${Math.Calc[    ${Me.Z}   +    ${Math.Calc[    120  *  ${Math.Sin[${Math.Calc[${Me.Look}/128*90]}]}      ]}     ]}
Also if you want to change the value of the calculation smaller or larger, change the 120 to whatever you wish. I suggest 20, and 130 units.

Just posted it in case someone could use it in any of their macros or whatever. Heh..took me a while to work out the proper math and test it so there you go.

|------------------------------------------------------------------
Here is something else you all might feel useful

Code: Select all

Locations are X Y Z format

location 10 feet north of you:  ${Math.Calc[${Me.Y}+10]} ${Me.X} ${Math.Calc[${Me.Z}+1]}
location 10 feet southof you:  ${Math.Calc[${Me.Y}-10]} ${Me.X} ${Math.Calc[${Me.Z}+1]}
location 10 feet east of you:  ${Me.Y} ${Math.Calc[${Me.X}-10]} ${Math.Calc[${Me.Z}+1]}
location 10 feet west of you:  ${Me.Y} ${Math.Calc[${Me.X}+10]} ${Math.Calc[${Me.Z}+1]}
location 10 feet up from you:  ${Me.Y} ${Me.X} ${Math.Calc[${Me.Z}+10]}
location 10 feet down from you:  ${Me.Y} ${Me.X} ${Math.Calc[${Me.Z}-10]}
I've added +1 unit N, E, S W, for reasons of practical use. Again. if you want smaller values or larger values change the 10's to whatever. I suggest 10 and 100

Posted: Sun Nov 07, 2004 2:44 am
by Night Hawk
Not sure how it could be used, maybe for checking spawns so many meters in front of you, but hey, nice job :wink:

Posted: Sun Nov 07, 2004 3:17 am
by Chill
Mobs within casting range I'm fairly certain, but wait til he upgrades his spell range to 25 or 30%.

OMG the math!

Posted: Sun Nov 07, 2004 1:02 pm
by Night Hawk
Yeah but casting range is radius, not just X feet in the direction your facing :P

Posted: Sun Nov 07, 2004 7:06 pm
by GD
It allows targeting of spawns that are in front of you, in your natural FOV.

Posted: Wed Nov 17, 2004 6:20 pm
by EQBot_man
Yeah not exactly what I had in mind but I'll give you 2 hints:
--------------------------------------
Hint #1
if one wanted to know the location 120 feet in front of them from a custombind:

Code: Select all

/Custombind add location 

/Custombind set location /echo ${Math.Calc[  ${Me.Y}+${Math.Calc[ (120 * ${Math.Cos[${Math.Calc[${Me.Look}/128*90]}]}) * ${Math.Cos[90- ${Math.Calc[   90-${Me.Heading.Degrees}   ]}]}     ]}	]}  ${Math.Calc[  ${Me.X}-${Math.Calc[ (120 * ${Math.Cos[${Math.Calc[${Me.Look}/128*90]}]}) * ${Math.Sin[90- ${Math.Calc[   90-${Me.Heading.Degrees}   ]}]}     ]}	]} ${Math.Calc[    ${Me.Z}   +    ${Math.Calc[    120  *  ${Math.Sin[${Math.Calc[${Me.Look}/128*90]}]}      ]}     ]}

/bind location e
This would output something like:
340.39 2395 34.1
everytime you pressed e.

-----------------------------------

Hint #2
Make sure you are levitating

Posted: Wed Nov 17, 2004 11:52 pm
by Cr4zyb4rd
some of us get it, and thanks ;)

Posted: Thu Nov 18, 2004 12:39 pm
by EQBot_man
ok good, glad some people could get use out of it

Posted: Thu Nov 18, 2004 3:15 pm
by Night Hawk
Either it's something very simple, or it's a place I don't go/don't have access to. /shrug

Posted: Mon Nov 22, 2004 6:20 pm
by fantum409
Now if you make it calculate the proper Z coordinate to indicate ground level on changing terrain...

Posted: Mon Nov 22, 2004 6:27 pm
by Lord_Vyper
Ever stare at code for a minute or 3, then CLICK! I feel slightly smarter now. Thanks bot_man

Posted: Mon Nov 22, 2004 7:07 pm
by EQBot_man
Now if you make it calculate the proper Z coordinate to indicate ground level on changing terrain...
Now that would be $.. but can't do that I don't beleive

Posted: Mon Nov 22, 2004 10:21 pm
by Cr4zyb4rd
Ever stare at code for a minute or 3, then CLICK! I feel slightly smarter now. Thanks bot_man
it's worth it if for no other reason than that :)

Posted: Mon Nov 22, 2004 11:25 pm
by Neolesh
Would it be hard to convert this to 120 feet behind your target? I'm bad with this level of math.

Posted: Tue Nov 30, 2004 6:12 pm
by EQBot_man
nt