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.
Entire forum
➜ MUSHclient
➜ Suggestions
➜ send to note, and others
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Tsunami
USA (204 posts) Bio
|
Date
| Sat 16 Apr 2005 06:39 PM (UTC) |
Message
| Something I'v been wishing for is an option that will convert anything that should have been sent to a MUD, and instead note it to the screen. I like to test/debug my plugins while disconnected, and this would save me having to go through my code and switch all the sends to notes and back, etc...
Also, a problem I posted on a little while ago while you were AWOL Nick. You may have fixed it in 3.66, because I haven't had the chance to check it yet. Line wrapping pays no attention to whether it is enabled or not, and only to the number of characters it is to wrap to. This was a problem as of 3.65. | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #1 on Sat 16 Apr 2005 07:10 PM (UTC) |
Message
| Send to Output is what you're looking for. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Tsunami
USA (204 posts) Bio
|
Date
| Reply #2 on Sun 17 Apr 2005 06:46 PM (UTC) |
Message
| Sorry Flannel, I'm not quite sure what you mean? Is that a script function, or are you talking about the option in the trigger/alias creation dialog?
I'v done some more testing with the line wrapping thing and this is what I'v found. MC always wraps to the number of characters specified, regardless of whether line-wrapping is selected or note. If it is selected however, then MC will wrap at word boundarys only, and it pays attention to the indent paragraphs option. Is that how it should be? It seems a little misleading to me. | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #3 on Sun 17 Apr 2005 06:55 PM (UTC) |
Message
| Output is a "send to" option, it's the third one down from the top.
Oh, you want a 'testing' option to automatically convert everything.
You could just write a dummy server to connect to, phantom will do this (of course it will echo back everything). |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Tsunami
USA (204 posts) Bio
|
Date
| Reply #4 on Sun 17 Apr 2005 08:23 PM (UTC) |
Message
| ah yes, I hadn't thought of a dummy server. I'll give it a go.
| Top |
|
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Reply #5 on Mon 18 Apr 2005 01:33 AM (UTC) |
Message
| Or you could use cat.exe, from poromenos.org if you want to read an entire file in. |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #6 on Mon 18 Apr 2005 09:21 PM (UTC) |
Message
| This is where Lua comes into its own. You can reassign the behaviour of the script functions by doing a simple assignment. eg.
Send = Note
Send ("say hello")
This example moves the address of the Note routine to replace the address of the Send routine in Lua's internal tables, so that subsequent Send is actually doing the Note function.
You could put that first line at the start (or logical start anyway) of your script file whenever you wanted to test offline. Then to restore normal behaviour comment it out, and reload the script file to force the script space to be re-initialised (ie. the correct Send routine to be installed).
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #7 on Mon 18 Apr 2005 09:32 PM (UTC) |
Message
| This approach would only catch scripted Sends of course, not ones where the triggers did their own sending (send to world).
You can get fancier for the scripted approach by writing your own function, which colours the line to make it more obvious, like this:
function MySend (x)
ColourNote ("blue", "white", x)
end -- function
Send = MySend
Send ("say hello")
In this example I am defining my own "Send" function that does a ColourNote, so the replaced Sends stand out.
The only problem with the above example is that it assumes a single argument to Send, whereas in the Lua interface you can have multiple arguments. A slightly more complicated replacement function will handle that:
function MySend (...)
for i, v in ipairs (arg) do
ColourTell ("blue", "white", v)
end -- for
Note ("")
end -- function
Send = MySend
Send ("say ", "hello")
This uses "..." to specify multiple arguments to be collected in the "arg" table, and then iterates through that to display each one using ColourTell (to keep them on the same line) and finishes with a Note to end the line. |
- 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.
24,114 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top