Dice Script

By Defero on Sep 07, 2013

This is a good working Dice script.
You can use it on your bot or on your own.
If you find any bugs please tell me in the comments or on the IRC: irc.quakenet.org Port: 6667 Channel: #Defero

Have fun with the script!

on *:TEXT:.dice*:#:{
  if ($2 == help) {
    notice $Nick The command for te dice game are:
    notice $nick .dice play - If you're the first user you need to type this to join
    notice $nick .dice join - If you want to join as a other user type this.
    notice $nick .dice leave - If you want to part type this.
  }
  elseif ($2 == play) {
    if !%dplayer {
      if !$timer(dstart) {
        set %dchan %dchan $chan
        set %dplayer %dplayer $nick
        .msg $chan Dice game has been started! You have 60 seconds to join. Join with: .dice join Current Players: $nick
        timerdstart 1 60 dstart
      }
      else .notice $nick join the game by typing : .dice join $duration($timer(dstart).secs)
    }
    else .notice $nick join the game by typing : .dice join $duration($timer(dstart).secs)
  }
  elseif ($2 == join) {
    if %dplayer {
      if !$istok(%dplayer,$nick,32) {
        set %dplayer %dplayer $nick
        notice $nick You have joined the Dice game!
      }
      else .notice $nick you're already in the game
    }
    else .notice $nick there is no current game
  }
  elseif ($2 == leave) {
    if %dplayer {
      if $istok(%dplayer,$nick,32) {
        set %dplayer $remtok(%dplayer,$nick,32)
        notice $nick You have left the dice game.
      }
      else you do not play
    }
    else .notice $nick there is no current game
  }
}

alias -l dstart {
  if $numtok(%dplayer,32) < 2) {
    msg %dchan Sorry but there are not enough players to play!
    unset %dplayer %dchan
  }
  else {
    msg %dchan The dice game has started! The players are: %dplayer
    var %i 1,%n $numtok(%dplayer,32)
    set %dfwin x 0
    while %i <= %n {
      set %dwin $r(1,6)
      if (%dwin >= $gettok(%dfwin,2,32)) { set %dfwin $gettok(%dplayer,%i,32) $v1 }
      msg %dchan The player $gettok(%dplayer,%i,32) is throwing the dice now! His/Her number is: %dwin
      inc %i
    }
    msg %dchan Good job $gettok(%dfwin,1,32) $+ ! You have won with the score $gettok(%dfwin,2,32)
    unset %dplayer %dchan %dwin %dfwin
  }
}

Comments

Sign in to comment.
Warriorii   -  Sep 11, 2013

I might have fun with it if i could figure out how to copy it. haven't been on i a while. everything is different now. any ideas on how to copy a snippet?

blackvenomm666  -  Sep 11, 2013

left click and drag to highlight then right click copy

Warriorii  -  Sep 12, 2013

I did that but the copy button isnt high lited just the delete, also the back ground in the snippet is black is yours?
actually it's grey like.

blackvenomm666  -  Sep 12, 2013

yes the background is gray

Defero  -  Sep 13, 2013

Just leftclick your mouse on the top left of the script and drag it down to the bottom right and just press CTRL + C then in your mIRC open the Remotes and press CTRL + V

Warriorii  -  Sep 16, 2013

that worked, thanks. I was highlighting it then right clicking to copy it and my copy was greyed out.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.