Guest User

Untitled

a guest
Jul 21st, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.49 KB | None | 0 0
  1. on *:text:!dd *:#USDicee: {
  2.   ; You can remove the first two IF lines if you don't care about checking if the nicks are on the channel.
  3.   if ($nick isvoice #dicing_ttg || $nick isreg #dicing_ttg) { msg $chan Only halfop or higher can start a duel. | return }
  4.   if ($2 !ison $chan) { msg $chan $2 is not a valid nick. | halt }
  5.   if ($3 !ison $chan) { msg $chan $3 is not a valid nick. | halt }
  6.   if (!$4) { msg $chan Invalid format.  Use: !dd nick1 nick2 reward | halt }
  7.   set %dd $2 $3 $4
  8.   msg $chan 8,1 Dice duel between $2 and $3 ; Type !roll.
  9.     .timerDD 1 300 EndDD
  10. }
  11. on *:text:!roll:#USDicee: {
  12.   if (!%dd) { msg $chan 8,1 No duel in progress. | halt }
  13.   if (!$istok(%dd,$nick,32)) { msg $chan You are not one of the duelists. | halt }
  14.   if ($($+(%,ddr.,$nick),2)) { msg $chan You have already rolled. | halt }
  15.   var %r = $rand(2,12), %d1 = $gettok(%dd,1,32), %d2 = $gettok(%dd,2,32), %p = $gettok(%dd,3,32)
  16.   set %ddr. $+ $nick %r
  17.   msg $chan 8,1 $nick rolled a %r $+ .
  18.   var %r1 = $($+(%,ddr.,$gettok(%dd,1,32)),2), %r2 = $($+(%,ddr.,$gettok(%dd,2,32)),2)
  19.   if (%r1 && %r2) {
  20.     if (%r1 > %r2) { msg $chan 8,1 %d1 won the %p pot with a %r1 $+ - $+ %r2 $+ . }
  21.     elseif (%r2 > %r1) { msg $chan 8,1 %d2 won the %p pot with a %r2 $+ - $+ %r1 $+ . }
  22.     else { msg $chan 8,1 %d1 and %d2 tied with a %r1 $+ - $+ %r2 $+ . }
  23.     unset %dd
  24.     unset %ddr.*
  25.     .timerDD off
  26.   }
  27. }
  28. alias EndDD {
  29.   msg $chan  The duel ran out of time and has been ended.
  30.   unset %dd
  31.   unset %ddr.*
  32. }
Add Comment
Please, Sign In to add comment