mIRC Home    About    Download    Register    News    Help

Print Thread
Help with Raw 353 #146504 05/04/06 02:46 PM
Joined: May 2005
Posts: 449
bwr30060 Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
I'm trying to process Raw 353 and add the names of the users in a channel to a listbox, and I'm not sure how. I'm working on an admin console, and actually having a bot connect to my server through a socket in this script. The bot has to send and receive messages in raw format since it's not really using mIRC to communicate the way we usually do. I need to get all of the names out of Raw 353 (the names list) and also strip out any of the status characters, like @ or &. The Names list looks like this:
353 Blake = #chat :&AdminBot Blake
Thanks for any help.

Re: Help with Raw 353 #146505 05/04/06 10:21 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The names of the people on the channel, as returned via raw 353 are located in $4-
To get those names without the prefixes, your could use $remove($4-,@,%,+)
This would remove the standard @ (for ops), % (for half-ops) and + (for voiced) from the string in $4-, leaving just the names. If you are aware of more status characters, like the & which is used on some networks to show administration, then just add the & to the list of items to be removed.

Once you have that list, you can add it to your dialog list using $didtok

So in the long run you could use something like
raw 353:*:{ didtok <Dialog> <ID> 32 $remove($4-,@,%,+,&) }

Please note that if raw 353 has to be returned more than once, I'm unsure if the names list in the dialog will be updated to include the new informatiion from the extra raw 353's or if the information from (for example) the 2nd raw 353 would replace that from the first.

Re: Help with Raw 353 #146506 05/04/06 11:48 PM
Joined: May 2005
Posts: 449
bwr30060 Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
Thanks, but that isn't working for some reason. I turned the debug window on and did a /names. It returns this:
:blakenet.myftp.org 353 Blake = #chat :AdminBot @Blake
So I think that means that I want $6-. However, I tried it your way and with $6- and neither work. I'm also having a problem getting what's read from the socket to be put in an editbox. Can someone take a look at my code and tell me why it's not working? It only ever puts a part of the first line it gets from the socket in my admin console's "status window". Thanks.
Code:
on *:dialog:admin:sclick:22:{
  botsock
}
alias botsock {
  sockopen bsock 192.168.1.101 6667
}
on *:sockopen:bsock:{
  sockwrite -n $sockname NICK AdminBot
  sockwrite -n $sockname USER AdminBot Dorothy blakenet.myftp.org AdminBot
  sockwrite -n $sockname JOIN #chat
  sockwrite -n $sockname JOIN #VB
  sockwrite -n $sockname JOIN #Help
  sockwrite -n $sockname NAMES #Chat
}
on *:sockread:bsock:{
  sockread %temptext  
  did -a admin 66 %temptext $+ $crlf
  if ($gettok(%temptext,1,32) == PING) {
    sockwrite -n $sockname PONG $gettok(%temptext,2,32)
  }
}
raw 353:*:{ 
  didtok admin 4 32 $remove($6-,@,%,+,&amp;) 

}

Re: Help with Raw 353 #146507 06/04/06 12:39 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
The actual contents of raw 353 begin after the 353, so the names are in fact in $4-.

Re: Help with Raw 353 #146508 06/04/06 01:35 AM
Joined: May 2005
Posts: 449
bwr30060 Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
I just realized my mistake. For the bot part of the connection, I'm actually using a socket to connect to my server, so it isn't really where mIRC could process the raw codes, it's just data being passed through a socket. I might actually change this to run on a separate instance of mIRC instead of using the socket thing. That would probably be easier. As for my other post about not getting all the data, I think I might be on to a solution. Thanks for your help.

Re: Help with Raw 353 #146509 06/04/06 03:54 AM
Joined: Dec 2002
Posts: 580
N
NaquadaServ Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Why the hell would you use mIRC's socket support to connect to an IRC server???

That's like asking a blind man to run around the block.


NaquadaBomb
www.mirc-dll.com