This should be easy

Posted by David Berthiaume on Tue 12 Apr 2005 05:52 AM — 3 posts, 17,170 views.

#0
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.
USA #1
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.
#2
That. Is perfect... I was thinking of something a little different though. But that easily accomplishes what it is I want to do.