mIRC Home    About    Download    Register    News    Help

Print Thread
#100345 12/10/04 02:35 AM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
can /savebuff somehow save info from @window without saving colors?

coz i have some info in @window that is colored but when saving it i get those squares and numbers for bold and color codes

#100346 12/10/04 06:43 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
/savebuf itself does not have that option. What you could do is the following:

Code:
[color:green]; create a new alias to use instead of savebuf[/color]
[color:green]; to use, type /savewin @windowname filename[/color]
alias savewin {
  [color:green]; error checking[/color]
  if ($!3) { echo -a 4 savewin error: incorrect parameter count | halt }
  if ($left($1,1) != $chr(64)) { echo -a 4 savewin error: parameter 1 should be a windowname | halt }
  [color:green]; create a new window[/color]
  window @savewintemp
  [color:green]; send every line from the specified window to the new window, stripping all codes[/color]
  var %i = 1
  while (%1 <= $line($1,1)) { aline @savewintemp $strip($line($1,%i)) | inc %i }
  [color:green]; savebuf the stripped version[/color]
  savebuf @savewintemp $2
  [color:green]; clean up mess[/color]
  close -@ @savewintemp
}


NOTE: /savebuf will overwrite any existing file. If you wish to append, you need to use /filter instead. In that case, /filter is easier anyway, since it has the option to strip codes without this messy code, and also has the option to strip colors but not bold, etc.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#100347 12/10/04 05:44 PM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
this looks very nice but i noticed this:

; create a new window
window @savewintemp

so in that case i would have for each special window create new alias like this smirk

is it possible in this code to change something so it works for ANY @window ?

OR this is only copied window that is clone but works for every @window ?

Last edited by Wragg; 12/10/04 05:45 PM.
#100348 13/10/04 06:43 PM
Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
The @savewintemp window is temp(orary) and is closed at the end:
; clean up mess
close -@ @savewintemp

Also the aliases are executed in a serial way so there's no chance of a conflict between two alias executions over the same window. Simply put, the code does work with all @windows without conflicting problems.


Maybe I wake up one day to notice that all my life was just a dream!
#100349 13/10/04 07:23 PM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
i get this

4 savewin error: incorrect parameter count

why is this happening ?

i use windows that aline info from server using /who command


Link Copied to Clipboard