All pastes #948393 Raw Edit

Something

public text v1 · immutable
·published 2008-03-19 02:25 UTC
rendered paste body
;#########################################
;# raven's serial.dll CloudyServ Plugin ##
;# written just for HaOsLsE ;)          ##
;#########################################
;# i know its a rough and simple way to ##
;# do this, but it gets the job done!   ##
;#########################################

;begin reading the renlog for certain words..

on *:signal:FDSlog: {
  if ($2 == Serial && $3 == hash && $4 == response) {
    set %serialhash $strip($left($8,32))
    var %n = ($strip($6))
    %n = $nick.chk(%n)
    var %i = $_info(%n).id
;this loop checks to see if the player's serial is on the banlist or not
    var %d = 1
    while (%d <= $lines(bannedhashes.txt)) {
      if (%serialhash isin $read(bannedhashes.txt,%d)) { inc %d $lines(bannedhashes.txt) | renrem msg $s_n $6 $+ 's serial hash is on the ban list. | renrem 

kick %i }
      inc %d 1
    }
;this loop checks to see if the player's serial is already in the database or not, if it isnt it adds it
    var %y = 1
    while (%y <= $lines(player_serials.txt)) {
       if ($6 isin $read(player_serials.txt,%y)) { inc %y $lines(player_serials.txt) | halt }
       inc %y 1
    }
    write player_serials.txt $6 %serialhash
  }
;ending of reading the renlog.. time for commands!

alias _LEVELcmds {
  if ($1 == !gethash) { %lvl = $readini(rav_serial.ini,PERMS,gethash) }
  elseif ($1 == !lookuphash) { %lvl = $readini(rav_serial.ini,PERMS,lookuphash) }
  elseif ($1 == !banhash) { %lvl = $readini(rav_serial.ini,PERMS,banhash) }
  elseif ($1 == !unbanhash) { %lvl = $readini(rav_serial.ini,PERMS,unbanhash) }
  elseif ($1 == !addhash) { %lvl = $readini(rav_serial.ini,PERMS,addhash) }
}

on *:TEXT:*:#: {
  var %cmd = $_LEVELcmds($1), %u = $ulev($nick)
  if ($1 == !gethash && %u >= %cmd) {
    var %n = $strip($2)
    if (!%n) { .msg $chan $s_n Please specify a player ingame. | halt }
    %n = $nick.chk(%n)
    var %i = $_info(%n).id
    if (!%n) { .msg $chan $s_n That player was not found ingame. | halt }
    renrem get_serial %i
    .msg $chan $s_n The serial hash for $2 is: $read(player_serials.txt,$2)
  }
  elseif ($1 == !lookuphash && %u >= %cmd) {
    var %n = $strip($2)
    if ($read(player_serials.txt,%n) == $null) { .msg $chan $s_n No serial found for %n $+ . }
    .msg $chan $s_n Serial for %n $+ : $read(player_serials.txt,%n)
  }