movement function, movement.ini, automove to zones/spellrou
Posted: Thu Jul 09, 2015 12:34 am
|if ur a bard this uses twist
|this may use moveutils not sure... im using uf client
|
|when I get back into playing again, these macros will be much better
|im still angry at movement it has permanently traumatized me with trig
|basically one of my ideas will be for your choice of hubs, pok or lobby
|------------------------------------------------------------------------------------
|ok well there is a problem, i dont use ogres or trolls
|had to make a troll berserker.... chars get stuck inside the troll and click the troll
|instead of the pok stones or pop zone ins
|this is not supporting of big races right this min, basically you would prolly
|want to set the distance check on each waypoint to 10 instead of 5, trolls
|should then be behind a bit (5) or so, maybey 12 and (7)...that's an easy fix
|
|:nearestlocloop
|/if (${troll} or ${ogre}) /varset nextlocations +10 or +12 -10 or -12
|is basically your rough answer....
|you might want to consider ${player size} > or something instead of troll/ogre
|in case something goes wrong somewhere
|
|----or----
|
|if (${troll} || ogre || playersize > ) {
|/keypress s hold
|/delay 4
|/keypress w or something watever it is.... correct syntax wise
|
|you may want to consider keypress forward/ keypress back
|in case something goes wrong
|
|if you are worried about something going wrong, you shouldn't be using
|small bank as a hub usually and shouldn't be using these exact locs/paths
|
|there is prolly other methods to fix this, first method is the best
|
|you could shrink ur trolls and ogres but that is like rlly ridiculous
|this will be fixed soon listen my server crashes when I ranged attack
|ths shit has to be tested, and then i gotta update the stuff on 16 macros,
|there is a list of about 40 things that have to be fixed serverwise
|there is a list of 45 things that have to be fixed macrowise for v1 of macros
|there is about 5 things i wanna do with movement, and about 4 diff things
|im gonna have to evolve movement into, im thinking networks and stuff
|object detection or even sht from .map printouts or something
|im gonna get around to it, wrote these macros 1yr ago,
|haven't played for 3 months, been studying ... 8/22/2015? 1:51am est
|------------------------------------------------------------------------------------
|movement code
|movement.ini
|spellroutines.inc
|test.mac
|
|THIS CODE IS NOT SAFE FOR LIVE AND ALSO USES /FACE NOLOOK FAST
|
|It tries to simulate userlike movement and viewing
|this could be much better but more code
|
|ill include my spellroutines
|
|im sure this works with any macroquest build
|mq2forunderfoot - hidden in wiki - MQ20100609
|
|twist version, vip plugins - MQ2Twist 09/22/09+
|
|moveutils version, vip plugins - MQ2MoveUtils june 2011
|
|I like my spellroutines better, it is posted here after movement ini
|spellroutines version, general macro snippets Spell_Routines - 7/05/09
|
|****Instructions!****
|
|this part above sub main -> #Event Movement "#1#guild, '#2#goto#3#'"
|
|you may want to put
|
|/declare didinvis int outer 0
| and
|/declare dotwist int outer 0
|
|in ur macro, below sub main where the declares go, and above ur actual
|macro code
|
|if you are a caster you want spellroutines.inc included prolly
|this part above sub main -> #include spell_routines.inc
|
|if you want toggle abort to abort movement, write it, or get it from one of
|my macro posted, you would have to include #Event Toggle blahblah
| above sub main in ur macro. toggle can be perfected as a starter project
| it currently aborts only at next location ur moving to... it can be
| instantaneous
|
|this is the movement code and functions, it goes at the bottom of ur macro
|this may use moveutils not sure... im using uf client
|
|when I get back into playing again, these macros will be much better
|im still angry at movement it has permanently traumatized me with trig
|basically one of my ideas will be for your choice of hubs, pok or lobby
|------------------------------------------------------------------------------------
|ok well there is a problem, i dont use ogres or trolls
|had to make a troll berserker.... chars get stuck inside the troll and click the troll
|instead of the pok stones or pop zone ins
|this is not supporting of big races right this min, basically you would prolly
|want to set the distance check on each waypoint to 10 instead of 5, trolls
|should then be behind a bit (5) or so, maybey 12 and (7)...that's an easy fix
|
|:nearestlocloop
|/if (${troll} or ${ogre}) /varset nextlocations +10 or +12 -10 or -12
|is basically your rough answer....
|you might want to consider ${player size} > or something instead of troll/ogre
|in case something goes wrong somewhere
|
|----or----
|
|if (${troll} || ogre || playersize > ) {
|/keypress s hold
|/delay 4
|/keypress w or something watever it is.... correct syntax wise
|
|you may want to consider keypress forward/ keypress back
|in case something goes wrong
|
|if you are worried about something going wrong, you shouldn't be using
|small bank as a hub usually and shouldn't be using these exact locs/paths
|
|there is prolly other methods to fix this, first method is the best
|
|you could shrink ur trolls and ogres but that is like rlly ridiculous
|this will be fixed soon listen my server crashes when I ranged attack
|ths shit has to be tested, and then i gotta update the stuff on 16 macros,
|there is a list of about 40 things that have to be fixed serverwise
|there is a list of 45 things that have to be fixed macrowise for v1 of macros
|there is about 5 things i wanna do with movement, and about 4 diff things
|im gonna have to evolve movement into, im thinking networks and stuff
|object detection or even sht from .map printouts or something
|im gonna get around to it, wrote these macros 1yr ago,
|haven't played for 3 months, been studying ... 8/22/2015? 1:51am est
|------------------------------------------------------------------------------------
|movement code
|movement.ini
|spellroutines.inc
|test.mac
|
|THIS CODE IS NOT SAFE FOR LIVE AND ALSO USES /FACE NOLOOK FAST
|
|It tries to simulate userlike movement and viewing
|this could be much better but more code
|
|ill include my spellroutines
|
|im sure this works with any macroquest build
|mq2forunderfoot - hidden in wiki - MQ20100609
|
|twist version, vip plugins - MQ2Twist 09/22/09+
|
|moveutils version, vip plugins - MQ2MoveUtils june 2011
|
|I like my spellroutines better, it is posted here after movement ini
|spellroutines version, general macro snippets Spell_Routines - 7/05/09
|
|****Instructions!****
|
|this part above sub main -> #Event Movement "#1#guild, '#2#goto#3#'"
|
|you may want to put
|
|/declare didinvis int outer 0
| and
|/declare dotwist int outer 0
|
|in ur macro, below sub main where the declares go, and above ur actual
|macro code
|
|if you are a caster you want spellroutines.inc included prolly
|this part above sub main -> #include spell_routines.inc
|
|if you want toggle abort to abort movement, write it, or get it from one of
|my macro posted, you would have to include #Event Toggle blahblah
| above sub main in ur macro. toggle can be perfected as a starter project
| it currently aborts only at next location ur moving to... it can be
| instantaneous
|
|this is the movement code and functions, it goes at the bottom of ur macro
Code: Select all
Sub page(direction, duration)
/if (${direction.Find[down]}) {
/keypress Page_Down hold
/delay ${duration}
/keypress Page_Down
}
/if (${direction.Find[up]}) {
/keypress Page_Up hold
/delay ${duration}
/keypress Page_Up
}
/return
Sub returntocamp(face)
/if (${Bool[${makecamploc}]}) {
/call gotoloc "${makecamploc}"
/if (${Macro.Return} == 1 && ${face.Equal[face]}) {
/if (${Me.Heading.Degrees} > 179) /face fast heading ${Math.Calc[${Me.Heading.Degrees} - 180]}
/if (${Me.Heading.Degrees} < 180) /face fast heading ${Math.Calc[${Me.Heading.Degrees} + 180]}
}
}
/return
Sub gotoloc(loc, command)
/declare locfrom string local
/declare zoneshortname string local ${Zone.ShortName}
/if (!${Bool[${loc}]}) /varset locfrom leashloc
/if (${Bool[${loc}]}) /varset locfrom loc
/declare nextlocationy string local ${${locfrom}.Arg[1,,]}
/declare nextlocationx string local ${${locfrom}.Arg[2,,]}
/declare nextlocationyhigh string local ${Math.Calc[${${locfrom}.Arg[1,,]} + 5]}
/declare nextlocationylow string local ${Math.Calc[${${locfrom}.Arg[1,,]} - 5]}
/declare nextlocationxhigh string local ${Math.Calc[${${locfrom}.Arg[2,,]} + 5]}
/declare nextlocationxlow string local ${Math.Calc[${${locfrom}.Arg[2,,]} - 5]}
/if (${nextlocationy.NotEqual[NULL]} && ${Me.Y} <= ${nextlocationyhigh} && ${Me.Y} >= ${nextlocationylow} && ${Me.X} <= ${nextlocationxhigh} && ${Me.X} >= ${nextlocationxlow}) {
/if (${command.NotEqual[empty]}) /call ${command}
/return
}
:travel
/keypress forward hold
/if (${nextlocationy.NotEqual[NULL]} && ${Me.Y} <= ${nextlocationyhigh} && ${Me.Y} >= ${nextlocationylow} && ${Me.X} <= ${nextlocationxhigh} && ${Me.X} >= ${nextlocationxlow}) {
/keypress forward
/if (!${Me.Class.PureCaster}) /varset didstick 0
/if (${command.NotEqual[empty]}) /call ${command}
/return 1
}
/if (${nextlocationy.NotEqual[NULL]}) {
/if (${Me.Y} <= ${nextlocationylow} || ${Me.X} <= ${nextlocationxlow} || ${Me.Y} >= ${nextlocationyhigh} || ${Me.X} >= ${nextlocationxhigh}) {
/face nolook fast loc ${nextlocationy},${nextlocationx}
}
}
/if (${zoneshortname.NotEqual[${Zone.ShortName}]}) {
/if (!${InvSlot[17].Item.ID}) {
/if (!${InvSlot[13].Item.ID} && !${Defined[amnaked]}) {
/guildsay - i died during movement -
/declare amnaked int outer 100
/keypress forward
/varset makecamploc ${Me.Y},${Me.X}
/return
}
}
}
/if (${zoneshortname.NotEqual[${Zone.ShortName}]}) {
/if (${InvSlot[17].Item.ID} || ${amnaked} == 100) {
/if (${InvSlot[13].Item.ID} && !${Defined[amnaked]} || !${InvSlot[13].Item.ID} && ${amnaked} == 100) {
/echo ~~ ${Zone.Name} ~~
/keypress forward
/deletevar zoneoutloc
/varset makecamploc ${Me.Y},${Me.X}
/return
}
}
/return
}
/delay 1
/goto :travel
/return
Sub zonedoor
/keypress forward
:doorloop
/keypress u
/delay 2
/keypress u
/delay 1s
/keypress u
/delay 2
/call viewing
/if (${zoneshortname.Equal[${Zone.ShortName}]}) /goto :doorloop
/return
Sub door
/keypress u
/if (!${Me.Moving}) {
/if (${Bool[${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}loc[${j}]door]}]}) {
/doortarget ${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}loc[${j}]door]}]}
/face door
/keypress u
}
}
/return
Sub viewing
/declare variable string local page_down
:viewing
/if (${zoneshortname.Equal[${Zone.ShortName}]}) {
/keypress ${variable} hold
/delay 2
/keypress ${variable}
/keypress u
/if (${zoneshortname.Equal[${Zone.ShortName}]}) {
/keypress ${variable} hold
/delay 4
/keypress ${variable}
/keypress u
/if (${zoneshortname.Equal[${Zone.ShortName}]}) {
/keypress ${variable} hold
/delay 4
/keypress ${variable}
/keypress u
/if (${variable.Equal[page_down]}) {
/varset variable page_up
/goto :viewing
}
/if (${variable.Equal[page_up]}) {
/varset variable page_down
/goto :viewing
}
}
}
}
/return
Sub findgroup
/declare totalgroups int local
/declare i int local
/declare j int local
/varset totalgroups ${Ini[toolismacro,Values,totalgroups]}
/for i 1 to ${totalgroups}
/for j 1 to 6
/if (${Ini[toolismacro,Group${i},member${j}].Equal[${Me.Name}]}) {
/return ${i}
}
/next j
/next i
/echo GROUP NOT FOUND ---- returning +1
/return ${Math.Calc[${totalgroups} + 1]}
Sub groupcheck
/declare i int local
/declare grpcheck int local 0
:checkgroup
/for i 0 to ${Group}
/if (${Group.Member[${i}].Distance} < 120 && ${Group.Member[${i}].ID}) /varset grpcheck ${Math.Calc[${grpcheck} + 1]}
/next i
/if (${grpcheck} == ${Group.GroupSize}) {
/delay 1s
/return 1
} else {
/varset grpcheck 0
/delay 2
/goto :checkgroup
}
/return
Sub Event_Movement(Line, SenderPerson, targetperson, TargetZone)
/if (${Bool[${targetperson}]}) {
/declare name int local
/declare force int local
/for force 1 to 10
/if (${targetperson.Arg[${force},].Equal[force]}) {
/declare forcemove bool local TRUE
}
/if (${targetperson.Arg[1,].Equal[force]} && !${Bool[${targetperson.Arg[2,]}]}) /goto :beginning
/next force
/if (${targetperson.Arg[1,].Equal[group]}) {
/if (${targetperson.Arg[1,].Equal[group]}) {
/declare groupnumber int local
/call findgroup
/varset targetperson ${targetperson.Right[-6]}
/if (${targetperson.Find[force]}) /varset targetperson ${targetperson.Left[-6]}
/for groupnumber 1 to ${Ini[toolismacro,Values,totalgroups]}
/if (${targetperson.Arg[${groupnumber},,]} == ${Macro.Return}) {
/goto :beginning
} else {
/next groupnumber
/return
}
}
}
/for name 1 to 10
/if (${targetperson.Arg[${name},].Equal[${Me.Name}]}) /goto :beginning
/next name
/return
}
:beginning
/if (!${Bool[${Ini[movement,${TargetZone},zoneshortnames].Arg[1,,]}]}) {
/echo Incorrect Destination
/return
}
/declare zoneshortname string local ${Zone.ShortName}
/declare savedtargetzone string local ${TargetZone}
/declare startlocation string local 0
/declare tempheading float local 0
/declare nextlocationx string local NULL
/declare nextlocationy string local NULL
/declare nextlocationxhigh string local
/declare nextlocationxlow string local
/declare nextlocationyhigh string local
/declare nextlocationylow string local
/declare i int local
/declare j int local
/declare junctions int local
/declare savedvariable int local 0
/if (${Me.Class.Name.NotEqual[Bard]}) /declare didinvis int local 0
/declare grpnumber int local 0
/echo - Starting -
/for junctions 1 to 12
/echo ${junctions} junctions
/for i 1 to 10
/echo ${i} i variable at i loop
:start
/if (${Bool[${Ini[movement,${TargetZone},junctions].Arg[${junctions},,]}]}) {
/echo ${Ini[movement,${TargetZone},junctions].Arg[${junctions},,]}
/varset TargetZone ${Ini[movement,${TargetZone},junctions].Arg[${junctions},,]}
/echo changed targetzone to ${TargetZone}
/echo ${Ini[movement,${TargetZone},junctions].Arg[${junctions},,]} targetzones junctions
/echo ${i} i variable in bool junctions
/varset i 1
}
/if (!${Bool[${Ini[movement,${savedtargetzone},junctions].Arg[${junctions},,]}]} && ${TargetZone.NotEqual[${savedtargetzone}]}) {
/varset TargetZone ${savedtargetzone}
/echo changed targetzone to savedtargetzone
/echo ${junctions} junctions
/echo ${i} i variable in not bool junctions
/echo ${j} j
/varset i 1
}
/if (${Bool[${Ini[movement,${savedtargetzone},junctions].Arg[${junctions},,]}]} && ${TargetZone.NotEqual[${Ini[movement,${savedtargetzone},junctions].Arg[${junctions},,]}]}) {
/varset TargetZone ${Ini[movement,${savedtargetzone},junctions].Arg[${junctions},,]}
/echo changed targetzone to savedtargetzone junction arg junctions
/echo ${junctions}
/echo ${i} i variable in bool junctions arg junctions
/echo ${j} j
/varset i 1
}
/if (${savedvariable} != 1) {
/if (${Bool[${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,].Equal[${Zone.ShortName}]}]} && ${startlocation.Equal[0]}) {
/echo found starting zone
/varset startlocation ${TargetZone},${i},
/echo ${startlocation}
/echo ${i} i variable
/echo ${j} j variable
}
/if (${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,].NotEqual[${Zone.ShortName}]} && ${startlocation.NotEqual[0]}) {
/echo found end of zones
/varset junctions 1
/varset savedvariable 1
/varset TargetZone ${startlocation.Arg[1,,]}
/varset i ${startlocation.Arg[2,,]}
}
}
/if (${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}].Arg[${j},,].Equal[finish]} && ${zoneshortname.Equal[${Zone.ShortName}]}) {
/keypress w
/varset didinvis 0
/echo i have reached my destination
/guildsay im at target destination
/varset makecamploc ${Me.Y},${Me.X}
/return
}
/if (${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,].Equal[${Zone.ShortName}]}) {
/if (!${forcemove}) {
/if (${Me.Class.Name.Equal[Bard]} && !${didinvis}) {
/call groupcheck
}
/if (${Me.Class.Name.NotEqual[Bard]} && !${didinvis}) {
/call findgroup
/varset grpnumber ${Macro.Return}
:waitforinvis
/doevents Toggle
/if (${Macro.Return.Equal[abort]}) {
/varset makecamploc ${Me.Y},${Me.X}
/return
}
/if (${Ini[toolismacro,Movement,group${grpnumber}ready].Equal[ready]}) {
/varset didinvis 1
}
/if (${Ini[toolismacro,Movement,group${grpnumber}ready].Equal[empty]}) {
/delay 2
/echo waiting for invis
/goto :waitforinvis
}
}
}
/if (${Me.Class.Name.Equal[Bard]} && !${didinvis}) {
/squelch /twist off
/varset didinvis 1
/varset dotwist 1
/if (!${Me.Gem[${travelsong}]} && !${Cursor.ID}) {
/guildsay sec memming travel song
/memspell ${travelsonggem} ${travelsong}
/delay 2s
}
/squelch /twist ${travelsonggem}
/delay 2s
/if (!${Me.Casting.ID}) {
/squelch /twist ${speedsonggem}
/delay 2s
/if (${Me.Casting.ID}) /delay 1s
/if (!${Me.Gem[${invissong}]} && !${Cursor.ID}) {
/guildsay sec memming invis song
/memspell ${travelsonggem} ${invissong}
/delay 2s
}
/squelch /twist ${travelsonggem}
/delay 3s
}
/if (${Me.Casting.ID}) /delay 2s
/call findgroup
/varset grpnumber ${Macro.Return}
/ini "toolismacro" "Movement" "group${grpnumber}ready" "ready"
/delay 6
/ini "toolismacro" "Movement" "group${grpnumber}ready" "empty"
}
/echo ${j} j (before for loop)
/for j 1 to 30
/echo ${j} j
/if (${Bool[${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}loc${j}]}]} && ${savedvariable} != 1) {
/varset savedvariable ${j}
/varset nextlocationy ${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}loc${j}].Arg[1,,]}
/varset nextlocationx ${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}loc${j}].Arg[2,,]}
/varset nextlocationyhigh ${Math.Calc[${nextlocationy} + 75]}
/varset nextlocationylow ${Math.Calc[${nextlocationy} - 75]}
/varset nextlocationxhigh ${Math.Calc[${nextlocationx} + 75]}
/varset nextlocationxlow ${Math.Calc[${nextlocationx} - 75]}
/if (${Me.Y} <= ${nextlocationyhigh} && ${Me.Y} >= ${nextlocationylow} && ${Me.X} <= ${nextlocationxhigh} && ${Me.X} >= ${nextlocationxlow}) {
/echo found correct loc
/varset savedvariable 1
/goto :end
}
/varset nextlocationyhigh ${Math.Calc[${nextlocationy} + 175]}
/varset nextlocationylow ${Math.Calc[${nextlocationy} - 175]}
/varset nextlocationxhigh ${Math.Calc[${nextlocationx} + 175]}
/varset nextlocationxlow ${Math.Calc[${nextlocationx} - 175]}
/if (${Me.Y} <= ${nextlocationyhigh} && ${Me.Y} >= ${nextlocationylow} && ${Me.X} <= ${nextlocationxhigh} && ${Me.X} >= ${nextlocationxlow}) {
/echo found nearest loc
/varset savedvariable 1
/goto :nearestlocloop
}
/echo this didnt work
/varset nextlocationy NULL
/if (${Bool[${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}loc${savedvariable}].Arg[1,,]}]}) {
/varset savedvariable ${Math.Calc[${j} + 1]}
/varset nextlocationy NULL
/if (${Bool[${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}loc${savedvariable}].Arg[1,,]}]}) {
/echo next j
/next j
}
/if (${Bool[${Ini[movement,${TargetZone},zoneshortnames].Arg[${Math.Calc[${i} + 1]},,]}]}) {
/varset j 0
/next i
}
/if (${Bool[${Ini[movement,${savedtargetzone},junctions].Arg[${junctions},,]}]}) {
/varset j 0
/echo next junctions instead of j
/varset TargetZone ${savedtargetzone}
/next junctions
}
}
/echo this fired
/varset savedvariable ${Math.Calc[${j} + 1]}
/delay 2
/next i
}
/if (!${Bool[${Ini[movement,${savedtargetzone},junctions].Arg[${junctions},,]}]} && ${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}].Arg[${j},,].Equal[junction]} || ${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}].Arg[${j},,].Equal[finish]}) {
/keypress w
/varset didinvis 0
/echo i have reached my destination
/guildsay im at target destination
/varset makecamploc ${Me.Y},${Me.X}
/return
}
:end
/if (${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}].Arg[${j},,].Equal[junction]}) {
/keypress forward
/varset j 1
/varset TargetZone ${savedtargetzone}
/if (!${Bool[${Ini[movement,${savedtargetzone},junctions].Arg[${junctions},,]}]}) {
/varset TargetZone ${startlocation.Arg[1,,]}
/varset i ${startlocation.Arg[2,,]}
}
/if (${Bool[${Ini[movement,${TargetZone},junctions].Arg[${junctions},,]}]}) {
/echo changing junctions +1 from hitting a junction
/next junctions
}
}
/if (${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}].Arg[${j},,].Equal[zonedoor]} && ${nextlocationy.NotEqual[NULL]}) {
/keypress forward
/varset j 1
:doorloop
/keypress u
/delay 2
/keypress u
/delay 1s
/if (${Bool[${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}zonedoor]}]}) {
/face nolook loc ${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}zonedoor]}
/keypress u
}
/call viewing
/if (${zoneshortname.Equal[${Zone.ShortName}]}) /goto :doorloop
/varset nextlocationy NULL
}
/if (${zoneshortname.Equal[${Zone.ShortName}]}) {
/varset tempheading ${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}].Arg[${j},,]})
/if (${Math.Calc[(360 - ${tempheading}) + 45]} > 360 && ${Me.Heading.Degrees} <= ${Math.Calc[(360 - ${tempheading}) - 45]} || ${Math.Calc[(360 - ${tempheading}) + 45]} > 360 && ${Me.Heading.Degrees} <= ${Math.Calc[45 - (360 - ${tempheading})]}) {
/goto :headingdone
}
/if (${Math.Calc[(360 - ${tempheading}) - 45]} < 0 && ${Me.Heading.Degrees} <= ${Math.Calc[(360 - ${tempheading}) + 45]} || ${Math.Calc[(360 - ${tempheading}) - 45]} < 0 && ${Me.Heading.Degrees} <= ${Math.Calc[45 - (360 - ${tempheading})]}) {
/goto :headingdone
}
/if (${Math.Calc[${Me.Heading.Degrees}]} >= ${Math.Calc[360 - ${tempheading}]} && ${Math.Calc[${Me.Heading.Degrees}]} <= ${Math.Calc[(360 - ${tempheading}) + 45]} || ${Math.Calc[${Me.Heading.Degrees}]} >= ${Math.Calc[(360 - ${tempheading}) - 45]} && ${Math.Calc[${Me.Heading.Degrees}]} <= ${Math.Calc[360 - ${tempheading}]}) {
/goto :headingdone
}
/if (${tempheading} <= 180) {
/echo Tempheading < 180
/if (${Me.Heading.Degrees} >= ${Math.Calc[(360 - ${tempheading}) - 180]} && ${Me.Heading.Degrees} <= ${Math.Calc[360 - ${tempheading}]}) {
/varset tempheading ${Math.Calc[${tempheading} + 45]}
/goto :heading
} else {
/if (${tempheading} <= 45) {
/varset tempheading ${Math.Calc[315 + ${tempheading}]}
/goto :heading
}
/varset tempheading ${Math.Calc[${tempheading} - 45]}
/goto :heading
}
}
/if (${tempheading} > 180) {
/echo Tempheading > 180
/if (${Me.Heading.Degrees} <= ${Math.Calc[(360 - ${tempheading}) + 180]} && ${Me.Heading.Degrees} >= ${Math.Calc[360 - ${tempheading}]}) {
/varset tempheading ${Math.Calc[${tempheading} - 45]}
/goto :heading
} else {
/if (${tempheading} <= 315) {
/varset tempheading ${Math.Calc[${tempheading} + 45]}
/goto :heading
}
/varset tempheading ${Math.Calc[(360 - ${tempheading}) - 45]}
/goto :heading
}
}
:heading
/face heading ${tempheading}
:headingdone
/face fast heading ${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}].Arg[${j},,]}
}
/varset nextlocationy NULL
/varset nextlocationx NULL
/if (${Bool[${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}loc${j}]}]}) {
/varset nextlocationy ${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}loc${j}].Arg[1,,]}
/varset nextlocationx ${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}loc${j}].Arg[2,,]}
}
:nearestlocloop
/doevents Toggle
/if (${Macro.Return.Equal[abort]}) {
/varset makecamploc ${Me.Y},${Me.X}
/return
}
/varset nextlocationyhigh ${Math.Calc[${nextlocationy} + 5]}
/varset nextlocationylow ${Math.Calc[${nextlocationy} - 5]}
/varset nextlocationxhigh ${Math.Calc[${nextlocationx} + 5]}
/varset nextlocationxlow ${Math.Calc[${nextlocationx} - 5]}
:movementloop
/keypress forward hold
/if (${nextlocationy.NotEqual[NULL]} && ${Me.Y} <= ${nextlocationyhigh} && ${Me.Y} >= ${nextlocationylow} && ${Me.X} <= ${nextlocationxhigh} && ${Me.X} >= ${nextlocationxlow}) {
/keypress forward
/delay 2
/if (${Bool[${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}loc${j}command]}]}) /call ${Ini[movement,${TargetZone},${Ini[movement,${TargetZone},zoneshortnames].Arg[${i},,]}loc${j}command]}
/next j
}
/if (${nextlocationy.NotEqual[NULL]}) {
/if (${Me.Y} <= ${nextlocationylow} || ${Me.X} <= ${nextlocationxlow} || ${Me.Y} >= ${nextlocationyhigh} || ${Me.X} >= ${nextlocationxhigh}) {
/face nolook fast loc ${nextlocationy},${nextlocationx}
}
}
/if (${zoneshortname.NotEqual[${Zone.ShortName}]}) {
/if (!${InvSlot[17].Item.ID}) {
/if (!${InvSlot[13].Item.ID} && !${Defined[amnaked]}) {
/guildsay - i died during movement -
/declare amnaked int outer 100
/doevents flush Movement
/return
}
}
/echo -- ${Zone.Name} --
/varset nextlocationy NULL
/keypress forward
/varset zoneshortname ${Zone.ShortName}
/varset didinvis 0
/varset j 1
/varset i 0
/delay 2
/next i
}
/delay 1
/goto :movementloop
}
/delay 2
/if (${Bool[${Ini[movement,${TargetZone},zoneshortnames].Arg[${Math.Calc[${i} + 1]},,]}]}) /next i
/varset i 0
/next junctions
/varset junctions 1
/varset savedvariable 1
/varset TargetZone ${startlocation.Arg[1,,]}
/varset i ${startlocation.Arg[2,,]}
/echo setting targetzone and zone im in
/next junctions
/echo returning
/return