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

Gammon Forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  Mysterious empty line being sent from somewhere
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Mysterious empty line being sent from somewhere

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


Posted by 1of10   Canada  (54 posts)  [Biography] bio
Date Mon 10 Dec 2001 02:18 AM (UTC)

Amended on Mon 10 Dec 2001 02:20 AM (UTC) by 1of10

Message
Recap from another thread ( http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=369 ):
"...problem is the AFK command sent from the script is immediatley followed by a single empty line, which cancels the AFK, sometimes sending me into a loop."

I tried the suggestion you mentioned in the other thread
( http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=369 ). It was no help. For one, I don't think packet debug worked, even though it was shown as enabled. I didn't see anything that looked like a debug message anywhere.

A single empty line is still being sent from somewhere when I call my AFK script. I use an alias regex ^\.goafk(.*)$ to call the script to go AFK, with or without a reason. I use one subroutine to handle going AFK, testing AFK when an idle warning pops up and returning from AFK.

Here's what happens:
- I type .goafk or .goafk test reason.
- Alias calls subroutine GoAFK with the label goafk.
- Script writes a note containing timestamp and notice of going AFK, including any reason.
- Script sets variable vAFK to reason or empty string if none.
- Script sets status line to show AFK set and reason if any.
- Script sends .afk[ reason], where [ reason] is optional, to the talker server.
- Log files show something sends a single empty line causing the return noted two items down.
- Talker server confirms AFK command.
- Talker server reports returning from AFK.
- Script is triggered on return text to display a note of timestamp and return notice, clear status line and delete vAFK variable.

This is a sample of the output. Script notes begin with a timestamp.

[12:35:04am] AFK
You are now AFK, press <return> to reset.
You are no longer AFK.
[12:35:04am] AFK: Return!


This is a sample of the log file. All text in/out has a timestamp followed by either <= for inbound (to me) or => for outbound (to server). Script notes already have a timestamp.

[12:35:04am] AFK
[00:35:04] =>
[00:35:04] <= You are now AFK, press <return> to reset.
[00:35:04] <= You are no longer AFK.
[12:35:04am] AFK: Return!

It should be noted above that the command sent from within the script is not displayed in the log file.


Below is my GoAFK subroutine, written in Perl.

sub GoAFK {
	my($name, $output, $cards) = @_;
	my($jAFK, $jCard);
	if ($name eq 'goafk') {
		$jCard = substr(@{$cards}[0],1);
		chomp($jCard);
		if ($jCard eq '') {
			$world->note(&myTime . " AFK");
			$world->setVariable("vAFK", "");
			$world->setStatus("    --AFK--    --AFK--    --AFK--    --AFK--    --AFK--");
			$world->send(".afk");
		} else {
			$world->note(&myTime . " AFK: $jCard");
			$world->setVariable("vAFK", $jCard);
			$world->setStatus("    --AFK--    --AFK--  [ $jCard ]  --AFK--    --AFK--");
			$world->send(".afk $jCard");
		}
	} elsif ($name eq 'testafk') {
		$world->send(".who");
		$jAFK = $world->getVariable("vAFK");
		if ($jAFK eq '' || !defined($jAFK)) {
			$world->setStatus("    --AFK--    --AFK--    --AFK--    --AFK--    --AFK--");
			$world->send(".afk");
		} else {
			$world->setStatus("    --AFK--    --AFK--  [ $jAFK ]  --AFK--    --AFK--");
			$world->send(".afk $jAFK");
		}
	} elsif ($name eq 'afkreturn') {
		$world->note(&myTime . " AFK: Return!");
		$world->deleteVariable("vAFK");
		$world->setStatus("");
	} else {
		$world->note(&myTime . " GoAFK: Unknown label/name: $name");
	}
}

One of Ten
Secondary Adjunct of Unimatrix Z03
[Go to top] top

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 10 Dec 2001 05:35 AM (UTC)
Message
There was a problem with blank lines, see the release notes for version 3.12 ...

1. Fixed a bug where every line you sent to the MUD was inadvertently followed by a blank line. This made it very hard to log into MUDs that prompted for a character name and password, as the password was always blank.


I suggest you download the latest version, and see if that fixes the problem.

- Nick Gammon

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

Posted by 1of10   Canada  (54 posts)  [Biography] bio
Date Reply #2 on Wed 12 Dec 2001 09:23 AM (UTC)
Message
I have the latest version: 3.17. I check the website often for updates. Perhaps two bugs the same? One for typed text, one for script sent text? This is only a problem with a script. If I go AFK on my own, using the talker server command myself, there is no problem.

