Plugin State Files.

Posted by Falgor on Fri 10 Feb 2017 07:06 PM — 2 posts, 13,447 views.

#0
I'm currently playing around with the mapper, trying to tweak it to work with MUDs with multiple same named rooms with the same exits (going down the route of giving every 'room' it's own ID, and making a room by moving in a direction, not waiting for a capturing trigger to fire. Then just enabling/disabling a "writing" mode.)

Anyway!

I'm doing so much trial and error I'd like to see how to delete my Mapper Plugin's state file, or at least clear tables within it. I've tried removing the tables in immediate, and in the plugin itself, yet every time I load MUSHclient my own rooms are saved.


I've tried


rooms = nil
config = nil
unvar rooms
unvar config


Inside the plugin itself, this should delete the saved data even after it has been serialized.

Thanks.

F.
Australia Forum Administrator #1
One approach is to open the state file. Right double-click the plugin in the plugin list. That opens the state file in your preferred editor. Then close the world (that saves the state file).

Now use your editor to delete the variables in it, and then save the state file. Now when you re-open the world the variables are gone.

Alternatively, make a note of the state file name (using the above technique of RH-double-clicking it. Close the world. Delete the state file in the file explorer.

I think you will find that the client opens the plugin and runs the script (this creates functions and runs any code at global scope). Then it loads the state file. Then it calls OnPluginInstall() function. Thus, deleting variables by code in global scope won't do it (it is run too early). You could do it in OnPluginInstall().

Probably the simplest thing, while testing, is just to make an alias (in the plugin) that resets or deletes any variables you want deleted.