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 ➜ Perlscript ➜ Controlling chat-functionality completely with scripts?

Controlling chat-functionality completely with scripts?

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


Posted by j0nas   (56 posts)  Bio
Date Mon 29 Sep 2003 02:53 PM (UTC)
Message
I'd like to be able to control the chat-functionality of MUSHclient entirely using scripts, in this case Perlscript. I'd like to be able to remove any chat-output from the main window, and have it all go through my script before being displayed to the user.

What I'm trying to accomplish with this is a connection with an external Java-application I've written, allowing the Java-app to take over some of the nastier parts of my script, the parts that are becoming too complicated to work well with the blocking nature of scripts in MUSHclient. I'd like my script to be able to send data to other chat-users, and in return process the data returned from these users, all without bothering the user at the keyboard with more than the output the script decides he needs to see.

I've been looking at what's available right now, and either I'm misunderstanding the scripting-support mentioned in http://www.mushclient.com/mushclient/chat.htm , or this can't be done right now.

Any tips would be appreciated. :)
Top

Posted by j0nas   (56 posts)  Bio
Date Reply #1 on Mon 29 Sep 2003 03:00 PM (UTC)
Message
Update, these are some functions I'm trying to use to 'mute' the chat-output to the text-window. They're not working at all, perhaps I'm doing something wrong?


sub OnPluginChatMessage {
	my ($id, $message, $text) = @_;
	return 0;
}

sub OnPluginChatDisplay {
	my ($message, $test) = @_;
	return 0;
}


Furthermore, the Java-application mentioned previously is already written, and will establish communication over the zChat-protocol without any hassle. It sends and recieves information, all that's left is the perlscript-backend for MUSHclient, and I'll be able to pull off some amazing things. :) If the script-part starts working semi-decently, I'll be sure to post the Java-source under the Tips & Tricks for those interested, with Nick's permission.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 30 Sep 2003 06:55 AM (UTC)
Message
You can totally control chat with scripting. It was written to do that. See:

http://www.gammon.com.au/forum/?bbsubject_id=1692

I tested your script:


sub OnPluginChatDisplay {
	my ($message, $test) = @_;
	return 0;
}


It worked as advertised - the message did not appear in the output window. However it must be in a plugin (it is a plugin callback) - it won't work in a regular script file.

- Nick Gammon

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

Posted by j0nas   (56 posts)  Bio
Date Reply #3 on Tue 30 Sep 2003 04:51 PM (UTC)
Message
Yes, doing it in a plugin works perfectly, thanks.
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.


15,434 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.