Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:join:#scripting: {
- notice $nick Welcome to scripting! Type 4lottoregister to register your name in the lottery!
- }
- on *:text:!lottoregister:#scripting: {
- if (!%points $+ $nick) {
- set %points $+ $nick 5
- notice $nick You have registered successfully! You will start with 5 points. Type 4lottostart to start a lottery drawing!
- }
- elseif (%points $+ $nick) {
- echo -a You are already registered in the lottery.
- }
- }
- on *:text:!lottostart:#scripting: {
- if (%points $+ $nick) {
- msg # A lottery drawing has started! A ticket costs 1 point! To buy a ticket, 4!lottobuy.
- set %lottery on
- set %amount 5
- }
- }
- on *:text:!lottobuy:#scripting: {
- if (%amount > 0 && %points [ $+ [ $nick ] ] > 0 && %lottery == on && $nick !isin %people) {
- dec %points $+ $nick
- notice $nick You have successfully bought a ticket! You have %points [ $+ [ $nick ] ] points left!
- set %people %people $nick
- dec %amount
- msg # $nick has joined the lottery! There are %amount spots open!
- }
- elseif ($nick isin %people) {
- notice $nick You are already in the lottery
- }
- if (%amount == 0) {
- draw
- }
- elseif (%points $+ $nick < 1) {
- notice $nick You don't have enough points to join the lottery. You might be bankrupt, or you have haven't registered. To register, type 4!lottoregister. If you are bankrupt, contact Charmander.
- }
- }
- alias draw {
- unset %lottery
- set %winner $gettok(%people,$r(1,$numtok(%people,32)),32)
- set %winner $gettok(%people,$r(1,$numtok(%people,32)),32)
- msg # Drumroll please...
- timer 1 5 msg # %winner has won the lottery! They will get 5 points.
- inc %points [ $+ [ %winner ] ] 5
- unset %amount
- unset %people
- unset %lottery
- unset %winner
- }
- on *:text:!lottoscore:#scripting: {
- notice $nick You have %points [ $+ [ $nick ] ] points!
- }
Advertisement
Add Comment
Please, Sign In to add comment