Few suggestions

Posted by Xevira on Thu 16 Feb 2006 03:53 AM — 8 posts, 29,218 views.

#0
On ImportXML and ExportXML, if referenced off a world object (gotten by GetWorld or GetWorldByID) to import into/export from THAT world. I've got a plugin that wishes to import keypad definitions (after prompting the user if they wish to have them). Using the "world." scope would reference the plugin/world as it does now.

-------

Allow the keypad definitions to be viewable/settable, even in plugins. Using the functions within plugins would reference the world's keypad.

-------

Add a GetFileName function that exposes the API call that opens the Open/Save file dialog box. The function would take a file filter (a list/array/table depending on the script language), a start path (empty/omitted if using current location) and an Open/Save flag (true for Save, defaults to false if omitted). The function would return a string result, either containing the filename or nothing if cancel was clicked. Errors would return back an error code.

-------

Allow the notepad buffer size to be definable? I use that for a display page for a channel logger plugin I made. I notice though that the notepad tends to LOCK if filled up with too much. I mean LOCK as in the entire text becomes selected and I can't use ReplaceNotepad to reset the text to anything new. I've since changed it to check the size of the entire log display that will be shown, stripping off old lines that will not fit, keeping it relatively small (around 10000 characters). I'm also converting it from Jscript to Lua and will use the io functions to SAVE the text to a file so the lines will not be lost (as I timestamp all the lines and mark Connect/Disconnects with full date-time stamps)

-------

That is all, for now. Great mud client, Nick! :D
Australia Forum Administrator #1
Quote:

On ImportXML and ExportXML, if referenced off a world object (gotten by GetWorld or GetWorldByID) to import into/export from THAT world.


What language are you using? It seems to work OK for me in Lua:



w = GetWorld ("test")
Note (ExportXML (w, 0, "mytrigger"))


This exported from the world "test" not the current world.

In VBscript the syntax is a bit different:


Set w = GetWorld ("test")
Note (w.ExportXML (0, "blockhead"))

Australia Forum Administrator #2
Quote:

Allow the keypad definitions to be viewable/settable, even in plugins. Using the functions within plugins would reference the world's keypad.


Do you mean macros or accelerators? See:

http://www.gammon.com.au/scripts/doc.php?function=AcceleratorList
Australia Forum Administrator #3
Quote:

Allow the notepad buffer size to be definable?


The notepad buffer is a straight Windows edit control. Its behaviour is really that of an edit control and can't be easily changed (its size varies a bit by operating system).
Australia Forum Administrator #4
Quote:

Add a GetFileName function that exposes the API call that opens the Open/Save file dialog box.


I'll look into that.
Australia Forum Administrator #5
Quote:

Add a GetFileName function that exposes the API call that opens the Open/Save file dialog box.


Version 3.74 now has a utils.filepicker function (available from Lua only) which exposes the Windows file picker. See release notes for more details.
#6
Sorry for not responding...

Some clarification, it is the Import that doesn't allow importing to outside the current world space.

I've tried this:


function OnImport()
	w = GetWorld("LuaTesting")
	w.ImportXML("<keypad><key name='Ctrl+2' >Test</key></keypad>")
end


Where LuaTesting is the world the test plugin was installed on. The alias used merely calls the function within the plugin script. Calling said function gives this error message:

Line 1: <keypad> tag cannot be used inside a plugin (problem in this file)


Australia Forum Administrator #7
Plugins are not designed to allow certain things to be done, which were considered "global" to the world, such as the world name, macros and so on.

You could consider making the plug use Accelerator in its startup phase, to map keystrokes to things you want to do:

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