[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]  General
. . -> [Subject]  This should be easy

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

This should be easy

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


Posted by David Berthiaume   (202 posts)  [Biography] bio
Date Tue 12 Apr 2005 05:52 AM (UTC)  quote  ]
Message
But I can't figure it out.

I want to write a script, that when I type: flip

It'll then emote me pulling a coin out, and flipping it. While the coin is in the air, it'll make me randomly call out heads or tails, then randomly pick heads or tails.

I'd like to space this out, so that it does something like this:

Character pulls out a shiny coin and flips it into the air.
Character says '<heads or tails>'
Character catches the flipping coin and displays, <heads or tails>.

I'd prefer to write this in VB if possible. Thanks. I am not even sure where to start. Oh yeah, and I'd like it to be an alias that executes the script.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Tue 12 Apr 2005 08:18 AM (UTC)  quote  ]
Message
This will work:
<aliases>
  <alias
   match="flip"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>send "emote Pulls out a coin."
Randomize
If (Rnd &gt;=.5) THEN
DoAfter 1,"emote calls heads."
Else
DoAfter 1,"emote calls tails."
End If

If (Rnd &gt;=.5) THEN
DoAfter 3,"emote catches the coin and displays heads."
Else
DoAfter 3,"emote catches the coin and displays tails."
End If</send>
  </alias>
</aliases>


Randomize Seeds the generator, Rnd returns x where 0<=x<1 (normally you do something like Int(rnd*6)+1 for a die, but since we dont need a number, this gives us 50% on both sides of the coin.
And obviously, you can change the doafter times and the exact wording.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by David Berthiaume   (202 posts)  [Biography] bio
Date Reply #2 on Wed 13 Apr 2005 02:33 AM (UTC)  quote  ]
Message
That. Is perfect... I was thinking of something a little different though. But that easily accomplishes what it is I want to do.
[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.


2,161 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

[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]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]