Back to the bard and $char(gem,#)...Regarding Selo`s

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Back to the bard and $char(gem,#)...Regarding Selo`s

Post by Draekz » Fri Aug 22, 2003 5:17 pm

I dunno how to explain this, but is there anyway around the ' error in Selo`s Accelerando?

When tryin to cast it via

Code: Select all

/cast $char(gem,2)
Gem 2 being Selo`s it uses the Apostrophe instead of this key ` . There's no real way around that when using a twisting macro that calls on the /cast $char(gem) function and i was just wondering if anyone knew of anyway to hardcode MQ into using ` key instead of the ' (apostrophe) since all of the spells requiring apostrophe use the other one.

ANyway thanks for any help!

Draekz

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Fri Aug 22, 2003 5:26 pm

Actually i might have just thought of a way around it, although its probably very trivial to figure out, im not the best at combining code and making ti work..

here's the original code:

Code: Select all

Sub Main 
  /varset nsongs 0 

  /if $p3!="" /if $p3!=NULL { 
            /varadd nsongs 1 
            /varset a(0,2) $p3 
            /echo Song 1: $char(gem,$p3) 
      }  

  /if $p4!="" /if $p4!=NULL { 
            /varadd nsongs 1 
            /varset a(0,2) $p4 
            /echo Song 2: $char(gem,$p4) 
      } 

  /if $p5!="" /if $p5!=NULL { 
            /varadd nsongs 1 
            /varset a(0,3) $p5 
            /echo Song 3: $char(gem,$p5) 
      } 

  /if $p6!="" /if $p6!=NULL { 
            /varadd nsongs 1 
            /varset a(0,4) $p6 
            /echo Song 4: $char(gem,$p6) 
      } 

  /varset cursong 1 
  /varset exper $char(exp) 
If i stuck in something like:

Code: Select all

 /if $p3!="" /if $p3!=NULL { 
            /varadd nsongs 1 
            /varset a(0,2) $p3 
            /echo Song 1: $char(gem,$p3) 
  }[b]else /if $p3~~"Selo's" {
           /varadd nsongs 1
           /varset a(0,2) "Selo`s Accelerando"
           /echo Song 1: $char(gem,"Selo`s Accelerando")
}[/b] 
I was wondering, since that is using the PROPER ` and not the apostrophe ' would the above code be a working workaround for the error built into mQ?

Please let me know if thats right! or if there's any better ideas (there HAS to be cuz thats just pathetic coding right there lol). Please post it!

Thanks

Draekz

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

Post by wassup » Fri Aug 22, 2003 5:37 pm

If you just want to cast the song I beleive you can use

Code: Select all

/cast "<songname>" 
instead of

Code: Select all

/cast $char(gem,2)
As an example, in the Sub Event_Chat of one of my macros

Code: Select all

/cast "tnarg`s mending"
is triggered by a tell of a specific word.

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Fri Aug 22, 2003 5:41 pm

Hmm, yes i know u can use /cast "spell name" but i was wondering how to implement that into the following macro (if you dont mind taking a quick look at it). The code isnt mine at all and I am pretty much just asking to get something i dont understand fully, to work, but nonetheless im trying to mod it :P so that should count as help on a macro that im "working on"

Not sure if that made any sense, ahvent slept for 2 days cuz of work lol..
anyway, here it is

Code: Select all

| - Twist1.mac - 
| - Created by: 
| - TheColonel - 
| * Edited by: 
| * Viisual 
| + Touched up: 
| + don't_know_at_all 
| 
| Description: This macro will run a bard in a circle, starting at an 
|              x,y loc you input and a radius you input and cast songs 
|              from the gem#(s) that you input 
| Call       : /macro <macroname> <xloc> <yloc> <radius> <song1> <song2> 
|              <song3> <song4> 
|______________________________________________________________________ 
#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 Exp   "You gain " 
#event Outof   "out of range" 
#event SpawnCheck "check" 

#define cursong v1    
#define exper V2 
#define nsongs v3 
#define targcount v4 
#define songname v5 
#define CastTimer t0 
#define xpleft v14 

Sub Main 
  /varset nsongs 0 

  /if $p3!="" /if $p3!=NULL /if $p3=="Selo`s Accelerando"  {
            /varadd nsongs 1 
            /varset a(0,2) $p3 
            /echo Song 1: $char(gem,$p3) 
      }

  /if $p4!="" /if $p4!=NULL { 
            /varadd nsongs 1 
            /varset a(0,2) $p4 
            /echo Song 2: $char(gem,$p4) 
      } 

  /if $p5!="" /if $p5!=NULL { 
            /varadd nsongs 1 
            /varset a(0,3) $p5 
            /echo Song 3: $char(gem,$p5) 
      } 

  /if $p6!="" /if $p6!=NULL { 
            /varadd nsongs 1 
            /varset a(0,4) $p6 
            /echo Song 4: $char(gem,$p6) 
      } 

  /varset cursong 1 
  /varset exper $char(exp) 

:Loop 
  /varset songname $char(gem,$cursong) 
  /call Sing $int($a(0,$cursong)) 
  /call circ $p0 $p1 $p2 
  /doevents 
  /varset CastTimer $int($spell("$songname",casttime)*10+$spell("$songname",recoverytime)*10) 
  :casting 
  /call circ $p0 $p1 $p2 
  /if n $CastTimer>0 /goto :casting 
  /doevents 
  /cal circ $p0 $p1 $p2 
/goto :Loop 
/return 

Sub Sing 
  /stopsong 
  /cast $p0 
  /varadd cursong 1 
  /if n $cursong>$nsongs /varset cursong 1 
  /doevents 
/return 

sub circ 
  /face heading $calc($heading($p0,$p1)+90+$calc($p2-$distance($p0,$p1))/2) 
  /varset v6 $calc($p2-$distance($p0,$p1)) 
  /if n $v6>10 { 
  /face heading $calc($heading($p0,$p1)+180) 
  } else /if n $v6<-10 {  
  /if n $v6<-180 /varset v6 -180 
  /face heading $calc($heading($p0,$p1)+90+$v6/2) 
  } else { 
  /face heading $calc($heading($p0,$p1)+90) 
} 

/return 

Sub Event_MissedNote 
  /varcalc cursong $cursong - 1 
  /if n $cursong<1 /varset cursong 1 
  /varset t0 0 
/return 

Sub Event_Slow 
  /if n $cursong!=1 { 
    /varset cursong 1 
    /varset t0 0 
    /doevent 
  } 
/return 

Sub Event_Outof 
  /varset t0 0 
  /varadd targcount 1 
  /if n targcount<=4 /if $target(hp)<"100" { 
    /varset targcount 0 
    /tar npc 
  } 
  /doevents 
/return 

Sub Event_Recovered 
  /delay .4 
  /doevents 
/return 

Sub Event_NeedTarget 
  /varadd cursong 1 
  /if n $cursong>nsongs /varset cursong 1 
  /tar npc 
/return 

Sub Event_Exp 
/varset xpleft $calc(100-$char(exp)) 
  /varcalc exper $char(exp)-$exper 
  /echo Kill:$exper%  Left:$xpleft 
  /varset exper $char(exp) 
  /tar npc 
/return 

Sub Event_SpawnCheck 
|  /ooc Big Island raptors 
/return
I dont really see where i should enter the code, if its one of the spells i have memorized and set into the /mac twist <loc> spell1 spell2 spell3 etc

Anyway, thanks for any help :)

Draekz

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

Post by wassup » Fri Aug 22, 2003 7:42 pm

Im not sure exactly what you mean then.

It should work as long as you have the songs in gems 1-4, with Selo's being in spell gem 1.

The part of the macro that has me scratching my head is this:

Code: Select all

/call Sing $int($a(0,$cursong)) 
Does $int($a(0,$cursong)) return the integer 1 if $a(0,1)=="Selo`s Accelerando"




Also, there might be a typo...

I think

Code: Select all

  /if $p3!="" /if $p3!=NULL /if $p3=="Selo`s Accelerando"  { 
            /varadd nsongs 1 
            /varset a(0,2) $p3 
            /echo Song 1: $char(gem,$p3) 
      } 
should be

Code: Select all

  /if $p3!="" /if $p3!=NULL /if $p3=="Selo`s Accelerando"  { 
            /varadd nsongs 1 
            /varset a(0,1) $p3 
            /echo Song 1: $char(gem,$p3) 
      } 
since in the current code a(0,2) will be overwritten by $p4 if it is not "" or NULL

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Re: Back to the bard and $char(gem,#)...Regarding Selo`s

Post by dont_know_at_all » Fri Aug 22, 2003 10:10 pm

Draekz wrote:I dunno how to explain this, but is there anyway around the ' error in Selo`s Accelerando?

When tryin to cast it via

Code: Select all

/cast $char(gem,2)
Don't do this.

There are over 4000 spell names. If you end up with a GetSpellByName() call, you are potentially doing 4000 string compares.

If you want to cast the spell on gem 2 then do /cast 2.

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Sat Aug 23, 2003 4:15 am

ahhh ok..guess i'll just do it the simple way :)

thanks for heads upon all the Q's i had! appreciate it!

Later

Draekz