How to backup scripts and map data

Post Reply
darklajid
Posts: 7
Joined: Sun Dec 07, 2014 5:03 pm

How to backup scripts and map data

Post by darklajid »

Hey.

The story:

So, I'm a new user, coming back to MUDs after quite some time. I use 3.x.
Found no mapper for my MUD of choice, read through the docs and implemented a simple but neat gmcp based set of mapping scripts.

Mudlet was open for days on my Thinkpad, I extended/expanded these scripts and ran across quite a bit of this MUD's map, especially on rather inaccessible parts, happy about the map that came to life on the right side of the screen.

Enter today (remember: Mudlet still open and running). My son managed to get close to my laptop, found that shiny, big, green glowing power button...

Booting again I found no consequences, until I started Mudlet. No map data (annoying, but no true disaster) and none of my Lua scripts (what??) anymore. I searched ~/.config/mudlet and .. find nothing of value.

The questions:

- Are these things really gone for good? No way to recover my scripts at least?

- How ARE you supposed to backup your scripts? I guess at this point that scripts are somehow serialized IN the XML/profile, and only if you exit the application, confirming the 'save this profile' dialog? Is that true? Can anyone explain how this process works? That seems utterly counter intuitive after hitting 'Save Item' gazillion times in the script editor, making incremental changes to my scripts. Is that 'Save item' purely in memory? Would it make sense to .. warn about that? Am I just dense when I expected that to hit the disk somehow (I'm assuming at this point that it doesn't and the answer to my first question is 'No')?

- Somewhat related: Is there a way to store both map data and lua scripts as .. files? To make sure that I will have periodic backups in the future?

Right now I'm hesitant to start again, until I understand what went wrong exactly and how to avoid that data loss in the future.:(

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: How to backup scripts and map data

Post by Vadi »

Are you sure there is nothing in ~/.config/mudlet? Snapshots of your profile are stored in ~/.config/mudlet/<profile>/current.

darklajid
Posts: 7
Joined: Sun Dec 07, 2014 5:03 pm

Re: How to backup scripts and map data

Post by darklajid »

Nothing? No, there are files in there. Plenty of them / 17 at the moment [1].

The question is - what would I expect to see here? The last date is the 3rd of December - which very well might have been before I created the scripts and ran around in the world. No snapshots afterwards. But even if there were snapshots, would those contain the lua scripts? The map data? Both?

Would you more recent _expect_ snapshots?

I understand that this long-running instance of Mudlet is probably not what people had in mind when they created the client. But .. would it make sense to actually save a snapshot for example when you hit save in the script editor? Or whenever you _close_ that editor?

And there's still the more general question: Given that I cannot find my lua scripts anywhere, not the map data: Where would that be stored? BOTH in that xml? Would the map end up somewhere else, but didn't in my special case?

1: This is the contents of that directory:

-rw-r--r-- 1 dar dar 8990 Dec 1 17:12 01-12-2014#17-12-10.xml
-rw-r--r-- 1 dar dar 8990 Dec 2 13:49 02-12-2014#13-49-49.xml
-rw-r--r-- 1 dar dar 8990 Dec 3 17:52 03-12-2014#17-52-01.xml
-rw-r--r-- 1 dar dar 8989 Nov 6 11:40 06-11-2014#11-40-20.xml
-rw-r--r-- 1 dar dar 8990 Nov 6 11:42 06-11-2014#11-42-46.xml
-rw-r--r-- 1 dar dar 8990 Nov 7 17:18 07-11-2014#17-18-43.xml
-rw-r--r-- 1 dar dar 8990 Nov 10 13:28 10-11-2014#13-28-47.xml
-rw-r--r-- 1 dar dar 8990 Nov 11 10:22 11-11-2014#10-22-13.xml
-rw-r--r-- 1 dar dar 8990 Nov 15 02:43 15-11-2014#02-43-05.xml
-rw-r--r-- 1 dar dar 8990 Nov 17 11:35 17-11-2014#11-35-46.xml
-rw-r--r-- 1 dar dar 8990 Nov 20 08:58 20-11-2014#08-58-56.xml
-rw-r--r-- 1 dar dar 8990 Nov 20 11:59 20-11-2014#11-59-16.xml
-rw-r--r-- 1 dar dar 8990 Nov 20 17:37 20-11-2014#17-37-30.xml
-rw-r--r-- 1 dar dar 8990 Nov 21 02:38 21-11-2014#02-38-34.xml
-rw-r--r-- 1 dar dar 8990 Nov 26 16:25 26-11-2014#16-25-35.xml
-rw-r--r-- 1 dar dar 8990 Nov 30 02:12 30-11-2014#02-12-18.xml

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: How to backup scripts and map data

Post by Vadi »

It saves a snapshot when you hit 'save profile' as the tooltip mentions... 'save' enables your changes to take effect, it will not create an entirely new snapshot. Long-running instances of Mudlet are fine, just hit 'save profile' to actually save to disk every now and then.

