Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:load:{
- echo -a 9,1Thanks for Loading Liths Raffle! :P Pretty easy to use, right click on the chat channel, and select "IRC Raffle" and then "Start Raffle". Answer any questions it might have. You may also change options, report raffle status, and even modify the raffle itself.
- echo -a 7,1Modified by Anthrax after supapaint at the request of SpaceCat.
- set %irc_raffle_winner_delay 1
- set %irc_raffle_report_delay 2
- set %irc_raffle_winner.timelimit 1
- set %irc_raffle_maxclaim 2
- irc_raffle_resetlimituser
- }
- on *:text:claim:%irc_raffle_chan:{
- irc_raffle_winner.claim
- }
- on *:text:claim:?:{
- irc_raffle_winner.claim
- }
- on *:text:!available*:%irc_raffle_chan:{
- if (%irc_raffle_on == 0) { halt }
- set %user_name $nick
- irc_raffle_available.user
- }
- on *:text:!removeme:%irc_raffle_chan:{
- irc_raffle_removeme
- }
- on *:text:!raffle*:%irc_raffle_chan:{
- if (%irc_raffle_on == 0) { halt }
- set %irc_raffle_slotvariable 1- $+ %irc_raffle_slots
- if ($2 == $null) {
- msg %irc_raffle_chan 8,1 $nick $+ , to select a number, you need to go !raffle #, like !raffle 15, for number 15. Simply going !raffle will not work.
- halt
- }
- if ($2 !isnum %irc_raffle_slotvariable) {
- msg %irc_raffle_chan 9,1Sorry $nick $+ , that entry is outside of the range of this raffle, this raffle will only accept numbers between 1 and %irc_raffle_slots $+ .
- halt
- }
- set %x 1
- set %y $lines(slots.txt)
- while (%x <= %y) {
- set %irc_raffle_checknum $read(slots.txt,%x)
- set %irc_raffle_numb $gettok(%irc_raffle_checknum,1,46)
- set %irc_raffle_name $gettok(%irc_raffle_checknum,2,46)
- if ($nick == %irc_raffle_name) {
- msg %irc_raffle_chan 4,1 $+ $nick you 9,1Mubn, 4,1you already have a number, its %irc_raffle_numb
- halt
- }
- else {
- inc %x
- }
- }
- irc_raffle $1-
- }
- alias irc_raffle_create {
- set %irc_raffle_entries 0
- set %irc_raffle_prize $4-
- set %irc_raffle_on 1
- set %irc_raffle_slots $1
- set %irc_raffle_time $2
- set %irc_raffle_numwinners $3
- set %x 1
- write -c slots.txt
- while (%x <= %irc_raffle_slots) {
- write slots.txt %x $+ . $+ irc_noname
- inc %x
- }
- set %irc_raffle_start $asctime(h:nn)
- set %irc_raffle_truetime $ctime
- set %irc_raffle_end $calc(%irc_raffle_truetime + (%irc_raffle_time * 60))
- set %irc_raffle_endseconds %irc_raffle_end
- set %ampmend $asctime(%irc_raffle_end,TT)
- set %irc_raffle_end_date $asctime(%irc_raffle_end,m/d/yy)
- set %irc_raffle_end $asctime(%irc_raffle_end,h:nn)
- set %ampmstart $asctime(TT)
- set %irc_raffle_start_date $asctime(m/d/yy)
- msg %irc_raffle_chan 9,1Raffle started! Raffle will be for $+ %irc_raffle_prize $+ , 9,1and we have %irc_raffle_slots slots open! Start picking your numbers. Pick with !raffle followed by the number you would like. Valid numbers are between 1 and %irc_raffle_slots $+ .
- msg %irc_raffle_chan 9,1Raffle Started at %irc_raffle_start $+ %ampm on %irc_raffle_start_date and will continue for %irc_raffle_time minute(s). Raffle will end at %irc_raffle_end %ampmend on %irc_raffle_end_date $+ .
- set %timer $calc($2 * 60)
- set %timer2 $calc(%irc_raffle_report_delay * 60)
- timerircraffle 1 %timer irc_raffle_stopraffle
- timerircrafflereport 0 %timer2 irc_raffle_report
- }
- alias irc_raffle_stopraffle {
- timerircrafflereport off
- set %irc_raffle_on 0
- msg %irc_raffle_chan 9,1Raffle is over! A winner will be selected in %irc_raffle_winner_delay minute(s).
- set %timer_winner $calc(%irc_raffle_winner_delay * 60)
- timerrafflewinner 1 %timer_winner irc_raffle_winner
- }
- alias irc_raffle {
- set %user_number $2
- set %user_name $nick
- set %irc_raffle_checknum $read(slots.txt,$2)
- set %irc_raffle_numb $gettok(%irc_raffle_checknum,1,46)
- set %irc_raffle_name $gettok(%irc_raffle_checknum,2,46)
- set %x $2
- if (%irc_raffle_name == irc_noname) {
- write $+(-l,%x) slots.txt %irc_raffle_numb $+ . $+ %user_name
- msg %irc_raffle_chan 9,1User %user_name is now set to number %irc_raffle_numb in the raffle.
- inc %irc_raffle_entries
- }
- else {
- msg %irc_raffle_chan 4,1Sorry9,1 %user_name $+ 4,1, 12,1 $+ %irc_raffle_name 4,1has already 8,1Jacked 4,1the winning number!!!
- irc_raffle_available.user
- }
- }
- alias irc_raffle_available.user {
- set %x 1
- set %y $lines(slots.txt)
- set %z $null
- set %true 1
- set %irc_raffle_longmessage 0
- set %irc_raffle_listmessage 75
- set %irc_raffle_msglenth 0
- while (%x <= %y) {
- set %irc_raffle_checknum $read(slots.txt,%x)
- set %irc_raffle_numb $gettok(%irc_raffle_checknum,1,46)
- set %irc_raffle_name $gettok(%irc_raffle_checknum,2,46)
- if (%irc_raffle_name == irc_noname) {
- if (%true == 1) {
- inc %true
- set %z %irc_raffle_numb
- inc %x
- inc %irc_raffle_msglenth
- }
- else {
- set %z %z $+ , %irc_raffle_numb
- inc %irc_raffle_msglenth
- if (%irc_raffle_msglenth == %irc_raffle_listmessage) {
- if ((%irc_raffle_msglenth > 74) && (%irc_raffle_msglenth < 150)) {
- notice %user_name 9,1Currently, the available numbers are %z
- }
- else {
- notice %user_name 9,1 $+ %z
- }
- set %irc_raffle_listmessage $calc(%irc_raffle_listmessage + 75)
- set %irc_raffle_longmessage 1
- set %true 1
- }
- inc %x
- }
- }
- else {
- inc %x
- }
- }
- if ((%irc_raffle_longmessage == 1) && (%irc_raffle_msglenth > 75)) {
- notice %user_name 9,1 $+ %z $+ .
- }
- elseif (%irc_raffle_msglenth == 75) {
- halt
- }
- else {
- notice %user_name 9,1Currently, the available numbers are %z $+ .
- }
- }
- alias irc_raffle_available {
- set %x 1
- set %y $lines(slots.txt)
- set %z $null
- set %true 1
- set %irc_raffle_longmessage 0
- set %irc_raffle_listmessage 75
- set %irc_raffle_msglenth 0
- while (%x <= %y) {
- set %irc_raffle_checknum $read(slots.txt,%x)
- set %irc_raffle_numb $gettok(%irc_raffle_checknum,1,46)
- set %irc_raffle_name $gettok(%irc_raffle_checknum,2,46)
- if (%irc_raffle_name == irc_noname) {
- if (%true == 1) {
- inc %true
- set %z %irc_raffle_numb
- inc %x
- inc %irc_raffle_msglenth
- }
- else {
- set %z %z $+ , %irc_raffle_numb
- inc %irc_raffle_msglenth
- if (%irc_raffle_msglenth == %irc_raffle_listmessage) {
- if ((%irc_raffle_msglenth > 74) && (%irc_raffle_msglenth < 150)) {
- msg %irc_raffle_chan 9,1Currently, the available numbers are %z
- }
- else {
- msg %irc_raffle_chan 9,1 $+ %z
- }
- set %irc_raffle_listmessage $calc(%irc_raffle_listmessage + 75)
- set %irc_raffle_longmessage 1
- set %true 1
- }
- inc %x
- }
- }
- else {
- inc %x
- }
- }
- if ((%irc_raffle_longmessage == 1) && (%irc_raffle_msglenth > 75)) {
- msg %irc_raffle_chan 9,1 $+ %z $+ .
- }
- elseif (%irc_raffle_msglenth == 75) {
- halt
- }
- else {
- msg %irc_raffle_chan 9,1Currently, the available numbers are %z $+ .
- }
- }
- alias irc_raffle_winner {
- set %irc_raffle_on 0
- set %irc_raffle_numwinners.temp 0
- set %irc_raffle_numwinners.true 1
- while (%irc_raffle_numwinners.true <= %irc_raffle_numwinners) {
- inc %irc_raffle_numwinners.temp
- inc %irc_raffle_numwinners.true
- set %winner_numb $rand(1,%irc_raffle_slots)
- set %irc_winner $read(slots.txt,%winner_numb)
- set %irc_winner_name $gettok(%irc_winner,2,46)
- set %x 1
- while ((%irc_winner_name == irc_noname) && (%x < 5000)) {
- set %winner_numb $rand(1,%irc_raffle_slots)
- set %irc_winner $read(slots.txt,%winner_numb)
- set %irc_winner_name $gettok(%irc_winner,2,46)
- inc %x
- }
- if ((%x < 5000) && (%irc_raffle_numwinners == 1)) {
- msg %irc_raffle_chan 4,1And our winner is....8,1 $+ %irc_winner_name $+ 9,1! Congrats! 8,1 %irc_winner_name 9,1won with number 8,1 %winner_numb $+ .
- write $+(-l,%winner_numb) slots.txt %winner_numb $+ . $+ irc_noname
- set %irc_winnerlist %irc_winner_name
- }
- elseif ((%x < 5000)) {
- if (%irc_raffle_numwinners.temp == 1) {
- msg %irc_raffle_chan 9,1And our first winner is.... $+ %irc_winner_name $+ ! Congrats! %irc_winner_name won with number %winner_numb $+ .
- write $+(-l,%winner_numb) slots.txt %winner_numb $+ . $+ irc_noname
- set %irc_winnerlist %irc_winner_name $+ .
- }
- if ((%irc_raffle_numwinners.temp > 1) && (%irc_raffle_numwinners.temp < %irc_raffle_numwinners)) {
- msg %irc_raffle_chan 9,1And our next winner is.... $+ %irc_winner_name $+ ! Congrats! %irc_winner_name won with number %winner_numb $+ .
- write $+(-l,%winner_numb) slots.txt %winner_numb $+ . $+ irc_noname
- set %irc_winnerlist %irc_winnerlist $+ %irc_winner_name $+ .
- }
- if ((%irc_raffle_numwinners.temp > 1) && (%irc_raffle_numwinners.temp == %irc_raffle_numwinners)) {
- msg %irc_raffle_chan 9,1And our last winner is.... $+ %irc_winner_name $+ ! Congrats! %irc_winner_name won with number %winner_numb $+ .
- write $+(-l,%winner_numb) slots.txt %winner_numb $+ . $+ irc_noname
- set %irc_winnerlist %irc_winnerlist $+ %irc_winner_name
- }
- }
- else {
- msg %irc_raffle_chan 9,1No Valid Winner Found, either nobody claimed the prizes and nobody is left, or nobody entered the raffle.
- ; timer* off
- halt
- }
- }
- msg %irc_raffle_chan 4,1Please type 9,1"Claim" 4,1here or msg me 9,1"Claim" 4,1to claim your prize. 9,1You have %irc_raffle_winner.timelimit minute(s) to claim your prize before another winner is selected. Please note, if you won more then once, please message me for each win.
- irc_raffle_winner.timelimit
- }
- alias irc_raffle_removeme {
- set %irc_raffle_removeme.name $nick
- var %irc_num 1
- set %irc_raffle_lines $lines(slots.txt)
- set %irc_raffle_checknum $read(slots.txt,%irc_num)
- while (%irc_num <= %irc_raffle_lines) {
- set %irc_raffle_checknum $read(slots.txt,%irc_num)
- set %irc_raffle_name $gettok(%irc_raffle_checknum,2,46)
- set %irc_raffle_numb $gettok(%irc_raffle_checknum,1,46)
- if (%irc_raffle_name == %irc_raffle_removeme.name) {
- write $+(-l,%irc_num) slots.txt %irc_raffle_numb $+ . $+ irc_noname
- inc %irc_raffle_entries -1
- msg %irc_raffle_chan 9,1Removing %irc_raffle_name $+ 's entry from the raffle. Please note, number %irc_raffle_numb is now available.
- halt
- }
- else {
- inc %irc_num
- }
- }
- msg %irc_raffle_chan 9,1Unable to find an entry for user $nick $+ .
- }
- alias irc_raffle_remove {
- set %x $1
- set %irc_raffle_checknum $read(slots.txt,%x)
- set %irc_raffle_numb $gettok(%irc_raffle_checknum,1,46)
- set %irc_raffle_name $gettok(%irc_raffle_checknum,2,46)
- if (%irc_raffle_name != irc_noname) {
- write $+(-l,%x) slots.txt %irc_raffle_numb $+ . $+ irc_noname
- inc %irc_raffle_entries -1
- msg %irc_raffle_chan 9,1Removing %irc_raffle_name $+ 's entry from the raffle. Please note, number %irc_raffle_numb is now available.
- }
- else {
- echo -a 4Error: Nobody currently has number %x selected for the raffle, therefore you cannot remove them from it.
- }
- }
- alias irc_raffle_options {
- set %irc_raffle_winner_delay $?="How many minutes would you like to wait after a raffle stops accepting entries, to auto-select a winner?"
- set %irc_raffle_report_delay $?="How many minutes between reports to the channel would you like there to be, on the status of the raffle? (Time Left, Entries Accepted, Ect)"
- set %irc_raffle_winner.timelimit $?="How many minutes would you like to grant the winner of a raffle to contact the bot, before forcing a new winner?"
- }
- alias irc_raffle_stop {
- timerircraffle off
- timerrafflewinner off
- timerircrafflereport off
- set %irc_raffle_on 0
- msg %irc_raffle_chan 9,1Raffle has been stopped. No winner will be auto-selected.
- }
- alias irc_raffle_report {
- set %irc_raffle_endtime %irc_raffle_endseconds
- set %irc_raffle_current_time $ctime
- set %irc_raffle_minleft $calc((%irc_raffle_endtime - %irc_raffle_current_time) / 60)
- set %irc_raffle_mins $round(%irc_raffle_minleft,0)
- if (%irc_raffle_mins < 1) { set %irc_raffle_mins less then one }
- msg %irc_raffle_chan 9,1R8,1a4,1f13,1f11,1l12,1e 9,1in Progress for 7,1 $+ %irc_raffle_prize $+ 9,1. There are currently 8,1 %irc_raffle_entries 9,1entries with a max of 8,1 %irc_raffle_slots 9,1entries. This raffle will end at 8,1 %irc_raffle_end %ampmend 9,1on 8,1 %irc_raffle_end_date $+ 9,1, which is in 8,1 %irc_raffle_mins 9,1minute(s). To Enter the raffle, simply type "7,1!raffle9,1" followed by the number you would like to have for the drawing.
- }
- alias irc_raffle_addslots {
- set %irc_raffle_addslots $?="How many slots would you like to add to the raffle?"
- set %x $calc(%irc_raffle_slots + 1)
- set %irc_raffle_slots $calc(%irc_raffle_slots + %irc_raffle_addslots)
- while (%x <= %irc_raffle_slots) {
- write slots.txt %x $+ . $+ irc_noname
- inc %x
- }
- msg %irc_raffle_chan 9,1Slots have been added to the raffle! The raffle now has a total of %irc_raffle_slots slots.
- }
- alias irc_raffle_restart {
- set %irc_raffle_restart_slots $lines(slots.txt)
- set %irc_raffle_on 1
- set %irc_raffle_time $?="How long untill you would like this restarted raffle to stop?"
- set %irc_raffle_start $asctime(h:nn)
- set %irc_raffle_truetime $ctime
- set %irc_raffle_end $calc(%irc_raffle_truetime + (%irc_raffle_time * 60))
- set %irc_raffle_endseconds %irc_raffle_end
- set %ampmend $asctime(%irc_raffle_end,TT)
- set %irc_raffle_end_date $asctime(%irc_raffle_end,m/d/yy)
- set %irc_raffle_end $asctime(%irc_raffle_end,h:nn)
- set %ampmstart $asctime(TT)
- set %irc_raffle_start_date $asctime(m/d/yy)
- msg %irc_raffle_chan 9,1Raffle started! Raffle will be for $+ %irc_raffle_prize $+ , and we have %irc_raffle_slots slots open! Start picking your numbers. Pick with !raffle followed by the number you would like. Valid numbers are between 1 and %irc_raffle_slots $+ .
- msg %irc_raffle_chan 9,1Raffle Started at %irc_raffle_start $+ %ampm on %irc_raffle_start_date and will continue for %irc_raffle_time minute(s). Raffle will end at %irc_raffle_end %ampmend on %irc_raffle_end_date $+ .
- set %timer $calc(%irc_raffle_time * 60)
- set %timer2 $calc(%irc_raffle_report_delay * 60)
- timerircraffle 1 %timer irc_raffle_stopraffle
- timerircrafflereport 0 %timer2 irc_raffle_report
- msg $chan 9,1Past Raffle Entries as follows:
- set %xyz !who
- irc_raffle_who
- }
- alias irc_raffle_report_reset {
- set %irc_raffle_report_delay $?="How many minutes between delays to the channel would you like?"
- set %timer2 $calc(%irc_raffle_report_delay * 60)
- timerircrafflereport 0 %timer2 irc_raffle_report
- }
- alias irc_raffle_winner.timelimit {
- set %irc_winner.tokens %irc_raffle_numwinners
- set %irc_x 1
- set %irc_raffle_winner.time $calc(%irc_raffle_winner.timelimit * 60)
- while (%irc_x <= %irc_winner.tokens) {
- set %timer.token $gettok(%irc_winnerlist,%irc_x,46)
- $+(timer,%timer.token) 1 %irc_raffle_winner.time irc_raffle_winner.reset %timer.token
- inc %irc_x
- }
- }
- alias irc_raffle_winner.reset {
- set %irc_winner.nick $1
- set %irc_winner.tokens %irc_raffle_numwinners
- ; set %irc_x 1
- ; set %irc_raffle_winner.time $calc(%irc_raffle_winner.timelimit * 60)
- ; while (%irc_x <= %irc_winner.tokens) {
- ; set %timer.token $gettok(%irc_winnerlist,%irc_x,46)
- ; if (%irc_winner.tokens == 1) {
- ; set %winner.reset %timer.token
- ; }
- ; elseif ((%irc_winner.tokens > 1) && (%irc_x != %irc_winner.tokens)) {
- ; set %winner.reset %winner.reset %+ , %timer.token
- ; }
- ; elseif (%irc_x == %irc_winner.tokens) {
- ; set %winner.reset %winner.reset and %timer.token
- ; }
- ; inc %irc_x
- ; }
- msg %irc_raffle_chan 9,1Winner %irc_winner.nick failed to message the bot in the allotted time. New winner will now be drawn.
- set %irc_raffle_numwinners 1
- irc_raffle_winner
- set %irc_raffle_numwinners %irc_winner.tokens
- }
- alias irc_raffle_winner.claim {
- set %irc_raffle_winner.claim $nick
- set %irc_raffle_winner.limit $readini Raffle.ini Maxclaims %irc_raffle_winner.claim
- if (%irc_raffle_winner.limit == $null) {
- set %irc_raffle_winner.limit 0
- }
- if (%irc_raffle_maxclaim <= %irc_raffle_winner.limit) {
- msg %irc_raffle_chan 4,1The winner %irc_raffle_winner.claim cannot claim this prize due to reaching the maxclaim limit already.
- msg %irc_raffle_winner.claim 4,1Sorry, you cannot claim this prize because you reached the max claim limit.
- halt
- }
- var %irc_temp $timer(%irc_raffle_winner.claim)
- if (%irc_temp != $null) {
- $+(timer,%irc_raffle_winner.claim) off
- msg %irc_raffle_winner.claim 9,1Prize Claimed.
- msg %irc_raffle_chan 9,1Winner %irc_raffle_winner.claim has claimed their prize.
- inc %irc_raffle_winner.limit
- writeini Raffle.ini Maxclaims %irc_raffle_winner.claim %irc_raffle_winner.limit
- inc %irc_raffle_numwinners -1
- set %irc_x 1
- while (%irc_x <= %irc_winner.tokens) {
- set %timer.token $gettok(%irc_winnerlist,%irc_x,46)
- if (%timer.token == %irc_raffle_winner.claim) {
- set %timer.token $deltok(%timer.token,%irc_x,46)
- halt
- }
- else {
- inc %irc_x
- }
- }
- }
- else {
- msg %irc_raffle_winner.claim 9,1Error: Name not detected as a winner.
- }
- }
- alias irc_raffle_resetlimituser {
- remini Raffle.ini Maxclaims
- echo -a 4,1Claim count for users has been reset.
- .msg %irc_raffle_chan 4,1Claim count for users has been reset.
- }
- alias irc_raffle_maxlimit {
- if ($1 == $null) {
- echo -a 4,1Max claims can't be null
- halt
- }
- set %irc_raffle_maxclaim $1
- msg %irc_raffle_chan 7,1Max claims has been set to9 $1
- echo -a 7,1Max claims has been set to9 $1
- }
- alias irc_raffle_addtime {
- }
- menu channel,status {
- IRC Raffle
- .Start Raffle: irc_raffle_create $?="How many Slots would you like in the raffle?" $?="How many minutes would you like the raffle to last?" $?="How many winners will there be in this raffle?" $?="What is it you are raffling off?" | set %irc_raffle_chan $chan
- .Stop Raffle: irc_raffle_stop
- .Restart a Stopped Raffle (this includes disconnects): irc_raffle_restart
- .Modify Max Claims: irc_raffle_maxlimit $?="How many max claims do you want to be set?"
- .Reset User Claim Amount: irc_raffle_resetlimituser
- .Modify Raffle
- ..Remove Entry: irc_raffle_remove $?="What number entry would you like to remove?"
- ..Add Slots: irc_raffle_addslots
- ..Randomly Select A New/Another Winner: set %irc_raffle_numwinners $$?="How many winners would you like to pick?" | irc_raffle_winner
- .Report Commands
- ..Raffle Status: irc_raffle_report
- ..Ajust Report Delay To Channel: irc_raffle_report_reset
- ..All Numbers Currently Open: irc_raffle_available
- .Options:
- ..Settings: irc_raffle_options
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement