alias theme return 3
alias settings {
if ($1 == 1) return $theme $+ $+ $3 has just started a lotto for $4 $+ . $iif($5,The lotto will end in $5 minutes.)
elseif ($1 == 2) return $theme $+ $+ $2 $+ , no lotto is running in $3 at the moment.
elseif ($1 == 3) return $theme $+ $+ $2 $+ , you cannot enter your own lotto's. That would be cheating
.
elseif ($1 == 4) return $theme $+ $+ $2 $+ , you are already in the lotto at postion $3 $+ .
elseif ($1 == 5) return $theme $+ $+ $2 $+ , you are now in the lotto at position $3 $+ .
elseif ($1 == 6) return $theme $+ $+ $2 $+ , You are not lotto starter or there is no lotto to draw at this moment.
elseif ($1 == 7) return $theme $+ Picking a nick name out at random...
elseif ($1 == 8) return $theme $+ Well done to $3 who won a $4 in $2 $+ !
elseif ($1 == 9) return $theme $+ A lotto has already been started. Please end that one before starting a new one.
elseif ($1 == 10) return $theme $+ $2 you have canceled the current lotto in progress.
elseif ($1 == 11) return $theme $+ You do not have the correct permissions to do this.
elseif ($1 == 12) return $theme $+ There is not enough people in the lotto to start.
}
;/* Edit above to change messages etc. Look at the example text to see what corisponds to what */
on *:TEXT:*:#:{
if ($1-2 == !lot off) && ($nick($chan,$nick,~&@)) {
msg $chan Lotto disabled for $chan $+ .
set %lotto.off [ $+ [ $chan ] ] on
}
if ($1-2 == !lot on) && ($nick($chan,$nick,~&@)) {
msg $chan Lotto enabled for $chan $+ .
unset %lotto.off [ $+ [ $chan ] ]
}
if (!%lotto.off [ $+ [ $chan ] ]) {
if ($1 == !lottostart) {
if (!$readini(lottos.ini,n,$chan,prize)) {
if ($regex($($+($,$0),2),/\(([0-9]+?)\)/)) {
var %prize $($+($,2- $+ $calc($0 - 1)),2)
msg $chan $settings(1,$chan,$nick,$($+($,$calc($0 - 1)),2),$regml(1))
.timerLottoEnd. $+ $chan 1 $calc($regml(1) * 60) lottoEnd $chan
}
else msg $chan $settings(1,$chan,$nick,$2-)
writeini -n lottos.ini $chan prize $iif(%prize,$v1,$2-)
writeini -n lottos.ini $chan user $nick
}
else msg $chan $settings(9)
}
elseif ($1 == !clotto) {
if ($nick($chan,$nick,&~)) {
if ($readini(lottos.ini,n,$chan,prize)) {
.timerLottoEnd. $+ $chan off
remini lottos.ini $chan
write -c lotto $+ $chan $+ .txt
msg $chan $settings(10,$chan,$nick)
}
else msg $chan $settings(2)
}
else msg $chan $settings(11)
}
elseif ($1 == !lotto) {
if ($readini(lottos.ini,n,$chan,prize)) {
if ($readini(lottos.ini,$chan,user) != $nick) {
if (!$read($+(lotto,$chan,.txt),s,$nick)) {
write $+(lotto,$chan,.txt) $nick 1
msg $chan $settings(5,$nick,$lines($+(lotto,$chan,.txt)))
}
else msg $chan $settings(4,$nick,$readn)
}
else msg $chan $settings(3,$nick)
}
else msg $chan $settings(2,$nick,$chan)
}
elseif ($1 == !draw) {
if ($readini(lottos.ini,n,$chan,prize)) && (($readini(lottos.ini,$chan,user) == $nick) || $nick($chan,$nick,&~)) {
lottoEnd $chan
}
else msg $chan $settings(6,$nick,$chan)
}
}
alias lottoend {
if ($lines($+(lotto,$1,.txt)) >= 3) {
var %txt $+(lotto,$1,.txt)
var %rand $read(%txt,$r(1,$lines(%txt)))
msg $1 $settings(7)
.timer 1 3 msg $1 $settings(8,$1,$gettok(%rand,1,32),$readini(lottos.ini,n,$chan,prize))
remini lottos.ini $1
write -c %txt
}
else msg $1 $settings(12,$1)
}
}