need some help - logging triggered text

Posted by Guest1 on Wed 18 Sep 2002 09:04 PM — 10 posts, 29,744 views.

USA #0
ok this is what I want to do:

I have an 'afk' mode on/off alias/trigger set so that if I go afk and someone tells me something, they are given an automatic response that I am afk. That part is no worries.

What I am also wanting to do is have whatever someone tells me while I'm afk to be saved to a notepad txt file.

I have 2 triggers now that both match on

* tells you *

one of the triggers (labelled afktrigger) just sends to world

tell %1 <auto reply> I am currently afk.

no worries there. the second trigger (labelled afklog) I have set to send to notepad (append) this:

%1 tells you %2

but there isn't any notepad .txt files being created ("If you are appending to a notepad window, the trigger text is appended to a window of the name: "Trigger: <label>" where <label> is the label of this trigger. If there is no label, then the window name will be just "Trigger:". If this window does not exist, it is created.")

What am I doing wrong here, can someone help please? I've searched C drive to make sure it wasn't hiding out somewhere.. no luck there.
USA #1
possibly an easier way would be to just have the one trigger that sends a tell to the world and calls a subroutine at the same time, and have the subroutine write to the txt file, but having problems there trying to figure out how to do it.. I presume using the World.writelog "message" in it?
USA #2
NO WORRIES - got it to work

used one trigger - triggers on

* tells you '*'

and sends world

tell %1 <auto reply> I am currently afk.

and calls this subroutine

sub afklog (thename, theoutput, thewildcards)
world.openlog "afklog.txt", append
World.writelog "" & thewildcards (1) & " tells you " & thewildcards (2) & ""
World.closelog
end sub


sweet :)
USA #3
oh - that should read

world.openlog "afklog.txt", false

rather than append at the end. hopefully someone will find this useful
Australia Forum Administrator #4
Quote:

I have set to send to notepad (append) this:

%1 tells you %2

but there isn't any notepad .txt files being created


It won't create a text file, it will append to a notepad window in MUSHclient. Are you sure there isn't such a window lurking behind the main world window?

Also, make sure both triggers are set to "keep evaluating" otherwise when the first one matches it won't go on and do the second one. That is probably your problem.

Doing that saves opening a file every time someone tells you something.
USA #5
hehe yup. I had the 'keep evaluating' selected ok. Several hours after posting here when I went to log off and hit the sack, I discovered the lurking windows on MUSHclient as I was shutting it down.

I felt pretty stupid. :)

I'm reverting back to that double trigger one. The opening separate .txt files is a few more clicks than neccessary, as you said. I might find a use for it somewhere else though.

Thanks as always Nick :)
USA #6
As an afterthought Nick, would it take much to have the 1-10 world buttons along the top of MC also indicate (be clickable for) the notepad window(s)? It's rare for me to ever have more than 3 worlds open/available at any given time anyway, although I don't know if this is the same for most people.. *shrug*
USA #7
add on: I'm aware of the wonders of the right click button to open the notepad window, but it would still be nice to be able to make one of the activity tool bar buttons assignable to the notepad window if I wanted to.
Australia Forum Administrator #8
This probably comes into the category of general improvements to customisation, eg. being able to assign any function to any keystroke. All this is planned for a future version.
USA #9
great :)