Deleted script body?

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Deleted script body?

Post by Nyyrazzilyss »

I'm not sure where this has originated from/ whether it was from mudlet or my own error, however i'm finding about once a month a script/alias/or trigger is still present, but has a blank body (Enter your LUA code...).

It doesn't happen that often, and i'd guess when it does it might be a week+ before I even notice, or potentially longer.

I think what i'd like to do is write a function to have it just loop through the entire script, and print out the names of any parts of it with blank values. Depending on how fast it runs, i'll have it run every startup/shutdown.

Is the script itself stored in a lua variable I can iterate through, and what would the name of it be?

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

Re: Deleted script body?

Post by SlySven »

Arrrrgh! That sounds like a previous bug like 1377401 has reared it's ugly head again. :o

What was even weirder is that in some cases, possibly with THAT bug, although the editor content was disappearing it was still present in the system and would come back again under some situations (close down Mudlet {or that profile if more that one is loaded} and restart/reload that profile - although under some other cases that would just confirm the loss!)

Don't forget that you can load in an older profile on the "Connection" screen, and get an older version of the lost script back, copy it to an external text editor and then paste it back into the later one when you close the profile and restart with the (default) latest one again - and that you can do that for other scripts if you have lost more than one...

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Deleted script body?

Post by Nyyrazzilyss »

I took a look at that particular bug - Following those steps didn't do it, but something might be :(

Restoring what's supposed to be there isn't a problem, once I find out it's missing in the first place. That's why i'd asked whether there's some way I can audit my script itself to check to see if anything got itself erased: It doesn't happen often enough for me to catch what caused it to occur.

I took at look at whether I could get that information by looping through _G/ and did a quick google, but _G only provides me with a function reference: Nothing about the function contents. The lua contents themselves appear to be compiled bytecodes, not the original script (and not accessable)

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Deleted script body?

Post by Nyyrazzilyss »

I guess I was hoping that might be some sort of pre-existing command like

getSummary()

That returned a table of all aliases/scripts/triggers, with a value of the number of lines for each one individually ( 0 for the Enter your LUA code message). Or number of bytes, or just a true/false as to it having contents.

Is there currently anything like that / or that would return similar information? I could use that information to alert myself if something disappears (and track down what might have caused it) - It doesn't happen very often, just annoying when it does - Suddenly something isn't working as expected, and it takes a bit to figure out why.

dicene
Posts: 47
Joined: Thu Sep 25, 2014 7:36 am

Re: Deleted script body?

Post by dicene »

I've seen this same thing occur a few times as well recently. Since I was running off a version I'd compiled with a handful of changes, I was worried it was something I had done. Glad to see that's not the case I guess? I'm almost positive it is related to searching scripts, as it hasn't happened in weeks since I stopped using the search feature. If I can remember tomorrow, I'll try and see if I can find a way to reliably reproduce it.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Deleted script body?

Post by Nyyrazzilyss »

I've no idea where it's originating (which is why i'd asked about a script summary I could use to attempt pin-pointing). To the best of my knowledge, this hasn't happened to me in about a month now, and personally I use the search function all the time.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Deleted script body?

Post by Nyyrazzilyss »

Just happened again - Not sure what caused it to occur, but it appears every script or alias I changed since the last time I restarted mudlet was deleted/erased

Those scripts were all working properly/ still present prior to restart

dicene
Posts: 47
Joined: Thu Sep 25, 2014 7:36 am

Re: Deleted script body?

Post by dicene »

Wonder how hard it would be to code in that getSummary() function you want. Hrm...

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Deleted script body?

Post by Nyyrazzilyss »

Something like that definitely wouldn't hurt, since I could use that to alert me right away when it happens - I got lucky (?) this time at least that since the previous time i'd restarted mudlet, one of the items i'd changed was a key script that's in use at all times. That it had been suddenly erased/blanked out showed up immediately on restart.

It had also been several days since the last time I restarted mudlet, and i'd made a number of small changes to various aliases/other scripts. Every one of them was also 'blanked' out.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Deleted script body?

Post by Nyyrazzilyss »

Just happened again (fairly quickly) using the development build rather then release30 that I normally build from/run - I will take a closer look at exact steps to duplicate, however, i'm fairly confident the bug is present in the development branch / not release30.

I can see a script that's been 'blanked' out. While mudlet says there's no lines in that script, it also happens to be my (only) script that makes calls to playSoundFile - Sound is still however getting played, so the compiled bytecode at least must still exist. I'd just changed that script a few minutes ago/was testing, and when I went back to it, it was gone. I do click 'save profile' after making changes, not just 'save item'.

When it's happened in the past, most likely I was running dev, and quite possibly didn't even notice until after switching back to release 30 on the same profile.

Post Reply