Detecting +q for script (mIRC)
Moderator: Supporters
Detecting +q for script (mIRC)
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
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
Malcolm Lunt
[resigned BotService Staff Member]
[WebMaster of *.suis.co.za]
[resigned BotService Staff Member]
[WebMaster of *.suis.co.za]
thanks
o..thought that only dealt with modes h, o, v - i'll give that one a try
ta
ta
Malcolm Lunt
[resigned BotService Staff Member]
[WebMaster of *.suis.co.za]
[resigned BotService Staff Member]
[WebMaster of *.suis.co.za]
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*
(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 .
*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)
}
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 .
I did post in mIRC forums on the web, didnt see any on these boards..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...
but i got no response?!!?!
Thanks for that aquanight!
Malcs
Malcolm Lunt
[resigned BotService Staff Member]
[WebMaster of *.suis.co.za]
[resigned BotService Staff Member]
[WebMaster of *.suis.co.za]
LMFAO
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
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
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!!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
malcs
Malcolm Lunt
[resigned BotService Staff Member]
[WebMaster of *.suis.co.za]
[resigned BotService Staff Member]
[WebMaster of *.suis.co.za]
-
- Posts: 267
- Joined: Tue Jan 18, 2005 3:24 pm
- Location: Scotland - United Kingdom
same as above
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
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
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.
Actually, I'm hard pressed to find a network that DOES use them.
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]