1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Greetings Guest!!

    In order to combat SPAM on the forums, all users are required to have a minimum of 2 posts before they can submit links in any post or thread.

    Dismiss Notice
  3. Greetings Guest! Tonights Maintenance is complete and the Stratics Community Wiki is now live. Please see this thread for more details.
    Dismiss Notice

[Tech Help] Help Me! (about LuaScript)

Discussion in 'UO Enhanced Client Discussion' started by BLAU, Sep 10, 2009.

  1. BLAU

    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. :(
  2. BLAU

    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 ) )

    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 )

    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.
  3. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Apr 22, 2004
    Likes Received:
    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.
  4. BLAU

    BLAU Guest

    Thanks for your advice.
    Then I will decide to use that add-on.:thumbup: