Page 1 of 2
Detecting +q for script (mIRC)
Posted: Sun Dec 26, 2004 4:54 pm
by MalcsMan
Hi there,
I'm trying to find a way to detect if a user has +q in the channel so that if they do try protect a user, they dont get told a million times that they aint a channel owner -- I use alias to set the +a mode for 6 or less users at the same time. I've tried lots of things, but they dont work ... maybe I did it wrong?!? This is a mIRC script btw.
Thanks,
MalcsMan
Posted: Sun Dec 26, 2004 7:30 pm
by codemastr
If PREFIX_AQ is on, yes, otherwise no. Basically, you use whatever it is mIRC uses to tell if the user is +o or another mode. I forget exactly (I don't use mIRC), but I think it was something like $nick($chan,N,q) where N specifies that you want to retrieve this for the Nth user.
thanks
Posted: Sun Dec 26, 2004 7:48 pm
by MalcsMan
o..thought that only dealt with modes h, o, v - i'll give that one a try
ta
Posted: Mon Dec 27, 2004 4:28 am
by aquanight
I actually have a nice set of alias'd identifiers to determine the status of a user... Although this question would've been better asked on the mIRC forums, I suppose I'll just share my solution in case you're curious...
*edit* Put this blob in your *ALIAS* tab, NOT REMOTE. Especially make sure you don't paste it in the middle of another alias. Ctrl+End is your friend

. */edit*
Code: Select all
/prefixof {
if ($1 == $null || $2 == $null) { return $null }
var %pnick $nick($1,$2).pnick
var %pos $pos(%pnick,$2,1)
if (%pos == $null) return $null
if (%pos == 1) return $null
return $left(%pnick,$calc(%pos - 1))
}
/isvoice {
if (+ isin $prefixof($1,$2) || $ishalfop($1,$2)) { return $true }
return $false
}
/ishalfop {
if (% isin $prefixof($1,$2) || $ischop($1,$2)) { return $true }
return $false
}
/ischop {
if (@ isin $prefixof($1,$2) || $isadmin($1,$2)) { return $true }
return $false
}
/isadmin {
if ($isowner($1,$2)) return $true
if (& == $null) return $false
if ($ircdadminchar(prefix) isin $prefixof($1,$2)) return $true
return $false
}
/isowner {
if ($ircdownerchar == $null) return $false
if ($ircdownerchar(prefix) isin $prefixof($1,$2)) return $true
return $false
}
/ircdownerchar {
return $iif($1 == prefix,$iif(~ isin $prefix,~,@),q)
}
/ircdadminchar {
return $iif($1 == prefix,$iif(& isin $prefix,&,@),a)
}
(1)
The first one and the last two are support aliases, the five is* aliases can be used as identifiers in an if clause. They test if the given user has the given status on a channel by checking what mirc thinks the prefixes are. The lower tests (eg, isvoice) will always return true if a higher test is true (because Unreal follows this mechanism, it's only appropriate for the client to expect this). isvoice, ishalfop, and ischop will test if a user is voiced, halfopped, or opped. isadmin and isowner will test for that state only when PREFIX_AQ is enabled, otherwise they just check for ops (since you can't tell short of that
(2), besides, if you're +q-o in this case you can't set modes anyway).
How does mIRC know if PREFIX_AQ is enabled? Simple: Unreal's 005 PREFIX= and CHANMODES= reply indicates if the prefixes enabled or not. (qaohv)~&@%+ and CHANMODES=be,kfL,l,psmntirRcOAQKVGCuzNSMT if the prefixes are on, PREFIX=(ohv)@%+ and CHANMODES=beqa,kfL,l,psmntirRcOAQKVGCuzNSMT if they are off. (Note that when off, q and a are listed as "list modes" - which they are, in a way.
*edit* Can't believe I forgot - the format for using them is $is<insert status here>(channel, nick), eg to if you are opped in the current channel you would do $ischop(#,$me) (if you want to play with these and /echo, remember to use two slashes on the command line ;P ).
Footnotes:
(1) : The ircd{admin|owner}char stuff have parameters like that because I actually had extra stuff that I stripped out that I used (let alone, needed) because not all IRC networks run unreal ;p .
(2) : You could do /mode #channel +a (no parameter) and /mode #channel +q (no parameter) and do your own admin/owner tracking but this would be quite a hack and probably isn't really that necessary. You can just /halt the "Not a channel owner" numeric if you were that desperate. But if you want to try this method, /debug -pt @debug is your friend ;p .
Posted: Tue Dec 28, 2004 9:13 pm
by MalcsMan
aquanight wrote:I actually have a nice set of alias'd identifiers to determine the status of a user... Although this question would've been better asked on the mIRC forums, I suppose I'll just share my solution in case you're curious...
I did post in mIRC forums on the web, didnt see any on these boards..
but i got no response?!!?!
Thanks for that aquanight!
Malcs
LMFAO
Posted: Sat Jan 15, 2005 12:54 am
by bash109
lol i have been scripting in mirc for like 6 years now and it should be clear to all mirc users that when someone has +q that there nick looks like this
eg.... .bash109 or ~bash109 lol i dont see the point in people putting scanners for this stuff in there scripts its just not needed..
and if an admin or something doesnt have anything beside his/her name just do a whois on him or her its that simple i just find people who make scanners for this lazy
Re: LMFAO
Posted: Sat Jan 15, 2005 9:17 pm
by MalcsMan
bash109 wrote:lol i have been scripting in mirc for like 6 years now and it should be clear to all mirc users that when someone has +q that there nick looks like this
eg.... .bash109 or ~bash109 lol i dont see the point in people putting scanners for this stuff in there scripts its just not needed..
and if an admin or something doesnt have anything beside his/her name just do a whois on him or her its that simple i just find people who make scanners for this lazy
this is for a counter script so a user doesnt get told that he/she cannot perform a certain action -- my script is for people who run away when they get a notice like that..lol, and it aint coz i'm lazy!!
malcs
Posted: Tue Jan 18, 2005 3:37 pm
by White_Magic
lot of code there aqua
ON *:RAWMODE:#:{
if ($1 == +q || ($1 == +qo || ($1 == +oq))) { add woteva }
}
i tend to use hash tables to store each persons modes they lose or gain, so its constantly updating itself
Posted: Thu Jan 20, 2005 4:55 am
by aquanight
Why? mirc tracks it for you. Why use the extra space?

