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

Gammon 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

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


Posted by Rivius   (95 posts)  [Biography] 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?
[Go to top] top

Posted by LezChap   (36 posts)  [Biography] 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.
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] 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.
[Go to top] top

Posted by Rivius   (95 posts)  [Biography] 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!
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] 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"))
[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.


4,268 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]