|kite.mac
|Chopped up Dizzy.mac edited by Airvz
#Event zone "#*#You have entered #*#"
#turbo 40
#chat tell
Sub Main(string PathType)
/combat off
/declare HpTimer timer Outer
/varset HpTimer 1m
/declare timerSelo timer outer 0
/if (${PathType.Equal[diamond]}) {
/declare DiamondY float outer
/declare DiamondX float outer
/declare N float outer
/declare S float outer
/declare E float outer
/declare W float outer
/declare TooClose float outer
/varset DiamondY ${Param1}
/varset DiamondX ${Param2}
/varset N ${Param3}
/varset S ${Param4}
/varset E ${Param5}
/varset W ${Param6}
/varset TooClose ${Param7}
/echo Running a diamond around (${DiamondY},${DiamondX}) with N/S/E/W corners ${N} ${S} ${E} ${W} ${If[${TooClose}>0,"- Paranoia Range set at: ${TooClose}",]}.
} else /if (${PathType.Equal[circle]}) {
/declare CircleY float outer
/declare CircleX float outer
/declare CircleR float outer
/declare TooClose float outer
/varset CircleY ${Param1}
/varset CircleX ${Param2}
/varset CircleR ${Param3}
/varset TooClose ${Param4}
/echo Running a perfect circle around (${CircleY},${CircleX}) at radius ${CircleR} ${If[${TooClose}>0,"- Paranoia Range set at: ${TooClose}",]}.
} else {
/call DumbAss
}
| Declare and set some variables for A.I. control.
/declare ProximityTimer timer outer
/declare StopMe int outer 0
/declare LastAAExp float outer ${Me.PctAAExp}
/declare TotalAAExp float outer 0
/declare LastLvl float outer ${Me.PctExp}
/declare TotalLvl float outer 0
|EDIT THIS AREA TO AVOID FRIENDS TRIPPING YOUR INSTA GATE
| /alert add 1 playername
| Add myself to the friendly PC list.
/squelch /alert add 1 ${Me.Name}
| EDIT THIS LINE - the songs you'll twist while kiting go here. Dots in gem 2-5 and 10 is for Composers Greaves if you got them
| otherwise EDIT 10 to be whatever gem you have selos in. MAKE SURE YOU HAVE YOUR HEAL SONG IN GEM 6
/if (!${timerSelo}) {
/squelch /twist 2 3 4 5 10
}
| Start moving and keep running Clockwise around the circular path.
/keypress up hold
:MainLoop
/call GMCheck
/if (${HpTimer}<=0) /call HpTimerEvent
/if (${PathType.Equal[circle]}) /call Circle ${CircleY} ${CircleX} ${CircleR}
/if (${PathType.Equal[diamond]}) /call Diamond ${DiamondY} ${DiamondX} ${N} ${S} ${E} ${W}
/if (!${StopMe}) {
/doevents
| Display
/if (${Me.PctExp}!=${LastLvl} || ${Me.PctAAExp}!=${LastAAExp}) /call ExpGain
| If any PCs are too close, go into standby.
/if (${TooClose} && ${Spawn[pc noalert 1 radius ${TooClose}].ID} && ${Me.CurrentMana}>900) {
/megawarp gate
/varset StopMe 1
/varset ProximityTimer 20s
/echo Foreign PC (${Spawn[pc noalert 1 radius ${TooClose}].Name}) detected inside Paranoia Range (${TooClose}), gating.
/mqlog Foreign PC (${Spawn[pc noalert 1 radius ${TooClose}].Name}) detected inside Paranoia Range (${TooClose}), gating.
}
| Stop twisting if no target.
/if (${Target.Type.Equal[PC]} && ${Twisting}) /squelch /twist stop
| If the current target is too high-level, too far away or is a PC, find a new one.
/if (!${Target.Type.Equal[NPC]} || ${Target.Distance}>300 || !${Target.ID}) {
/target myself
/if (${Spawn[npc radius 250].ID}) {
/target npc radius 250
| Activate the Boastful Bellows AA to tag the targetted mob.
/alt activate 199
/squelch /twist start
} else {
/squelch /twist stop
}
}
}
/if (${StopMe}>0 && ${Twisting}) /squelch /twist stop
/if (${StopMe} && !${ProximityTimer}) /goto :Standby
/goto :MainLoop
:Standby
/alt activate 212
/keypress back
/keypress back
/keypress back
| This loop iterates until no foreign PCs are in range and the bard has enough mana to FM.
:StandbyLoop
/doevents
/if (${Math.Calc[${Spawn[pc noalert 1 radius ${TooClose}].ID}==NULL]} && ${Me.CurrentMana}>1000) {
/varset StopMe 0
/delay 5m
/keypress up hold
/twist 3
/varset timerSelo 5s
/echo No foreign PCs detected, resuming chant-kiting.
/keypress Esc
/goto :MainLoop
}
/goto :StandbyLoop
/return
| -------------------------------------------------------
| Circle: Keeps the character facing a clockwise tangent
| to a circular path. Arguments are the center
| coordinates and the radius of the circle.
| Created by IceIsFun
| -------------------------------------------------------
Sub Circle(float Y,float X,float R)
/declare C_Heading float local
/declare C_Distance float local
/vardata C_Heading Heading[${Y},${X}].DegreesCCW
/vardata C_Distance Math.Distance[${Y},${X}]
/if (${C_Distance}<${R}) {
/face heading ${Math.Calc[${C_Heading}+180]}
} else {
/face heading ${Math.Calc[${C_Heading}+${Math.Calc[90*${Math.Calc[${R}/${C_Distance}]}]}]}
}
/return
| -------------------------------------------------------
| Diamond: Keeps the character facing the next corner of
| a clock-wise diamond path. Arguments are the center
| coordinates and N/S/E/W distance offsets for each
| corner of the diamond.
| Created by IceIsFun
| -------------------------------------------------------
Sub Diamond(float CenterY,float CenterX,float North,float South,float East,float West)
/if (${Me.X}>${CenterX} && ${Me.Y}>${CenterY}) /face fast nolook loc ${Math.Calc[${CenterY}+${North}]},${CenterX}
/if (${Me.X}>${CenterX} && ${Me.Y}<${CenterY}) /face fast nolook loc ${CenterY},${Math.Calc[${CenterX}+${West}]}
/if (${Me.X}<${CenterX} && ${Me.Y}>${CenterY}) /face fast nolook loc ${CenterY},${Math.Calc[${CenterX}-${East}]}
/if (${Me.X}<${CenterX} && ${Me.Y}<${CenterY}) /face fast nolook loc ${Math.Calc[${CenterY}-${South}]},${CenterX}
/return
| -------------------------------------------------------
| ExpGain: echos a formatted message, indicating total AA
| and regular exp gained during the RunTime of the
| current macro. Calls Sub Formatted_RunTime.
| Assumes the following declarations in Sub Main:
| /declare LastAAExp float outer ${Me.PctAAExp}
| /declare TotalAAExp float outer 0
| /declare LastLvl float outer ${Me.PctExp}
| /declare TotalLvl float outer 0
| Created by IceIsFun
| -------------------------------------------------------
Sub ExpGain
/if (${Me.PctExp}<${LastLvl}) {
/varset TotalLvl ${Math.Calc[${TotalLvl}+${Math.Calc[100+${Me.PctExp}-${LastLvl}]}]}
/varset LastLvl ${Me.PctExp}
} else {
/varset TotalLvl ${Math.Calc[${TotalLvl}+${Math.Calc[${Me.PctExp}-${LastLvl}]}]}
/varset LastLvl ${Me.PctExp}
}
/if (${Me.PctAAExp}<${LastAAExp}) {
/varset TotalAAExp ${Math.Calc[${TotalAAExp}+${Math.Calc[100+${Me.PctAAExp}-${LastAAExp}]}]}
/varset LastAAExp ${Me.PctAAExp}
} else {
/varset TotalAAExp ${Math.Calc[${TotalAAExp}+${Math.Calc[${Me.PctAAExp}-${LastAAExp}]}]}
/varset LastAAExp ${Me.PctAAExp}
}
/call Formatted_RunTime
/echo ${Macro.Name} has generated ${TotalAAExp}% AA Exp and ${TotalLvl}% Regular Exp in ${Macro.Return}.
/return
| -------------------------------------------------------
| Formatted_RunTime: returns a formatted string, giving
| the RunTime of the current Macro in HH:MM:SS.
| Created by IceIsFun
| -------------------------------------------------------
Sub Formatted_RunTime
/declare Hours int local ${Math.Calc[${Macro.RunTime}/3600].Int}
/declare Minutes int local ${Math.Calc[${Math.Calc[${Macro.RunTime}-${Math.Calc[${Hours}*3600]}]}/60].Int}
/declare Seconds int local ${Math.Calc[${Macro.RunTime}-${Math.Calc[${Hours}*3600]}-${Math.Calc[${Minutes}*60]}]}
/declare Zero int local 0
/declare S_Total string local ${Hours}:
/if (${Minutes}>9) {
/varset S_Total ${S_Total}${Minutes}:
} else {
/varset S_Total ${S_Total}${Zero}${Minutes}:
}
/if (${Seconds}>9) {
/varset S_Total ${S_Total}${Seconds}
} else {
/varset S_Total ${S_Total}${Zero}${Seconds}
}
/return ${S_Total}
| -------------------------------------------------------
| DumbAss: Echos usage instructions for Dizzy.mac
| -------------------------------------------------------
Sub DumbAss
/echo kite.mac usage:
/echo
/echo .: CIRCLE VERSION :.
/echo /mac Dizzy circle <Y> <X> <Radius> [<Paranoia Range>]
/echo <Y> - The Y-coordinate of the center of the circle you want to run.
/echo <X> - The X-coordinate of the center of the circle you want to run.
/echo <Radius> - The radius of the circle you want to run.
/echo <Paranoia Range> - OPTIONAL range at which non-friendly PCs will trigger a standby mode.
/echo
/echo .: DIAMOND VERSION :.
/echo /mac kite diamond <Y> <X> <North> <South> <East> <West> [<Paranoia Range>]
/echo <Y> - The Y-coordinate of the center of the diamond you want to run.
/echo <X> - The X-coordinate of the center of the diamond you want to run.
/echo <North> - The distance "north" (+Y) from the center of the diamond you want to run.
/echo <South> - The distance "south" (-Y) from the center of the diamond you want to run.
/echo <East> - The distance "east" (-X) from the center of the diamond you want to run.
/echo <West> - The distance "west" (+X) from the center of the diamond you want to run.
/echo <Paranoia Range> - OPTIONAL range at which non-friendly PCs will trigger a standby mode.
/echo
/echo NOTES:
/echo - This macro assumes you have compiled and loaded the MQ2Twist plugin.
/echo - Edit the line that says "/squelch /twist 2 3 4 5 10" with the gems for your chants.
/echo - Edit the line that says "/if (${ChatText.Equal["password"]}) {" with the password of your choice.
/echo - If you don't have the bard AA "Fading Memories", Paranoia Range will probably get you killed.
/echo - To add a "friendly" PC, type "/alert add 1 mynewfriendsname".
/return
| -------------------------------------------------------
| Event_Chat: responds to password-protected
| group requests and status requests. Invites the sender
| to the group and sets them to "friendly" status if the
| correct password is given.
| -------------------------------------------------------
Sub Event_Chat(string ChatType,string Sender,string ChatText)
/mqlog ${ChatType}: ${Sender} tells you: ${ChatText}
/declare MyMob int local
/varset MyMob ${Target.ID}
|EDIT THIS make "password' whatever you want so people can get invited to group
/if (${ChatText.Equal["password"]}) {
/alert add 1 ${Sender}
/if (${Group}<6) {
/target range 1 22000 ${Sender}
/invite
/tell ${Sender} I'm kiting at ${Me.Y}, ${Me.X} -- come join me.
} else {
/tell ${Sender} My group is full right now, try back later!
}
}
|EDIT THIS LINE make "status" what you want for the bot to relay exp etc..
/if (${ChatText.Equal["status"]}) {
/tell ${Sender} I am currently ${If[${StopMe}>0,"in Standby Mode","chant-kiting"]} in ${Zone.Name}. I have ${Me.AAPoints} unspent AA points and have ${Me.PctExp}% experience.
}
/target id MyMob
/return
Sub GMCheck
/if (${Spawn[gm].ID}) {
/mqlog << Gm Entered Zone /q'd to Save My Ass >>
/echo GM has entered the zone!
/echo FUCK HIM but ending the macro...
/keypress forward
/keypress back
/quit
/endmacro
}
/return
Sub HpTimerEvent
/if (${Int[${Me.PctHPs}]}<60) {
/squelch /twist 2 3 4 5 6 10
/echo << Heal Song Active >>
}
/if (${Int[${Me.PctHPs}]}>80) {
/squelch /twist 2 3 4 5 10
}
/varset HpTimer 1m
/return
Sub event_zone
/camp desktop
/mqlog << Zoned >>
/delay 20s
/endmacro
/return