same as above
Posted: Fri Jan 21, 2005 12:23 am
by bash109
LMFAO soooooo many people do this stuff it is not funny.
take for example techgear007 or mirc.net every script on every part of there website has it and there virtually the same... lol its not worth the extra 2 or 3 seconds that it takes to load the script just because users cant define when someone has +q in a channel, IT IS right before your eyes and if people dont see it they need to get glasses bc as i have said b4 users with +q have ~ beside there name or . eg ~bash109 .bash109 and omg this subject is so lame man lol
Posted: Fri Jan 21, 2005 11:30 pm
by aquanight
Not all servers put ~ in front of the channel owner. Not all servers put . or ! or whatever in front either. Unreal itself allows you to turn off the ~ prefix (and then the only way to know is to check /mode #channel q every X seconds). I know 3 networks that use unreal and do NOT have the prefixes enabled.
Posted: Fri Jan 28, 2005 2:08 am
by w00t
Actually, I'm hard pressed to find a network that DOES use them.
Posted: Fri Jan 28, 2005 4:43 pm
by aquanight
Well, I do go on one network that uses them. Unfortuantely, I can't 100% truthfully say that they use unreal

.
Posted: Sat Jan 29, 2005 4:10 am
by Ron2K
aquanight wrote:Well, I do go on one network that uses them. Unfortuantely, I can't 100% truthfully say that they use unreal

.
Ditto

Posted: Sat Jan 29, 2005 5:04 am
by codemastr
w00t wrote:Actually, I'm hard pressed to find a network that DOES use them.
I know of many. Disabling these prefixes leads to one thing - problems.