Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:text:.ldrules:#scripting,#mildeep: {
- 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.
- 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.
- }
- alias enders return Charmander Daenym JupiterDjinn
- on *:text:.ldskip:#scripting,#mildeep: {
- if (%round != on && %ld.ld == on && $findtok($enders,$nick,32)) {
- .timer* off
- trans
- }
- }
- on *:text:.ldstart:#scripting,#mildeep: {
- set %ld.chan #
- if (%ld.ld != on) {
- set %ld.ld on
- msg # A Liar's Dice game was started by $+(04,$nick,,.) To join, type 04.ldjoin.
- msg # Signups end in 0430 seconds!
- .timer 1 30 trans
- addplayer # $nick
- }
- else msg # There is already a game going on!
- }
- alias trans {
- if ($numtok(%ld.players,32) >= 2) {
- set %ld.round on
- set %ld.it $gettok(%ld.players,$r(1,$numtok(%ld.players,32)),32)
- msg %ld.chan Time is up, and it is time to bid! $+(04,%ld.it,,) will go first!
- }
- else {
- msg %ld.chan Not enough players! Game over.
- unset %ld.*
- halt
- }
- tokenize 32 %ld.players
- var %ld.count 1
- while ($0 >= %ld.count) {
- notice $ [ $+ [ %ld.count ] ] Your dice rolls are $+(04,%ld.dice [ $+ [ $ [ $+ [ %ld.count ] ] ] ],,.)
- inc %ld.count
- }
- msg %ld.chan To bid, type 04.ldbid <quantity> <face>.
- }
- on *:text:.ldjoin:#scripting,#mildeep:if (!%ld.round && !$findtok(%ld.players,$nick,32) && %ld.ld == on) addplayer # $nick
- on $*:text:/^(\.ldbid (\d|\d\d) \d)$/Si:#scripting,#mildeep: {
- 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)))) {
- set %ld.bid $2 $3
- set %ld.person $nick
- set %ld.lie $iif($findtok(%ld.total,$3,0,32) >= $2,true,false)
- msg # $+(04,$nick,) claims there are $+(04,$2,) dice numbered $+(04,$3,,!)
- setturn
- }
- }
- on *:text:.ldbs:#scripting,#mildeep: {
- if (%ld.person != $nick && %ld.person && $findtok(%ld.players,$nick,32) && %ld.round == on) {
- msg # $+(04,$iif(%ld.lie == false,$nick,%ld.person),) wins the round!
- unset %ld.*
- }
- }
- on *:text:.lddice:#scripting,#mildeep:if ($findtok(%ld.players,$nick,32)) notice $nick $+(04,$nick,'s) dice are $+(04,%ld.dice [ $+ [ $nick ] ],,!)
- on *:text:.ldend:#scripting,#mildeep: {
- if (%ld.ld == on && $findtok($enders,$nick,32)) {
- msg # The game was ended by $+(04,$nick,,.) To start a new game, type 04.ldstart.
- unset %ld.*
- halt
- }
- }
- alias setturn {
- if ($findtok(%ld.players,%ld.it,32) == $numtok(%ld.players,32)) set %ld.it $gettok(%ld.players,1,32)
- else set %ld.it $gettok(%ld.players,$calc($findtok(%ld.players,%ld.it,32)+1),32)
- msg %ld.chan It is $+(04,%ld.it,,'s) turn!
- }
- 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),)
- alias addplayer {
- msg # $+(04,$nick,) has joined the game!
- set %ld.players %ld.players $nick
- set %ld.dice [ $+ [ $nick ] ] $sorttok($r(1,6) $r(1,6) $r(1,6) $r(1,6) $r(1,6),32,n)
- set %ld.total %ld.total %ld.dice [ $+ [ $nick ] ]
- }
Add Comment
Please, Sign In to add comment