|
|
|
Othello
|
|
Othello
|
I am trying to figure out the correct usage of $aop. The $aop(address/N) identifier returns any matching address in the list, or the Nth address. The .type property returns the list of channels.
raw 352:*: {
if ($aop == $true) && ($3 !isop $aop.type) { /mode $2 +o $3 }
halt
}
or should it be used as
raw 352:*: {
if ($aop($3) == $true) && ($3 !isop $aop($3).type) { /mode $2 +o $3 }
halt
}
|
|
|
|
|
|
Hammer
|
|
Hammer
|
OK, I will have to assume that you are issuing this /who $chan on OP. I will also assume that you have added them by using type 3: //aop nick #channel1,#channel2,#channe3 3 $network. Modify the script below to fit however you actually do it. In a raw 352 response: $2 is $chan, $3 is the userid, $4 is the host and $6 is the nick, so you build the nick!userid@host and use $mask( ,3) to get an accurate mask to compare to what's in the AOP list.
[color:#840017]
; $6 ! $3 @ $4 [color:black]returns nick userid host[/color]
; $+($6,!,$3,@,$4) [color:black]returns nick!userid@host[/color]
; $mask($+($6,!,$3,@,$4),3) [color:black]returns *!*userid@*.host[/color]
; $aop($mask($+($6,!,$3,@,$4),3)).type [color:black]returns the list of channels, if they're aop[/color]
; $istok($aop($mask($+($6,!,$3,@,$4),3)).type,$2,44) [color:black]returns $true if $2 is in that list[/color]
;if ($istok($aop($mask($+($6,!,$3,@,$4),3)).type,$2,44))[color:black]then op their nick ($6) on $2[/color]
[/color]
raw 352:*: if ($istok($aop($mask($+($6,!,$3,@,$4),3)).type,$2,44)) mode $2 +o $6 The above method could concievably flood you off if there are a LOT of non-opped aops present because you'd send out a complete mode command for each of them as you get each 352 in and process it. Another idea is to just add their nick to a variable in the 352 and and op $modespl at a time in the 315, looping through the list until you are all the way through the variable.
|
|
|
|
|
|
Othello
|
|
Othello
|
My intentions are to use this script to scan the channel for unwanted nicks as I get opped in a channel. I also wanted the script to give ops to the ops who don't have ops at that time.. [color:red]raw 352:*: {
if $ulist($address($3,2),11,1) { ban $2 $maddress | kick $2 $3 }
[color:green] if ($istok($aop($mask($+($6,!,$3,@,$4),3)).type,$2,44)) mode $2 +o $6 [color:red]
halt
}
|
|
|
|
|
|
Hammer
|
|
Hammer
|
Try $address($6,2) instead of $address($3,2).
|
|
|
|
|
|
Othello
|
|
Othello
|
Thank you Hammer for your help. I have made another change to this script With what you suggested befor the script auto-op chan scan. the nicks even if that had ops in the channel. was being oped. So I made this change. [color:red]
raw 352:*: {
if $ulist($address($6,2),11,1) { ban $2 $maddress | kick $2 $6 }
if ($istok($aop($mask($+($6,!,$3,@,$4),3)).type,$2,44) [color:green]&& $6 !isop $2[color:red]) mode $2 +o $6
halt
}
|
|
|
|
|
|
Othello
|
|
Othello
|
Now, I am not sure how I would apply the use the $modespl in Raw 315 unless its simular to the mass op script
|
|
|
|
|
|
Hammer
|
|
Hammer
|
$ModesPL (Modes Per Line) tells you (when it's defined by your server's 005 numeric) how many o's you can have in +oooooo and therefore how many non-opped nicks on your op list you can op in a single command. Not all networks support that yet, though, which is why I didn't give you a worked example of that particular mass command.
|
|
|
|
|
|
Nimue
|
|
Nimue
|
If not defined otherwise in 005, $modespl defaults to 3.
|
|
|
|
|
|
Othello
|
|
Othello
|
I only stay on Dalnet. I am always open for suggestions on new ways to learn. All of of the scripting I learn is from examples I see posted here on the message boards. So how what you suggest $ModesPL be used in a code?
|
|
|
|
|
|
Hammer
|
|
Hammer
|
In general, we do not help with any mass commands at all because they are very easily re-scriptable into more harmful/non-fun scripts. I know that I, personally, don't help with war scripts or ANYthing else to do with mass commands, such as mass commands to spam or invite or whatever. This is one of those times where I will only give you a brief example of how to proceed and let you figure out the details yourself through trial and error for the rest.
raw 352:*:{
if ($istok($aop($mask($+($6,!,$3,@,$4),3)).type,$2,44) && $6 !isop $2) {
%Ops = $addtok(%Ops,$6,32)
halt
}
}
raw 315:*:{
if (!ops) return
var %i = 1
while (%ops) {
mode $2 $+(+,$str(o,$modespl)) $gettok(%ops,$+(1-,$modespl),32)
%ops = $deltok(%ops,$+(1-,$modespl),32)
}
halt
}
|
|
|
|
|