need help on the name of this variable.... or something.

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

thepaan
decaying skeleton
decaying skeleton
Posts: 8
Joined: Wed Jul 30, 2003 8:35 am

need help on the name of this variable.... or something.

Post by thepaan » Wed Dec 24, 2003 12:14 pm

in cast.mac (posted for reference)

Code: Select all

#event castmcr_err_oom "Insufficient Mana to cast this spell!" 
#event castmcr_err_range "Your target is out of range, get closer!" 
#event castmcr_err_fizzle "Your spell fizzles!" 
#event castmcr_err_interrupt "Your spell is interrupted." 
#event castmcr_err_recovered "You haven't recovered yet..." 
#event castmcr_err_standing "You must be standing to cast a spell." 
#event castmcr_err_target "You must first select a target for this spell!" 
#event castmcr_err_cannotsee "You cannot see your target." 
#event castmcr_err_recovery "Spell recovery time not yet met." 
#event castmcr_err_memorized "You do not seem to have that spell memorized." 
#define spellmaxskill_ 235 
#define alertlistno_ 9 
#define alertpcradius_ 250 

Sub Main 

/declare castmcr_parametercur global 
/declare castmcr_spellidno global 
/declare castmcr_spellname global 
/declare castmcr_spelltype global 
/declare castmcr_spellcycle global 
/declare castmcr_spellmaxskill global 
/declare castmcr_spellskillabj global 
/declare castmcr_spellskillalt global 
/declare castmcr_spellskillcon global 
/declare castmcr_spellskillevo global 
/declare castmcr_spellskilldiv global 
/declare castmcr_spellnull global 
/declare castmcr_parameter0 global 
/declare castmcr_parameter1 global 
/declare castmcr_parameter2 global 
/declare castmcr_parameter3 global 
/declare castmcr_parameter4 global 
/declare castmcr_parameter5 global 
/declare castmcr_parameter6 global 
/declare castmcr_parameter7 global 
/declare castmcr_parameter8 global 
/declare castmcr_parameter9 global 
/declare castmcr_castingchecktimer timer 

/if "@Param0"!~"Param0" /varset castmcr_parameter0 "@Param0" 
/if "@Param1"!~"Param1" /varset castmcr_parameter1 "@Param1" 
/if "@Param2"!~"Param2" /varset castmcr_parameter2 "@Param2" 
/if "@Param3"!~"Param3" /varset castmcr_parameter3 "@Param3" 
/if "@Param4"!~"Param4" /varset castmcr_parameter4 "@Param4" 
/if "@Param5"!~"Param5" /varset castmcr_parameter5 "@Param5" 
/if "@Param6"!~"Param6" /varset castmcr_parameter6 "@Param6" 
/if "@Param7"!~"Param7" /varset castmcr_parameter7 "@Param7" 
/if "@Param8"!~"Param8" /varset castmcr_parameter8 "@Param8" 
/if "@Param9"!~"Param9" /varset castmcr_parameter9 "@Param9" 
/call castmcr_casting 
/alert clear alertlistno_ 

/return 

Sub castmcr_casting 
/if n $strlen("@castmcr_parameter1")==0 { 
/call castmcr_instructions 
/return 
} 

/varset castmcr_parametercur 0 
/alert clear alertlistno_ 
/alert add alertlistno_ pc radius alertpcradius_ a 
/alert add alertlistno_ pc radius alertpcradius_ e 
/alert add alertlistno_ pc radius alertpcradius_ i 
/alert add alertlistno_ pc radius alertpcradius_ o 
/alert add alertlistno_ pc radius alertpcradius_ u 
/if "@castmcr_parameter0"==#current /goto :castmcr_loop 
/target "@castmcr_parameter0" 
:castmcr_loop 

/if $target()==FALSE { 
/echo 'Cast Macro' No valid target, ending macro 
/call castmcr_endmacro 
} 

/call castmcr_spellset 
/call castmcr_spellskills 
/call castmcr_spellmemorized 

/if n $return==1 /goto :castmcr_loop 

/if n @castmcr_spellnull==1 { 
/echo 'Cast Macro' Macro Ended - Skills: 
/echo 'Cast Macro' Alteration ($char(skill,alteration)/@castmcr_spellmaxskill) 
/echo 'Cast Macro' Abjuration ($char(skill,abjuration)/@castmcr_spellmaxskill) 
/echo 'Cast Macro' Conjuration ($char(skill,conjuration)/@castmcr_spellmaxskill) 
/echo 'Cast Macro' Divination ($char(skill,divination)/@castmcr_spellmaxskill) 
/echo 'Cast Macro' Evocation ($char(skill,evocation)/@castmcr_spellmaxskill) 
/return 
} 

/call castmcr_spellcast 
/goto :castmcr_loop 

/return 

