Kind of annoying thing I want to fix

Posted by Rivius on Sat 06 Nov 2010 02:27 AM — 5 posts, 23,407 views.

#0

<aliases>
  <alias
   match="cal"
   enabled="y"
   expand_variables="y"
   group="Poison"
   send_to="12"
   sequence="100"
  >
  <send>SetVariable("venom1", "Calcise")
SetVariable("venom2", "Calcise")
ColourTell("black","cornflowerblue", "@venom1")ColourTell("black","royalblue", "@venom2")
Note("")</send>
  </alias>
  <alias
   match="den"
   enabled="y"
   expand_variables="y"
   group="Poison"
   send_to="12"
   sequence="100"
  >
  <send>SetVariable("venom1", "Dendroxin")
SetVariable("venom2", "Dendroxin")
ColourTell("black","cornflowerblue", "@venom1")ColourTell("black","royalblue", "@venom2")
Note("")</send>
  </alias>
  <alias
   match="had"
   enabled="y"
   expand_variables="y"
   group="Poison"
   send_to="12"
   sequence="100"
  >
  <send>SetVariable("venom1", "Hadrudin")
SetVariable("venom2", "Dulak")
ColourTell("black","cornflowerblue", "@venom1 ")ColourTell("black","royalblue", "@venom2")
Note("")
</send>
  </alias>
  <alias
   match="slp"
   enabled="y"
   expand_variables="y"
   group="Poison"
   send_to="12"
   sequence="100"
  >
  <send>SetVariable("venom1", "Morphite")
SetVariable("venom2", "Morphite")
ColourTell("black","cornflowerblue", "@venom1")ColourTell("black","royalblue", "@venom2")
Note("")</send>
  </alias>
  <alias
   match="stu"
   enabled="y"
   expand_variables="y"
   group="Poison"
   send_to="12"
   sequence="1000"
  >
  <send>SetVariable("venom1", "Dulak")
SetVariable("venom2", "Mantakaya")


ColourTell("black","cornflowerblue", "@venom1")ColourTell("black","royalblue", "@venom2")
Note("")</send>
  </alias>
</aliases>


Here you can try the commands out. When you switch from one to the other, there is a repetition of the first one. It seems that before switching the variable, the ColourTell is executed. Is there a way to fix this?
#1
Change '"@Var"' to 'GetVariable("Var")' and it should work how you want it.
Netherlands #2
LezChap is correct.

Reason it works that way is because 'Send to:' functionality, before running the script, replaces any @variable notations to be filled with their actual values. And only then will it let the script run.
#3
Oooh! I see. Well, I guess now I know and can prevent future problems like this. Feel like a dumby!

Thanks, guys!
#4
You can also shorten your ColourTell, ColourTell, Note to just one ColourNote. You can repeat the foreground, background, text parameters as many times as you like in a single call, so it would like like this:
ColourNote("black", "cornflowerblue", GetVariable("venom1"), "black", "royalblue", GetVariable("venom2"))