resetProfile being loaded multiple times

Post Reply
zhenzh
Posts: 44
Joined: Fri Apr 17, 2020 2:23 am

resetProfile being loaded multiple times

Post by zhenzh »

I have an issue that each time I run the script containing resetProfile() function, it is executed multiple time for unknown reason.
To isolate the issue, I have tried unstalling all additional script packages but the issue remains.
Attachments
reset.png

Alyven
Posts: 16
Joined: Sat Oct 01, 2011 8:43 pm

Re: resetProfile being loaded multiple times

Post by Alyven »

As you put the resetProfile() in an script in the Script-manager you even can call yourself lucky it didn't create a infinite loop as resetProfile() is
also reloading the scripts.

To use resetProfile() properply try to use the command lua resetProfile() in the commandline.

Edit:
Just noticed that it isn't mentioned in the Mudlet wiki.
Made a small note in the wiki.

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

Re: resetProfile being loaded multiple times

Post by Vadi »

Remember that a script is run every time you click on it or save it.

zhenzh
Posts: 44
Joined: Fri Apr 17, 2020 2:23 am

Re: resetProfile being loaded multiple times

Post by zhenzh »

I can run the reset by issuing alias, but the new problem is that different from scripts, all aliases wil not be reloaded. So that I have to save one by one to get them reactive

Alyven
Posts: 16
Joined: Sat Oct 01, 2011 8:43 pm

Re: resetProfile being loaded multiple times

Post by Alyven »

A solution for that would be to make a tempAlias in you scripts.
I do it like this

Code: Select all

resetProfilAlias = resetProfileAlias or tempAlias("^rp$",[[resetProfile()]])
Like this the command rp would call resetProfile() and it works all the time

zhenzh
Posts: 44
Joined: Fri Apr 17, 2020 2:23 am

Re: resetProfile being loaded multiple times

Post by zhenzh »

you are right, I create tempAlias for all permAlias at the begining of my script as a work around

Post Reply