Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;!start treating (prize here) to start a giveaway.
- ;!trickortreat - to join the giveaway
- ;!end treating - to end the giveaway.
- alias starttreat {
- if ($lines($+(treats.,$1,.txt))) {
- msg $1 Now drawing to win $2 $+ 's prize of $3- $+ ...
- var %randnick $gettok($read($+(treats.,$1,.txt),$rand(1,$lines($+(treats.,$1,.txt)))),1,32)
- .notice $2 %randnick won your prize of $3- $+ .
- .timer 1 3 msg $1 Well done to %randnick who just won the prize of $3-
- write -c $+(treats.,$1,.txt)
- }
- else msg $1 Unfortunatly no one entered the treating...
- }
- on *:TEXT:*:#:{
- if ($me == BooBbot) {
- if ($1-2 == !trickortreat) {
- if ($($+(%,treat.,$chan),2) == on) {
- if (!$read($+(treats.,$chan,.txt),s,$nick)) {
- write $+(treats.,$chan,.txt) $nick 1
- echo -a $read($+(treats.,$chan,.txt),s,$nick)
- msg $chan $+ $nick has joined the treat, you're entry number $lines($+(treats.,$chan,.txt)) $+ . Treating will end in $duration($timer(.treat. $+ $chan).secs) $+ .
- }
- else msg $chan $+ $nick you are already in the current giveaway.
- }
- else msg $chan $+ $nick there is no trick or treating going on at the moment.
- }
- elseif ($1 == !help) {
- .notice $nick Commands are: !start trickortreating prize - To add a prize, !end trickortreating - To end the current treating session, !trickortreat - To try your luck at winning.
- }
- elseif ($2 == trickortreating) {
- if ($nick($chan,$nick,@&~)) {
- if ($1 == !start) {
- if ($($+(%,treat.,$chan),2) != on) {
- if ($3) {
- set $+(%,treat.,$chan) on
- msg $chan $+ $nick is giving out a treat of $3- $+ . Type !trickortreat to try your luck.
- .timer.treat. $+ $chan 1 180 starttreat $chan $nick $3-
- }
- else msg $chan You need to specify a prize.
- }
- else msg $chan $+ $nick there is already a treat going on. It will end in $duration($timer(.treat. $+ $chan).secs) $+ .
- }
- elseif ($1 == !end ) {
- if ($($+(%,treat.,$chan),2) == on) {
- set $+(%,treat.,$chan) off
- .timer.treat. $+ $chan -e
- }
- else msg $chan $+ $nick there is no treating going on at the moment.
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement