We have detected that cookies are not enabled on your browser. Please enable cookies to ensure the proper experience.
Results 1 to 7 of 7
  1. #1

    Simple TitanBar money display fix

    I wanted to share a very simple fix for a money display problem on the TitanBar wallet plugin.

    If you have the problem of money not being displayed correctly, especially when you have many characters and have the money display for all characters enabled, you can do the following modifications to one of the TitanBar files.

    The file is 'functionsCtr.lua' in the folder 'Documents\The Lord of the Rings Online\Plugins\HabnaPlugins\Ti tanBar'.

    Use a text editor to edit the file (like Notepad++, UltraEdit etc.), do not use something like M$ Word or OpenOffice/LibreOffice, unless you know what you're doing and how to save raw text files in those. I did not try to use Windows Notepad, the displayed text might look weird (a single line or very few lines only). I don't recommend using it.

    Make a backup of the unmodified file just in case something goes wrong.

    Open the file, go to line 641 and change the following code
    (if you have another version than I have - v.1.29.00 -, search for the code lines below, might even be on the same lines)

    Code:
      if (string.len(CopperTot)==3) then
        local CopperTotX = CopperTot;
        SilverTot = SilverTot + string.sub(CopperTotX,1,-3);
        CopperTot = string.sub(CopperTot,2,-1);
      end
    	
      if (string.len(SilverTot)==4) then
        local SilverTotX = SilverTot;
        GoldTot = GoldTot + string.sub(SilverTotX,1,-4);
        SilverTot = string.sub(SilverTot,2,-1);
      end
    to

    Code:
      -- if (string.len(CopperTot)==3) then
      if (string.len(CopperTot)>2) then
        local CopperTotX = CopperTot;
        local CopperOverLength = string.len(CopperTot) - 2;
        -- SilverTot = SilverTot + string.sub(CopperTotX,1,-3);
        -- CopperTot = string.sub(CopperTot,2,-1);
        SilverTot = SilverTot + string.sub(CopperTotX,1,CopperOverLength);
        CopperTot = string.sub(CopperTot,-2);
      end
    		
      -- if (string.len(SilverTot)==4) then
      if (string.len(SilverTot)>3) then
        local SilverTotX = SilverTot;
        local SilverOverLength = string.len(SilverTot) - 3;
        -- GoldTot = GoldTot + string.sub(SilverTotX,1,-4);
        -- SilverTot = string.sub(SilverTot,2,-1);
        GoldTot = GoldTot + string.sub(SilverTotX,1,SilverOverLength);
        SilverTot = string.sub(SilverTot,-3);
      end
    You can remove the commented lines - those that start with two dashes - completely if you like.
    Should work for german and french clients too but I did not test it.

    Do not edit the file while any character is logged in. You can edit the file though while you're at the character selection screen.

    After these changes, I now have a working money display again.

    You can also copy & paste the code lines from here, just make sure you overwrite the existing code lines in that case.

  2. #2

    Thumbs up Under new management!

    Quote Originally Posted by FrauBlake01 View Post
    I wanted to share a very simple fix for a money display problem on the TitanBar wallet plugin.

    If you have the problem of money not being displayed correctly, especially when you have many characters and have the money display for all characters enabled, you can do the following modifications to one of the TitanBar files.

    The file is 'functionsCtr.lua' in the folder 'Documents\The Lord of the Rings Online\Plugins\HabnaPlugins\Ti tanBar'.

    Use a text editor to edit the file (like Notepad++, UltraEdit etc.), do not use something like M$ Word or OpenOffice/LibreOffice, unless you know what you're doing and how to save raw text files in those. I did not try to use Windows Notepad, the displayed text might look weird (a single line or very few lines only). I don't recommend using it.

    Make a backup of the unmodified file just in case something goes wrong.

    Open the file, go to line 641 and change the following code
    (if you have another version than I have - v.1.29.00 -, search for the code lines below, might even be on the same lines)

    Code:
      if (string.len(CopperTot)==3) then
        local CopperTotX = CopperTot;
        SilverTot = SilverTot + string.sub(CopperTotX,1,-3);
        CopperTot = string.sub(CopperTot,2,-1);
      end
    	
      if (string.len(SilverTot)==4) then
        local SilverTotX = SilverTot;
        GoldTot = GoldTot + string.sub(SilverTotX,1,-4);
        SilverTot = string.sub(SilverTot,2,-1);
      end
    to

    Code:
      -- if (string.len(CopperTot)==3) then
      if (string.len(CopperTot)>2) then
        local CopperTotX = CopperTot;
        local CopperOverLength = string.len(CopperTot) - 2;
        -- SilverTot = SilverTot + string.sub(CopperTotX,1,-3);
        -- CopperTot = string.sub(CopperTot,2,-1);
        SilverTot = SilverTot + string.sub(CopperTotX,1,CopperOverLength);
        CopperTot = string.sub(CopperTot,-2);
      end
    		
      -- if (string.len(SilverTot)==4) then
      if (string.len(SilverTot)>3) then
        local SilverTotX = SilverTot;
        local SilverOverLength = string.len(SilverTot) - 3;
        -- GoldTot = GoldTot + string.sub(SilverTotX,1,-4);
        -- SilverTot = string.sub(SilverTot,2,-1);
        GoldTot = GoldTot + string.sub(SilverTotX,1,SilverOverLength);
        SilverTot = string.sub(SilverTot,-3);
      end
    You can remove the commented lines - those that start with two dashes - completely if you like.
    Should work for german and french clients too but I did not test it.

    Do not edit the file while any character is logged in. You can edit the file though while you're at the character selection screen.

    After these changes, I now have a working money display again.

    You can also copy & paste the code lines from here, just make sure you overwrite the existing code lines in that case.
    Hello! I've taken over development of TitanBar as of this past week and there is a new version available through the Plugin Compendium found on http://www.lotrointerface.com/downlo...nfo.php?id=967 -- This being the case, can you show me a screenshot of exactly what the bug was before you created your patch so I can better understand what this patch accomplishes? Then I'd love if you could fork the new repo for TitanBar and submit a pull request for this patch (so that it can be properly credited and attributed to you in the history) on https://github.com/Technical-13/HabnaPlugins or let me know that you'd like me to code in the patch on your behalf (with a couple comments declaring it was your patch linking back here and a note in the credits.txt/changelog.txt). Thanks!!!

  3. #3
    Join Date
    Jun 2011
    Location
    Germany
    Posts
    151
    Quote Originally Posted by Technical_13 View Post
    Hello! I've taken over development of TitanBar as of this past week and there is a new version available through the Plugin Compendium found on http://www.lotrointerface.com/downlo...nfo.php?id=967 -- This being the case, can you show me a screenshot of exactly what the bug was before you created your patch so I can better understand what this patch accomplishes? Then I'd love if you could fork the new repo for TitanBar and submit a pull request for this patch (so that it can be properly credited and attributed to you in the history) on https://github.com/Technical-13/HabnaPlugins or let me know that you'd like me to code in the patch on your behalf (with a couple comments declaring it was your patch linking back here and a note in the credits.txt/changelog.txt). Thanks!!!
    Hi, glad someone is giving this great plugin some love. Do you think you could add flower phials to the currency tracker? They're account-wide after all, so it would make sense. Thanks for your efforts!
    There's something good in this world, and it is worth fighting for.

  4. #4

    Is there fix for time display?

    Hi, i installed this plugin, but time in the bar is not updating unless the plugin is reloaded.
    Is there a way to force the time (both in-game and real time) updating itself periodically?

  5. #5
    Quote Originally Posted by Misapprehension View Post
    [...] time in the bar is not updating unless the plugin is reloaded [...]
    I've seen just the opposite issue. For any character with established TitanBar settings, time works correctly. However, if I need to load a profile for any character (with or without settings) then the time does not update for the remainder of that game session. Logging a character out and back into the game will correct this problem. After logging out the time is displayed correctly because the required settings exist.

  6. #6
    Quote Originally Posted by AccessDenied View Post
    I've seen just the opposite issue. For any character with established TitanBar settings, time works correctly. However, if I need to load a profile for any character (with or without settings) then the time does not update for the remainder of that game session. Logging a character out and back into the game will correct this problem. After logging out the time is displayed correctly because the required settings exist.
    Thank you for explaining the situation
    Time does seem to work normally, just did not work the first day!

  7. #7
    Quote Originally Posted by Technical_13 View Post
    Hello! I've taken over development of TitanBar as of this past week and there is a new version available through the Plugin Compendium found on http://www.lotrointerface.com/downlo...nfo.php?id=967 -- This being the case, can you show me a screenshot of exactly what the bug was before you created your patch so I can better understand what this patch accomplishes? Then I'd love if you could fork the new repo for TitanBar and submit a pull request for this patch (so that it can be properly credited and attributed to you in the history) on https://github.com/Technical-13/HabnaPlugins or let me know that you'd like me to code in the patch on your behalf (with a couple comments declaring it was your patch linking back here and a note in the credits.txt/changelog.txt). Thanks!!!
    Sorry for answering so late, I haven't been looking into the forum for very long ;-)

    I don't have a screenshot, and I don't want to revert to the buggy state to make one. But I can explain what happened:
    Titanbar money added money up to above 99 copper, above 999 silver, etc. So the display would break because the too long values did not fit into the space reserved for them.

    You will only see that effect if you have very many characters and Titanbar enabled for all of them, because the string of the calculated money amount can be much bigger than the original author expected, and it will show something like 1045 copper, which is nonsense of course.

    Most important parts in this little 'code fix' are the if()s, I don't check for exact lengths but if the length of the amount string is bigger than allowed: 3 for silver, 2 for copper.
    And since I don't expect a fixed length anymore, I adjusted the string.sub()s to do what is expected.

    As far as I remember, the 'overflow' only happened for copper, because that can easily sum up to above 999 with many chars, and since the if() only checked for strings of length 3 before and not for even longer ones, it was never caught and the totals calculation was wrong. (Sometimes, it was correct, depending on how much copper every character had.)


    Edit:
    You don't need to give me any credits if you want to include the changes, it's only a very little thing.
    (Finding for the code part was actually much harder than the coding itself ;-)
    Last edited by FrauBlake01; Sep 13 2017 at 08:23 PM.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

This form's session has expired. You need to reload the page.

Reload