Help needed, begginer

Posted by Alachine on Mon 28 Aug 2006 07:39 PM — 9 posts, 29,369 views.

#0
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?
Amended on Mon 28 Aug 2006 09:54 PM by Alachine
USA #1
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! :)
#2
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...
USA #3
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.
Australia Forum Administrator #4
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

Amended on Mon 28 Aug 2006 11:45 PM by Nick Gammon
Australia Forum Administrator #5
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.
#6
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.
Amended on Tue 29 Aug 2006 04:05 AM by Alachine
Australia Forum Administrator #7
See this:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4777

What I had there does not go into your script file.
#8
ah, thanks!