Map data is stored separately in the map/ folder.

darklajid
Posts: 7
Joined: Sun Dec 07, 2014 5:03 pm

Re: How to backup scripts and map data

Post by darklajid »

*sigh*
Not your fault, of course, but try to see why 'Save profile' isn't exactly something that came to my mind here:
Script editor in my tiling window manager
Script editor in my tiling window manager
(i3wm, that's what the script editor looks like when it comes up next to the main window - this is what I'm used to here)

So the single most important button for my issue is not on screen. The tooltip is huge and explaining exactly what I needed, but .. somewhat less accessible than I'd have expected.

Thanks for your replies, at least I know how to prevent this in the future. Back to the drawing board.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: How to backup scripts and map data

Post by Vadi »

It shows up fine on Windows, Mac, and the general Linux desktops by default... sorry, I don't think we can accomodate for every window manager a person could be using on the Linux desktop.

darklajid
Posts: 7
Joined: Sun Dec 07, 2014 5:03 pm

Re: How to backup scripts and map data

Post by darklajid »

I .. feel that you're misunderstanding me.

First: No hard feelings. Text is a crap medium (as MUD players know best) to transfer emotions. You do seem to 'sound' annoyed. That wasn't my goal here..

Second: What the screenshot shows is the script editor, limited to half of my screen. A tiling window manager might be awkward/a niche thing, but in this case the misfortune is unrelated. 'Save Profile' is the very last button. If you have a screen smaller than needed to accommodate all buttons, 'Save Profile' is the first one to go. I've never seen it before you told me that I should be interested in it.
Granted, that wouldn't happen if you don't use a tiling manager and have a horizontal resolution that is big enough to contain all of these buttons. Which is probably working out fine, ignoring other niche platforms like puny netbooks.

At this point I'm mostly trying to explain why 'Save Profile' never crossed my mind. IF I would've seen that thing, my question above wouldn't make half as much sense.

Bottom line: A series of unfortunate events [1] lead to map and script data loss in my case. This thread was my quest to figure out how I can make sure that this won't happen again, before I write another line of Lua. Mission accomplished. Thanks a lot!

1:
- Long running instance of Mudlet
- Writing scripts and collecting map data in that very instance
- Knowing nothing about 'Save Profile', not even that this button exists/what that'd be for
- A 2 year old with quick fingers and an interest in green glowing buttons
- A crappy OS configuration that instantly shuts down the machine without confirmation

User avatar
SlySven
Posts: 1023
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: How to backup scripts and map data

Post by SlySven »

Um, the visual problem is that the window is not maximised and is oversized - the right hand side is literally off the screen. In that situation you may be able to restore a more reasonable size (which would have been saved in an .ini style file called, I think "Mudlet 1.0.conf" that you ought to find amongst the Mudlet user data files) on Windows and Linux platforms I think that if you "Alt-Tab" to select the editor window - the one which ought to have the Mudlet icon with the yellow construction hat you can then bring up the main window menu with "Alt-Spacebar" which is what appears on clicking the top left button for MS Windows Windows and sometimes there for *Nix ones. Using the key board if you can't see it to click with a mouse you can try pressing 'r' to "resize" and then press and hold the left arrow to drag the right side of the window in to view. Pressing 'm' to "move" can also help for a window that is so large you can't see the top title bar.

If the resized window is too small to hold all the buttons on a toolbar the remainder that cannot be shown will of course be temporarily shown in a second row below the top one if you now click on the extra ">>" that will now be visible on the end of the visible toolbar.

darklajid
Posts: 7
Joined: Sun Dec 07, 2014 5:03 pm

Re: How to backup scripts and map data

Post by darklajid »

I failed to understand your post. Then I scrolled back up. I'm now reasonably sure you judge my problem by looking at the (cropped) thumbnails of my screenshots, without viewing them in their original size (click them).

The >> button was always visible, nothing is off the screen. My confusion was merely not knowing about the right way to save my changes (Save Profile), paired with the fact that it is the last button and therefor the first to fall out of view, into the >> container. That button just never appeared on my screen and I didn't investigate the >> menu.

So, thanks, but I think you misunderstood my issue based on a flawed premise?

User avatar
SlySven
Posts: 1023
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: How to backup scripts and map data

Post by SlySven »

OK, I realized that some people are unfamiliar with how to deal with a window that they cannot grab the edges of with a mouse by using the keyboard, hence the hints above - but I understand that was (if at all) the least of your problems. As far as saving the map regularly you might consider setting up a "Timer" with say an hourly (or what ever) interval and sticking a saveMap() or saveMap("") call (the absence of a path/file argument causes a normal date-stamped version to accumulate in the profile's map directory {so you may want to empty that out of unneeded backups occasionally}) - if that was the right lua command - in as the stuff to run. Off the top of my head I don't think you can build in a command to save the rest of the profile's data from a script run from it...

Post Reply