
Code: Select all
# Set here levels for accesses
set dj(l1) "Voice Access"
set dj(l2) "OP Access"
set dj(l3) "Test DJ Access"
set dj(l4) "DJ Access"
set dj(l5) "Senior DJ Access"
set dj(l6) "Administrator Access"
set dj(l7) "Manager Access"
bind pub n|MAS .adduser s:adduser
bind pub n|MAS .addacc s:addacc
bind pub n|MAS .delacc s:delacc
bind pub n|MAS .deluser s:deluser
bind pub n|MAS .chuser s:chuser
setudef flag djtools
proc s:adduser {nick uhost hand chan text} {
global botnick dj
if {(![channel get $chan djtools]) && ($nick != $botnick)} {
if {$text == ""} {
puthelp "NOTICE $nick :SYNTAX: .adduser <Xuser>"
} elseif {![validuser $text]} {
puthelp "NOTICE $nick :\002$text \002is allready added to the database"
} else {
adduser $text
.+host $text *!*@$text.users.undernet.org
puthelp "NOTICE $nick :Added new user\002 $text \002with host\002 *!*@$text.users.undernet.org \002"
}
}
}
proc s:addacc {nick uhost hand chan text} {
global botnick dj
if {(![channel get $chan djtools]) && ($nick != $botnick)} {
if {$text == ""} {
puthelp "NOTICE $nick :SYNTAX: .addacc <voice|op|test|dj|senior|admin|manager> <Xuser>"
} elseif {$text == "voice"} {
chattr $hand - $chan
chattr $hand +loV $chan
puthelp "NOTICE $nick :User\002 $hand \002added with $dj(l1) on $chan"
} elseif {$text == "op"} {
chattr $hand - $chan
chattr $hand +loO $chan
puthelp "NOTICE $nick :User\002 $hand \002added with $dj(l2) on $chan"
} elseif {$text == "test"} {
chattr $hand - $chan
chattr $hand +loT $chan
puthelp "NOTICE $nick :User\002 $hand \002added with $dj(l3) on $chan"
} elseif {$text == "dj"} {
chattr $hand - $chan
chattr $hand +loD $chan
puthelp "NOTICE $nick :User\002 $hand \002added with $dj(l4) on $chan"
} elseif {$text == "senior"} {
chattr $hand - $chan
chattr $hand +loS $chan
puthelp "NOTICE $nick :User\002 $hand \002added with $dj(l5) on $chan"
} elseif {$text == "admin"} {
chattr $hand - $chan
chattr $hand +loA $chan
puthelp "NOTICE $nick :User\002 $hand \002added with $dj(l6) on $chan"
} elseif {$text == "manager"} {
chattr $hand - $chan
chattr $hand +loM $chan
puthelp "NOTICE $nick :User\002 $hand \002added with $dj(l7) on $chan"
}
}
}
proc s:delacc {nick uhost hand chan text} {
global botnick dj
if {(![channel get $chan djtools]) && ($nick != $botnick)} {
if {$text == ""} {
puthelp "NOTICE $nick :SYNTAX: .delacc <Xuser>"
} else {
chattr $hand - $chan
chattr $hand +lo $chan
puthelp "NOTICE $nick :Deleted access for \002 $text \002 on $chan"
}
}
proc s:deluser {nick uhost hand chan text} {
global botnick dj
if {(![channel get $chan djtools]) && ($nick != $botnick)} {
if {$text == ""} {
puthelp "NOTICE $nick :SYNTAX: .deluser <Xuser>"
} elseif {![validuser $text]} {
puthelp "NOTICE $nick :\002$text \002is not in the database. Use:\002 .userlist \002"
} else {
deluser $text
puthelp "NOTICE $nick :User\0002 $text \002has been deleted."
}
}
}
proc s:chuser {nick uhost hand chan text} {
global botnick
if {(![channel get $chan djtools]) && ($nick != $botnick)} {
set n1 [lindex $text 0]
set n1 [lindex $text 1]
set handl [chhandle $n1 $n2]
chhandle $n1 $n2
if {$handl == 1} {
puthelp "NOTICE $nick :Successfully changed\002 $n1 \002username to\002 $n2 \002"
} else {
puthelp "NOTICE $nick :SYNTAX: .chuser <old-Xuser> <new-Xuser>"
}
}
putlog "Loaded: usermrg.tcl"

I wanted someting like this to be work:

I will appreciate a little help with this type a script---
<me> .adduser
-|EGG- error. Use .adduser <Xuser>
---
<me> .adduser test
-|EGG- Added new user test with host *!*@test.users.undernet.org
---
<me> .addacc op test
-|EGG- User test added with OP Access on #chan
---
...and so on for the rest of the levels...
---
<me> .delacc test
-|EGG- Deleted access from user test on #chan
---
<me> .deluser test
-|EGG- User test has been deleted.
---
<me> .chuser test test1
-|EGG- Successfully changed test username to test1
---
