Seperate captures into different notepad windows with different names

Posted by forral on Sat 10 Oct 2009 12:20 PM — 13 posts, 47,610 views.

USA #0
*edit* Crap, my post got wiped out when I tried to copy my mud output.


I recently got, with help of Twisol, my wine to append captures to a notepad window. However, I would like to take it one step further and append captures to different windows, grouped together by category (clantalk, alliancetalk, and form talk in one....tells, pktalk, and relays in the other)

I noticed there is a command in the help file (Lua) of the following:

ActivateNotepad("Nick's Window")

Will that call a notepad with a different name every time the trigger fires? Or just once?

As per the trigger help submission guidelines, here is some info:

Literal copy of trigger: * tells you '*

Text to match: Duende tells you 'look at the mushclient forums'

Scripting language: Lua seems to be the easiest, but I am willing to learn any of them.

No error message

Does work, but appends them all to a new window. I would like 3 notepad windows to be created when I start MUSH, each corresponding to a different group of captures, and have the triggers selectively post to these 3 windows.

I am using version 4.43 of MUSHclient.



I hope the info I provided is useful in determining a solution which, I am sure, will be incredibly simple. I will tinker with some settings and post back if I have any luck.

Thanks for any help,
Killa


*EDITEDIT* Ok I had some mild success: I went through each trigger, and gave them each a separate label. However, now each and every capture opens up a separate window. How would I make it so that X X and X captures go in 1 window, and Y Y and Y captures go into another?
Amended on Sat 10 Oct 2009 12:35 PM by forral
USA #1
I think what you really want is AppendToNotepad(). As per the documentation:

Quote:
Appends the text to a notepad window of the given title. If no such window exists, it is created.

The function "AppendToNotepad" does not activate (bring to the front) the notepad window. However the function "ActivateNotepad" can be used to do that.

You can use world.activate to activate the world itself (eg. you might want to do that after creating a notepad window).

You might use GetNotepadLength to check if there is likely to be room in the notepad for the new text.


ActivateNotepad(), as far as I know, only brings a specific notepad "to the front", which has no effect on appending.
USA #2
Twisol said:

I think what you really want is AppendToNotepad(). As per the documentation:

Quote:
Appends the text to a notepad window of the given title. If no such window exists, it is created.

The function "AppendToNotepad" does not activate (bring to the front) the notepad window. However the function "ActivateNotepad" can be used to do that.

You can use world.activate to activate the world itself (eg. you might want to do that after creating a notepad window).

You might use GetNotepadLength to check if there is likely to be room in the notepad for the new text.


ActivateNotepad(), as far as I know, only brings a specific notepad "to the front", which has no effect on appending.


Alright that solves part of the issue. Is there a way to split up my captures to go to different windows? Because from my experimentation, you cannot give two windows the same title, and I don't like having 6 windows all crowding up the screen. I've talked to some players in game and they say its really complicated coding to try and have the script target a specific window...can you shed some light on this twisol?
USA #3
After six script commands and some window resizing, I have this setup[1]. Each notepad has a numeric name here, but obviously that's not required. This is the script I used:

AppendToNotepad("1", "Notepad 1")
AppendToNotepad("2", "Notepad 2")
AppendToNotepad("3", "Notepad 3")
AppendToNotepad("4", "Notepad 4")
AppendToNotepad("5", "Notepad 5")
AppendToNotepad("6", "Notepad 6")


In practice, you might name one "Tells", and sort all TELLs you get into it. Another might be "TimeChanges", where you make a note of the passing of time in the MUD. Et cetera.

EDIT: Also, I'm not really sure what you want here. You don't want multiple windows cluttering the screen, yet you want your scripts to target multiple windows?

[1] http://img237.imageshack.us/img237/5578/mushnotepads.png
Amended on Sat 10 Oct 2009 09:57 PM by Twisol
USA #4
Twisol said:

