if( settings == nil ) then include("settings.lua"); end -- ver 1.2 function goldtracker(_acc) if starttime == nil then starttime = os.clock() end local currentgold = RoMScript('GetPlayerMoney("copper");') if startgold == nil then startgold = currentgold return false end if _acc == nil then _acc = "" end filename = getExecutionPath() .. "/profiles/aaGoldTracker" .. _acc .. ".xml"; file, err = io.open(filename, "a+"); if( not file ) then error(err, 0); end local profit = currentgold - startgold local elapsedtime = (os.clock() - starttime)/60 --printf(RoMScript("GetEquipmentRepairAllMoney();")) printf("Current gold: " .. currentgold .. "\n") printf("Profit: " .. profit .. "\n") printf("Elapsed time: " .. elapsedtime .. " minutes. \n"); -- prints elapsed time in seconds. printf("Profit per hour: " .. profit / elapsedtime * 60 .. "\n") file:write(" Character name: " ..player.Name.. ". Date: " .. os.date() .. " Starting gold: " ..startgold.. ". Ending Gold: " ..currentgold.. ". Earned gold: " ..profit.. "\n"); file:close(); end