One of Ten
Secondary Adjunct of Unimatrix Z03
[Go to top] top

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 12 Dec 2001 10:02 AM (UTC)
Message
Yes, if there was a bug it might be the same one, however when I do the packet debug (see earlier thread) and don't see two newlines, I can't confirm there is a problem.

I repeat my offer that you send me the world file, and tell me what to type, so I can see what is happening.

- Nick Gammon

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

Posted by 1of10   Canada  (54 posts)  [Biography] bio
Date Reply #4 on Thu 13 Dec 2001 09:51 AM (UTC)
Message
I outlined exactly what is done already. Everything is handled by the one script I posted in the original message. I type
.goafk[ reason]
to call the script to send the command to the talker server.

I will send stripped copies of the world file and script file in an email.
Instructions can be found in the original message.

One of Ten
Secondary Adjunct of Unimatrix Z03
[Go to top] top

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Thu 13 Dec 2001 08:50 PM (UTC)
Message
Yes, I see what you mean. It appears that an alias will always send a blank line, so what is happening is that the script does its stuff, then the alias contents (empty in your case) is taken, a newline appended, and then the alias sent.

I have added that as bug #428.

I will have to omit the blank line if the alias output is empty, and hope that this does not affect anyone else who is relying on it.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Thu 13 Dec 2001 09:20 PM (UTC)
Message
While you are waiting for the next version of MUSHclient to be released, I have thought of a work-around for you. :)

Instead of "send" use "queue" to go AFK. ie.


$world->queue(".afk $jCard");


Make sure your "speedwalk" delay is something other than zero.

This will change the order things are done in.

Currently:


  • You type ".goafk"
  • The script does: $world->send(".afk $jCard");
  • The text ".afk (whatever)" is sent to the MUD
  • The blank alias sends a newline
  • The newline cancels AFK mode


Now what will happen is:


  • You type ".goafk"
  • The script does: $world->queue(".afk $jCard");
  • The blank alias sends a newline
  • The newline does not have much affect
  • After a delay (say, one second), the text ".afk (whatever)" is sent to the MUD
  • You stay in AFK mode





- Nick Gammon

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

Posted by 1of10   Canada  (54 posts)  [Biography] bio
Date Reply #7 on Sat 15 Dec 2001 03:20 PM (UTC)
Message
I tried the work-around you suggested, but that didn't help. No error was returned when the script file was reloaded... No error was returned when I intentionally misspelled queue, to see if it would catch it. The queue doesn't appear to do anything at all.

I'll wait for the next version. I've gone this long without a custom AFK command. I can go longer...

One of Ten
Secondary Adjunct of Unimatrix Z03
[Go to top] top

Posted by 1of10   Canada  (54 posts)  [Biography] bio
Date Reply #8 on Sun 16 Dec 2001 07:49 AM (UTC)
Message
I got the queue working. I looked through the function list and discovered the queue command requires two variables: the message and a true/false for output echo. However, it was still no help. The same thing happens using queue as when using send. The only difference is the time delay.


[11:44:31pm] AFK
[23:44:31] => 
[23:44:32] <= You are now AFK, press <return> to reset.
[23:44:34] <= You are no longer AFK.
[11:44:34pm] AFK: Return!

One of Ten
Secondary Adjunct of Unimatrix Z03
[Go to top] top

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Sun 16 Dec 2001 10:15 PM (UTC)

Amended on Sun 16 Dec 2001 10:16 PM (UTC) by Nick Gammon

Message
So much for my brilliant idea! :(

It seems the same bug infests the queued command sending, so that the queued command is followed by a final newline.

Looks like you'll need to wait for the bugfix, sorry.

I have amended the bug report to include this problem as well.

- Nick Gammon

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

Posted by 1of10   Canada  (54 posts)  [Biography] bio
Date Reply #10 on Mon 17 Dec 2001 12:04 AM (UTC)
Message
Hey, it was a good idea. I'm happy enough that there's a solution in the works. Just knowing eventually my script and custom command will work is good enough for me. MUSHclient is still the best chat/MU* client I've ever used. I'm glad I actually legally registered it.

One of Ten
Secondary Adjunct of Unimatrix Z03
[Go to top] top

Posted by 1of10   Canada  (54 posts)  [Biography] bio
Date Reply #11 on Sun 12 May 2002 01:16 PM (UTC)
Message
I just downloaded 3.20 and tested my AFK script.

I'm VERY pleased to say it works perfectly! Bug #428 has been fixed. :)

You're wonderful! MUSHclient is wonderful! Registering this software was worth it. :)

Thank you.

One of Ten
Secondary Adjunct of Unimatrix Z03
[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.


6,833 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]