mIRC Home    About    Download    Register    News    Help

Print Thread
#72721 25/02/04 07:51 AM
Joined: Sep 2003
Posts: 8
S
sgh Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Sep 2003
Posts: 8
Correct me if I'm wrong, but I haven't found a way to clear just a specified number of lines off a window's buffer. It could clear them from the end of the window's buffer or <from line>-<to line> just like /savebuf.

That would be useful when, for example, someone sends 1 or more lines full of control codes and you want to clear them without losing all of your buffer and can't resign to strip control codes. That could be added with another switch to /clear ... smile


"Blessed is he who expects nothing, for he shall never be disappointed." (Benjamin Franklin)
#72722 25/02/04 09:59 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
i was gonna say use /dline but i guess your talking about channel windows.

I doubt there well ever be a selective lines remove for channels, but a delete the first X number of lines might be nice.

The reason i dout the selective, is it would be well used to manipulate the screen to trick unssuspecting people into thinking only some things were said etc etc.

While i disagree with this reasoning for limiting commands, it seems to be prevalent.

#72723 26/02/04 02:20 PM
Joined: Apr 2003
Posts: 414
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 414
Here is a litle script.. But it will screw the standart mIRC colors..
Code:
;Example of ussing /Dlines #Channel 1-2
Alias DLines {
  window @@Dline
  filter -cww $1 @@Dline
  dline @@Dline $2-
  ;filter -cww @@Dline $1 | ;filter can't fill the channels ;]
  clear $1
  var %i = 1
  while (%i &lt;= $line(@@Dline,0)) { echo $1 $line(@@Dline,%i) | inc %i }
  window -c @@Dline
}


mIRC Chm Help 6.16.0.3 Full Anchored!
#72724 27/02/04 01:27 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
great script, I wacked some extras in that speed it up a little, normally I wouldnt have posted it here, but i wanted to say how good I thought it was, I looked at it and just went, "hmmm bummer filter dont work on channels, oh well".

Code:
DLines {
  var %a = $active
  window -c @@Dline
  window -hn @@Dline
  filter -cww $1 @@Dline
  dline @@Dline $2-
  ;filter -cww @@Dline $1 | ;filter can't fill the channels ;]
  var %c = $window($1).state
  window -n $1
  clear $1
  var %i = 1
  while (%i &lt;= $line(@@Dline,0)) { echo $1 $line(@@Dline,%i) | inc %i }
  window $gettok(-n -m -h -r,$findtok(minimized maximized hidden normal,%c,1,32),32) $1
  window -c @@Dline
  window -a $+(",%a,")
}

#72725 27/02/04 02:31 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You can greatly speed it up by avoiding the loop. /filter doesn't work on a channel but /loadbuf does:
Code:
alias DLines {
  close -@ @@
  window -h @@
  filter -ww $1 @@
  dline @@ $2-
  savebuf @@ temp.txt
  loadbuf -pir $1 temp.txt
  window -c @@
  .remove temp.txt
}


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#72726 27/02/04 07:37 PM
Joined: Apr 2003
Posts: 414
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 414
Thanks ;')


mIRC Chm Help 6.16.0.3 Full Anchored!
#72727 27/02/04 10:30 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Well theres an advantage the loadbuf/savebuf have over filter.

Odd that filter wont do it, when there is such an easy workaround.
(i say easy now after i was shown it smile )

#72728 13/09/05 09:36 PM
Joined: Apr 2004
Posts: 19
L
Pikka bird
Offline
Pikka bird
L
Joined: Apr 2004
Posts: 19
I was looking for a function like this too, when I found this very useful topic. In my case I want to have the possibility to delete lines in query windows. With this script that is no problem, but I found myself having problems on the function of deleting for instance only the last 10 lines in the query window. Does someone have a suggestion on how to handle this?


Link Copied to Clipboard