TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

History/buffer questions

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
ranix



Joined: 22 Aug 2007
Posts: 5

PostPosted: Wed Aug 22, 2007 11:05 pm    Post subject: History/buffer questions Reply with quote

I have some questions about the input buffer (am I calling it right?)

I used a mud client that stripped all commands less than two characters from the buffer. If you entered these commands:

n
w
exam sack
s
l

And then pressed the up arrow, you would get "exam sack" in your buffer. How do I enable this functionality in TinTin++?

Also, something perhaps slightly more difficult. If I were to enter the following commands:

look
foobar
funny
sneak
explode

and then type the letters "fo" into the input line and press the up arrow, it would fetch the most recent item in the entry history that matches that input and autocomplete to "foobar". Is there any way to enable this functionality in TinTin++?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Aug 23, 2007 1:58 am    Post subject: Reply with quote

The general idea is to type: !fo to repeat the last command starting with fo.

Another way is the interactive search which is enabled by pressing ctrl-r, then type fo, which would find foobar as well, though pressing up and down would show older matches starting with fo while inside the interactive search.


I'll add not including 1/2 letter commands to the todo list.
Back to top
View user's profile Send private message Send e-mail
ranix



Joined: 22 Aug 2007
Posts: 5

PostPosted: Thu Aug 23, 2007 3:02 pm    Post subject: Reply with quote

Can you toss me a little bone, Scandum, and give me a hint on where I might find that input history in the code?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Aug 24, 2007 5:16 am    Post subject: Reply with quote

Most is in history.c and cursor.c
Back to top
View user's profile Send private message Send e-mail
ranix



Joined: 22 Aug 2007
Posts: 5

PostPosted: Fri Aug 24, 2007 9:23 am    Post subject: Reply with quote

Thanks, found what I was looking for. I made the first change already; I'm no longer adding lines to the history if the line length is shorter than a chosen value.

I'll see what I can do about matching to the most recent history line on >up arrow< or maybe >ctrl+up arrow<
Back to top
View user's profile Send private message
ranix



Joined: 22 Aug 2007
Posts: 5

PostPosted: Fri Aug 24, 2007 7:02 pm    Post subject: Reply with quote

I have added these two features.

The first is just a hack, I just added a conditional to not perform insertnode_list(...) if the line's second character is '\0'.

The second is more interesting, but not as fast as it could be; I've used some local variables that I could have made global to trade a few bytes of ram for a few less cpu cycles. I used GNU regular expressions (regex.h) to repeatedly perform some parts of history_prev(...) to compare the contents of gtd->input_tmp to gtd->input_buf

I think it works rather well, and it definitely makes player killing MUCH easier for me. The utility comes from being able to rest or sleep, and entering big commands:

murder foo
dirt foo
c blind foo
c light foo

And then to recall them simply by typing a couple characters and stabbing the up arrow. I think this is superior to your ! notation because you can catch a glimpse of the command you're entering for a few milliseconds; enough time to catch your bearings and make a mental note of what actions you're taking.

Should I post this change somewhere, maybe get some feedback on it? I probably only added between 10 and 20 lines of code.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sat Aug 25, 2007 2:34 am    Post subject: Reply with quote

Well, you can already type: ctrl-r -> foo -> ctrl-p -> ctrl-p to do the same thing.
Back to top
View user's profile Send private message Send e-mail
ranix



Joined: 22 Aug 2007
Posts: 5

PostPosted: Sat Aug 25, 2007 12:14 pm    Post subject: Reply with quote

    That way isn't as fast
    It searches for substrings, not the beginning of the line
    It's not as useful in a PK situation


If you don't care about it, that's fine. But there are reasons these features are in Zmud and JMC, and these are the reasons that people use them instead of tt++. I think with these features there's no reason to use JMC over tt++ anymore
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Aug 26, 2007 9:51 am    Post subject: Reply with quote

Ah, I thought you wanted a substring search.

I guess a prefix search can't hurt, I'll add it for the next release.
Back to top
View user's profile Send private message Send e-mail
CroX



Joined: 27 Sep 2007
Posts: 5

PostPosted: Thu Sep 27, 2007 7:22 am    Post subject: Reply with quote

(I hope this is not too much OT. Please feel free to move if so.)

I have just started looking into TT++ and so far I'm loving what I'm seeing! There are, however, some big usability features I do miss from my previous clients.

One is that of partial command recollection, which you allready stated will be added to the next version. Thumbs up for that!

Another is tab completion, from the buffert. MUSHclient got that and I find it such a useful feature that I'm considering keeping MUSHclient (through Wine, mind you) for that sake solely. The idea is that when you see a name, such as CroX, you can type in "give all gold to cr", press tab and you will be one enter from giving me your shinies. Smile It's wonderful! Could we expect something similar from TT++?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Sep 27, 2007 1:45 pm    Post subject: Reply with quote

Tintin already has tab completion though it doesn't use the scrollback buffer to determine possible tabs.

Possibly you could write a trigger that automatically adds names to the tab list? I don't think using the last two or three pages of text from the scrollback buffer would be as effective as a decent trigger.
Back to top
View user's profile Send private message Send e-mail
CroX



Joined: 27 Sep 2007
Posts: 5

PostPosted: Fri Sep 28, 2007 6:23 am    Post subject: Reply with quote

Scandum wrote:
Tintin already has tab completion though it doesn't use the scrollback buffer to determine possible tabs.

Possibly you could write a trigger that automatically adds names to the tab list? I don't think using the last two or three pages of text from the scrollback buffer would be as effective as a decent trigger.

This could open up for even more intelligent tab completion, than what MUSHclient has. Thanks, I'll look into it!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group