Quote:
Triggers can fire on world.note's, right?
No, triggers fire on incoming text from the MUD, aliases fire on what you type, and nothing fires on notes.
Quote:
Can you take a line received from the mud, and internally send it to the trigger matching routine of a different world?
Ah, not exactly. I suppose a trigger could do this:
sub mytrigger (sName, sLine, wildcards)
world.getworld ("my-other-world").send sLine
end sub
This would send it to the other world, and it would then go through the trigger matching routine, however this seems a bit circuitous.
Quote:
Can you take the line entered into the command box, and internally send it to the alias matching routine of a different world?
Not really. I suppose you could use a similar technique to the above, but use "setcommand" instead of send, but it is not really doing that.
Quote:
Can you take all "send" data from a world, and internally send it to another world?
No, I think not.
You are trying to set up multiple virtual machines, aren't you?
The basic MUSHclient COM object is the document, or "world". It is the thing that has:
- A TCP/IP connection to a MUD site
- Some attributes, like whether things you type are echoed
- A scrollback buffer, part of which you see in the output window
- Some trigggers, aliases, timers, and variables, which are owned by that world
- A scripting environment, if enabled.
I simply can't see multiple "worlds" that belong to the same "world" being a viable concept, let alone a useful thing to program. Maybe, if I had thought of it early enough, aliases and timers etc. could have been grouped into "groups of things", however I didn't, and to change it now would render lots of existing scripts invalid.
The best I can do, and I think it will work quite well, is to do something like the plugin concept, and also things like "groups of triggers" (eg. all triggers labelled with a group identifier "xyz"). Then you might enable a group, disable a group, delete a group. But basically they would be in the same list.
What I suggest is, rather than going down the path of inventing things like virtual machines, describe how a plugin might be expected to work, and in what way it doesn't work now. For instance, for me the major sticking blocks, right now, from doing a plugin are two things:
- Possible name collisions for things like trigger labels, alias labels, script names, and variable names
- The tedium of trying to explain how to take a snippet of VB code an add it to the existing script file, enable scripting, select the appropriate script file, and so on.
My proposed snippet idea addresses both of those. Name collisions would be resolved for triggers etc. while they were loaded, and each snippet would have its own script engine space.
I can't get too excited about different spaces for things like colours, I think it will just be confusing. However, I see what you are saying about notes. What I have done, then, is added two new routines, designed to simplify sending nice coloured note messages, without worrying about saving and restoring colours. Now if every plugin author uses those, the problem pretty-well goes away. If they don't, you can bop them. ;)
'
' Send a note in nominated text/back colours
'
World.ColourNote "red", "blue", "Warning - HP are low"
'
' Change text colour only
'
World.ColourNote "red", "", "Tick almost up"
'
' Note without a newline
'
World.ColourTell "blue", "gray", "Food running "
World.ColourTell "red", "gray", "LOW"
These two routines restore the colours afterwards, so they don't permanently change the environment. |