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.
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.
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.
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-,@,%,+,&)
}
The actual contents of raw 353 begin after the 353, so the names are in fact in $4-.
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.
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.