[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]  Tips and tricks
. . -> [Subject]  Variables
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Variables

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


Posted by Hathcock   (49 posts)  [Biography] bio
Date Sun 28 Dec 2003 02:57 AM (UTC)  quote  ]
Message
Ok, I've tried to figure this out and yet again I'm lost.....can someone tell me step-by-step how to set up a variable.....I hope it's a variable I'm looking for...I have many pipes aliases and triggers that affect certain pipes based on ID#s, I was looking to make a variable so that when I switch to another character I can just type in the right variable and it will switch all the pipes in the aliases and triggers so that they affect the new pipes. Maybe it can't be done, I'm not sure.....but if it can, I'd appreciate the help. I looked in the variables sections here and I'm still lost, so that didn't help
[Go to top] top

Posted by Nick Gammon   Australia  (19,434 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 29 Dec 2003 05:17 AM (UTC)  quote  ]
Message
You can set up a variable very easily by going to the world configuration screen and scrolling down to the last item - variables (Scripting -> Variables).

Click "Add" and then type a name (eg. "pipe") and the contents (eg. "1234").

Then in your alias or trigger you can expand that variable. eg. an alias might say "fill @pipe".

Check the "Expand Variables" checkbox, and the contents of the pipe variable will replace @pipe.

You can make an alias to change the variable quickly. eg.

Match: newpipe *
Send: %1
Send to: Variable
Variable: pipe

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Meerclar   USA  (584 posts)  [Biography] bio
Date Reply #2 on Mon 29 Dec 2003 09:04 AM (UTC)  quote  ]
Message
If you are looking for a fast way to switch what every pipe does when you switch characters you *might* be able to use an if check or switch in the script to determine which pipes each character uses. It's not gonna be fast or pretty to code a fullscale switch routine that reworks whole pipe sets though and may not even be practical depending what scripting language you're using. Now that I think on that idea a bit more you could probably use a main script to call subscripts based on which character is being played and use Nick's example for how to store which char you're using. Still not fast or pretty but easier than trying to code something to automagically switch the pipes when you switch characters.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Firgin   (15 posts)  [Biography] bio
Date Reply #3 on Tue 16 Mar 2004 12:36 PM (UTC)  quote  ]
Message
Hey again.. Im having the same problem, I have a variable called "axe1" I dont have it in any script or anything, just in the variable box.. and then I have loads with envenom alises, and when I get new axes, I want to just change the axe1 variable, I tried to make a alias "envenom @axe1 with (venom) but it wont work, anyone know why?
thanks
[Go to top] top

Posted by Nick Gammon   Australia  (19,434 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Wed 17 Mar 2004 02:30 AM (UTC)  quote  ]
Message
Seems to work for me. Did you check the "expand variables" check box?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Dubthach   (47 posts)  [Biography] bio
Date Reply #5 on Wed 17 Mar 2004 02:57 PM (UTC)  quote  ]
Message
I didn't know that Send to: Variable thing. Handy.

It would be nice, however, to have a common syntax in the command box to assign variables without resorting to perl, JS, etc.

@pipe = %1
@tobacco = %2
...and so on

explicitly, instead of having to do it with a Send to.

If this is already possible, great.

Dub
[Go to top] top

Posted by Nick Gammon   Australia  (19,434 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Wed 17 Mar 2004 08:20 PM (UTC)  quote  ]
Message
If you want to set multiple variables in a trigger or alias, use "send to script" and put in a couple of lines like this:


SetVariable "pipe", "%1"
SetVariable "tobacco", "%2"


That is not much more work than what you suggested.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


3,191 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

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

[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]    [Web site powered by FutureQuest.Net]