Skip to content
General IRCX

Dialog Help

A TG007 community discussion started by JasonK.

Discussion 3 posts
Page 1 of 1
Open
Topic #11281 · 3 published posts · 2,011 views

Hello,

 

I need some help trying to write a piece of code that would allow me to create an exception.

 

Say for example I would like to add access to all of the nicks in my channel by default.

here is my code:

 

Code:

;syntax: addall <chan> <type>

alias addall {

var %^ = $nick($1,0)

while (%^) {

if ($nick($1,%^) != $me) { access $1 add $2 $v1 }

dec %^

}

}

 

 

But let's say I want to add an exception; I would like add access to all of the following individuals except: nickname1,nickname2,nickname3 (The format should be nickname seperate by commas to handle single or multiple nicks to except)

 

I am not quite sure how to relate this back to the alias and to the dialog

 

Code:

dialog addall {

title "Add All"

size -1 -1 109 82

option dbu

combo 2, 13 15 79 10, drop

box "", 1, 1 -1 106 67

text "What type of entry would you like to add?", 3, 3 5 107 8

button "OK", 4, 34 69 35 11, default flat ok cancel

check "Except:", 5, 13 26 30 10

edit "", 6, 12 37 90 10

text "Add nick(s) seperated by commas", 7, 13 48 89 8

text "eg. nick1,nick2,nick3 ect.", 8, 13 56 89 8

}

 

 

 

Thanks in advance,

 

Cheers,

 

Jay

 

i aint scripted for a while but could you not have

 

 

/addall #test owner nick1 nick2 nick3

 

 

then within ur alias have

 

if $nick($1,%^) isin $1- | halt

 

 

 

 

i hope you know what i mean

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

Yeah, or the way he wants it...

 

 

/addall $chan Owner nick1,nick2,nick3

 

alias addall {
var %^ = $nick($1,0), %n
while (%^) {
%n = $nick($1,%^)
if (%n == $me) || (%n isin $3) { dec %^ | continue }
access $1 add $2 %n
dec %^
}
}

 

 

Because it references the nickname 3 times now, I made it a local variable to speed up the process.