mIRC Homepage

Up-Arrow Buffer

Posted By: MrBucket

Up-Arrow Buffer - 01/06/05 07:53 PM

THank you for mIRC.

For the sake of those familiar with Irssi if the up-arrow buffer for the edit box contained the last thing submitted instead of an empty up-arrow buffer when opening a new window/channel.

kthx
Posted By: Brax

Re: Up-Arrow Buffer - 01/06/05 09:25 PM

And just why should mIRC work like Irssi? :tongue:

And having an "empty up-arrow buffer when opening a new window/channel" is pretty logical to me. (You opened new window.... how can there be some 'history'?)
Posted By: Kelder

Re: Up-Arrow Buffer - 01/06/05 10:32 PM

Why shouldn't mIRC use some good features of other clients?

As for the logic: a channel window for a specific network can surely have history, mIRC puts lots of logs in there, why would storing the last input from editboxes be different? For custom @windows (with an editbox) the history can be remembered by name. Using a specific window name again seems like a decent clue that it's the same window as last time, so the history can be relevant.


For the actual proposition: some people might love that their /msg nickserv identify password line is remembered when mIRC is started the next day. Others will probably hate it, or don't know about it and have someone take advantage of it.

Maybe a way to add entries to that list with a script? Then just write a simple on JOIN or on OPEN trigger to reload the history yourself. For getting the info: either a special $identifer or just use on INPUT...
Posted By: Armada

Re: Up-Arrow Buffer - 01/06/05 10:38 PM

Sorry horrible idea, think about there is a reason wny theres a chat buffer as well, say Im online 3 days straight now thats just another thing mirc has to hold in memory
Posted By: DaveC

Re: Up-Arrow Buffer - 02/06/05 04:11 AM

Quote:
Maybe a way to add entries to that list with a script?


/window -a @targetwindow
/editbox -n @targetwindow texthere

^ that well store into the history list already.
Posted By: Kelder

Re: Up-Arrow Buffer - 02/06/05 04:30 PM

I made it /window -ae @targetwindow, but the /editbox -n @win/#chan text executes/msg's the given text, that's not what was requested... Also, it doesn't update the up-key history, the line /editbox added doesn't show up, while previous typed-in /cmds or messages do.
Posted By: DaveC

Re: Up-Arrow Buffer - 03/06/05 12:19 AM

So what your saying is, you were given clear instructions what loads the history list of a @window and then you did SOMETHING ELSE, and you say it doesnt work? WOW i dont really have a clue why that might have happened. <snicker snicker>

And as to it activates the command entered, I never said it didnt, that was simply how to load the buffer, it doesnt take much to halt a command of course.

In case you dont think it can be done.

Code:
;load the history buffer of any window(s)
;usage /load.history windowname text
; ^ windowname can only be one word
;usage $load.history(windowname,text content)
; ^ windowname can be multiple words ie: "status window", NB if hardcoding text beware of the limitation of placing commas
;
;NB : History well not be stored untill calling script completes
;
alias load.history {
  if (($len($1) == 0) || ($len($2) == 0)) { return }
  hadd -m history.spool.buffer Buffer.Start $int($calc($hget(history.spool.buffer,Buffer.Start) + 0))
  hadd -m history.spool.buffer Buffer.Finish $iif($int($calc($hget(history.spool.buffer,Buffer.Finish) + 1)),$v1)
  hadd -m history.spool.buffer $v1 $+($1,$cr,$2-)
  .timer.despool.history.spool.buffer 1 0 despool.history.spool.buffer
}
alias -l despool.history.spool.buffer {
  if ($0) { var %active = $1- } | else { var %active = $active }
  var %start  = $int($calc($hget(history.spool.buffer,Buffer.Start) + 0))
  var %finish = $int($calc($hget(history.spool.buffer,Buffer.Finish) + 0))
  while ( (%start &lt;= %finish) &amp;&amp; ( ($numtok($hget(history.spool.buffer,%start),$asc($cr)) &lt; 2) || (!$numtok($gettok($hget(history.spool.buffer,%start),1,$asc($cr)),32)) || (!$numtok($gettok($hget(history.spool.buffer,%start),2-,$asc($cr)),32)) || (!$window($gettok($gettok($hget(history.spool.buffer,%start),1 ,$asc($cr)),1-,32))) ) ) { inc %start }
  if (%start &lt;= %finish) {
    hadd -m history.spool.buffer Buffer.Start %start
    var %window = $gettok($gettok($hget(history.spool.buffer,%start),1 ,$asc($cr)),1-,32)
    var %text   = $gettok($gettok($hget(history.spool.buffer,%start),2-,$asc($cr)),1-,32)
    hdel history.spool.buffer %start
    set -u1000000000 %history.buffer.load.text %text
    .timer.despool.history.spool.buffer 1 0 despool.history.spool.buffer %active
    window -a $+(",%window,")
    editbox $iif((%window == Status Window),-ns,-n %window) %text
  }
  else {
    hfree -w history.spool.buffer
    window -a $+(",%active,")
  }
}
on *:INPUT:*:{ if ($1- == %history.buffer.load.text) { unset %history.buffer.load.text | halt } }


