[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  How does log work

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

How does log work

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Buji   (4 posts)  [Biography] bio
Date Tue 26 Feb 2002 01:20 AM (UTC)  quote  ]
Message
Should this work?

sub LogTest()
world.openlog "test.txt", false
world.logoutput = 1
world.loginput = 1
world.send "l"
world.closelog()
end sub

[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 26 Feb 2002 11:55 AM (UTC)  quote  ]
Message
Logging logs output from the mud, and things you type (actually type, not world.send).

The reason logging does not log things in a script is that, if the script wants them logged, it can do it itself. A recent post suggest that if you want that then make your own function to do just that. That would be less typing anyway. eg.


sub Sendit (strText)
world.send strText
world.writelog strText
end sub


Thus you can now call "sendit" to send and log rather than "world.send". You can see that calling "sendit" is less typing, but automatically logs.

With this functionality available it seems unnecessary to worry about whether or not world.send logs in its own right.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Buji   (4 posts)  [Biography] bio
Date Reply #2 on Tue 26 Feb 2002 07:10 PM (UTC)  quote  ]
Message
I like the idea of sendIt. The other problem I'm having is that the output from the "l" (look) is not being logged. The log is created, but empty. Should have made that clear in my first post, sorry.
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 27 Feb 2002 12:42 AM (UTC)  quote  ]
Message
Ah I see. Your script sends the "L" command to the mud and then immediately closes the log (during the execution of the script). Thus the log is closed by the time the mud responds.

If you really wanted to capture something like a "look" output but nothing else, you would need to do it a bit differently. Here is one idea (remembering that the the mud might have stuff queued up to send you before it gets the "look" command).

1. Send a special string that is unlikely to occur normally.
2. Have a trigger that matches on that string and turns logging on.
3. Send the "look" command.
4. Send another special string.
5. Have another trigger that matches on the second string, this trigger turns logging off.

eg. something like this:

world.send "think $*&%$(*&%$FKJEDLKJSKDF"
world.send "look"
world.send "think 39u349flkjdfkjh&$%&$"

The triggers that match on the 2 funny strings could "omit from output" to avoid annoying you.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


1,743 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]