Gold tracker

Made an incredible simple gold tracker. Just wanted to share it if any would like to use it. Probably plenty of them out there already.

Made this one all in the code so no plugin, tried to comment most of the script. (Dont forget to change the alias at the top from "gold" if you like.)

Edit* Should just be able to paste it and it will start working.

Print: https://ibb.co/KNy7Vp9
Code: https://ada-young.com/pastebin/wvmtcyq-

Comments

  • Fixed a typo in: tempTimer(0.1, [[ gold.attrractor = false ]])

    https://ada-young.com/pastebin/Yx4D5OUR
  • @Icarius not sure but I ran into an issue with i and i.t not being defined anywhere in this script. I switched out your line 119 and it works perfect for me.

    if not gold.t[i.t.char.name] then gold.t[i.t.char.name] = {} end

    supposed to be:

    if not gold.t[gold.character] then gold.t[gold.character] = {} end







  • edited October 2020

    including the change to the gold.print() at the end you can drop it all in a movable resizable window. I locked it to top screen here:
  • Zulah said:
    @Icarius not sure but I ran into an issue with i and i.t not being defined anywhere in this script. I switched out your line 119 and it works perfect for me.

    if not gold.t[i.t.char.name] then gold.t[i.t.char.name] = {} end

    supposed to be:

    if not gold.t[gold.character] then gold.t[gold.character] = {} end







    Thank you, misstake from my part. i.t.char.name is part of my other script.
  • Should be the last with bug fixes. https://ada-young.com/pastebin/ouQVjmqW
  • I had to add some code into this function so that if you disconnect and dont shutdown mudlet you ask for IRE.TIME support again when connecting.

    registerAnonymousEventHandler("sysConnectionEvent", "gold.timeload")
    function gold.timeload()
      -- check if previous table exist if so load it
      if io.exists(getMudletHomeDir().."/gold") then table.load(getMudletHomeDir().."/gold", gold.t) end
      -- set this variable to false on connect so that we always after connecting request IRE.Time support
      gold.coresupport = false
    end
  • Found and issue with long-term use of values beginning to misalign.


Sign In or Register to comment.