I was bored and decided to make this if.
if you would like to change the %var
edit
Writeini AutoOpScript.ini $chan active yes
and
Writeini AutoOpScript.ini $chan active no
you also want to edit
if %var = yes { mode $chan +o $nick }
otherwise just load it.
on *:Load:{
echo -a Ty For Loading AutoOpScript By Eternal/DragonFlare
echo -a An Eternal-Networking Script
echo -a To activate in a channel right click in the channel highlight AutoOpScript and click on/off
}
;AutoOpScript
Menu Channel {
-
AutoOpScript ( $+ $Active $+ ):
.on: .Enable #AutoOpScript | Writeini AutoOpScript.ini $chan active yes | msg $chan 14,1 AutoOpScript Has Been Activated in $active
.off: .Disable #AutoOpScript | Writeini AutoOpScript.ini $chan active no | msg $chan 14,1 AutoOpScript has been Disabled in $active
}
#AutoOpScript on
on *:join:#:{
%var = $readini(AutoOpScript.ini,$chan,active)
if %var = yes { mode $chan +o $nick }
else { halt }
}
Jethro,
LOL.. be yourself and Jetify it!..
just a couple tweeks..
no need for ! on join the @ takes care of that..
when you do on/off things.. if you use 1/0 then
you can do as follows.. also if its shorter and
doesnt matter rearrange it for positive logic to
make it easier to read..
on @*:JOIN:#:if (%op) .mode # +o $nick
alias op {
set -e %op $iif(%op,0,1)
echo -a * $iif(%op,AutoOp has been turned on.,AutoOp has been turned off.)
}
Another way to go would be to script the aop
function in the control tab of the address book
something like this:
Menu Nicklist {
-
AutoOpScript is $+([,$iif($aop,on,off),]):$iif($aop,aop off,aop on)
$iif($aop($+($gettok($address($1,5),1,64),@*)),Remove $1 From AutoOp,Add $1 To AutoOp):$iif($aop($+($gettok($address($1,5),1,64),@*)),aop -r $+($gettok($address($1,5),1,64),@*) # $network,aop $+($gettok($address($1,5),1,64),@*) # $network)
}
Sorry for the long folded line
errm why add rediculous amounts of code, one you could use the server commands and two that code is way to excessive.
this would be better:
alias opon {
.set %op on
}
alias opoff {
.unset %op
}
on *:JOIN:#:{ if (%op == on) {
.mode # +o $nick
}
}
Simple usually = better oh and does not involve stupid %var changes.
woah, ever heard of levels?
To change base levels or to give auto voice on join. you type /cs levels channel set type level Example. /cs levels #help set autovoice -1. Here is a list of levels.
autodeop autohalfop autoop autoprotectect autovoice autojoin signkick Acc-list acc-change akick set ban banme clear getkey halfop halfopme info kick kickme invite opdeop opdeopme protect protectme topic Unban Voice Voiceme memo assign badwords fantasia greet nokick say.
Just set autoop to -1.
I don't get why you needed to make a variable for %var when you could simply do:
#AutoOpScript on
on @*:join:#:{
if $readini(AutoOpScript.ini,$chan,active) = yes { mode $chan +o $nick }
}
#AutoOpScript end
You should check if you're opped in channel by adding a @ prefix to your join event. Your else is redundant and can be omitted.