mIRC Homepage
Posted By: keeker Parsing Services (Nick, Chan, Memo) - 02/06/03 04:40 PM
Hi I am trying to make windows to display notices from the network's services, and this is what i got:

Code:
on *:NOTICE:*:?:{
  if ($nick == NickServ) {
    window -e @Nickserv
    aline @nickserv $1-
  }
  if ($nick == ChanServ) {
    window -e @Chanserv
    aline @Chanserv $1-
  }
  if ($nick == MemoServ) {
    window -e @Memoserv
    aline @Memoserv $1-
  }

}


This works good to open the windows and shoot the text to the window, but how do i preserve the formatting. For example:

Code:
From The Server:
[11:19:48] -NickServ-     Nick1              Nick1@215.216.i.bwrd.com
[11:19:48] -NickServ-     Nickss             Nickss@195.214.i.bwrd.com
[11:19:48] -NickServ-     TNick              TNick@143.285.i.bwrd.com
[11:19:48] -NickServ-     xtranick           xtranick@210.159.i.bwrd.com  


But this is displayed in the @Nickserv window:
Code:
Nickss Nickss@195.214.i.bwrd.com
TNick TNick@143.285.i.bwrd.com
xtranick xtranick@210.159.i.bwrd.com   
Nick1 Nick1@215.216.i.bwrd.com

And i WANT it to be like this:
Code:
Nickss       Nickss@195.214.i.bwrd.com
TNick        TNick@143.285.i.bwrd.com
xtranick     xtranick@210.159.i.bwrd.com   
Nick1        Nick1@215.216.i.bwrd.com


any one know how i can keep the formatting that the server sends?

thanks
Posted By: JonXP Re: Parsing Services (Nick, Chan, Memo) - 02/06/03 04:44 PM
That's been bugging me for a while too. It seems that the remote scripting in mIRC always reduces whitespace in any string down to one character.
Posted By: Jerk Re: Parsing Services (Nick, Chan, Memo) - 02/06/03 04:45 PM
You can't. This has been a problem with mirc scripting forever. $1- will strip out consecutive spaces.
Just use /window's -t switch to set tab positions and use tabs to format the text.
Posted By: Online Re: Parsing Services (Nick, Chan, Memo) - 02/06/03 05:53 PM
There is a way around, but that requires a debug window open. You could do that on start, /window -h @x and /debug @x.
Code:
On *:notice:*:?:{
  if ????serv iswm $nick {
    var %w = @ $+ $nick
    window -e %w
    if $replace($line($debug,$line($debug,0)),$chr(32),$chr(160)) {
      aline %w $gettok($ifmatch,3-,58)
    }
    else aline %w $1-
  }
}
Posted By: ShadowWlf Re: Parsing Services (Nick, Chan, Memo) - 08/06/03 09:28 PM
Hmmm,

Would it be possible to edit that so that it logs into different files ie: nickserv.log, operserv.log, etc instead of opening up a @window?

Thanks
© mIRC Discussion Forums