All pastes #208990 Raw Edit

Something

public text v1 · immutable
#208990 ·published 2006-10-18 23:19 UTC
rendered paste body
  if ( $2 = bar ) {

    %bars = $readini(injustice.ini, $nick, bars)

    if ( %bars <= 10 ) { %barearn = $rand(1,32)
    elseif ( %bars <= 20 ) %barearn = $rand(1,24)
    elseif ( %bars <= 30 ) %barearn = $rand(1,16)
    elseif ( %bars <= 40 ) %barearn = $rand(1,12)
    elseif ( %bars <= 50 ) %barearn = $rand(1,8)
    elseif ( %bars <= 60 ) %barearn = $rand(1,6)
    elseif ( %bars <= 70 ) %barearn = $rand(1,3)
    elseif ( %bars <= 80 ) %barearn = $rand(1,2)
    elseif ( %bars <= 90 ) %barearn = $rand(1,2)
    else ( %bars <= 100 ) %barearn = 1

    if ( %barearn == 1 ) {
      set %barmoney $calc( $rand(1,20) * %bars )
      msg %chan You worked a long night at the bar and earned your self %barmoney $+ .
      set %bars $calc( $readini(injustice.ini, $nick, bars) + 1 )
      set %money $calc( $readini(injustice.ini, $nick, money) + %barmoney )
      writeini -n injustice.ini $nick bars %bars
      writeini -n injustice.ini $nick money %money
    }

    elseif (%barearn > 1) {
      msg %chan You worked a long night and earned no tips!
      set %bars $calc( $readini(injustice.ini, $nick, bars) + $rand(0,1) )
      writeini -n injustice.ini $nick bars %bars
    }

  }