All pastes #399059 Raw Edit

Something

public text v1 · immutable
·published 2007-03-17 18:30 UTC
rendered paste body
alias update1 {
  var %x 1
  while ($read(mtusers.txt, %x)) {
    set %selled. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] $calc($rand(300,1000) * 40)
    if (%selled. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) > %tecos.1 [ $+ [ $gettok($read(mtusers.txt,%x),1,32)) {
      set %selled. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) %tecos.1 [ $+ [ $gettok($read(mtusers.txt,%x),1,32)
    }
    set %selled1. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] $calc($rand(300,1000) * 100)
    if (%selled1. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) > %tecos.2 [ $+ [ $gettok($read(mtusers.txt,%x),1,32)) {
      set %selled.1 [ $+ [ $gettok($read(mtusers.txt,%x),1,32) %tecos.2 [ $+ [ $gettok($read(mtusers.txt,%x),1,32)
    }
    set %selled2. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] $calc($rand(300,1000) * 120)
    if (%selled2. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) > %tecos.3 [ $+ [ $gettok($read(mtusers.txt,%x),1,32)) {
      set %selled2. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) %tecos.3 [ $+ [ $gettok($read(mtusers.txt,%x),1,32)
    }
    set %selled3. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] $calc($rand(300,1000) * 140)
    if (%selled3. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) > %tecos.4 [ $+ [ $gettok($read(mtusers.txt,%x),1,32)) {
      set %selled3. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) %tecos.4 [ $+ [ $gettok($read(mtusers.txt,%x),1,32)
    }
    set %selled.1. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] $calc(%selled. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] / 40)
    set %selled1.1. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] $calc(%selled1. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] / 100)
    set %selled2.1. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] $calc(%selled2. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] / 120)
    set %selled3.1. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] $calc(%selled3. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] / 140)
    dec %tecos.1 [ $+ [ $gettok($read(mtusers.txt,%x),1,32) %selled.1. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ]
    dec %tecos.2 [ $+ [ $gettok($read(mtusers.txt,%x),1,32) %selled1.1. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ]
    dec %tecos.3 [ $+ [ $gettok($read(mtusers.txt,%x),1,32) %selled2.1. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ]
    dec %tecos.4 [ $+ [ $gettok($read(mtusers.txt,%x),1,32) %selled3.1. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ]
    set %totalselled. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] $calc(%selled. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] + %selled1. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] + %selled2. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] + %selled3. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ])
    inc %money. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] $calc(%totalselled. [ $+ [ $gettok($read(mtusers.txt,%x),1,32) ] ] * $telecomshops($gettok($read(mtusers.txt,%x),1,32)))
    var %x $calc($readn + 1)
    if (%x >= $lines(mtusers.txt)) {
      halt
    }
  }
}