Lottery problems - 05/02/15 08:32 AM
Hey guys i've been trying to learn programming lately and have set up a points system and some other smaller features for my twitch stream. I've been working on a random lottery feature so every few mins it selects a random viewer and says you have won the random lottery you win 50 points (random number out of selected few) and writes it to the points.ini file. this is what i got so far
Would rather the lottery start when the bot starts but not sure how to do that.
Thanks malko
Code:
on *:text:!startlottery:#:{ $+(.timerlottery.,#,.,$nick) 0 60 add.pts $+(#,.,$nick) if ($nick isop #) { msg # [Lottery]: $nick(#,$rand(1,$nick(#,0))) You have just won the random lottery } else on !*:part:#:$+(.timerlottery.,#,.,$nick) off alias -l add.pts { writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points /set %rand $rand(1,10) { if (%rand == 1) { /msg $chan You win 5 points } elseif (%rand == 2) { /msg $chan You win 10 points } elseif (%rand == 3) { /msg $chan You win 20 points } elseif (%rand == 4) { /msg $chan You win 30 points } elseif (%rand == 5) { /msg $chan You win 40 points } elseif (%rand == 6) { /msg $chan You win 50 points } elseif (%rand == 7) { /msg $chan You win 60 points } elseif (%rand == 8) { /msg $chan You win 70 points } elseif (%rand == 9) { /msg $chan You win 80 points } elseif (%rand == 10) { /msg $chan You win 90 points } else { /msg $chan You win 150 points } } } }
Would rather the lottery start when the bot starts but not sure how to do that.
Thanks malko