• Hail Guest!
    We're looking for Community Content Contribuitors to Stratics. If you would like to write articles, fan fiction, do guild or shard event recaps, it's simple. Find out how in this thread: Community Contributions
  • Greetings Guest, Having Login Issues? Check this thread!
  • Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
  • Hail Guest!
    Please read the new announcement concerning the upcoming addition to Stratics. You can find the announcement Here!

[Tech Help] Help Me! (about LuaScript)

B

BLAU

Guest
I want to save the data, because I added custom setting.

Therefore I used "TextLogSetIncrementalSaving".

Data are restored when I do Log-in after doing Log-out.
But the data are not restored when I rebooted UOSAclient.

I want advice to solve this problem, because I am not good at making a script.
I cannot release CustomSkin without solving this problem, I am in trouble. :(
 
B

BLAU

Guest
function SettingsWindow.CustomSettingRestore()
--TextLogLoadFromFile( "EnhancedSetting", "logs/EnhancedSetting.log" )
local timestamp, filterType, entryText = TextLogGetEntry( "EnhancedSetting", 1 )
SliderBarSetCurrentPosition( "CustomSliderBar1", entryText )
LabelSetText( "CustomVal1", wstring.format( L"%2.2f", entryText ) )
end

function SettingsWindow.SaveEnhancedSettings()
local Customslider = SliderBarGetCurrentPosition( "CustomSliderBar1" )
local CustomType = 1
TextLogCreate( "EnhancedSetting", 2 )
TextLogSetEnabled( "EnhancedSetting", true )
TextLogSetIncrementalSaving( "EnhancedSetting", true, "logs/EnhancedSetting.log" )
TextLogAddFilterType( "EnhancedSetting", CustomType , L"Custom1: " )
TextLogAddEntry( "EnhancedSetting", CustomType , L""..Customslider )
end



I do not understand in RESTORE routine.
A method to read from logfile, and assign restore data into "EnhancedSetting".
"TextLogLoadFromFile" is commentout now, because does not work according to expectations.
 

Gildar

Babbling Loonie
Stratics Veteran
Stratics Legend
Do not use logs for custom settings - they're very unreliable.
Instead, look at the CustomSettings mod available at the Modders Exchange. Hopefully all the comments translate well.
 
B

BLAU

Guest
Do not use logs for custom settings - they're very unreliable.
Instead, look at the CustomSettings mod available at the Modders Exchange. Hopefully all the comments translate well.
Thanks for your advice.
Then I will decide to use that add-on.:thumbup:
 
Top