A little thing i decided to do when i was bored :|
just remember to set the %owner Variable
First Script -
on *:text:*+v *:*:{
if ($nick == %owner) { mode $chan +v $2 }
if ($nick != %owner) { Notice $nick You can't tell me what to do, Fool. }
}
on *:text:*-v *:*:{
if ($nick == %owner) { mode $chan -v $2 }
if ($nick != %owner) { Notice $nick You can't tell me what to do, Fool. }
}
on *:text:*+h *:*:{
if ($nick == %owner) { mode $chan +h $2 }
if ($nick != %owner) { Notice $nick You can't tell me what to do, Fool. }
}
on *:text:*-h *:*:{
if ($nick == %owner) { mode $chan -h $2 }
if ($nick != %owner) { Notice $nick You can't tell me what to do, Fool. }
}
on *:text:*+o *:*:{
if ($nick == %owner) { mode $chan +o $2 }
if ($nick != %owner) { Notice $nick You can't tell me what to do, Fool. }
}
on *:text:*-o *:*:{
if ($nick == %owner) { mode $chan -v $2 }
if ($nick != %owner) { Notice $nick You can't tell me what to do, Fool. }
}
on *:text:*+a *:*:{
if ($nick == %owner) { mode $chan +a $2 }
if ($nick != %owner) { Notice $nick You can't tell me what to do, Fool. }
}
on *:text:*-a *:*:{
if ($nick == %owner) { mode $chan -a $2 }
if ($nick != %owner) { Notice $nick You can't tell me what to do, Fool. }
}
on *:text:*+q *:*:{
if ($nick == %owner) { mode $chan +q $2 }
if ($nick != %owner) { Notice $nick You can't tell me what to do, Fool. }
}
on *:text:*-q *:*:{
if ($nick == %owner) { mode $chan -q $2 }
if ($nick != %owner) { Notice $nick You can't tell me what to do, Fool. }
}
You could have just done this and saved some time (I haven't tested it myself yet, but I'm pretty sure it should work) :
on :input::{
if ( $1 == +v ) { mode $chan +v $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == -v ) { mode $chan -v $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == +h ) { mode $chan +h $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == -h ) { mode $chan -h $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == +o ) { mode $chan +o $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == -o ) { mode $chan -o $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == +a ) { mode $chan +a $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == -a ) { mode $chan -a $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == +q ) { mode $chan +q $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == -q ) { mode $chan -q $2 } $msg $chan $2 You can't tell me what to do, Fool.
}
Or simply:
on *:input:#:{
if ($regex($1,/^[+-][vhoaq]$/)) {
mode $chan $1-2
msg $chan You can't tell me what to do, Fool.
}
}
You could have just done this and saved some time (I haven't tested it myself yet, but I'm pretty sure it should work) :
on :input::{
if ( $1 == +v ) { mode $chan +v $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == -v ) { mode $chan -v $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == +h ) { mode $chan +h $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == -h ) { mode $chan -h $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == +o ) { mode $chan +o $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == -o ) { mode $chan -o $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == +a ) { mode $chan +a $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == -a ) { mode $chan -a $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == +q ) { mode $chan +q $2 } $msg $chan $2 You can't tell me what to do, Fool.
if ( $1 == -q ) { mode $chan -q $2 } $msg $chan $2 You can't tell me what to do, Fool.
}
Another idea would be just set yourself as bot owner under users and use , for example, on owner:text:!+v*:#:{ /mode # +v $2 }. Though as TopNut said this is merely a suggestion, everyone has their own way of scripting and kudos on your first script, you will get better as time progresses. Keep it up!
This code can be optimized greatly. But as it is your first code, I won\'t tell you that it\'s badly coded. The note would then be \'Can Improve\'.
Here is another method of doing it:
On $@:Text:/^(([+-][vhoaq])\s(\S{2,}))/S::{
If ($nick == %owner) { MODE # $regml(2) $regml(3) }
Else { Notice $nick You can\'t tell me what to do, Fool. }
}