Hello, function that would be very usefull, get the current $settingsname.
Hello, function that would be very usefull, get the current $settingsname.
Why do you need it? When you gonna use this? To get script name? to get script dir?
If so, you can use $curscript
This image is hosted on a possibly dangerous website (http://www.codeivate.com/users/zen/signature.jpg). Please consider reuploading it on Imgur.com.
This image is hosted on a possibly dangerous website (http://www.codeivate.com/users/zen/signature.jpg). Please consider reuploading it on Imgur.com.
Set the script name on user options and use getuseroption('scriptname')
Will try that RoxZin xD.
works same as loadsettings with name check no diffrencePHP Code:if $name == 'x' and getuseroption('settings') ~= ('Knight rotworm.xml') then
loadsettings('Knight Rotworm.xml')
end
if $name == 'y' and getuseroption('settings') ~= ('testing ghost pal.xml') then
loadsettings('testing ghost pal.xml')
end
if $name == 'z' and getuseroption('settings') ~= ('Knight Bas.xml') then
loadsettings('Knight Bas.xml')
end
infinite loop
After some testing soemtimes it works sometimes settings dont change, sometimes persistent scvript dont load at all and sometimes cavebot user options changes. I tried forlong time to set this becasue i dont want supervise my accounts every day, more like every weekend, this $checksettings function be realy useful for people who have difrent vocations and want run difrent settings for each character without supervising every day.
@Longerion you're using it wrong. Did you make an option called 'settings' or what? Also, it should be different all the time because it won't return the value inside ().
What I told you to do was: On all your scripts, add on the user options something like this:
{
"type" : "scriptinfo",
"name" : "EK - Banuta"
}
Then, you check the script name with getuseroption('scriptname'), like this. It will return EK - Banuta when you try to get it. In your case, it should be something like this:
if $name == 'x' and getuseroption('scriptname') ~= 'Knight rotworm' then
loadsettings('Knight Rotworm.xml')
elseif $name == 'y' and getuseroption('scriptname') ~= 'testing ghost pal' then
loadsettings('testing ghost pal.xml')
elseif $name == 'z' and getuseroption('scriptname') ~= 'Knight Bas.xml' then
loadsettings('Knight Bas.xml')
end