Top

Dice Script


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  1.0 (of 1 scores)
Date Added  Nov 04, 2007
Last Updated  Nov 04, 2007
Tags  1  10  2  3  4  5  6  7  8  9  dice  numbers 

Introduction

Well i was :|:| Bored |:|: So i made a dice game script.

Grab the Code

;;Dice Roller Script
;; Noa_Destiny
;; Use /dice to run it, or right click in the channel window.
 
menu channel { 
  .Dice Script:{
    dialog -m dice dice
    dice.init
  }
}
 
alias dice {
  dialog -m dice dice
  dice.init
}
 
alias dice.init { 
  did -i dice 15 1 0
  did -i dice 16 1 0
  did -i dice 17 1 0
  did -i dice 18 1 0
  did -i dice 19 1 0
  did -i dice 20 1 0
  did -i dice 15 1 0
  did -i dice 23 1 0
  did -i dice 24 1 0
  did -i dice 25 1 0
  did -i dice 26 1 0
  did -i dice 27 1 0
  did -i dice 28 1 0
  did -m dice 21
  did -i dice 37 1 0
  did -i dice 38 1 0
  did -i dice 39 1 0
  did -i dice 40 1 0
  set %loghelp 1
}
 
 
 
dialog dice {
  title "D&D Dice Roller - SGB162"
  size -1 -1 204 108
  option dbu
  edit "", 15, 7 41 25 9
  edit "", 16, 7 51 25 9
  edit "", 17, 7 61 25 9
  edit "", 18, 7 71 25 9
  edit "", 19, 7 81 25 9
  edit "", 20, 7 91 25 9
  edit "", 23, 70 40 26 9
  edit "", 24, 70 50 26 9
  edit "", 25, 70 60 26 9
  edit "", 26, 70 71 26 9
  edit "", 27, 70 81 26 9
  edit "", 28, 70 91 26 9
  edit "", 30, 98 40 23 9
  edit "", 31, 98 50 23 9
  edit "", 32, 98 60 23 9
  edit "", 33, 98 71 23 9
  edit "", 34, 98 81 23 9
  edit "", 35, 98 91 23 9
  button "4", 1, 35 41 32 9
  button "6", 2, 35 51 32 9
  button "8", 3, 35 61 32 9
  button "10", 4, 35 71 32 9
  button "12", 5, 35 81 32 9
  button "20", 6, 35 91 32 9
  text "   # of", 7, 7 31 25 8
  text "    Sides", 8, 39 31 25 8
  text "  Modifier", 9, 70 31 25 8
  text "  Result", 10, 98 31 25 8
  box "Roller", 11, 3 22 123 83
  box "Log", 12, 128 22 74 83
  check "Echo", 13, 119 1 29 10
  check "Say", 14, 119 10 26 10
  edit "", 21, 163 10 32 10
  text " Chan:", 22, 144 11 18 8
  edit "", 29, 131 30 68 72, multi return autohs autovs
  button "Roll", 42, 24 17 90 7, flat
  edit "0", 37, 2 7 27 10
  edit "", 38, 31 7 28 10
  edit "", 39, 61 7 24 10
  edit "", 40, 87 7 29 10
  text "  # of die ", 36, 4 -1 25 8
  text "| Sides         | Modifier |    Result", 41, 32 -1 84 8
}
 
on 1:dialog:dice:sclick:14: { 
  if ($did(dice,14).state == 1) {
    did -n dice 21
  }
  else { 
    did -m dice 21
  }
}
 
