Guest User

Untitled

a guest
Dec 10th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.59 KB | None | 0 0
  1. on *:text:.ldrules:#scripting,#mildeep: {
  2.   notice $nick Each player has two choices during his turn: make a higher bid, or challenge the previous bid as being wrong. The player may bid an increased quantity of any face, or the same quantity of a higher face.
  3.   notice $nick If the current player thinks the previous player's bid is wrong, he challenges it, and then all dice are revealed to determine whether the bid was valid. If the number of the relevant face revealed is at least as high as the bid, then the bid is valid, in which case the bidder wins.
  4. }
  5. alias enders return Charmander Daenym JupiterDjinn
  6. on *:text:.ldskip:#scripting,#mildeep: {
  7.   if (%round != on && %ld.ld == on && $findtok($enders,$nick,32)) {
  8.     .timer* off
  9.     trans
  10.   }
  11. }
  12. on *:text:.ldstart:#scripting,#mildeep: {
  13.   set %ld.chan #
  14.   if (%ld.ld != on) {
  15.     set %ld.ld on
  16.     msg # A Liar's Dice game was started by $+(04,$nick,,.) To join, type 04.ldjoin.
  17.     msg # Signups end in 0430 seconds!
  18.     .timer 1 30 trans
  19.     addplayer # $nick
  20.   }
  21.   else msg # There is already a game going on!
  22. }
  23. alias trans {
  24.   if ($numtok(%ld.players,32) >= 2) {
  25.     set %ld.round on
  26.     set %ld.it $gettok(%ld.players,$r(1,$numtok(%ld.players,32)),32)
  27.     msg %ld.chan Time is up, and it is time to bid! $+(04,%ld.it,,) will go first!
  28.   }
  29.   else {
  30.     msg %ld.chan Not enough players! Game over.
  31.     unset %ld.*
  32.     halt
  33.   }
  34.   tokenize 32 %ld.players
  35.   var %ld.count 1
  36.   while ($0 >= %ld.count) {
  37.     notice $ [ $+ [ %ld.count ] ] Your dice rolls are $+(04,%ld.dice [ $+ [ $ [ $+ [ %ld.count ] ] ] ],,.)
  38.     inc %ld.count
  39.   }
  40.   msg %ld.chan To bid, type 04.ldbid <quantity> <face>.
  41. }
  42. on *:text:.ldjoin:#scripting,#mildeep:if (!%ld.round && !$findtok(%ld.players,$nick,32) && %ld.ld == on) addplayer # $nick
  43. on $*:text:/^(\.ldbid (\d|\d\d) \d)$/Si:#scripting,#mildeep: {
  44.   if ((%ld.it == $nick) && (%ld.round == on) && ((!%ld.bid) || ($2 >= $gettok(%ld.bid,1,32) && $3 > $gettok(%ld.bid,2,32)) || ($2 > $gettok(%ld.bid,1,32) && $3 <= $gettok(%ld.bid,2,32)))) {
  45.     set %ld.bid $2 $3
  46.     set %ld.person $nick
  47.     set %ld.lie $iif($findtok(%ld.total,$3,0,32) >= $2,true,false)
  48.     msg # $+(04,$nick,) claims there are $+(04,$2,) dice numbered $+(04,$3,,!)
  49.     setturn
  50.   }
  51. }
  52. on *:text:.ldbs:#scripting,#mildeep: {
  53.   if (%ld.person != $nick && %ld.person && $findtok(%ld.players,$nick,32) && %ld.round == on) {
  54.     msg # $+(04,$iif(%ld.lie == false,$nick,%ld.person),) wins the round!
  55.     unset %ld.*
  56.   }
  57. }
  58. on *:text:.lddice:#scripting,#mildeep:if ($findtok(%ld.players,$nick,32)) notice $nick $+(04,$nick,'s) dice are $+(04,%ld.dice [ $+ [ $nick ] ],,!)
  59. on *:text:.ldend:#scripting,#mildeep: {
  60.   if (%ld.ld == on && $findtok($enders,$nick,32)) {
  61.     msg # The game was ended by $+(04,$nick,,.) To start a new game, type 04.ldstart.
  62.     unset %ld.*
  63.     halt
  64.   }
  65. }
  66. alias setturn {
  67.   if ($findtok(%ld.players,%ld.it,32) == $numtok(%ld.players,32)) set %ld.it $gettok(%ld.players,1,32)
  68.   else set %ld.it $gettok(%ld.players,$calc($findtok(%ld.players,%ld.it,32)+1),32)
  69.   msg %ld.chan It is $+(04,%ld.it,,'s) turn!
  70. }
  71. on *:text:.ldinfo:#scripting,#mildeep:if (%ld.ld == on) msg # Bid: $+(04,$iif(%ld.bid != $null,%ld.bid,0 0),,s) $chr(124) Turn: $+(04,%ld.it,) $chr(124) Players: $+(04,%ld.players,) $chr(124) Phase: $+(04,$iif(%ld.round == on,Bidding,Signups),)
  72. alias addplayer {
  73.   msg # $+(04,$nick,) has joined the game!
  74.   set %ld.players %ld.players $nick
  75.   set %ld.dice [ $+ [ $nick ] ] $sorttok($r(1,6) $r(1,6) $r(1,6) $r(1,6) $r(1,6),32,n)
  76.   set %ld.total %ld.total %ld.dice [ $+ [ $nick ] ]
  77. }
Add Comment
Please, Sign In to add comment