Just a simple code for a bot to tell you whether or not you're op/half-op/or voice.
on *:TEXT:Am I an op?:#: {
if ($nick isop $chan) { /msg $chan Yes, $nick $+ , you are an op! =D }
if ($nick ishop $chan) { /msg $chan No, $nick $+ , you are a half op! :O }
if ($nick isvoice $chan) { /msg $chan No, $nick $+ , you are voiced. =/ }
else { halt }
}
jonesy44: I beg to differ. You see, the parser will run much quicker when you don't re-use $nick & $chan over and over; it will keep on referring back to it's event and reading the identifiers over and over. However, setting them to static variables makes the parser run much quicker because now the call is set in stone, no longer being retrieved but inserted. It's not going to be leaps and bounds quicker, but quicker nonetheless ;)
Also, if you are referring to the %m variable and using $chr(44), it's merely this way because you can't use multiple ',' (commas) within $iif(), such as: $iif(1 == 1,First Response:No, you can't have that comma,Second Response: You can't have this one, either). But, that's obviously something learned (syntax-wise) early on, so I'm sure you know that :)
How about:
on *:TEXT:Am I an op?:#: {
var %c = $chan, %n = $nick, %m = $chr(44) $+ %n $+ $chr(44)
msg %c $iif(%n isop %c,Yes $+ %m you are an op! =D,$iif(%n ishop %c,No $+ %m you are a half op! :O,$iif(%n isvoice %c,No $+ %m you are voiced =/,%n you are not anything! :p)))
}
Didn't test, sorry, not sure if it's right.
And yet another completelty pointless waste of space on hawkee.
The only thing scripts like this do is push real scripts off the recent list.
I'm really getting tired of it. This is the only site I post on and its getting to where posting here is a waste of time because it gets lost in junk like this.
Scripts like this are way better suited for say the forum or just kept yourself.
It's like a lil while back when someone posted a one line On Text that was a simple "Welcome to #Channel".
What the hell is the point in posting crap like that? I mean the mirc help file has more complated examples for an on text than that.
Some people would argue that this is a learning site and to them I say this:
I agree but stuff like the example above should be in the forum. If someone comes here wanting a script as simple as that then a request for it in the forum would have a valid reply or ten in no time at all.
People keep posting crap and every time they say they didn't test because they were in a hurry or they say that its pointless or stupid but they know that and were just bored so don't say so.
If you know its pointless or stupid, if you havent had the time to test a script and CONFIRM IT WORKS, if your code is something that can be found in the examples in a newbie mirc tutorial or if function of your script was to cure boredome when making it and not actually something usefull to others than just keep it to yourself ir take it to the forums.
It doesn't make you look cool to have a dozen snippets if theyre all crap and its just ruining the site.
A lot of this comment is me being fed up with this site goind down hill so fast and not intended to be aimed at the OP in particular. Yes this script did get me going but tbh its not half as bad as most the ones im refering to.