mIRC Home    About    Download    Register    News    Help

Print Thread
#216981 26/12/09 12:34 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
When the server sends me a 353 reply it appears like this. Paul is me, Jonathon is in the room and is voiced. The last letter in the 4 letter code before the nickname, indicates whether the user is voiced or not (V = voiced, N = not voiced).

Quote:

:FlashIrcServer.1 353 Paul = %#!!Roomy :UMNV,Jonathon UMNN,'Paul


I then send a 353 to my localhost socket
Code:
if ($2 == 353) sockwrite -n buzz.avoLocal $1-5 $regsubex($6-, /([^:,\s]+,)/g, )


It sends
Quote:

sockwrite -n buzz.avoLocal :FlashIrcServer.1 353 Paul = %#!!Roomy :Jonathon 'Paul


As you see, it should be sending

sockwrite -n buzz.avoLocal :FlashIrcServer.1 353 Paul = %#!!Roomy :+Jonathon 'Paul

so how could I change the regex to check for the last lettercode V and send a + symbol along with the nickname when i send my 353 to the localhost socket.

Last edited by pouncer; 26/12/09 12:36 PM.
Joined: Nov 2009
Posts: 117
Vogon poet
Offline
Vogon poet
Joined: Nov 2009
Posts: 117
Post deleted by gooshie

gooshie #216983 26/12/09 02:20 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
That works perfectly thanks gooshie. I have a lil problem though, if users are owners and voiced it is sending their nickname like this

+.Jonathon

and so they appear in my nicklist like +.Jonathon whereas they should only appear as .Jonathon because owner has priority over voice in terms of how nicknames are displayed.

is there a way to add the + after the . so its like .+Jonathon (this way Jonathon would still show as owner, and when someone -q's Jonathon he would then show as voiced)

Last edited by pouncer; 26/12/09 02:32 PM.
pouncer #216986 26/12/09 07:06 PM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Code:
if ($2 == 353) sockwrite -n buzz.avoLocal $1-5 $+(:,$replace($mid($6,5,1),V,+,O,@,H,%),$gettok($6,2,44)) $gettok($7,2,44)
Don't use regex if you don't need them and especially if you don't know them.I've guessed O for op and H for halfop but just change that

Last edited by Wims; 26/12/09 07:08 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #216997 27/12/09 12:16 AM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
Originally Posted By: Wims
Code:
if ($2 == 353) sockwrite -n buzz.avoLocal $1-5 $+(:,$replace($mid($6,5,1),V,+,O,@,H,%),$gettok($6,2,44)) $gettok($7,2,44)
Don't use regex if you don't need them and especially if you don't know them.I've guessed O for op and H for halfop but just change that


Thanks but I have problems with this

Code:
alias rtest {
  var %server_str =  :FlashIrcServer.1 353 Paul = $(%#!!Roomy, ) :UMPV,.Damien UUNV,@Sarah UMNV,@Sid UMNV,.Manny[4]

  tokenize 32 %server_str

  var %output = $1-5 $+(:,$replace($mid($6,5,1),V,+,O,@,H,%),$gettok($6,2,44)) $gettok($7,2,44)

  echo -a %output
}

It echos

:FlashIrcServer.1 353 Paul = %#!!Roomy :+.Damien @Sarah

Firstly, it is missing the other nicknames,
Secondly, it needs to be .+Damien

any ideas? many thanks.

The last letter of the 4 letter code can only be V or N - noting else. V = voiced. N = not voiced. dnt care about other symbols

Last edited by pouncer; 27/12/09 12:17 AM.
pouncer #216998 27/12/09 01:36 AM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Oh ok now I see why you want $regsubex :
Code:
alias rtest {
  var %server_str =  :FlashIrcServer.1 353 Paul = $(%#!!Roomy,0) :UMPV,.Damien UUNV,@Sarah UMNV,@Sid UMNV,.Manny[4]
  var %pattern = /(...(.) $+ $chr(44) $+ ([.@]+)?(\S+))/g
  tokenize 32 %server_str
  var %output = $1-5 : $+ $regsubex($right($6-,-1),%pattern,$+($iif(\4,\3),$iif(\2 == V,+),\4))
  echo -a %output
}


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard