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
➜ Tips and tricks
➜ Setting Scripts/variables to where my aliases can point to them...
|
Setting Scripts/variables to where my aliases can point to them...
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Laetias
(3 posts) Bio
|
| Date
| Sun 10 Mar 2002 10:01 AM (UTC) |
| Message
| I have wraked my brain trying to figure this out. I play alot of PK muds, and PK'ing is my favorite thing. Now Im lookin for a way to set an aliase like such.<Target *>(where whatever * is saved and then I can have aliases like)
<kt=murder Variable [or] cdt=com 'demonfire' Variable> problem, I cant seem to get the coding down going from the first alias to the variable, and then for the alias to pull the information from the variable. Im just not good with code, and was wondering if yall could help me get this rolling.
Thanks fellas, and lassys.
Laetias
"My reputation grows with every failure." -Bernard Shaw- | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Mon 11 Mar 2002 08:45 AM (UTC) |
| Message
| This is pretty easy. First you need an alias to set the variable (the target), although you could do it without scripting, by enabling scripting, and just typing:
/world.SetVariable "target", "whatever"
If, however, you want your alias ("target whatever") then make an alias like this:
Alias: target *
Label: NewTarget
Script: NewTarget
Then add the following small script to the supplied script file, or just make a small file with this in it ...
sub NewTarget (thename, theoutput, thewildcards)
world.SetVariable "target", thewildcards (1)
end sub
Then, typing "target blah" should set the variable "target" to "blah". You can confirm that by looking at the "variables" tab in the configuration dialogue.
Having done that, everything else is simple. Make your other aliases (murder variable) like this:
Alias: murder @target
Expand variables: checked
This will cause "@target" to be replaced by the current contents of the "target" variable. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Magnum
Canada (580 posts) Bio
|
| Date
| Reply #2 on Mon 11 Mar 2002 12:34 PM (UTC) |
| Message
| Just to eliminate what might be confusing, I think Nick meant to put this:
Alias: murder
Expand Variables: CHECKED
Send: murder @target
...Then you would just type "murder" by itself while connected to the mud, and the alias would append the value stored in the "target" variable.
Also, you might want some feedback when you have set a new variable. The following script is just Nick's, with an extra line added:
sub NewTarget (thename, theoutput, thewildcards)
world.SetVariable "target", thewildcards (1)
world.Note "Target: " & world.GetVariable("target")
end sub
The 'world.Note' line will send a line to your output screen confirming that the variable was set. |
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Mon 11 Mar 2002 08:10 PM (UTC) |
| Message
| Oops, you're right Magnum!
In fact, from the original post, he really wants:
Alias: kt
Send: murder @target
Expand variables: checked
And for his other example:
Alias: cdt
Send: com 'demonfire' @target
Expand variables: checked
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Laetias
(3 posts) Bio
|
| Date
| Reply #4 on Tue 12 Mar 2002 12:14 AM (UTC) |
| Message
| im kind of confused how to implement the script, I do not get a blank white screen like I have in working with VB3.0 and ect, so I am a little confused how to implement it.
Thanks for your help so far.
Steve
-Laetias- | | Top |
|
| Posted by
| Laetias
(3 posts) Bio
|
| Date
| Reply #5 on Tue 12 Mar 2002 12:42 AM (UTC) |
| Message
| after I racked my brain over this for a short bit, I figured out how to use it. thanks alot fellas.
Steve
-Leatias- | | 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.
20,660 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top