Register forum user name Search FAQ

Gammon Forum

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 ➜ VBscript ➜ Logging commands send via World.Send

Logging commands send via World.Send

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Magnum   Canada  (580 posts)  Bio
Date Sat 23 Feb 2002 08:09 AM (UTC)
Message
I've noticed that commands sent via World.Send do not get put in the log. (Everything under log in options is checked except HTML)

Is there a way to log commands sent via "World.Send"?

Perhaps it has something to do with my script turning echo off on occasion. Although I don't want commands to echo to the screen, I still may want them logged).

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 23 Feb 2002 09:31 PM (UTC)
Message
I suppose that should be an option? Anyway, use world.WriteLog to log anything you want to.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Magnum   Canada  (580 posts)  Bio
Date Reply #2 on Sat 23 Feb 2002 11:28 PM (UTC)
Message
Yes, make it an option please.

For the moment, I can't be bothered to go through my 1800 line script and add a world.writelog command to match every world.send I do. I am not sure I want to do that anyway, just because it would make my script that much bulkier.

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Sun 24 Feb 2002 12:34 AM (UTC)
Message
I have added that as suggestion #448.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Dubthach   (47 posts)  Bio
Date Reply #4 on Mon 25 Feb 2002 02:34 PM (UTC)
Message
In the meantime, you might consider writing a small function that takes a text argument and does both a world.send and a world.WriteLog. Then just search through your script for world.sends and replace them with your new function. This might even be nicer for you, since you could put a generic signal to yourself that the text being logged is from your own scripts.
Top

Posted by Buji   (4 posts)  Bio
Date Reply #5 on Tue 26 Feb 2002 01:12 AM (UTC)
Message
LogInput sounds (to me) like it should do this for you. Doesn't work for me though.

http://www.mushclient.com/scripts/function.php?name=LogInput&searchfor=

Top

Posted by Magnum   Canada  (580 posts)  Bio
Date Reply #6 on Tue 26 Feb 2002 10:57 AM (UTC)
Message
Not a bad solution, Dubtach. It should work well for anyone else with this problem.

I realized that the main commands I wanted to log were skill\spell commands. Since they are ALL sent through my spell queue, it's a simple matter to add a single World.WriteLog command within the spell queue code.

At least half of the other World.Send's in my script are "party tell"s. Since I see what I said echoed back to me from the mud, I don't care to see the outgoing command as well ...So I turn echo off during World.Send, and I don't care if these don't get logged.

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #7 on Tue 26 Feb 2002 11:46 AM (UTC)
Message
Strictly speaking, "commands" are things you type.

Text sent via world.send is not considered a command.

This is a semantic point, but is the reason it doesn't work right now. When the option is added in a future version you can choose whether world.send is logged.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Krenath   USA  (76 posts)  Bio
Date Reply #8 on Fri 08 Mar 2002 11:15 PM (UTC)

Amended on Fri 08 Mar 2002 11:16 PM (UTC) by Krenath

Message
Put this in your script file:

Sub LoggedSend(sText)
    World.Send sText
    World.WriteLog sText
End Sub

Then simply search-and-replace all occurrences of "World.Send" with "LoggedSend".

This approach is far better than simply wedging an extra line next to every world.send in your script file, and allows you the flexibility to change how this is handled at any time in the future.

Say you suddenly want to check to be certain the log is open before writing to the log: Just edit the definition of LoggedSend:

Sub LoggedSend(sText)
    World.Send sText
    If World.IsLogOpen Then
        World.WriteLog sText
    End IF
End Sub

If you're not already using subroutines and functions extensively in your code, you're just making things harder on yourself when it comes to maintenance.

- Krenath from
bDv TrekMUSH
ATS TrekMUSH
TNG TrekMUSE
TOS TrekMUSE
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.


29,301 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.