bard chantkiting help - Conversion

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

ThatOtherGuy
a lesser mummy
a lesser mummy
Posts: 41
Joined: Tue Aug 05, 2003 6:12 pm

bard chantkiting help - Conversion

Post by ThatOtherGuy » Sun Oct 05, 2003 8:17 am

Mkay. So I had this working (modified of one from the old Macro Depot) pre-big-change... Now it errors out with

Code: Select all

Cleared the following: Timers Vars Arrays
[MacroQuest] Song 1: Tuyen`s Chant of Ice
[MacroQuest] Song 2: Tuyen`s Chant of the Plague
[MacroQuest] Song 3: Tuyen`s Chant of Flame
[MacroQuest] Song 4: Tuyen`s Chant of Poison
[MacroQuest] Song 5: Selo`s Accelerating Chorus
Ending macro: Calculate encountered a '
chantkite.mac@109 (circ): /face heading $calc($heading(@Param0,@Param1)+$calc(90*$calc(@Param2/$distance(@Param0,@Param1))))
chantkite.mac@86 (Main): /call circ @xloc @yloc @radius
Cleared the following: Timers Vars Arrays
The current macro has ended.
Heres the code I have, hopefully all covnerted

Code: Select all

| - ChantKite.mac - 
| /mac Chantkite <GEM> <GEM> <GEM> <GEM> <SELOS GEM> <XLOC> <YLOC> <RADIUS> 
| Note, since the lvl 49 Selo's lasts 2.5 minutes, this macro WONT WORK 
| IF YOU HAVEN'T GOT THE 2.5 MINUTE SELOS DON'T TRY, DON'T BITCH IT WON'T 

#event MissedNote "You miss a note, bringing your song to a close!" 
#event Recovered "You haven't recovered yet..." 
#event NeedTarget "You must first select a target for this spell!" 
#event Slow "You slow down"
#event Outran "out of range" 
#event Outran "You cannot see" 

Sub Main
/zapvars

/declare CASTTIME global
/declare cursong global
/declare nsongs global
/declare targcount global
/declare xloc global
/declare yloc global
/declare radius global
/declare chorus global
/declare prevsong global
/declare SELOS global
/declare timer0 timer
/declare timer1 timer
/declare songarray array2

/varset CASTTIME 32
/varset SELOS 5
/varset cursong 1
/varset targcount 0
/varset nsongs 5
/varset timer1 0 

	/if @Param5!="" /if @Param5!=NULL { 
		/varset xloc @Param5 
	} else /varset xloc $target(y) 

	/if @Param6!="" /if @Param6!=NULL { 
		/varset yloc @Param6 
	} else /varset yloc $target(x) 

	/if @Param7!="" /if @Param7!=NULL { 
		/varset radius @Param7 
	} else /varset radius 75 

| -----------------------

	/if @Param0!="" /if @Param0!=NULL { 
		/varset songarray(0,1) @Param0
	} else /varset songarray(0,1) 1 
	/echo Song 1: $char(gem,@songarray(0,1)) 

	/if @Param1!="" /if @Param1!=NULL { 
			/varset songarray(0,2) @Param1 
	} else /varset songarray(0,2) 2 
	/echo Song 2: $char(gem,@songarray(0,2)) 

	/if @Param2!="" /if @Param2!=NULL { 
			/varset songarray(0,3) @Param2 
	} else /varset songarray(0,3) 3 
	/echo Song 3: $char(gem,@songarray(0,3)) 

	/if @Param3!="" /if @Param3!=NULL { 
			/varset songarray(0,4) @Param3 
	} else /varset songarray(0,4) 4 
	/echo Song 4: $char(gem,@songarray(0,4)) 

	/if @Param4!="" /if @Param4!=NULL { 
		/varset songarray(0,5) @Param4 
	} else /varset songarray(0,5) 5 
	/echo Song 5: $char(gem,@songarray(0,5)) 

:Loop 
	/if n @timer1<=$calc(@timer0+@CASTTIME) { 
		/varset cursong SELOS
	} 
	/if n $t1<=CASTTIME {  
		/varset timer0 1 
	} 
	/if n @timer0<=0 {
		/call Sing $int(@songarray(0,@cursong))
	}
	/call circ @xloc @yloc @radius 
	/doevents 
/goto :Loop 

/return 


Sub Sing 
  /varset timer0 CASTTIME 
  /if n $cursong==SELOS /varset t1 1500 
  /stopsong
  /cast @Param0
  /varset prevsong $cursong
  /varadd cursong 1
  /if n @cursong>@nsongs /varset cursong 1
  /call circ @xloc @yloc @radius 
  /doevents 
/return 

sub circ 
	/if n $distance(@Param0,@Param1)<(@Param2/2){ 
		/face heading $calc($heading(@Param0,@Param1)+180)
	} else { 
		/face heading $calc($heading(@Param0,@Param1)+$calc(90*$calc(@Param2/$distance(@Param0,@Param1))))
	} 
/return 

Sub Event_MissedNote 
  /varset cursong @Paramrevsong 
  /varset timer0 0 
  /doevents 
/return 

Sub Event_Slow 
  /varset cursong SELOS 
  /varset timer0 0 
/return 

Sub Event_Outran 
  /varset timer0 0 
  /varadd targcount 1 
  /if n $targcount>=4 { 
    /varset targcount 0 
    /tar npc 
  } 
  /call circ @xloc @yloc @radius 
  /doevents 
/return 

Sub Event_Recovered 
  /varset timer0 0 
  /varset cursong @Paramrevsong 
  /doevents 
/return 

Sub Event_NeedTarget 
  /varadd targcount 1 
  /if n $targcount>=2 { 
    /varset targcount 0 
    /tar npc 
  } 
  /call circ @xloc @yloc @radius 
  /doevents 
/return 
Please, someone who understands the new code help :P
-TOG

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: bard chantkiting help - Conversion

Post by wassup » Sun Oct 05, 2003 1:00 pm

ThatOtherGuy wrote:Mkay. So I had this working (modified of one from the old Macro Depot) pre-big-change... Now it errors out with

Code: Select all

Ending macro: Calculate encountered a '
chantkite.mac@109 (circ): /face heading $calc($heading(@Param0,@Param1)+$calc(90*$calc(@Param2/$distance(@Param0,@Param1))))
chantkite.mac@86 (Main): /call circ @xloc @yloc @radius
Cleared the following: Timers Vars Arrays
The current macro has ended.
Heres the code I have, hopefully all covnerted

Code: Select all

	/call circ @xloc @yloc @radius 
	/doevents 
/goto :Loop 

/return 


sub circ 
	/if n $distance(@Param0,@Param1)<(@Param2/2){ 
		/face heading $calc($heading(@Param0,@Param1)+180)
	} else { 
		/face heading $calc($heading(@Param0,@Param1)+$calc(90*$calc(@Param2/$distance(@Param0,@Param1))))
	} 
/return 

I'm not 100% positive, but I think that you need to use parameters more in line with other languages now, like below:

Code: Select all

sub circ(xloc,yloc,radius)
	/if n $distance(@Param0,@Param1)<(@Param2/2){ 
		/face heading $calc($heading(@Param0,@Param1)+180)
	} else { 
		/face heading $calc($heading(@Param0,@Param1)+$calc(90*$calc(@Param2/$distance(@Param0,@Param1))))
	} 
/return
I'm still trying to figure out everything about the new variable useage.