mIRC Homepage
Posted By: colt45 Lower Level Access - 14/04/21 11:21 AM
Trying to understand a bit and my English isn't my first language.

I'm trying to find how to send a message into the channel when a user join channel that isn't level 5 or higher.

i.e.

on *:JOIN: {
.msg $chan Welcome $nick to this channel.
}

I have this ^10 working for staff but I have a helper too which is set to 5, but want anything 4 or below to see that message when they join the channel.
Posted By: Epic Re: Lower Level Access - 14/04/21 11:52 AM

There is an error in your example script, the correct syntax for this event handler is will be like this: on <level>:JOIN:<#[,#]>:{commands}

If you want this message to be visible to all users join the channel, to then the code might look like this:
Code
on *:JOIN:#:{
  .msg $chan Welcome $nick to this channel.
}

If you need a restriction only for members with access level 4 and higher, then like this:
Code
on +4:JOIN:#channel:{
  .msg $chan Welcome $nick to this channel.
}


You can find a more detailed description here -> https://en.wikichip.org/wiki/mirc/access_levels

Posted By: colt45 Re: Lower Level Access - 14/04/21 11:53 AM
No, what I want is "lower" than level 4 not higher than 4.
I've tried wink
Posted By: Epic Re: Lower Level Access - 14/04/21 12:19 PM

I experimented with this and found such this solution. Perhaps this method will work for you:
Code
on *:JOIN:#:{
  if ($level($nick) isnum 2-4) {
    .msg $chan Welcome $nick to this channel.
  }
}

Should work only with nicknames that have an access level of 2-4.

You can also do this with addresses. More details here -> https://en.wikichip.org/wiki/mirc/identifiers/$level

Posted By: colt45 Re: Lower Level Access - 14/04/21 12:26 PM
Hmm, I've tried this script and it seems that everyone including myself is showing up at level 1.

I've set myself at 10 but showing 1 frown (I did via 2nd mirc script to test)
Posted By: Epic Re: Lower Level Access - 14/04/21 12:35 PM
Try replacing 1-4 with 2-4, this is it works for me. This should only work for those who has access level from 2 to 4, but not higher and not lower.
Moreover the message NOT be must shown to all those who join the channel, without any established access level.
Posted By: colt45 Re: Lower Level Access - 14/04/21 12:54 PM
Ok,here what I have in "Users" list.

10:colt!*@h.i.d.d.e.n
2:Gurth!*@h.i.d.d.e.n
2:Peru1987!*@h.i.d.d.e.n

When I test myself
I get no result.
Now, when I changed from
2:Peru1987!*@h.i.d.d.e.n
to
1:Peru1987!*@h.i.d.d.e.n
That works, however...
2-5 didn't show up result, so I went back to 1-5 and it's showing up only level 1, not level 2 or even level 10!

I find this very confusing, it's why I had to ask for help to fix this - it's probably a bug or something, I honestly not sure frown
Posted By: colt45 Re: Lower Level Access - 14/04/21 01:02 PM
Works if I use address instead of $nick
Now I have to figure this out by checking based on address smile
Posted By: Epic Re: Lower Level Access - 14/04/21 01:31 PM

That it worked correctly with the id $nick, the entry in the tab "Users" with access levels should look like this:
Code
10:colt
2:Gurth
2:Peru1987

In your case, it is correct to use the identifier $address with records in the form of addresses.

Here's of how I did it using the example of a user with the nickname "user":
Code
2:user!*@*

Script code:
Code
on *:JOIN:#:{
  if ($level($address($nick,5)) isnum 2-4) {
    .msg $chan $+([,$nick = $level($address($nick,5)),]) - Welcome $nick to this channel.
  }
}


Posted By: colt45 Re: Lower Level Access - 14/04/21 01:49 PM
Perfect - but with a little tweak.

Using !isnum 2-10 - So that only new user will see the message and not level 2 or above smile

Works for me now,
Thanks
Posted By: Epic Re: Lower Level Access - 14/04/21 01:58 PM
I'm glad you it finally managed to do. Always please and welcome! Do not forget to put 👍 likes 👍 for monetize my account grin smirk cool
Posted By: Epic Re: Lower Level Access - 15/04/21 07:30 AM
Of course, it would be much more convenient if several new values using the dash “-” were added to the syntax of event handlers that deal with access levels for simplify and prevent clutter when creating a script.

For to assign access level equal to the specified numeral and below, example (-4):
Code
on -4:JOIN:#:

For to assign enumeration of access levels through a dash from and to, example (2-4):
Code
on 2-4:JOIN:#:

And for all except the listed access levels, example (!2-4):
Code
on !2-4:JOIN:#:


I hopefully what this is possible and will be implemented in future versions of the client someday.

Posted By: colt45 Re: Lower Level Access - 15/04/21 07:44 AM
Yup, I did try that but didn't work but it's all good now, hope for an update in the next version? :P
© mIRC Discussion Forums