This is a simple Auto Op/Voice/HalfOP Bot, just change #Chan to your desired Channel. Commands are,
!aop NICKNAMEHERE (Auto OP)
!aov NICKNAMEHERE (Auto Voice)
!aoh NICKNAMEHERE (Auto HalfOP)
!delaop NICKNAMEHERE (Deletes NICKNAME from Auto Op List)
!delaov NICKNAMEHERE (Deletes NICKNAME from Auto Voice List)
!delaoh NICKNAMEHERE (Deletes NICKNAME from Auto HalfOP List)
You must be OP for the commands to operate, Enjoy.
on 1:TEXT:!aop*:#Chan:{
if ($nick !isop #Chan) { msg $chan Command Ignored (Must be OP) }
else { writeini aop.ini $2 aop $address($2,2) | msg $chan Added $2 to Auto Op List }
}
on 1:TEXT:!aov*:#Chan:{
if ($nick !isop #Chan) { msg $chan Command Ignored (Must be OP) }
else { writeini aov.ini $2 aov $address($2,2) | msg $chan Added $2 to Auto Voice List }
}
on 1:TEXT:!aoh*:#Chan:{
if ($nick !isop #Chan) { msg $chan Command Ignored (Must be OP) }
else { writeini aoh.ini $2 aoh $address($2,2) | msg $chan Added $2 to Auto Half-OP List }
}
on 1:JOIN:#Chan:{
if ($readini(aop.ini,$nick,aop) == $address($nick,2)) { mode $chan +o $nick }
if ($readini(aov.ini,$nick,aov) == $address($nick,2)) { mode $chan +v $nick }
if ($readini(aoh.ini,$nick,aoh) == $address($nick,2)) { mode $chan +h $nick }
}
on 1:TEXT:!delaop*:#Chan:{
if ($nick !isop #Chan) { msg $chan Command ignored (Must be OP) }
else { remini aop.ini $2 | msg $chan Removed $2 From Auto Op List }
}
on 1:TEXT:!delaov*:#Chan:{
if ($nick !isop #Chan) { msg $chan Command ignored (Must be OP) }
else { remini aov.ini $2 | msg $chan Removed $2 From Auto Voice List }
}
on 1:TEXT:!delaoh*:#Chan:{
if ($nick !isop #Chan) { msg $chan Command ignored (Must be OP) }
else { remini aoh.ini $2 | msg $chan Removed $2 From Auto Half-OP List }
}
two little notes. About your on text events, It\'s nice to let the user know they don\'t have access to the commands, however if a user with an attitude abuses this they have a chance of flooding off the client, You might want to consider adding some type of protection for this. Also you should try and string your on text events into one event. Other then that, GJ :)
intresting way of coding the on join event. but you can simplify your code.
on :text:#:!: {
if ($1 == !aoh) { ;put what the command does in this area and close with a bracket.
if ($1 == !aop) {
if ($1 == !aov) {
if ($1 == !delaop) {
if ($1 == !delaov) {
if ($1 == !delaoh) {
}
then your on text event can go down here.