Sub castmcr_spellset 
/varadd castmcr_parametercur 1 
/if n $int(@castmcr_parametercur)==1 /call castmcr_spellidset "@castmcr_parameter1" 
/if n $int(@castmcr_parametercur)==2 /call castmcr_spellidset "@castmcr_parameter2" 
/if n $int(@castmcr_parametercur)==3 /call castmcr_spellidset "@castmcr_parameter3" 
/if n $int(@castmcr_parametercur)==4 /call castmcr_spellidset "@castmcr_parameter4" 
/if n $int(@castmcr_parametercur)==5 /call castmcr_spellidset "@castmcr_parameter5" 
/if n $int(@castmcr_parametercur)==6 /call castmcr_spellidset "@castmcr_parameter6" 
/if n $int(@castmcr_parametercur)==7 /call castmcr_spellidset "@castmcr_parameter7" 
/if n $int(@castmcr_parametercur)==8 /call castmcr_spellidset "@castmcr_parameter8" 
/if n $int(@castmcr_parametercur)==9 /call castmcr_spellidset "@castmcr_parameter9" 
/if n $int(@castmcr_parametercur)>=10 /varset castmcr_spellnull 1 
/varset castmcr_spellname "$left($calc($strlen("@castmcr_spellidno")-4),"@castmcr_spellidno")" 
/varset castmcr_spelltype $right(3,"@castmcr_spellidno") 
/varset castmcr_spellcycle $calc($calc($calc($calc($spell("@castmcr_spellname",casttime)+$spell("@castmcr_spellname",recasttime))+$if(n,$spell("@castmcr_spellname",recasttime)<$spell("@castmcr_spellname",recoverytime),$spell("@castmcr_spellname",recoverytime),0))*10)+5) 
/if n $int($calc($char(level)*5+5))<=spellmaxskill_ /varset castmcr_spellmaxskill $int($calc($char(level)*5+5)) 
/if n $int($calc($char(level)*5+5))>=spellmaxskill_ /varset castmcr_spellmaxskill spellmaxskill_ 
/call castmcr_spelltype 
/return 

Sub castmcr_spellcast 
/stand 
/echo 'Cast Macro' Casting: "@castmcr_spellname" to raise "@castmcr_spelltype" from skill level "$char(skill,"@castmcr_spelltype")" to "@castmcr_spellmaxskill" (level cap) 
:castmcr_spellcastloop 
/if n $char(skill,@castmcr_spelltype)>=@castmcr_spellmaxskill { 
/echo 'Cast Macro' "@castmcr_spelltype" cap reached. 
/return 
} 



| /if $alert(alertlistno_)==TRUE { 
| /echo 'Cast Macro' Player detected nearby, pausing for 5 seconds and trying again. 
| /delay 50 
| /goto :castmcr_spellcastloop 
| } 



/if $gm==TRUE { 
/echo 'Cast Macro' A GM or Guide has been detected in the zone, the macro will be paused and the screen filled with '/who all' information, the macro will resume when the zone is clear of GM/Guides 
/who all 
/goto :castmcr_spellcastloop 
} 

/call castmcr_castingcheck 
/goto :castmcr_spellcastloop 

/return 

Sub castmcr_spellskills 
/varset castmcr_spellskillabj $char(skill,abjuration) 
/varset castmcr_spellskillalt $char(skill,alteration) 
/varset castmcr_spellskillcon $char(skill,conjuration) 
/varset castmcr_spellskillevo $char(skill,evocation) 
/varset castmcr_spellskilldiv $char(skill,divination) 

/return 

Sub castmcr_instructions 
/echo 'Cast Macro' Usage: /macro cast <target> <spell one,skill type> <spell two,skill type> <spell three,skill type> <spell four,skill type> <spell five,skill type> 
/echo 'Cast Macro' Usage: skill types: Abjuration (abj); Alteration (alt); Conjuration (con); Divination (div); Evocation (evo) 
/echo 'Cast Macro' Usage: example: /macro cast "player's corpse" "spirit of wolf,alt" "blessing of aegolism,abj" "invisibility versus undead,div" "summon drink,con" "burst of flame,evo" 
/echo 'Cast Macro' Usage: The best target's for casting skill ups are player corpses with plenty of time left on their expiration timer, alternatively use 'myself' to target yourself. 
/echo 'Cast Macro' Usage: You can have the macro use your current target by entering "#current" for your target, e.g. /macro cast #current "spirit of wolf,alt" 
/echo 'Cast Macro' Usage: You must have your spells memorized prior to running this macro, it will not memorize them for you, this macro works in the new UI because of this. 

/return 

Sub Event_castmcr_err_oom 
/if n $char(mana,pct)==100 { 
/echo 'Cast Macro' Your mana pool is too small to cast "@castmcr_spellname", ending macro 
/call castmcr_endmacro 
} 

/stand 
/sit 

:castmcr_medloop 
/if n $char(mana,pct)==100 { 
/stand 
/return 
} 

/delay 10 
/goto :castmcr_medloop 