After six script commands and some window resizing, I have this setup[1]. Each notepad has a numeric name here, but obviously that's not required. This is the script I used:

AppendToNotepad("1", "Notepad 1")
AppendToNotepad("2", "Notepad 2")
AppendToNotepad("3", "Notepad 3")
AppendToNotepad("4", "Notepad 4")
AppendToNotepad("5", "Notepad 5")
AppendToNotepad("6", "Notepad 6")


In practice, you might name one "Tells", and sort all TELLs you get into it. Another might be "TimeChanges", where you make a note of the passing of time in the MUD. Et cetera.

EDIT: Also, I'm not really sure what you want here. You don't want multiple windows cluttering the screen, yet you want your scripts to target multiple windows?

[1] http://img237.imageshack.us/img237/5578/mushnotepads.png



Sorry for confusing you Twisol, I wasn't very clear in what I meant.

What I meant was the way I had it set up was each trigger opening to a different window, and combine that with 6-8 triggers, it can get a bit messy. What I want to have it similar to what you have, except I will most likely only use 3 windows, and have 2 captures per window, that is all.

I will try this out and post my results, along with a screenshot.
USA #5
Good news, I was able to get my captures working. Since I was running MUSH on Wine, the VBScript and Lua languages didn't seem to want to work (for whatever reason). I was able to get my captures working by using the Jscript language, and my friend in the game provided me the code snippet.

I further went on to customize some of the options, like tabs along the top to help me keep all my captures organized. Everything works perfectly and thanks alot for your help Twisol.
USA #6
L337killa07 said:
Since I was running MUSH on Wine, the VBScript and Lua languages didn't seem to want to work (for whatever reason).


That's strange; those are the two that should work out of the box under both Windows and Wine. Regardless, glad to hear it's working for you!

EDIT: At least Lua; I'm not entirely sure about VBscript.
Amended on Tue 13 Oct 2009 05:55 PM by Twisol
Australia Forum Administrator #7
Lua should certainly work under Wine, I have tested lots of Lua plugins on Wine.

Make sure that you have your Wine emulation set to Windows 98, if not, various things may crash the client (particularly opening notepad windows).

When you say "Lua languages didn't seem to want to work" - in what way? Did they crash? Was there an error message?
USA #8
Nick,

When I tried using Lua, the captures just didn't show up. I cannot remember the bit of code I used right now but I will find it and post it. And I will also make sure I am emulating under windows 98, although I'm sure I set that option previously.

If I recall, I think there WAS an error message, but again I cannot remember and would have to wait until later today to post it (after class, of course).

Both Lua and VBscript gave me errors when trying to run the captures using Wine, but perhaps it was just my fault and my novice coding skills.

Sorry for the vague details but like I said I cannot remember off the top of my head. I will boot into Linux later today, load up wine, and try to replicate the errors and post the error codes.
USA #9
Error number: -2146827273
Event: Execution of line 1 column 90
Description: Unterminated string constant

Line in error:

world.AppendToNotepad("Misc", "[PKTALK C] Haley: 'about to sac this piece of crap jhepps'
Called by: Immediate execution


Ok thats the error. What I did was take my world file that works perfectly in Wine under Linux, all the captures work fine using JScript, I copied + pasted it over into windows, loaded the world file, and it starts giving me that error.

Not sure what the issue may be. if you need any more details let me know please.
Netherlands #10
You don't properly terminate the command. You'll probably want to put a ") at the end of that line, one to end the string and one to end the list of parameters.
USA #11
Quote:

world.AppendToNotepad("Misc", "[PKTALK C] Haley: 'about to sac this piece of crap jhepps'")


I think your code needs to be

AppendToNotepad("Misc", "%0")


you're missing the close quote (which terminates the string)
USA #12
Oh of course, I knew it was something silly like that...

I have been a bit distracted lately but I am going to spend some time this weekend to sort these captures out....I want to just use 1 language across both OS's to keep things simple.

Thanks everyone for the help!