mIRC Homepage
Posted By: LooseFlapper Grant access level to specific channel? - 23/02/14 10:34 PM
Hi!

I would like to create a script where I can give someone access level but only in a certain channel. So say I want to grant someone access level 2 but I only want him to have access level 2 in #apples. How would I go about doing this?
Just to explain what I mean, here's an example of what it COULD be. :P
Quote:
on *:TEXT:*!grant 2*:#: {
if ($nick isop #) {
auser 2 $3 $chan
msg # $3 has been granted access level 2 in $chan.
}
}


Hopefully this will kinda help you understand what I want. smile


/Loose
Posted By: Crinul Re: Grant access level to specific channel? - 24/02/14 01:49 PM
Code:
/auser [-a] <levels> <nick|address> [info]

The info parameter allows you to append text to the entry that is added to the users list, you can reference this later with the $ulist() identifier.

Originally Posted By: Help File
$ulist(nick!userid@address,L,N)
Properties: info

You'll need to check if ($ulist(nick!userid@address,L,N).info == $chan) in the access code.

/help $ulist
Could you try and explain that again? smile I didn't quite follow.

I read the /help $ulist stuff but still not sure how to go about doing this. :P
Posted By: Crinul Re: Grant access level to specific channel? - 24/02/14 08:19 PM
Quote:
auser <levels> <nick|address> [info]
auser 2 $3 $chan

<levels> = 2
<nick|address> = $3
[info] = $chan

The [info] parameter allows you to append text to the entry that is added to the users list, you can reference this with the $ulist(<nick|address>).info or $ulist($3).info

auser 2 Crinul #apples
$ulist(Crinul).info == #apples
I see now! smile Thank you very much!
I attempted to make this as a test but it didn't work.

Code:
on *:text:*test*:#: {
  if ($ulist($nick).info == $chan) {
    msg $chan Test complete...
  }
}


Any suggestions what I might've done wrong?


EDIT: This is what it looks like in the Users TAB.

Code:
2:testuser #looseflapper
Posted By: Crinul Re: Grant access level to specific channel? - 26/02/14 12:32 PM
Works fine on my end.

testuser (not you) has to type test. If the channel matches you see the message.
The on TEXT event triggers when you receive messages, not when you send them.
Strange, it's what I did. I will try and move the script up a bit and see if that helps.

EDIT: Yepp, that fixed it. Haha. Thank you very much.
© mIRC Discussion Forums