/return 

Sub Event_castmcr_err_range 
/echo 'Cast Macro' no target in range, ending macro. 
/call castmcr_endmacro 

/return 

Sub Event_castmcr_err_fizzle 
/return 1 

Sub Event_castmcr_err_interrupt 
/return 1 

Sub Event_castmcr_err_recovered 
/return 1 

Sub Event_castmcr_err_target 
/target @castmcr_parameter0 
/return 1 

Sub Event_castmcr_err_standing 
/stand 
/return 1 

Sub Event_castmcr_err_powerful 
/echo 'Cast Macro' Your target is too low level, please select a new target, preferably level 42+, ending macro. 
/call castmcr_endmacro 
/return 1 

Sub Event_castmcr_err_cannotsee 
/echo 'Cast Macro' You are unable to see your target, please select a new target, ending macro. 
/call castmcr_endmacro 
/return 1 

Sub Event_castmcr_err_memorized 
/echo 'Cast Macro' "@castmcr_spellname" has become unavailable, please check your spell list and restart the macro, ending macro. 
/call castmcr_endmacro 
/return 1 

Sub Event_castmcr_err_recovery 
/return 1 

Sub castmcr_resetreturn 
/return 0 

Sub castmcr_spelltype 
/if "@castmcr_spelltype"=="alt" { 
/varset castmcr_spelltype Alteration 
/return 
} 

/if "@castmcr_spelltype"=="abj" { 
/varset castmcr_spelltype Abjuration 
/return 
} 

/if "@castmcr_spelltype"=="con" { 
/varset castmcr_spelltype Conjuration 
/return 
} 

/if "@castmcr_spelltype"=="div" { 
/varset castmcr_spelltype Divination 
/return 
} 

/if "@castmcr_spelltype"=="evo" { 
/varset castmcr_spelltype Evocation 
/return 
} 

/echo 'Cast Macro' invalid skill type entered, please check the macro parameters, type "/macro cast" for help, ending macro. 
/call castmcr_endmacro 

/return 1 

Sub castmcr_spellidset 
/if "@Param0"~~UNDEFINED { 
/varset castmcr_spellnull 1 
/return 
} 

/varset castmcr_spellidno "@Param0" 

/return 

Sub castmcr_castingcheck 
:castmcr_castingloop 
/varset castmcr_castingchecktimer @castmcr_spellcycle 
/call castmcr_resetreturn 
/cast "@castmcr_spellname" 
:castmcr_castingcheckloop 
/doevents 
/if n $return>=1 /goto :castmcr_castingloop 
/if @castmcr_castingchecktimer!=0 /goto :castmcr_castingcheckloop 

/return 

Sub castmcr_spellmemorized 
/call castmcr_resetreturn 
/if n @castmcr_spellnull==1 /return 
/if n $char(gem,"@castmcr_spellname")==0 { 
/echo 'Cast Macro' Spell "@castmcr_spellname" not memorized, please check the macro parameters, type "/macro cast" for help, moving to next in list. 
/return 1 
} 

/return 

Sub castmcr_endmacro 
/alert clear alertlistno_ 
/stand 
/sit 
/endmacro 
/return
i want to change it to check for the specialization of the skill not the regular skill. from looking at it i think this next part is what i need to edit. but i dont know what to put in or where to look for what to put in

Code: Select all

Sub castmcr_spellskills 
/varset castmcr_spellskillabj $char(skill,abjuration) 
/varset castmcr_spellskillalt $char(skill,alteration) 
/varset castmcr_spellskillcon $char(skill,conjuration) 
/varset castmcr_spellskillevo $char(skill,evocation) 
/varset castmcr_spellskilldiv $char(skill,divination) 

/return
i was thinking change it to something like:

Code: Select all

Sub castmcr_spellskills 
/varset castmcr_spellskillabj $char(skill,specializeabjuration) 
/varset castmcr_spellskillalt $char(skill,specializealteration) 
/varset castmcr_spellskillcon $char(skill,specializeconjuration) 
/varset castmcr_spellskillevo $char(skill,specializeevocation) 
/varset castmcr_spellskilldiv $char(skill,specializedivination) 

/return
could someone tell me is that right?
i should have been a gnome

battaile
Contributing Member
Contributing Member
Posts: 40
Joined: Tue Dec 09, 2003 10:55 am

Post by battaile » Thu Dec 25, 2003 5:45 pm

I havent tested it but I think this'll work:

Code: Select all

/varset castmcr_spellskillabj $char(skill,"Specialize Abjure")
/varset castmcr_spellskillalt $char(skill,"Specialize Alteration")
/varset castmcr_spellskillcon $char(skill,"Specialize Conjuration") 
/varset castmcr_spellskilldiv $char(skill,"Specialize Divination")
/varset castmcr_spellskillevo $char(skill,"Specialize Evocation")
I'm new to this so I could be way off though. :)

edit -fixed cut and paste error