Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ Kind of annoying thing I want to fix

Kind of annoying thing I want to fix

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Rivius   (99 posts)  Bio
Date Sat 06 Nov 2010 02:27 AM (UTC)
Message

<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?
Top

Posted by LezChap   (36 posts)  Bio
Date Reply #1 on Sat 06 Nov 2010 03:26 AM (UTC)
Message
Change '"@Var"' to 'GetVariable("Var")' and it should work how you want it.
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #2 on Sat 06 Nov 2010 05:27 AM (UTC)
Message
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.
Top

Posted by Rivius   (99 posts)  Bio
Date Reply #3 on Sat 06 Nov 2010 04:22 PM (UTC)
Message
Oooh! I see. Well, I guess now I know and can prevent future problems like this. Feel like a dumby!

Thanks, guys!
Top

Posted by Larkin   (278 posts)  Bio
Date Reply #4 on Sat 06 Nov 2010 05:53 PM (UTC)
Message
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"))
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


18,592 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.