A bard square kite macro. Needs help
Posted: Mon May 31, 2004 6:12 pm
This macro is supposed to run in a square while chanting 2 dots and selos.
It doesn't work. Ne help would be appreciated.
It doesn't work. Ne help would be appreciated.
Code: Select all
|****************************************************************|
|*******************Bard Chant Kite Macro************************|
|**************Runs in a square while doting mobs****************|
|****************************************************************|
|******************/macro kite dot1 dot2 selos*******************|
|****************************************************************|
|****************************************************************|
|**************************By: Luc`Dragon************************|
|****************************************************************|
|*##############################################################*|
|****************************************************************|
|***************************Events Set-Up************************|
|****************************************************************|
#event Dies "#*#LOADING, PLEASE WAIT...#*#"
#event MissedNote "#*#You miss a note, bringing your song to a close!#*#"
#event Recovered "#*#You haven't recovered yet...#*#"
#event Slowed "#*#You slow#*#"
Sub MAIN(int Dot1, int Dot2, int Selos)
|****************************************************************|
|************************Global Variables************************|
|****************************************************************|
/declare cursong int outer 0
/declare CurLocLock int outer 0
/declare SpellTicks int outer 0
/declare SDCnt int outer 0
/declare SpellDelay int outer 0
/declare X1 int outer 0
/declare X2 int outer 0
/declare Y1 int outer 0
/declare Y2 int outer 0
/declare Dist int outer
|****************************************************************|
|*********************Iniaties 1-Time Events*********************|
|****************************************************************|
:PreStart
/echo Starting run... Num Lock Down.
/keypress Num_Lock
/call FindXY
/varset Dist 90 |*Change this to increase-decrease size of square*|
/echo Running at a distance of ${Dist}
|****************************************************************|
|*****************Calls Events in Main Cycle*********************|
|****************************************************************|
:MainLoop
/call GetXY
/call TChk
/varset cursong ${Selos}
/call Chant
/call GetXY
/call TChk
/varset cursong ${Dot1}
/call Chant
/call GetXY
/call TChk
/varset cursong ${Dot2}
/call Chant
/call GetXY
/goto :MainLoop
/return
|****************************************************************|
|*************************Chant Routine**************************|
|****************************************************************|
Sub Chant
|****************************************************************|
|**************Stop Song and GetXY While Queded******************|
|****************************************************************|
/echo Beging chant of ${cursong}
:StopCastLoop
/stopsong
/delay 2
/call GetXY
/doevents
/delay 1
/if (${Me.SpellReady[${cursong}]}) {
/echo Going to cast...
/goto :Cast
}
/goto :StopCastLoop
|****************************************************************|
|***************************Beging Chant*************************|
|****************************************************************|
:Cast
/cast ${cursong}
/varcalc SpellDelay 1
/call GetXY
/echo Cast song delay ${SpellDelay}
|****************************************************************|
|**********Song Delay Loop. Does GetXY while queded**************|
|****************************************************************|
:SDLoop
/call GetXY
/echo Spell Delay loop ${SDCnt}/5
/if (${SDCnt}>=4) {
/varset SDCnt 1
/goto :Done
}
/call GetXY
/delay 1
/call GetXY
/delay ${SpellDelay}s
/varcalc SDCnt ${SDCnt}+1
/call GetXY
/doevents
/goto :SDLoop
:Done
/call GetXY
/echo Ending chant sub routine...
/return
|****************************************************************|
|*************Set and Calcs 4 Point Loc System*******************|
|****************************************************************|
Sub FindXY
/declare X int outer
/declare Y int outer
/varset X ${Target.Y}
/varset Y ${Target.X}
/varset X1 ${Math.Calc[${X}+90]}
/varset X2 ${Math.Calc[${X}-90]}
/varset Y1 ${Math.Calc[${Y}+90]}
/varset Y2 ${Math.Calc[${Y}-90]}
/delay 2
/echo Center at ${X}, ${Y}. X1=>${X1}, X2=>${X2}, Y1=>${Y1}, Y2=>${Y2}
/return
|****************************************************************|
|********************Checks and Finds New Loc********************|
|****************************************************************|
Sub GetXY
/if (${CurLocLock}>=4) /varset CurLocLock 0
/call Move${CurLocLock}
/return
|****************************************************************|
|*****************Check Dists and Changes Locs*******************|
|****************************************************************|
Sub Move0
/echo Doing loc 1[${X1},${Y1}] Distance to target loc ${Math.Distance[${X1},${Y1}]}
/if (${Math.Distance[${X1},${Y1}]}<=25) {
/echo Distance to target less than 25. Turning.. Move Loc 1 Sub Routine
complete.
/varcalc CurLocLock ${CurLocLock}+1
/goto :Done
}
/face loc ${X1},${Y1}
:Done
/return
Sub Move1
/echo Doing loc 1[${X1},${Y2}] Distance to target loc ${Math.Distance[${X1},${Y2}]}
/if (${Math.Distance[${X1},${Y2}]}<25) {
/echo Distance to target less than 25. Turning.. Move Loc 2 Sub Routine
complete.
/varcalc CurLocLock ${CurLocLock}+1
/goto :Done
}
/face loc ${X1},${Y2}
:Done
/return
Sub Move2
/echo Doing loc 1[${X2},${Y2}] Distance to target loc ${Math.Distance[${X2},${Y2}]}
/if (${Math.Distance[${X2},${Y2}]}<25) {
/echo Distance to target less than 25. Turning.. Move Loc 3 Sub Routine complete.
/varcalc CurLocLock ${CurLocLock}+1
/goto :Done
}
/face loc ${X2},${Y2}
:Done
/return
Sub Move3
/echo Doing loc 1[${X2},${Y1}] Distance to target loc ${Math.Distance[${X2},${Y1}]}
/if (${Math.Distance[${X2},${Y1}]}<25) {
/echo Distance to target less than 25. Turning.. Move Loc 4 Sub Routine complete.
/varcalc CurLocLock ${CurLocLock}+1
/goto :Done
}
/face loc ${X2},${Y1}
:Done
/return
|****************************************************************|
|************************Checks for Target***********************|
|****************************************************************|
Sub TChk
/if (${Target.ID}) /goto :Done
/if (${Target.Distance}>1000) {
/target clear
/goto :GetTarget
}
/goto :Done
:GetTarget
/echo Aquiring new target...
/target npc radius 250
/echo Target ${Target.Name}, level ${Target.Level}, class ${Target.Class}, HP
${Target.Hp}
:Done
/return
|****************************************************************|
|******************************Events****************************|
|****************************************************************|
Sub Event_MissedNote
/echo You missed a note. Retrying song ${cursong}
/call chant
/return
Sub Event_Died
/echo You died. Ending macro and sitting down...
/end
/sit
/return
Sub Event_Recovered
/echo You did not recover in time to cast that song.
/call chant
/return
Sub Event_Slowed
/echo You have lost selos. Casting selos...
/varset cursong ${selos}
/call chant
/return