and example alias is below on how to load them

Code:
alias example {
  window -c @targetwindow1 | window -e @targetwindow1
  window -c @targetwindow2 | window -e @targetwindow2
  window -a "status window"
  load.history @targetwindow1 this is t1 line 1 $time
  load.history $chan(1) a line in $chan(1) $time
  load.history @targetwindow1 this is t1 line 2 $time
  load.history @targetwindow3 this is t3 line 1 $time
  load.history $chan(2) a line in $chan(2) $time
  $load.history(Status window,status window text $time)
  load.history @targetwindow2 this is t2 line 1 $time
  load.history @targetwindow1 this is t1 line 3 $time
  load.history @targetwindow2 this is t2 line 2 $time
}


The flickering between windows is the only unavoidable problem, due to the way mirc handles the history list, only text entered into the active window well be saved to history.
Posted By: SergioNL

Re: Up-Arrow Buffer - 03/06/05 01:09 AM

you mean tools / options / irc / logging / reload logs ?????
Posted By: Kelder

Re: Up-Arrow Buffer - 03/06/05 11:49 AM

Thank you for being so nice with me. I will type EXACTLY what you said the first time into status window:
/window -a @targetwindow
/editbox -n @targetwindow texthere

And what do I get: a custom window @targetwindow without an editbox and
-
* /editbox: invalid window
-


Now, that's all very fancy and stuff, but there's no editbox to use the up arrow to see if there's some history in it, and there's no extra history in the status window editbox either.
So I'm kinda thinking 'maybe he overlooked something small' and at least put in an actual editbox so there's no error anymore. This results in absolutely nothing for that custom window. Nothing is done (that's ok for me) but when I use the up arrow in the editbox, there's still no history, only the aint-nothing-here-beep.

----

Now for the script stuff, after carefully reading it and testing it out, it appears the /editbox command only works ok when the @win/#chan is active. I have the habit of typing those commands in Status Window, so then it won't work. Also you have to use the on INPUT trigger to halt the text. It's a hack, but apparently there's no other way...

Here's what the example above should have looked like:
//window -ae @targetwindow | editbox -n @targetwindow texthere
//window -a #channel | editbox -n #channel texthere
warning: use on *:INPUT:@targetwindow,#channel:halt to prevent it from executing/sending it

Anyway, your script seems to do the trick, so irssi-lovers have another reason to use mIRC smile
Posted By: DaveC

Re: Up-Arrow Buffer - 04/06/05 12:23 AM

Your just trying to be pedantic now. (hehe i had to look up the spelling on that and the meaning)

I stated the method to add a line to the (history) list was... "that well store into the history list already"
I may have wrongly assumed that from that you would have realised I ment an already correctly formated window is the @targetwindow.

I must say tho If i stated how to place a graphic dot and see it i would have said.
/drawdot @targetwindow 1 1 10 10

This of course would get * /drawdot: invalid window on its own.
© 2021 mIRC Discussion Forums