[color=blue]I haven't written a script for a few months since my bot broke down, and I was really mad, but I'm starting it again and by vote my users chose the newest command to be a lottery one.
Now I'm still not very good at scripting, but this is a really good one for me, even though it doesn't really use any advance scripts.
Also, thanks to Shadowmajestic, admin of
http://www.revpermin.com/ for helping me with the if statement in the !joinlottery part.
Anyways, this is how it works!!!
Here are user commands...
*!lottery
Gives info about the lottery
*!startlottery
Pms the owner to start it
*!joinlottery
Once the lottery has started, to 'submit a ballot with your name on it'
*!admin
If they've won, can choose this to be admin for the day
*!box
If they've won, can choose the mystery box (filled with 6 different things, 3 of which are nothing)
Bot's Commands
Right click anywhere in channel and choose Lottery>On. This will start it.
Right click anywhere in channel and choose Lottery>Off. This will end it.
FEATURES
Pretty lame preset mystery box choices etc.
Security so someone can't submit their name twice, or when it's off.
Security so you don't get a "mystery box" or "Admin" message from non-winners
Everything already done for you, for the FULLY AUTOMATED system to work, all you have to do is Right Click>Lottery>On, and everything will be doen for you.
No changes in the code, either;this means you don't have to edit the code
AT ALL unless you choose to edit something.
Hope you enjoy :D
on *:LOAD:{
remove box.txt | write box.txt You have won the $me Administrator for a week! | write box.txt You have won Infinite $me V.I.P Spot-This means your suggestions will be highly valued and I'll try my best to listen to your commands. | write box.txt You have won the Admin for a Day | write box.txt You have won Nothing, sorry. | write box.txt You have won Nothing, sorry. | write box.txt You have won Nothing, sorry. }
menu channel {
Lottery
.On:set %lottery on | echo 7LOTTERY IS ON | amsg 3-4[ $me ]3-12The lottery has started!!! You have 5 minutes to join! To join, just type 3!joinlottery4 and to learn more about the lottery type 3!lottery | timer 1 10 set %winner $read(lottery.txt) | timer 1 300 amsg 3-4[ $me ]3-12The lottery has ended! The winner is.......4 %winner | timer 1 305 msg %winner Congratulations, %winner -you have won the lottery! Now, you can either choose to be a $me admin for a day, or choose the Mystery Box!(It's filled with good and bad things, the one chosen is completly random!) To be admin, type 3!admin4 and to choose the Mystery Box type 3!box | timer 1 301 set %lottery off | timer 1 310 remove lottery.txt
.Off:set %lottery off | echo 7LOTTERY IS OFF
}
on *:TEXT:!joinlottery:#:{
if ($read(lottery.txt,w,$nick)) { halt }
if (%lottery == on) { write lottery.txt $nick | notice $nick You have been added to the list }
}
on *:TEXT:!startlottery:#:{ msg $me 3-4[ $me ]3-12 $nick from $chan has requested that you start the lottery!
}
on *:TEXT:!lottery:#:{
msg $nick 3-4[ $me ]3-12The Lottery is a fun, simple, and interactive command on $me
msg $nick 3-4[ $me ]3-12To begin the lottery, I must activate it. If you feel like having a lotter, type 3!startlottery4 This will not automatically start it, but it will tell me that you have said this.
msg $nick 3-4[ $me ]3-12If I choose to start it, every channel I'm on will be alerted of such. You have 5 minutes to type 3!joinlottery4 and to join it, there's no cost. You can't submit your name twice, I've made precautions against this.
msg $nick 3-4[ $me ]3-12After 5 minutes, a name will be randomly selected from those submitted, and all the channels will be alerted of the winner. The winner will get a message, offering either admtxtstrationship for a day, or a mystery box. They can type 3!admin4 or 3!box
}
on *:TEXT:!admin:#:{
if ($nick == %winner) { msg $me 3-4[ $me ]3-12 $nick from $chan was the winner from the lottery, and chose the !admin command. | msg $nick You're request has been sent. }
on *:TEXT:!box:#:{
if ($nick == %winner) {
set %box $read(box.txt) | msg $me 3-4[ $me ]3-12 $nick from $chan has won %box | msg $nick %bot
} }