on 1:dialog:dice:sclick:1: {
  var %click5.random $($str($($rand(1,4),0) $chr(32),$did(dice, 15)),3)
  var %click5.number $numtok(%click5.random,32)
  var %click5.loop 1
  while (%click5.loop <= %click5.number) { 
    var %click5.output = $calc(%click5.output + $gettok(%click5.random, %click5.loop,32))
    inc %click5.loop
  }
  var %click5.loop2 2
  var %click5.calculation $gettok(%click5.random,1,32)
  while (%click5.loop2 <= %click5.number) {
    var %click5.calculation = %click5.calculation$gettok(%click5.random, %click5.loop2, 32)
    inc %click5.loop2
  }
  if ($did(dice,23) == 0) {
    did -i dice 30 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,23) = %click5.output
      }
      else { 
        echo -a You must enter a channel name [of a channel you're on] for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation + $did(dice,23) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,24) = %click5.output
    inc %loghelp
  }
  else {
    if ($left($did(dice,23),1) == $chr(45)) { 
      var %click5.output = $calc(%click5.output $did(dice,23))
    }
    else {
      var %click5.output = $calc(%click5.output + $did(dice,23))
    }
    did -i dice 30 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,23) = %click5.output
      }
      else { 
        echo -a You must enter a channel name [of a channel you're on] for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation $chr(32) + $did(dice,23) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,24) = %click5.output
    inc %loghelp
  }
}
 
 
 
 
 
 
on 1:dialog:dice:sclick:2: {
  var %click5.random $($str($($rand(1,6),0) $chr(32),$did(dice, 16)),3)
  var %click5.number $numtok(%click5.random,32)
  var %click5.loop 1
  while (%click5.loop <= %click5.number) { 
    var %click5.output = $calc(%click5.output + $gettok(%click5.random, %click5.loop,32))
    inc %click5.loop
  }
  var %click5.loop2 2
  var %click5.calculation $gettok(%click5.random,1,32)
  while (%click5.loop2 <= %click5.number) {
    var %click5.calculation = %click5.calculation$gettok(%click5.random, %click5.loop2, 32)
    inc %click5.loop2
  }
  if ($did(dice,24) == 0) {
    did -i dice 31 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,24) = %click5.output
      }
      else { 
        echo -a You must enter a channel name [of a channel you're on] for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation + $did(dice,24) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,25) = %click5.output
    inc %loghelp
  }
  else {
    if ($left($did(dice,24),1) == $chr(45)) { 
      var %click5.output = $calc(%click5.output $did(dice,24))
    }
    else {
      var %click5.output = $calc(%click5.output + $did(dice,24))
    }
    did -i dice 31 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,24) = %click5.output
      }
      else { 
        echo -a You must enter a channel name [of a channel you're on] for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation $chr(32) + $did(dice,24) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,25) = %click5.output
    inc %loghelp
  }
}
 
on 1:dialog:dice:sclick:3: {
  var %click5.random $($str($($rand(1,8),0) $chr(32),$did(dice, 17)),3)
  var %click5.number $numtok(%click5.random,32)
  var %click5.loop 1
  while (%click5.loop <= %click5.number) { 
    var %click5.output = $calc(%click5.output + $gettok(%click5.random, %click5.loop,32))
    inc %click5.loop
  }
  var %click5.loop2 2
  var %click5.calculation $gettok(%click5.random,1,32)
  while (%click5.loop2 <= %click5.number) {
    var %click5.calculation = %click5.calculation$gettok(%click5.random, %click5.loop2, 32)
    inc %click5.loop2
  }
  if ($did(dice,25) == 0) {
    did -i dice 32 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,25) = %click5.output
      }
      else { 
        echo -a You must enter a channel name [of a channel you're on] for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation + $did(dice,25) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,26) = %click5.output
    inc %loghelp
  }
  else {
    if ($left($did(dice,25),1) == $chr(45)) { 
      var %click5.output = $calc(%click5.output $did(dice,25))
    }
    else {
      var %click5.output = $calc(%click5.output + $did(dice,25))
    }
    did -i dice 32 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,25) = %click5.output
      }
      else { 
        echo -a You must enter a channel name [of a channel you're on] for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation $chr(32) + $did(dice,25) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,26) = %click5.output
    inc %loghelp
  }
}
 
 
on 1:dialog:dice:sclick:4: {
  var %click5.random $($str($($rand(1,10),0) $chr(32),$did(dice, 18)),3)
  var %click5.number $numtok(%click5.random,32)
  var %click5.loop 1
  while (%click5.loop <= %click5.number) { 
    var %click5.output = $calc(%click5.output + $gettok(%click5.random, %click5.loop,32))
    inc %click5.loop
  }
  var %click5.loop2 2
  var %click5.calculation $gettok(%click5.random,1,32)
  while (%click5.loop2 <= %click5.number) {
    var %click5.calculation = %click5.calculation$gettok(%click5.random, %click5.loop2, 32)
    inc %click5.loop2
  }
  if ($did(dice,26) == 0) {
    did -i dice 33 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,26) = %click5.output
      }
      else { 
        echo -a You must enter a channel name [of a channel you're on] for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation + $did(dice,26) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,27) = %click5.output
    inc %loghelp
  }
  else {
    if ($left($did(dice,26),1) == $chr(45)) { 
      var %click5.output = $calc(%click5.output $did(dice,26))
    }
    else {
      var %click5.output = $calc(%click5.output + $did(dice,26))
    }
    did -i dice 33 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,26) = %click5.output
      }
      else { 
        echo -a You must enter a channel name [of a channel you're on] for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation $chr(32) + $did(dice,26) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,27) = %click5.output
    inc %loghelp
  }
}
 
