Use !Join #Channelnamehere
And !leave to leave with your bot
And my simple !op namehere and !deop namehere :)
FIRST SCRIPT!
on *:TEXT:!join*:#: {
join $2
}
on *:TEXT:!leave*:#: {
part $chan
}
on *:TEXT:!op*:#: {
if ($nick isop $chan) (
mode $chan +o $2
}
on *:TEXT:!deop*:#: {
if ($nick isop $chan) (
mode $chan -o $2
}
1st and 2nd must be in userlist one Admin:NICK and then with the command !add you can add more Admin: and OP:
The OP Can be !op and !deop like Admin
The Admin Can be !op and !deop and !add admin/op.
3rd
The nick with the level 3:Nick can add new admin (!add) can (!op and !deop)
The 2:Nick can be only !op and !deop
on *:text:*:#:{
if ($ulevel == Admin) {
if ($1 == !add) {
if ($2-3) {
if ($2 == OP) { auser op $3 }
if ($2 == Admin) { auser admin $3 }
}
else { notice $nick !add level nick }
}
if ($1 == !op) { if ($2) && ($me isop $chan) && ($2 ison $chan) { mode $chan +o $2 } }
if ($1 == !deop) { if ($2) && ($me isop $chan) && ($2 !isop $chan) && ($2 ison $chan) { mode $chan -o $2 } }
}
if ($ulevel == OP) {
if ($1 == !op) { if ($2) && ($me isop $chan) && ($2 ison $chan) { mode $chan +o $2 } }
if ($1 == !deop) { if ($2) && ($me isop $chan) && ($2 !isop $chan) && ($2 ison $chan) { mode $chan -o $2 } }
}
}
Or
on *:text:*:#:{
if ($ulevel == Admin) {
if ($1 == !add) {
if ($2-3) {
if ($2 == OP) { auser op $3 }
if ($2 == Admin) { auser admin $3 }
}
else { notice $nick !add level nick }
}
}
if ($ulevel == Admin) || ($ulevel == OP) {
if ($1 == !op) { if ($2) && ($me isop $chan) && ($2 ison $chan) { mode $chan +o $2 } }
if ($1 == !deop) { if ($2) && ($me isop $chan) && ($2 !isop $chan) && ($2 ison $chan) { mode $chan -o $2 } }
}
}
Or
on *:text:*:#:{
if ($ulevel == 3) {
if ($1 == !add) {
if ($2-3) {
if ($2 == OP) { auser 2 $3 }
if ($2 == Admin) { auser 3 $3 }
}
else { notice $nick !add level(OP/ADMIN) nick }
}
}
if ($ulevel >= 2) {
if ($1 == !op) { if ($2) && ($me isop $chan) && ($2 ison $chan) { mode $chan +o $2 } }
if ($1 == !deop) { if ($2) && ($me isop $chan) && ($2 !isop $chan) && ($2 ison $chan) { mode $chan -o $2 } }
}
}
thanks for pointing that out I didn't notice that, however, even though there is a space inbetween the else & if it still functioned lol.
(15:55:21) <@Bertrum> !deop Bertrum
(15:55:22) * Corinthian sets mode: -o Bertrum
(15:55:31) <Bertrum> !op Bertrum
(15:55:35) <Bertrum> !leave #boo
(15:55:36) * @Corinthian (Corinth@NixtrixIRC.net) has left #boo
it !deops me but because i'm not op doesn't op me lol, so even though there is a space, it still works?
on 1:text:*:*:{
if (!join isin $1-) { join $2 }
if (!leave isin $1-) { part $2 }
else if ($nick isop $chan) {
if (!op isin $1-) { mode $chan +o $2 }
if (!deop isin $1-) { mode $chan -o $2 }
}
}
That would be how I would do it?
Rather than having an on @:text::*:{ event I prefer for it just to check if $nick isop $chan.
Regarding the one text event, it can be one or four, it doesn't matter. I would just say it is uneccessary to have more than one if it can be helped. Although I do realise some people prefer to have an on text event for each command/trigger because it looks neater. Having one is just my preference.
Also considering it is this users first script try not to be too harsh as it may discourage them from making further scripts, & explain why you would or wouldn't do certain things and how different things would work. Oh yeah, it works the way it is so good job!
it should only be one text event more than one is pointless and wastes time, also you NEED brackets otherwise it can cause multiple errors especially in large scripts, the next thing is one line scripts they are pointless and harder to correct any errors i advise you to consider using meditor for coding it is simple but very effective.
on *:TEXT:!op*:#: {
if ($nick isop $chan) (
mode $chan +o $2
}
on *:TEXT:!deop*:#: {
if ($nick isop $chan) (
mode $chan -o $2
}
Should be
on @*:TEXT:!op*:#: {
if ($nick isop $chan) {
mode $chan +o $2
}
}
on @*:TEXT:!deop*:#: {
if ($nick isop $chan) {
mode $chan -o $2
}
}
You need to check if you are channel operator.
Ghost-Writer, i don't think by removing the {} can make it better. As Neptune stated, it makes the code more easier to read. Expert coder also use it. You make it more ugly. I think you know why the Author of mIRC create { and }.
to be honest you dont need to use 1 text event but you could make it better, like 1 line, no need to {} abuse.
on *:TEXT:!join*:#: {
join $2
}
on *:TEXT:!leave*:#: {
part $chan
}
on *:TEXT:!op*:#: {
if ($nick isop $chan) (
mode $chan +o $2
}
on *:TEXT:!deop*:#: {
if ($nick isop $chan) (
mode $chan -o $2
}
could be used better like so,
on *:TEXT:!join*:#: {
if ($2) join $2
else msg $nick Error! Channel not specified.
}
on *:TEXT:!leave*:#: part $iif($2,$v1,$chan)
on *:TEXT:!op*:#: if ($nick isop $chan) mode $chan +o $2
on *:TEXT:!deop*:#: if ($nick isop $chan) mode $chan -o $2