Copying from Mud to Chat Session

Posted by Marc Dver on Wed 16 Jun 2004 07:54 PM — 7 posts, 26,131 views.

#0
My problem is simple conseptually, though difficult in execution.

What I would like to do is allow people to get certain information from my mud session using the chat plugin. Specifically, I would like to set up specific chat commands such that if a person enters "sr", Mushclient will copy the report into a variable and then paste the contents of the variable to the appropriate chat ID. I have been working with a vbscript file that can parse the data, but I can't figure out how to use a trigger in a plugin.

Also, what would be nice is a way to temporarily turn off output from the mud while the commands are going, and turn back on when the copying is done.

Here is my script file:

dim report

sub BeginSR (sName, sLine, wildcards)
world.setvariable "report", wildcards (1)
world.enabletrigger "SensorReport2", 1
world.enabletrigger "SensorReport3", 1
world.enabletrigger sName, 0
end sub

sub ContSR (sName, sLine, wildcards)
world.setvariable "report", report & vbCrLf & wildcards (1)
if wildcards (1) = "*Velocity:*" then
world.enabletrigger "FSR", 1
world.enabletrigger "SensorReport2", 0
end if
end sub

Here are my triggers so far:
<triggers>
<trigger
ignore_case="y"
match="*--[Sensor Report]*"
name="SensorReport"
script="BeginSR"
sequence="99"
>
</trigger>
</triggers>
<triggers>
<trigger
ignore_case="y"
match="*"
name="SensorReport2"
script="ContSR"
sequence="100"
>
</trigger>
</triggers>
<triggers>
<trigger
ignore_case="y"
match="-------------------------------------------------------------------------------"
name="SensorFinal"
script="FSR"
sequence="100"
>
</trigger>
</triggers>


Sincerely,
Marc DVer
USA #1
You cant trigger on chat things, if thats what you were trying to do. You have to do all that triggering in your plugin, using callbacks and the like. There are examples of this in the forums.

Thats probably your problem at the moment, youre trying to have them send something through chat, and trigger it in mushclient, yes?
Australia Forum Administrator #2
He wants to capture his sensor report and "chat" that, which is OK.

Once you have assembled the sensor report, you can use ChatEverybody to send it to everyone (just separate lines with the newline character).


http://www.gammon.com.au/scripts/doc.php?function=ChatEverybody


Also you might make the triggers "omit from output" to stop showing the data in your main screen.
Australia Forum Administrator #3
I wouldn't even change the chat plugin, make a separate set of triggers, aliases etc. and put them in their own plugin.
#4
I don't want to send to everybody, but rather to just the person who requested the sensor report.
USA #5
http://www.gammon.com.au/scripts/function.php?name=ChatPersonal

Perhaps more relevant, if youre pasting...
http://www.gammon.com.au/scripts/function.php?name=ChatPasteText
Australia Forum Administrator #6
Pasting is from the Windows Clipboard, ChatPersonal is probably the way to go.