Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Tips and tricks
➜ Exporting Notepad to World on Notepad Close
|
Exporting Notepad to World on Notepad Close
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| WhaleProbe
(2 posts) Bio
|
| Date
| Wed 26 Jun 2013 11:56 PM (UTC) Amended on Wed 26 Jun 2013 11:59 PM (UTC) by WhaleProbe
|
| Message
| I'm trying to capture output from the lsedit command on Mucks into a Notepad for easy editing, and then send it back to the Muck when the Notepad is closed.
I've successfully setup aliases and triggers to capture the output to a named Notepad, but I have no way of sending that data back to the Muck when the Notepad closes.
Here is some example output of the lsedit command from your typical Furry muck:
Syntax: lsedit <object>=<property>
Command: lsedit me=description
< Welcome to the list editor. You can get help by entering '.h' >
< '.end' will exit and save the list. '.abort' will abort any changes. >
< To save changes to the list, and continue editing, use '.save' >
< Insert at line 1 >
Command: .p
1: Line One
2: Line Two
< listed 2 lines starting at line 1 >
At this point, the description's contents have been successfully captured by triggers into a Notepad named me=description where it can be edited.
After I've edited the contents of the Notepad, how can I send it back to the Muck automatically when I close the Notepad window? Is there a scripting event to detect when a Notepad closes? Is there a better way to do this? | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Fri 28 Jun 2013 10:40 AM (UTC) |
| Message
| In terms of user interaction, I don't believe "close this window" should mean "send this window's contents to the MUD".
Under the Edit menu are already various options for dealing with the contents, such as "Send to <world name>". |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| WhaleProbe
(2 posts) Bio
|
| Date
| Reply #2 on Fri 28 Jun 2013 02:55 PM (UTC) Amended on Fri 28 Jun 2013 02:59 PM (UTC) by WhaleProbe
|
| Message
|
Nick Gammon said:
In terms of user interaction, I don't believe "close this window" should mean "send this window's contents to the MUD".
Under the Edit menu are already various options for dealing with the contents, such as "Send to <world name>".
I didn't communicate my intent well enough. I don't want MUSHclient to do that on its own. I just want to be able to detect when a Notepad is being closed so I can decide what to do with its contents via scripting.
If there's no way to do this, I suspect I'm going to need to program an editor plugin from scratch made out of miniwindows, which really seems like overkill since there is a Notepad built right into MUSHclient (and I'm still learning LUA and plugins).
All I'm trying to do is make editing multi-paragraph descriptions on a Muck more user-friendly by redirecting their editing to a Notepad in a seamless manner through LUA scripting.
Maybe I could draw a miniwindow "close" button that exports the Notepad's lines where I need and then destroys the Notepad? In this sense I would only be taking advantage of the Notepad for its ease of editing text.
TL;DR: Looking for a scripting method to detect the event of a Notepad is being closed, not for a radically different handling of all Notepad behaviour across the board. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Fri 28 Jun 2013 10:35 PM (UTC) |
| Message
| Right now you can't attach scripts to notepad windows, things like script callbacks are attached for worlds (which have a script space) and not notepad windows.
You could conceivably detect (on a timer) that a notepad had been closed recently, however it would be too late then to retrieve its former contents.
There was a MUSH code formatter plugin ( http://www.gammon.com.au/forum/bbshowpost.php?id=2636 ) about 10 years ago. However that just relied on you manually sending the contents to the MUSH, and then closing the window.
Quote:
Maybe I could draw a miniwindow "close" button that exports the Notepad's lines where I need and then destroys the Notepad? In this sense I would only be taking advantage of the Notepad for its ease of editing text.
In the world window (not the notepad window) you could conceivably do that. You can grab the notepad's contents (GetNotepadText) and then close it (CloseNotepad). |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
19,139 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top