Basic Lotto Script

By MitchellGled on Feb 11, 2012

!lottostart
!clotto
!lotto
!draw
!lot on
!lot off

;/* Edit Below to change the theme */
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)
  }
}

Comments

Sign in to comment.
[Plornt]   -  Nov 02, 2013

This is my script from Torn...

Its been modified though... someone has broken it. Why would you do that?

 Respond  
Stewie1k94   -  Feb 14, 2012

My bot does have an info script, !info [TornID] :P

 Respond  
Tripple-D   -  Feb 14, 2012

who is ynot2413
i cant see im in fed

 Respond  
Stewie1k94   -  Feb 13, 2012

MitchellGled that's not your ID! Your spelling is too good, no offence Ynot2413, but your spelling is crap compared to his. ;)

 Respond  
ynot2413   -  Feb 13, 2012

MitchellGled
1608165 that my id whats up

 Respond  
MitchellGled   -  Feb 12, 2012

1608165

 Respond  
kushman420TC   -  Feb 12, 2012

torn id MitchellGled?

 Respond  
Spoof   -  Feb 11, 2012
  else msg $chan $settings(6,$nick,$chan)
}

}
alias lottoend {

should look like:

  else msg $chan $settings(6,$nick,$chan)
}

}
} <----- note the close brace for the end of the events. This is a must have in order for the alias "lottoend" to work.
alias lottoend { <--- Plus all alias touch the far left side in the editor... no spacing, but that was because of the missing brace above.

 Respond  
Stewie1k94   -  Feb 11, 2012

I don't give a monkey's who's script it is, the point is, it shouldn't be posted by the imbecile who posted it.

 Respond  
Wade   -  Feb 11, 2012

Well whoevers script it is, its not gunna work. You have alias in an event. They should be separate blocks of code

 Respond  
Stewie1k94   -  Feb 11, 2012

Whatever

 Respond  
MitchellGled   -  Feb 11, 2012

know i posted it so other people can find it out easier

 Respond  
Stewie1k94   -  Feb 11, 2012

This script isn't yours...

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.