Advertisement
westor

BET Module (Modified) for FuryRang v2.0

Feb 10th, 2015
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 6.68 KB | None | 0 0
  1. ON !*:TEXT:*:#: {
  2.   tokenize 32 $strip($1-,burci)
  3.   if ($1 == !bet) {
  4.     if (!$check_mod($nick,$chan)) { .msg $chan ( $+ $nick $+ ): Error, You are NOT an channel moderator! | return }
  5.     if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Try again and enter the correct value, more info at !bethelp | return }
  6.     if ($2 == open) || ($2 == start) || ($2 == on) {
  7.       if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
  8.       if (%bet) { .msg $chan ( $+ $nick $+ ): Error, There is already an BET running try again later or use !bet stop to stop the bet! | return }
  9.       set -e %bet $nick $chan
  10.       .msg $chan ( $+ $nick $+ ): The BET has been started, use now !beton 1 or !beton 2 to enter the bet.
  11.     }
  12.     if ($2 == stop) || ($2 == end) || ($2 == off) {
  13.       if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
  14.       if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
  15.       unset %bet_win %bet_lose %bet %bet_pause
  16.       .msg $chan ( $+ $nick $+ ): The BET has been stopped.
  17.     }
  18.     if ($2 == resume) {
  19.       if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
  20.       if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
  21.       if (!%bet_pause) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any bet paused since now! | return }
  22.       unset %bet_pause
  23.       .msg $chan ( $+ $nick $+ ): The BET has been resumed.
  24.     }
  25.     if ($2 == pause) {
  26.       if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
  27.       if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
  28.       if (%bet_pause) { .msg $chan ( $+ $nick $+ ): Error, The BET is already paused! | return }
  29.       set -e %bet_pause $nick
  30.       .msg $chan ( $+ $nick $+ ): The BET has been paused.
  31.     }
  32.     if ($2 == result) || ($2 == results) {
  33.       if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
  34.       if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
  35.       if (!$3) { .msg $chan ( $+ $nick $+ ): Error, Try again and enter the result win or lose . | return }
  36.       if ($3 == 1) {
  37.         if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
  38.         .msg $chan ( $+ $nick $+ ) The BET has been stopped to option 1..
  39.         if (!%bet_win) { .msg $chan ( $+ $nick $+ ): There is NOT any user bet at 1. }
  40.         elseif (%bet_win) { .msg $chan ( $+ $nick $+ ): The BET nick(s) are %bet_win - (Total: $numtok(%bet_win,44) $+ ) }
  41.         if (%bet_lose) { bet_delpoints $chan %bet_lose }
  42.         unset %bet_win %bet_lose %bet %bet_pause
  43.       }
  44.       if ($3 == 2) {
  45.         if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
  46.         .msg $chan ( $+ $nick $+ ) The BET has been stopped to option 2..
  47.         if (!%bet_lose) { .msg $chan ( $+ $nick $+ ): There is NOT any user bet at 2. }
  48.         elseif (%bet_lose) { .msg $chan ( $+ $nick $+ ): The BET nick(s) are %bet_lose - (Total: $numtok(%bet_lose,44) $+ ) }
  49.         if (%bet_win) { bet_addpoints $chan %bet_win }
  50.         unset %bet_win %bet_lose %bet %bet_pause
  51.       }
  52.     }
  53.   }
  54.   if ($1 == !beton) {
  55.     if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
  56.     if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
  57.     if (%bet_pause) { return }
  58.     if ($2 == 1) {
  59.       if ($istok(%bet_win,$nick,44)) { .msg $chan ( $+ $nick $+ ): Error, You have already bet at 1! | return }
  60.       if ($istok(%bet_lose,$nick,44)) { set -e %bet_lose $remtok(%bet_lose,$nick,1,44) | var %ch = 1 }
  61.       set -e %bet_win $addtok(%bet_win,$nick,44)
  62.       .msg $chan ( $+ $nick $+ ): You $iif(%ch,have change your,have) bet at 1. - Good luck!
  63.     }
  64.     elseif ($2 == 2) {
  65.       if ($istok(%bet_lose,$nick,44)) { .msg $chan ( $+ $nick $+ ): Error, You have already bet at 2! | return }
  66.       if ($istok(%bet_win,$nick,44)) { set -e %bet_win $remtok(%bet_win,$nick,1,44) | var %ch = 1 }
  67.       set -e %bet_lose $addtok(%bet_lose,$nick,44)
  68.       .msg $chan ( $+ $nick $+ ): You $iif(%ch,have change your,have) bet at 2. - Good luck!
  69.     }
  70.   }
  71.   if ($1 == !remove) {
  72.     if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
  73.     if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
  74.     if (%bet_pause) { return }
  75.     if ($istok(%bet_lose,$nick,44)) { set -e %bet_lose $remtok(%bet_lose,$nick,1,44) | .msg $chan ( $+ $nick $+ ): You have been removed from the bet at 2! }
  76.     elseif ($istok(%bet_win,$nick,44)) { set -e %bet_win $remtok(%bet_win,$nick,1,44) | .msg $chan ( $+ $nick $+ ): You have been removed from the bet at 1! }
  77.     else { .msg $chan ( $+ $nick $+ ): Error, You have NOT bet yet! }
  78.   }
  79.   if ($1 == !results) || ($1 == !stats) {
  80.     if (!$check_mod($nick,$chan)) { .msg $chan ( $+ $nick $+ ): Error, You are NOT an channel moderator! | return }
  81.     if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
  82.     if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
  83.     if (%bet_pause) { return }
  84.     .msg $chan ( $+ $nick $+ ): Bet(s) at 1: $iif(%bet_win,$numtok(%bet_win,44),0)
  85.     .msg $chan ( $+ $nick $+ ): Bet(s) at 2: $iif(%bet_lose,$numtok(%bet_lose,44),0)
  86.     .msg $chan ( $+ $nick $+ ): Total Bet(s): $calc($iif(%bet_win,$numtok(%bet_win,44),0) + $iif(%bet_lose,$numtok(%bet_lose,44),0))
  87.   }
  88.   if ($1 == !mybet) {
  89.     if (%bet) && ($gettok(%bet,2,32) !== $chan) { return }
  90.     if (!%bet) { .msg $chan ( $+ $nick $+ ): Error, There is NOT any BET running try again later or use !bet open to start a new bet! | return }
  91.     if (%bet_pause) { return }
  92.     if ($istok(%bet_lose,$nick,44)) { .msg $chan ( $+ $nick $+ ): You have bet at lose! }
  93.     elseif ($istok(%bet_win,$nick,44)) { .msg $chan ( $+ $nick $+ ): You have bet at win! }
  94.     else { .msg $chan ( $+ $nick $+ ): Error, You have NOT bet yet! }
  95.   }
  96.   if ($1 == !bethelp) { .msg $chan ( $+ $nick $+ ): BET Commands are: !Bet open - !Bet stop - !Bet pause - !Bet resume - !Bet result 1/2 - !Beton 1 - !Beton 2 - !remove - !results - !mybet }
  97. }
  98.  
  99. alias check_mod {
  100.   if (!$1) { return }
  101.   if (!$2) { return }
  102.   if ($me !ison $2) { return 0 }
  103.   if ($1 !ison $2) { return 0 }
  104.   var %f = mods.txt
  105.   if (!$isfile(%f)) { return 0 }
  106.   if (!$lines(%f)) { return 0 }
  107.   var %r = $read(%f,nw,$1)
  108.   if (%r) { return 1 }
  109.   elseif (!%r) { return 0 }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement