Scripting Identifiers

By Rolo on Nov 26, 2009

Some identifiers to make scripting a bit easier.

Some uses:
if ($owner(nickname)) { ... } ;checks if nickname is an owner
if ($admin) { ... } ;checks if you're an admin
msg # $nick has been idle $idle($nick)
msg # Random nickname: $rnick

It's all fairly straightforward.

alias owner { return $nick(#,$iif($1,$1,$me),~) }
alias admin { return $nick(#,$iif($1,$1,$me),&) }
alias op { return $nick(#,$iif($1,$1,$me),o) }
alias halfop { return $nick(#,$iif($1,$1,$me),h) }
alias voice { return $nick(#,$iif($1,$1,$me),v) }
alias rnick { return $nick(#,$r(1,$nick(#,0))) }
alias idle { return $duration($nick(#,$iif($1,$1,$me)).idle) }

Comments

Sign in to comment.
Rolo   -  Dec 06, 2009

33 comments guys? Insane.

 Respond  
RJosh   -  Dec 06, 2009

By depreciated i mean replaced by another identifier. ofcourse it's still usable. just most people don't have all the undocumented features ;)

 Respond  
Jethro   -  Dec 06, 2009

Version History of mIRC 5.61

* Fixed lock dialog password bug.
* Improved support for IRCX servers:
        Added property $nick().owner, isowner if comparison, and q\r property to $nick(#,N,aohvrq,aohvrq) where q is for owners.

        Added on OWNER/DEOWNER events, work the same as on OP/DEOP, and $mode().owner/deowner properties.

        mIRC also now automatically sends /ircx to the IRCX server the moment it connects. Perhaps this only works for ircx related servers. And $rnick() has not been deprecated and is still usable. Though it seems obsolete at best.
 Respond  
^Neptune   -  Dec 06, 2009

By the way, this apparently undocumented isowner does not in fact exist. Or even if it does, it doesn't work.

//echo -ag $iif($me isowner $chan,y,n)

On a channel I have owner status always returns n.

 Respond  
Jonesy44   -  Dec 06, 2009

Tbh looks like 3 or 4 new users from the same server/sh*thole all backing each other up + Jethro_ still managing to come out on top. :)

 Respond  
^Neptune   -  Nov 29, 2009

"lol"

This is going around in circles.. everyone stfu. Problem solved.

 Respond  
Master-Of-Death   -  Nov 29, 2009

Armand as your the wisest of us all why don't you try putting helpful comments or posting a snippet so we can see an example of your absolute perfection. sarcasm

 Respond  
Jethro   -  Nov 29, 2009

Because you didn't read the introduction, nor the code itself. Your problem not mine. Next time before you comment, at least read the code.If you can write what I've quoted above, I'm sure you know darn well the insult was not necessary in the first place. But you had to be insulting. That, I suppose, is one of your shortcomings.

 Respond  
Armand   -  Nov 28, 2009

Yes, I insulted you. Why? Because you didn't read the introduction, nor the code itself. Your problem not mine. Next time before you comment, at least read the code.

 Respond  
Jethro   -  Nov 28, 2009

You went off rambling about nothing. If his code is fine, don't go off on something else that is 100% irrelevant. I don't care if the information is correct or not, it's of no use to the author who never requested that you go into "A History of mIRC".I can accept what you've stated here, Armand, gladly. But, what you wrote in the very beginning of going back to 1st grade and people can't read was epic idiotic, ignorant of you.

You don't go around illiterate people and shout out, "you all can't read and should go back to 1st grade, do you?" Have some respect or you don't have one for yourself.

 Respond  
Master-Of-Death   -  Nov 28, 2009

Ty armand for your rudeness its nice to see that we have such a pleasant community. Period.

 Respond  
Armand   -  Nov 28, 2009

@Jethro_
You went off rambling about nothing. If his code is fine, don't go off on something else that is 100% irrelevant. I don't care if the information is correct or not, it's of no use to the author who never requested that you go into "A History of mIRC".

@Master-Of-Death
Go kiss ass elsewhere. And you really should read below.

Read the code, if it has issues, then comment. Don't add stuff that a) makes the code worse or b) has nothing to do with the author's original intent. If you really wish to assist users, you'd make an attempt to understand what they are trying to code, and then you comment with relevant information.

@gooshie
You give perfect example of a useful comment, thanks for not failing

 Respond  
gooshie   -  Nov 27, 2009
 Respond  
Lord-Harlot   -  Nov 27, 2009

I cried when I saw Master-Of-Death's "better" version.

 Respond  
Rolo   -  Nov 27, 2009

@Master-Of-Death
I don't see how either of your examples would make $rnick better.

@gooshie
Thanks for pointing that out, I'll change it.

 Respond  
Jethro   -  Nov 27, 2009

Thank you, Master-Of-Death, for the compliment. I don't see myself as being best enough. There's still a lot for me to learn. :-)

 Respond  
Master-Of-Death   -  Nov 27, 2009

Armand who are you to be so rude to Jethro no offence but Jethro is one of the best coders i know and for this /rnick rubbish you can just use.

alias rnick { .set %a $nick(#,0)
.set %b $rand(1,%a)
.echo -a $nick(#,%b)

or use

.echo -a $nick(#,$rand(1,$nick(#,0)))

simple, oh and Jethro_'s information is correct.

 Respond  
Jethro   -  Nov 27, 2009

There was a misunderstanding between my post about the $rnick() identifier and your rnick alias. If you had done some research, you'd know what I was talking about. In other words, I wasn't pinpointing your rnick alias. There's actually a $rnick identifier introduced by mirc back in the older version of 5.5. It may seem I was off-topic, but in actuality I was giving the info about the official identifier is all. Period.

P.S. I do apologize my heated posts in reply to Armand's. I just didn't appreciate his disparaging remarks.

 Respond  
gooshie   -  Nov 27, 2009
alias owner { return $nick(#,$iif($1,$1,$me),~) }
alias admin { return $nick(#,$iif($1,$1,$me),&) }
alias op { return $nick(#,$iif($1,$1,$me),o) }
alias halfop { return $nick(#,$iif($1,$1,$me),h) }
alias voice { return $nick(#,$iif($1,$1,$me),v) }

The $iif $true $false not really needed if you're only
going to use it as in your example. You would only
really need the $true $false returned if you wanted
to echo out or msg or by whatever means see the words
$true or $false. If so then do as follows:

alias owner { return $iif($nick(#,$iif($1,$1,$me),~),$true,$false) }
alias admin { return $iif($nick(#,$iif($1,$1,$me),&),$true,$false) }
alias op { return $iif($nick(#,$iif($1,$1,$me),o),$true,$false) }
alias halfop { return $iif($nick(#,$iif($1,$1,$me),h),$true,$false) }
alias voice { return $iif($nick(#,$iif($1,$1,$me),v),$true,$false) }
 Respond  
Rolo   -  Nov 27, 2009

Just tested, my $rnick doesn't clash with the undocumented $rnick function, as mine doesn't take parameters. Why'd you bring the undocumented $rnick up if they don't clash?

(By undocumented I mean not in the help file)

 Respond  
Armand   -  Nov 27, 2009

Dude, just read the damn code. Where does he imply that $rnick(chan,#) is its usage here?

alias rnick { return $nick(#,$r(1,$nick(#,0))) }

Read the code. And you're not benefitting anyone by not reading what is going on in the code. Don't blindly go and call someone out if you haven't even looked at it.

 Respond  
Jethro   -  Nov 27, 2009

Armand, I'm not going to argue with you. You've started out by telling people to go back to first grade and claimed people illiterate, which is uncalled for. People are not here to be belittled by your ignorance.

 Respond  
Armand   -  Nov 27, 2009

You clearly don't understand. His $rnick has nothing to do with what you're going on about. Like I said, read the intro, and hell, look at the damn code before you go off saying someone is incorrect.

 Respond  
Jethro   -  Nov 27, 2009
Armand   -  Nov 27, 2009

Listen, don't go commenting on stuff if you don't read the damned introduction. And don't get all pissy when someone says you're wrong.

 Respond  
Jethro   -  Nov 27, 2009

Armand, who are you to tell people to go back to 1st grade? Who are you to tell people they can't read? Please have some ethic in replying to people with decency. We are here to encourage each other with what we know, and get benefited from what we gather about scripting, to the best of our knowledge. Please don't be an arrogant prick.

 Respond  
Rolo   -  Nov 27, 2009

/help $rnick
Doesn't exist in the help file, and if it doesn't exist in the help file, why would I take it into account in practical scripting?

 Respond  
Armand   -  Nov 27, 2009

Jethro_, he's not trying to do that. $rnick in its usage here essentially pulls a random nickname from a channel. Like I said, maybe you should go back to the 1st grade and learn how to read, or at least read the introduction.

 Respond  
Jethro   -  Nov 27, 2009

Rolo, you are incorrect.

As a matter of fact, it's been added since mirc v5.5 released on 08/01/99 (I took it back; it's surely been documented) and I quote:> 81.Added $rnick(#,N) identifier, returns regular (non-op/help/voice) nicks on a channel, and isreg if comparison.

 Respond  
Armand   -  Nov 27, 2009

Let's see here.. None of you can read, so I suggest before you comment, you read up the mIRC help file. Or if that is too tough, you might find the 1st grade very helpful to you.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.