Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. ;!start treating (prize here) to start a giveaway.
  2. ;!trickortreat - to join the giveaway
  3. ;!end treating - to end the giveaway.
  4.  
  5. alias starttreat {
  6. if ($lines($+(treats.,$1,.txt))) {
  7. msg $1 Now drawing to win $2 $+ 's prize of $3- $+ ...
  8. var %randnick $gettok($read($+(treats.,$1,.txt),$rand(1,$lines($+(treats.,$1,.txt)))),1,32)
  9. .notice $2 %randnick won your prize of $3- $+ .
  10. .timer 1 3 msg $1 Well done to %randnick who just won the prize of $3-
  11. write -c $+(treats.,$1,.txt)
  12. }
  13. else msg $1 Unfortunatly no one entered the treating...
  14. }
  15. on *:TEXT:*:#:{
  16. if ($me == BooBbot) {
  17. if ($1-2 == !trickortreat) {
  18. if ($($+(%,treat.,$chan),2) == on) {
  19. if (!$read($+(treats.,$chan,.txt),s,$nick)) {
  20. write $+(treats.,$chan,.txt) $nick 1
  21. echo -a $read($+(treats.,$chan,.txt),s,$nick)
  22. msg $chan  $+ $nick has joined the treat, you're entry number $lines($+(treats.,$chan,.txt)) $+ . Treating will end in $duration($timer(.treat. $+ $chan).secs) $+ .
  23. }
  24. else msg $chan  $+ $nick you are already in the current giveaway.
  25. }
  26. else msg $chan  $+ $nick there is no trick or treating going on at the moment.
  27. }
  28. elseif ($1 == !help) {
  29. .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.
  30. }
  31. elseif ($2 == trickortreating) {
  32. if ($nick($chan,$nick,@&~)) {
  33. if ($1 == !start) {
  34. if ($($+(%,treat.,$chan),2) != on) {
  35. if ($3) {
  36. set $+(%,treat.,$chan) on
  37. msg $chan  $+ $nick is giving out a treat of $3- $+ . Type !trickortreat to try your luck.
  38. .timer.treat. $+ $chan 1 180 starttreat $chan $nick $3-
  39. }
  40. else msg $chan You need to specify a prize.
  41. }
  42. else msg $chan  $+ $nick there is already a treat going on. It will end in $duration($timer(.treat. $+ $chan).secs) $+ .
  43. }
  44. elseif ($1 == !end ) {
  45. if ($($+(%,treat.,$chan),2) == on) {
  46. set $+(%,treat.,$chan) off
  47. .timer.treat. $+ $chan -e
  48. }
  49. else msg $chan  $+ $nick there is no treating going on at the moment.
  50. }
  51. }
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement