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
➜ General
➜ Help needed, begginer
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Alachine
(4 posts) Bio
|
Date
| Mon 28 Aug 2006 07:39 PM (UTC) Amended on Mon 28 Aug 2006 09:54 PM (UTC) by Alachine
|
Message
| Ok, I am trying to do the following, and have no clue as to how:
send 'em takes a small flute from her pack and begins playing a soft melody, very highly pitched.'
wait three seconds
send 'em continues the melody, softly, as it flows lower in pitch and stays there, flickering like an insect.'
wait three seconds
send 'em brings the song to the mid tones and crescendos to an average volume, and changes the song to more like that of chanting rather than an insect.'
wait three seconds
send 'em takes the song softer again and the music becomes darker as it stays in the lower pitches.'
wait three seconds
send 'em finishes the song with a dramatic crescendo and brings the music to the high tones, in a triumphant manner.'
I am doing this because it makes things easier on my part in a MUD I play in, and once I know how this one is done I can do all the others. Help please? | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #1 on Mon 28 Aug 2006 07:52 PM (UTC) |
Message
| Hi,
Here's an example:
sub MyAliasScript (a, b, c)
world.send "take a potion"
world.doafter 2, "take the 2nd potion"
world.doafter 3, "rub some salve"
world.doafter 3, "eat something"
end sub
I got this by searching for "pausing", and found this post: http://www.gammon.com.au/forum/bbshowpost.php?id=127
What this does is send the first text immediately, then after 2 seconds, send the second, and so forth.
You would create an alias that called a script, and make the function name it called be the function name here (in this case, MyAliasScript, but you might want to change that).
I think the script itself goes into your world script file, but I haven't played around with this in a while and am not sure of the details. There are people here with more knowledge than me in using MUSHclient's scripting system.
Hope this helps! :) |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Alachine
(4 posts) Bio
|
Date
| Reply #2 on Mon 28 Aug 2006 09:43 PM (UTC) |
Message
| Sorry, I meant to specify that I am using Lua... which I do believe that was not. And I really do have no clue whatsoever about how to do this... | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #3 on Mon 28 Aug 2006 10:16 PM (UTC) |
Message
| I believe the Lua translation would look like this:
function MyAliasScript (a, b, c)
world.send ("take a potion")
world.doafter (2, "take the 2nd potion")
world.doafter (3, "rub some salve")
world.doafter (3, "eat something")
end
EDIT:
or something like that, I might not have the case right on the function names. You might want to check the docs to see if it's doAfter, doafter, DoAfter, etc. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
Date
| Reply #4 on Mon 28 Aug 2006 11:41 PM (UTC) Amended on Mon 28 Aug 2006 11:45 PM (UTC) by Nick Gammon
|
Message
| Yep in Lua it would be:
function MyAliasScript ()
Send ("take a potion")
DoAfter (2, "take the 2nd potion")
DoAfter (3, "rub some salve")
DoAfter (3, "eat something")
end
The important thing is that the times are all from when the script runs, so if you want to wait for 3 seconds between each thing, then you must keep adding 3, like this:
function MyAliasScript ()
Send ("em takes a small flute from her pack and begins playing a soft melody, ...")
DoAfter (3, "em continues the melody, softly, ...")
DoAfter (6, "em brings the song to the mid tones and crescendos to an average volume, ...")
DoAfter (9, "em takes the song softer again and the music becomes darker ...")
-- and so on ...
end
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
Date
| Reply #5 on Mon 28 Aug 2006 11:47 PM (UTC) |
Message
| You don't need a separate script file, something like this can be done by simplying "send to script", like this:
<aliases>
<alias
match="sing"
enabled="y"
send_to="12"
sequence="100"
>
<send>Send ("em takes a small flute from her pack and begins playing a soft melody, ...")
DoAfter (3, "em continues the melody, softly, ...")
DoAfter (6, "em brings the song to the mid tones and crescendos to an average volume, ...")
DoAfter (9, "em takes the song softer again and the music becomes darker ...")</send>
</alias>
</aliases>
That is your alias, you can copy and paste into the alias list. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Alachine
(4 posts) Bio
|
Date
| Reply #6 on Tue 29 Aug 2006 03:46 AM (UTC) Amended on Tue 29 Aug 2006 04:05 AM (UTC) by Alachine
|
Message
| thank you very, very much, but it gives me this message now...:
Error number: 0
Event: Compile error
Description: [string "Alias: "]:1: unexpected symbol near `<'
Called by: Immediate execution
I copied it exactly. | Top |
|
Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
Date
| Reply #7 on Tue 29 Aug 2006 04:39 AM (UTC) |
Message
| |
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.
24,708 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top