mIRC Home    About    Download    Register    News    Help

Print Thread
#268707 14/04/21 11:21 AM
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
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.

Joined: Jan 2012
Posts: 299
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2012
Posts: 299

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



🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Epic #268709 14/04/21 11:53 AM
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
No, what I want is "lower" than level 4 not higher than 4.
I've tried wink

Joined: Jan 2012
Posts: 299
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2012
Posts: 299

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



🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Epic #268711 14/04/21 12:26 PM
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
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)

Joined: Jan 2012
Posts: 299
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2012
Posts: 299
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.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Epic #268713 14/04/21 12:54 PM
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
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

Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Works if I use address instead of $nick
Now I have to figure this out by checking based on address smile

Joined: Jan 2012
Posts: 299
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2012
Posts: 299

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.
  }
}




🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Epic #268716 14/04/21 01:49 PM
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
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

Joined: Jan 2012
Posts: 299
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2012
Posts: 299
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


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Jan 2012
Posts: 299
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2012
Posts: 299
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.



🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Epic #268727 15/04/21 07:44 AM
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Yup, I did try that but didn't work but it's all good now, hope for an update in the next version? :P


Link Copied to Clipboard