previously working script not working under ros 5.15

The below script I have deployed and working at 3 hotels all running ros v 4 software.
I just have to set the initial password to the value that corresponds to the current week # out of 52 weeks in the year.
I have the scheduler set to run this every 7 days essentially changing my hotspot password every sunday night at midnight.

I have a RB 450 G running ROS 5.15 I’ve configured with the same script with a the only modifications being to the constant portion of the password MKEDW in this case.
The scheduler fires the script off and I receive the email with the new password.

I set the initial password for hotspot user1 to be MKEDW20, so after I run the script it should just add +1 to the number portion of the password, however when the script runs it sets the password everytime to MKEDW01, as reflected by the email sent out and by logging into the hotspot and only MKEDW01 working for the password.
I’m wondering what has changed scripting wise between ROS v 4 and v 5 that broke my previously working script.
To make sure credit is given where due the script below was provided to me in a past post by fewi(genius).

I do have ntp client setup on the mikrotik and the time and date are accurate.



:local currentPassword [/ip hotspot user get [/ip hotspot user find name=“user1”] password];
:local number [:tonum [:pick $currentPassword 4 6]];
:local newPassword ($number + 1);
:if ($newPassword < 10) do={
:set newPassword (“0” . $newPassword);
};
:if ($newPassword = 53) do={
:set newPassword “01”;
};
:set newPassword (“MKEDW” . $newPassword);
/ip hotspot user set [/ip hotspot user find name=“user1”] password=“$newPassword”;

/tool e-mail send \ to=support@changeddomainnamehere.com \ subject=“Insert hotel name here New Hotspot \ Password”
body=“$newPassword”

/tool e-mail send \ to=michael@changeddomainnamehere.com
subject=“Insert hotel name herel New Hotspot \ Password”
body=“$newPassword”

This line is grabbing chars 4-6 of the password, which ends up being: MKEDW20 instead of MKEDW20. And converting it to a number ends up being nothing. Add 1 to nothing and you get 1 every time.

:local number [:tonum [:pick $currentPassword 4 6]];

Change this line to:

:local number [:tonum [:pick $currentPassword 5 7]];

I’m guessing than when you modified the constant portion of the password MKEDW, it used to have 1 less character before?

Ah yes,
Skot you nailed it on my other 3 deployed Mikrotiks the constant portion of the hotspot password was only the first four characters.
In this new hotel mikrotik the constant is 5 , thanks so much for the help.