Detecting +q for script (mIRC)

Talk about pretty much anything here, but DO NOT USE FOR SUPPORT.

Moderator: Supporters

MalcsMan
Posts: 6
Joined: Fri Jun 04, 2004 12:55 am
Location: Pretoria, South Africa
Contact:

Detecting +q for script (mIRC)

Post 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
Malcolm Lunt
[resigned BotService Staff Member] :roll:
[WebMaster of *.suis.co.za] :lol:
codemastr
Former UnrealIRCd head coder
Posts: 811
Joined: Sat Mar 06, 2004 8:47 pm
Location: United States
Contact:

Post 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.
-- codemastr
MalcsMan
Posts: 6
Joined: Fri Jun 04, 2004 12:55 am
Location: Pretoria, South Africa
Contact:

thanks

Post by MalcsMan »

o..thought that only dealt with modes h, o, v - i'll give that one a try
ta
Malcolm Lunt
[resigned BotService Staff Member] :roll:
[WebMaster of *.suis.co.za] :lol:
aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post 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 :P . */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 .
MalcsMan
Posts: 6
Joined: Fri Jun 04, 2004 12:55 am
Location: Pretoria, South Africa
Contact:

Post 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
Malcolm Lunt
[resigned BotService Staff Member] :roll:
[WebMaster of *.suis.co.za] :lol:
bash109
Posts: 7
Joined: Thu Jan 13, 2005 1:56 am

LMFAO

Post 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
MalcsMan
Posts: 6
Joined: Fri Jun 04, 2004 12:55 am
Location: Pretoria, South Africa
Contact:

Re: LMFAO

Post 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
Malcolm Lunt
[resigned BotService Staff Member] :roll:
[WebMaster of *.suis.co.za] :lol:
White_Magic
Posts: 267
Joined: Tue Jan 18, 2005 3:24 pm
Location: Scotland - United Kingdom

Post 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
aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight »

Why? mirc tracks it for you. Why use the extra space? :P
bash109
Posts: 7
Joined: Thu Jan 13, 2005 1:56 am

same as above

Post 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
aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post 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.
w00t
Posts: 1136
Joined: Thu Mar 25, 2004 3:31 am
Location: Nowra, Australia

Post by w00t »

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]
aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight »

Well, I do go on one network that uses them. Unfortuantely, I can't 100% truthfully say that they use unreal :) .
Ron2K

Post 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 :P
codemastr
Former UnrealIRCd head coder
Posts: 811
Joined: Sat Mar 06, 2004 8:47 pm
Location: United States
Contact:

Post 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.
-- codemastr
Locked