[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]  VBscript
. . -> [Subject]  mushclient, com objects and hooks
Home  |  Users  |  Search  |  FAQ
Register forum user name
Forgotten password?
(New message)
Subject: mushclient, com objects and hooks
Your forum user name.
Register forum user name
Your forum password.
Forgotten password?
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...

Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (19,672 posts)  [Biography] bio   Forum Administrator
Date Sat 27 May 2006 11:02 PM (UTC)  quote  ]
Also see this thread, which is about using the SAPI (speech API) to speak stuff easily:


- Nick Gammon

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

Posted by Nick Gammon   Australia  (19,672 posts)  [Biography] bio   Forum Administrator
Date Sun 06 Nov 2005 02:52 AM (UTC)  quote  ]
Version 3.68 is released now, see:


- Nick Gammon

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

Posted by Nick Gammon   Australia  (19,672 posts)  [Biography] bio   Forum Administrator
Date Fri 04 Nov 2005 08:51 PM (UTC)  quote  ]
In the next couple of days.

- Nick Gammon

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

Posted by Tspivey   Canada  (50 posts)  [Biography] bio
Date Thu 03 Nov 2005 11:50 PM (UTC)  quote  ]
When will 3.68 be released, so I can try this feature and get some scripts going for it?
I think that this is the answer to some, if not most,
of my problems - calling the screen reader through its api is sometimes
better than letting a screen reader scrape the screen and not get the results it needs.
[Go to top] top

Posted by Nick Gammon   Australia  (19,672 posts)  [Biography] bio   Forum Administrator
Date Sun 30 Oct 2005 03:52 AM (UTC)  quote  ]
This is to do with the screen reader isn't it?

I have been thinking that there isn't really an easy way to capture every line that is typed in, displayed with world.note, and sent from the MUD.

Thus I have added an extra plugin callback into version 3.68 - OnPluginScreendraw.

This hooks into the "display line" routine, in such a way that it will capture input lines (things you type), note lines (from scripts) and also output lines that have not been gagged. This should work around your problem that your screen reader currently reads the lines that appear, even if they are about to be gagged.

A small plugin, like the one below, illustrates its use.

As for the COM side of it, as Shadowfyr suggests, you simply need to open the COM object (with CreateObject) early on, and store it in a variable outside any function.

You might create the COM object in OnPluginInstall.

The arguments to OnPluginScreendraw are:

type: type of line, where 0 = output line, 1 = note, 2 = command

log: are we planning to log it?

line: the text of the line itself

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Sunday, October 30, 2005, 3:29 PM -->
<!-- MuClient version 3.68 -->

<!-- Plugin "screendraw_test" generated by Plugin Wizard -->

   author="Nick Gammon"
   purpose="testing OnPluginScreendraw"
   date_written="2005-10-30 15:27:42"


<!--  Script  -->

function OnPluginScreendraw (type, log, line)
  AppendToNotepad ("test", type, " ", log, " ", line, "\r\n")
end -- function


- Nick Gammon

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

Posted by Shadowfyr   USA  (1,776 posts)  [Biography] bio
Date Sun 30 Oct 2005 03:05 AM (UTC)  quote  ]
This is pretty simple. In both plugins and the main script file, any variable declaired 'outside' of a function is kept, so long as the script doesn't reload or the program exits.

For example, if this was your script:

dim a
dim d

sub Create_Objects (name, output, wilds)
  a = createobject("My_Object")
  b = createobject("My_Object")
  c = createobject("My_Object")
  dim d
  d = createobject("My_Object")
end sub

dim c

sub Do_Somestuff (...)
end sub

Both a and c will remain for as long as the script is not reloaded and/or you exit mushclient. b however will be lost as soon as Create_Objects returns control to mushclient, since its 'local' to Create_Objects, while the others are 'global'. 'd' is lost because you create a 'new' d, which is specifically declared 'local' by the 'dim' in that sub. (Or it should). Since b doesn't exist in the 'global' layer, its automatically assumed to be 'local' and thus vanishes, like d in this case, because it was created in the sub.

Note. All variables created using 'send to script' in triggers, aliases and timers exist in the 'global' space. This means they can overwrite values you intended to make permanent, unlike those created and destroyed in a sub, if you accidentally use the same name. This is why a, b, c, d are probably 'bad' names, while 'mywindow' or the like will prevent accidentally messing up. ;) Hope that helps.

main {
__if (Schrodinger_Cat is Alive or version >= "XP"){
____if version = "Vista" then Performance /= Number_of_Cores;
____call Functional_Code();}
____call Crash_Windows();}
[Go to top] top

Posted by Tspivey   Canada  (50 posts)  [Biography] bio
Date Sun 30 Oct 2005 02:10 AM (UTC)  quote  ]
Hello. I need to do the following:
1. create a com object, and keep it until mushclient exits.
2. on every line received (including world.note), send it to that com object.
this would exclude gags, etc.
is this possible?
I know how to create a com object with CreateObject, but not sure how to keep it there.
I"m also not sure how to hook into world.note.
[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.


It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [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.


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]    [Web site powered by FutureQuest.Net]