All pastes #85998 Raw Edit

cellkyborg

public text v1 · immutable
·published 2006-07-12 12:09 UTC
rendered paste body
on *:text:.suzaide *:#: { 
  if (@ $+ $nick $+ @ isin %users.allow) {
    var %kom1 $gettok($3,1,58) 
    var %kom2 $gettok($3,2,58)
    if ($2) && ($4) && (%kom1 isnum 0-16) && (%kom2 isnum 0-16) {
      if (%kom1 == 15) && (%kom2 == 15) {
        write -s $+ $2 komandos.txt $2 $calc($read(komandos.txt,s,$2)+2)
        write -s $+ $4 komandos.txt $4 $calc($read(komandos.txt,s,$4)+2)
        msg $chan Baigesi rungtynes $2 $3 $4 $+ ! Lygiosios abi komandos gauna po 2 taskus!
        halt
      }
      if (%kom1 > %kom2) {
        write -s $+ $2 komandos.txt $2 $calc($read(komandos.txt,s,$2)+3)
        write -s $+ $4 komandos.txt $4 $calc($read(komandos.txt,s,$4)+1)
        msg $chan Baigesi rungtynes $2 $3 $4 $+ ! Laimejo $2 - gauna 3 taskus. $4 gauna 1 taska.
      }
      else { 
        write -s $+ $2 komandos.txt $2 $calc($read(komandos.txt,s,$2)+1)
        write -s $+ $4 komandos.txt $4 $calc($read(komandos.txt,s,$4)+3)
        Baigesi rungtynes $2 $3 $4 $+ ! Laimejo $4 - gauna 3 taskus. $2 gauna 1 taska.
      }
    }
  }
  else { msg $nick Jums nesuteikta teise naudoti sia komanda }
}