Advertisement
westor

Givaway addon for Aotik v1.0

Jan 18th, 2015
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.79 KB | None | 0 0
  1. ON !*:TEXT:*:#: {
  2.   if (%giveawaystart_ [ $+ [ $chan ] ]) {
  3.     if ($1 == %giveawaymsg_ [ $+ [ $chan ] ]) {
  4.       if ($read(Raffle_ $+ $chan $+ .txt,nw,$nick)) { msg # ( $+ $nick $+ ): You are already into the list! | return }
  5.       write Raffle_ $+ $chan $+ .txt $nick
  6.       msg # ( $+ $nick $+ ): You have been added to the list.
  7.     }
  8.   }
  9.   if ($1 == !giveawayend) {
  10.     if (!%giveawaystart_ [ $+ [ $chan ] ]) { msg # ( $+ $nick $+ ): There is NOT any giveaway at the moment! | return }
  11.     var %user = $read(Raffle $+ _ $+ $chan $+ .txt,n)
  12.     if ($nick isop #) {
  13.       unset %giveawaystart_ [ $+ [ $chan ] ]
  14.       unset %giveawaymsg_ [ $+ [ $chan ] ]
  15.       unset %giveawaynick_ [ $+ [ $chan ] ]
  16.       if (%user) {
  17.         msg # ( $+ $nick $+ ): Giveaway has ended, the winner is: %user
  18.         if ($isfile(Raffle_ $+ $chan $+ .txt)) { .remove $qt(Raffle_ $+ $chan $+ .txt) }
  19.       }
  20.       else { msg # ( $+ $nick $+ ): There is NOT any winner available }
  21.     }
  22.     elseif ($nick !isop #) { msg # ( $+ $nick $+ ): You are NOT an channel operator! }
  23.   }
  24.   if ($1 == !giveawaystart) {
  25.     if ($nick isop #) {
  26.       if ($2) {
  27.         if (%giveawaystart_ [ $+ [ $chan ] ]) { msg # ( $+ $nick $+ ): There is an other giveaway at the moment! | return }
  28.         set -e %giveawaystart_ [ $+ [ $chan ] ] On
  29.         set -e %giveawaymsg_ [ $+ [ $chan ] ] $2
  30.         set -e %giveawaynick_ [ $+ [ $chan ] ] $nick
  31.         msg # ( $+ $nick $+ ): Giveaway started, the word/phrase to join is $qt($2)
  32.         if ($isfile(Raffle_ $+ $chan $+ .txt)) { .remove $qt(Raffle_ $+ $chan $+ .txt) }
  33.       }
  34.       elseif (!$2) { msg # ( $+ $nick $+ ): Please enter a word for the giveaway trigger. }
  35.     }
  36.     elseif ($nick !isop #) { msg # ( $+ $nick $+ ): You are NOT an channel operator! }
  37.   }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement