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, Having Login Issues? Check this thread!
    Dismiss Notice
  4. Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
    Dismiss Notice
  5. Author Wes Locher has teamed up with Stratics for a giveaway of his new book Braving Britannia. This book explores the history and impact of Ultima Online and includes interviews from current and past dev team members as well as many UO and Stratics community members. Click here 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 Stratics Legend

    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: