Guest User

Untitled

a guest
Apr 19th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1.  
  2. on *:TEXT:!dd*:#real_g_irl: .signal sig!dd $Nick $chan $1-
  3. on *:TEXT:!roll:#real_g_irl: .signal sig!roll $Nick $chan $1-
  4.  
  5. on *:SIGNAL:sig!dd:{
  6. var %nick = $1, %chan = $2
  7. tokenize 32 $3-
  8.  
  9. if (%roll_int) {
  10. notice %Nick I'm sorry but there is already a game going on. Please wait until the current game is finished.
  11. }
  12. elseif ($0 != 4) {
  13. notice %Nick You must first place a bet before you begin a dice game.
  14. }
  15. elseif ($4. !isnum 1-) {
  16. notice %nick You have placed an invalid bet. Bets must be a whole number of atleast 1 (one).
  17. }
  18. elseif ($2 !ison %chan) || ($3 !ison %chan) {
  19. notice %nick In order to start a dicing game, 4 $$+ $v1 $+  must be in the channel. Please try again.
  20. }
  21. elseif ($2 == $3) {
  22. notice %nick I'm sorry but you must specify two different players.
  23. }
  24. elseif (%nick isreg %chan) {
  25. notice %nick In order to start a dicing game, a rank must start the game. Please have a voice or higher start the game for you.
  26. }
  27. else {
  28. set -eu300 %roll_int %nick
  29. set -eu300 %roll_P1 $nick(%chan,$nick(%chan,$2))
  30. set -eu300 %roll_P2 $nick(%chan,$nick(%chan,$3))
  31. set -eu300 %roll_bet $4
  32. set -eu300 %roll_turn 1
  33. set -eu300 %roll_p1tot
  34.  
  35. msg %chan A dicing game between 4 $+ $2 $+  and 4 $+ $3 $+  has been started.
  36. msg %chan The wager is $4 $+ .
  37. msg %chan To begin rolling type 4 $+ !roll $+  to roll, starting with 4 $+ $2 $+  $+ . You may only roll once each.
  38. }
  39. }
  40.  
  41. on *:SIGNAL:sig!roll:{
  42. var %nick = $1, %chan = $2
  43. tokenize 32 $3-
  44.  
  45. if (%nick == %roll_P1) {
  46. if (%roll_turn == 1) {
  47. var %roll1 $r(1,6), %roll2 $r(1,6)
  48. set -eu300 %roll_p1tot $calc(%roll1 + %roll2)
  49. msg %chan %nick has rolled a %roll1 and a %roll2 $+ , adding up to a roll of %roll_p1tot $+ .
  50. inc %roll_turn
  51. }
  52. else {
  53. notice %Nick I'm sorry but it's not your turn.
  54. }
  55. }
  56. elseif (%nick == %roll_p2) {
  57. if (%roll_turn == 2) {
  58.  
  59. var %roll1 = $r(1,6), %roll2 = $r(1,6), %p1tot = %roll_p1tot, %p2tot = $calc(%roll1 + %roll2)
  60. var %c = $iif(%p1tot > %p2tot,doubled won against,$iif($v1 < $v2,lost lost against,kept tied with))
  61.  
  62. msg %chan %nick has rolled a %roll1 and a %roll2 $+ , adding up to a roll of %p2tot $+ .
  63. msg %chan %roll_p1 has $gettok(%c,2-,32) %nick $+ .
  64. msg %chan %roll_int has $gettok(%c,1,32) his/her bet of %roll_bet
  65. timer1 5 1 msg #real_g_irl The dicing game between 4 $+ %roll_P1 $+  and 4 $+ %roll_P2 $+  has ended. You may now play another game.
  66.  
  67. unset %roll_*
  68. }
  69. else {
  70. notice %Nick I'm sorry but it's not your turn.
  71. }
  72. }
  73. else {
  74. notice %nick I'm sorry but no one has placed a bet on you.
  75. }
  76. }
  77.  
  78. on *:INPUT:#: {
  79. if (!$ctrlenter) && (!$inpaste) {
  80. if ($1 == !dd) .signal sig!dd $me $chan $1-
  81. elseif ($1 == !roll) .signal sig!roll $me $chan $1-
  82. }
  83. }
Add Comment
Please, Sign In to add comment