[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Kind of annoying thing I want to fix

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Kind of annoying thing I want to fix

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Rivius   (93 posts)  [Biography] bio
Date Sat 06 Nov 2010 02:27 AM (UTC)  quote  ]
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?
[Go to top] top

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

Posted by Worstje   Netherlands  (867 posts)  [Biography] bio
Date Reply #2 on Sat 06 Nov 2010 05:27 AM (UTC)  quote  ]
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.
[Go to top] top

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

Thanks, guys!
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #4 on Sat 06 Nov 2010 05:53 PM (UTC)  quote  ]
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"))
[Go to top] 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.


1,509 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]