mIRC Home    About    Download    Register    News    Help

Print Thread
#190467 21/11/07 10:37 AM
Joined: Mar 2007
Posts: 139
S
Solo1 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2007
Posts: 139
Hi, is there any way i can check to see if a server accepts +e or +i modes? like an identifier that i can do for example

Code:
//echo -a $iif(whatever identifier,accepts +e modes,does not accept +e modes)

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Note that to use it for the first time, you have to re-connect to the network, or request the versions reply with "/version" smile

Code:
; alias to check for valid channelmodes
; SYNTAX: $cmodes(<network>,<mode>)
; if a variable is set for this network, returns "$true" (if this mode is allowed), or "$false" (if not)
; if NO variable is found or a parameter is missing, returns "error"
; example "if ($cmodes($network,e) == $true) { -stuff- }

alias cmodes {
  if (($isid) && ($2) && ($($+(%,cmodes.,$1),2))) {
    return $iif(($2 isincs $v1),$true,$false)
  }
  else { return error }
}

; "on connect", parse the "versions" reply of the server (you'll always get this raw line on connect)
; and set the valid chanmodes to a cmode variable for this network (unsets automatically on exit)
RAW 5:*: { 
  if ($wildtok($1-,CHANMODES=*,1,32)) { set -e $+(%,cmodes.,$network) $gettok($v1,2,61) }
}

; on disconnect, unset the cmode-variable for this network
on *:disconnect: { 
  if ($($+(%,cmodes.,$network),2)) { unset $+(%,cmodes.,$network) }
}

EDIT:
uhm, I forgot about mIRCs in-built $chanmodes identifier crazy
Forget about my snippet and parse $chanmodes on your own with "isincs"
e.g.
echo -a mode +e can $iif((e !isincs $chanmodes),not) be set. }
if (i isincs $scid(<some connection id>).chanmodes) { echo -a i can be set on this connection }

Last edited by Horstl; 21/11/07 11:52 AM.
Joined: Mar 2007
Posts: 139
S
Solo1 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2007
Posts: 139
heh thanks,


Link Copied to Clipboard