Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

Gold tracker

IcariusIcarius Member Posts: 14
edited October 16 in Curing Systems and Scripts
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-
TysandrZulahUtianima

Comments

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

    https://ada-young.com/pastebin/Yx4D5OUR
  • ZulahZulah Member Posts: 791 @ - Epic Achaean
    @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







  • ZulahZulah Member Posts: 791 @ - Epic Achaean
    edited October 19

    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:
    Utianima
  • IcariusIcarius Member Posts: 14
    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.
  • IcariusIcarius Member Posts: 14
    Should be the last with bug fixes. https://ada-young.com/pastebin/ouQVjmqW
    Zulah
  • IcariusIcarius Member Posts: 14
    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
    Zulah
Sign In to Comment.