level

By artcore.essencz on Apr 11, 2009

.level - see your level
.level nick - see level (nick)
.toplevel - level top

if person stay channel he's get experience, 50 lvl = auto voice, 100 lvl = auto op.

on *:START: {
  hmake level
  hmake level.uptime
  hload level $qt($scriptdir $+ level.txt)
}
on *:TEXT:*:#: {
  if $1 == .level {
    var %n = $iif($2,$2,$nick)
    if $hget(level.uptime,$+($chan,.,%n)) {
      hinc level $+($chan,.,%n) $calc($ctime - $hget(level.uptime,$+($chan,.,%n)))
      hadd level.uptime $+($chan,.,%n) $ctime
    }
    if $hget(level,$+($chan,.,%n)) {
      var %l = $iif($hget(level,$+($chan,.,%n)),$ifmatch,0), %e = %l
      while (%e > 3600) dec %e 3600
      .describe $chan 12 $+ $nick $+ : 06 $+ $iif($2 && $2 != $nick,This user 12 $+ $2 $+ $chr(32)) $+ 06 $+ level is 04 $+ $round($iif(%l,$calc($ifmatch / 3600),0),0) $+  06[experience:03 $+ %l $+ 06] Enhancing the experience 03+ $+ %e $+  06[03,03 $+ $str($chr(35),$round($calc(%e / 3600 * 9),0)) $+ 14,14 $+ $chr(35) $+ 15,15 $+ $str($chr(35),$round($calc(9 - %e / 3600 * 9),0)) $+ 06], Prior to the next level is 02 $+ $calc(3600 - %e) 06experience $+ 
    }
    else { .describe $chan 12 $+ $nick $+ : 06I have no information, $iif(!$2 || $2 == $nick,your level,about the level of user3 $2) $+  }
  }
  elseif $left($1,9) == .toplevel {
    .fopen -no toplevel $qt($scriptdir $+ toplevel.txt)
    var %i = 1, %l = $hget(level,0).item, %t = $iif($right($1,-9) > 10,$v1,10), %w = $calc(%t - 9), %o
    while %i <= %l {
      if $gettok($hget(level,%i).item,1- $+ $calc($numtok($hget(level,%i).item,46) - 1),46) == $chan { .fwrite -n toplevel $gettok($hget(level,%i).item,-1,46) $hget(level,$hget(level,%i).item) }
      inc %i
    }
    .fclose toplevel
    filter -euffct 2 32 $qt($scriptdir $+ toplevel.txt) $qt($scriptdir $+ toplevel.txt)
    while %w <= %t {
      if $read($qt($scriptdir $+ toplevel.txt),n,%w) { set %o %o 12 $+ $ord(%w) $+ . 03 $+ $gettok($ifmatch,1,32) $+  12(04 $+ $round($calc($gettok($ifmatch,2,32) / 3600),0) $+ 12)(06 $+ $gettok($ifmatch,2,32) $+ 12) }
      inc %w
    }
    .describe $chan 06Top $+ %t level $+ $iif(%o,: %o,$chr(32) None...)
  }
}
on *:JOIN:#: {
  var %l = $calc($hget(level,$+($chan,.,$nick)) / 3600)
  hadd level.uptime $+($chan,.,$nick) $ctime
  if %l > 100 { .describe $chan 12 $+ $nick 06You have already received03 100 06LVL and more, you now have 03auto-op1! 06Type .level to view!
mode $chan +o $nick }
  elseif %l > 50 { .describe $chan 12 $+ $nick 06You have already received03 50 06LVL and more, you now have 03auto-voice1! 06Type .level to view!
  mode $chan +v $nick }
}
on *:PART:#:hinc level $+($chan,.,$nick) $calc($ctime - $hget(level.uptime,$+($chan,.,$nick))) | hdel level.uptime $+($chan,.,$nick)
on *:NICK: {
  var %i = 1
  while ($comchan($newnick,%i)) {
    hinc level $+($ifmatch,.,$nick) $calc($ctime - $hget(level.uptime,$+($ifmatch,.,$nick)))
    hdel level.uptime $+($ifmatch,.,$nick)
    hadd level.uptime $+($ifmatch,.,$newnick) $ctime
    inc %i
  }
}
on *:QUIT: {
  var %i = 1
  while ($comchan($nick,%i)) {
    hinc level $+($ifmatch,.,$nick) $calc($ctime - $hget(level.uptime,$+($ifmatch,.,$nick)))
    hdel level.uptime $+($ifmatch,.,$nick)
    inc %i
  }
}
on *:PING:hsave level $qt($scriptdir $+ level.txt)
raw 353:*: {
  var %i = 4, %n
  while (%i <= $0) {
    set %n $gettok($1-,%i,32)
    hadd level.uptime $+($3,.,$iif($left(%n,1) isin $prefix,$right(%n,-1),%n)) $ctime
    inc %i
  }
}

Comments

Sign in to comment.
Eugenio   -  Apr 12, 2009

rofl

 Respond  
fraguk   -  Apr 12, 2009

quote [if person stay channel he's get experience]

It would help if you used proper english to explain what exactly the script is ment to do.

 Respond  
94killerz   -  Apr 12, 2009

Does this auto-voice/op work on unregistered nicks?

 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.