on 1:dialog:dice:sclick:5: {
  var %click5.random $($str($($rand(1,12),0) $chr(32),$did(dice, 19)),3)
  var %click5.number $numtok(%click5.random,32)
  var %click5.loop 1
  while (%click5.loop <= %click5.number) { 
    var %click5.output = $calc(%click5.output + $gettok(%click5.random, %click5.loop,32))
    inc %click5.loop
  }
  var %click5.loop2 2
  var %click5.calculation $gettok(%click5.random,1,32)
  while (%click5.loop2 <= %click5.number) {
    var %click5.calculation = %click5.calculation$gettok(%click5.random, %click5.loop2, 32)
    inc %click5.loop2
  }
  if ($did(dice,27) == 0) {
    did -i dice 34 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,27) = %click5.output
        did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,27) = %click5.output
        inc %loghelp
      }
      else { 
        echo -a You must enter a channel name [of a channel you're on] for the 'Say' function to work properly.
        did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,27) = %click5.output
        inc %loghelp
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation + $did(dice,27) = %click5.output
      did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,27) = %click5.output
      inc %loghelp
    }
  }
  else {
    if ($left($did(dice,27),1) == $chr(45)) { 
      var %click5.output = $calc(%click5.output $did(dice,27))
    }
    else {
      var %click5.output = $calc(%click5.output + $did(dice,27))
    }
    did -i dice 34 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,27) = %click5.output
      }
      else { 
        echo -a You must enter a channel name [of a channel you're on] for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation $chr(32) + $did(dice,27) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,27) = %click5.output
    inc %loghelp
  }
}
 
on 1:dialog:dice:sclick:42: {
  var %click5.random $($str($($rand(1, $did(dice,38)),0) $chr(32),$did(dice, 37)),3)
  var %click5.number $numtok(%click5.random,32)
  var %click5.loop 1
  while (%click5.loop <= %click5.number) { 
    var %click5.output = $calc(%click5.output + $gettok(%click5.random, %click5.loop,32))
    inc %click5.loop
  }
  var %click5.loop2 2
  var %click5.calculation $gettok(%click5.random,1,32)
  while (%click5.loop2 <= %click5.number) {
    var %click5.calculation = %click5.calculation$gettok(%click5.random, %click5.loop2, 32)
    inc %click5.loop2
  }
  if ($did(dice,28) == 0) {
    did -i dice 40 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,28) = %click5.output
      }
      else { 
        echo -a You must enter a channel name [of a channel you're on] for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation + $did(dice,39) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,39) = %click5.output
    inc %loghelp
  }
  else {
    if ($left($did(dice,39),1) == $chr(45)) { 
      var %click5.output = $calc(%click5.output $did(dice,39))
    }
    else {
      var %click5.output = $calc(%click5.output + $did(dice,39))
    }
    did -i dice 40 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,39) = %click5.output
      }
      else { 
        echo -a You must enter a channel name for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation $chr(32) + $did(dice,39) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,39) = %click5.output
    inc %loghelp
  }
}
 
 
on 1:dialog:dice:sclick:6: {
  var %click5.random $($str($($rand(1,20),0) $chr(32),$did(dice, 20)),3)
  var %click5.number $numtok(%click5.random,32)
  var %click5.loop 1
  while (%click5.loop <= %click5.number) { 
    var %click5.output = $calc(%click5.output + $gettok(%click5.random, %click5.loop,32))
    inc %click5.loop
  }
  var %click5.loop2 2
  var %click5.calculation $gettok(%click5.random,1,32)
  while (%click5.loop2 <= %click5.number) {
    var %click5.calculation = %click5.calculation$gettok(%click5.random, %click5.loop2, 32)
    inc %click5.loop2
  }
  if ($did(dice,28) == 0) {
    did -i dice 35 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,28) = %click5.output
      }
      else { 
        echo -a You must enter a channel name [of a channel you're on] for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation + $did(dice,28) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,28) = %click5.output
    inc %loghelp
  }
  else {
    if ($left($did(dice,28),1) == $chr(45)) { 
      var %click5.output = $calc(%click5.output $did(dice,28))
    }
    else {
      var %click5.output = $calc(%click5.output + $did(dice,28))
    }
    did -i dice 35 1 %click5.output
    if ($did(dice,14).state == 1) { 
      if ($me ison $did(dice,21)) { 
        msg $did(dice,21) %click5.calculation $chr(32) + $did(dice,28) = %click5.output
      }
      else { 
        echo -a You must enter a channel name for the 'Say' function to work properly.
      }
    }
    if ($did(dice,13).state == 1) { 
      echo -a %click5.calculation $chr(32) + $did(dice,28) = %click5.output
    }
    did -i dice 29 %loghelp %click5.calculation $chr(32) + $did(dice,28) = %click5.output
    inc %loghelp
  }
}
 

Comments

  (1)  RSS
Ghost-writer
Comments: 255
 
mIRC Snippet:  Dice Script
Posted on Jul 25, 2009 6:24 pm
WTH all this for on:TEXT:!dice:#: msg $chan rand(1,50)

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom