All pastes #284723 Raw Edit

Something

public text v1 · immutable
#284723 ·published 2006-12-19 06:28 UTC
rendered paste body
### REPUTATION POINTS ###

# For admin's
proc rep:proc {nick host hand chan text} {
set user [lindex [split $text] 0]
set rep [lindex [split $text] 1]
set num [string is digit $rep]

foreach chan [channels] { if [channel get $chan rankscript] {
set a [ini_read "db/userfile.ini" "$user" "nick"]

if {$a !=";" && $num == "1"} {
ini_write "db/userfile.ini" "$user" "rep" "$rep"
putserv "PRIVMSG $chan :$user\'s Rep is now: [ini_read "db/userfile.ini" "$user" "rep"]"
} elseif {$a == ";"} {
putserv "PRIVMSG $chan :User is not in the database"
} elseif {$num == "0"} {
putserv "PRIVMSG $chan :Rep Points Must Be Numeric"
   }
  }
 }
}

# For users
proc urep:proc {nick host hand chan text} {
set user [lindex [split $text] 0]
set flag [lindex [split $text] 1]

foreach chan [channels] { if [channel get $chan rankscript] {
if {$flag == "-"} {set t "\0555" } elseif {$flag == "+"} {set t "\0535" }

set a [ini_read "db/userfile.ini" "$user" "nick"]
set b [expr [ini_read "db/userfile.ini" "$user" "rep"] $t]

set c [ini_read "db/banfile.ini" "$nick" "nick"]
set d [ini_read "db/banfile.ini" "$nick" "host"]
set e [ini_read "db/banfile.ini" "$nick" "repuser"]


if {$c == "$nick" && $d == "$host" && $e == "$user"} {
        putserv "PRIVMSG $chan :You may not add any more rep to \002$user\002 for: <\002 1 DAY \002>"
return
}

if {$a !=";" && $flag != ""} {
        ini_write "db/userfile.ini" "$user" "rep" "$b"
        putserv "PRIVMSG $chan :$user\'s Rep is now: [ini_read "db/userfile.ini" "$user" "rep"]"
        ini_write "db/banfile.ini" "$nick" "nick" "$nick"
        ini_write "db/banfile.ini" "$nick" "host" "$host"

        if {$e != "$user"} {
                        set x 0
                        set y [incr x 1]
        ini_write "db/banfile.ini" "$nick" "$y" "$user"
        } else { ini_write "db/banfile.ini" "$nick" "repuser" "$user" }

        putserv "PRIVMSG $chan :You may not add any more rep to $user for <\002 1 DAY \002>"
} elseif {$a == ";"} {
        putserv "PRIVMSG $chan :User is not in the database"
        return
   }
  }
 }
}