View Feature Request
Time Last Played
Feature #: 2829
File: FuBar - RestFu
Date: 07-27-08 06:56 PM
By: reubenhelms
Status: Feature Implemented
Would it be possible to have a "time last played" that could be expressed as a days:hours:seconds, and perhaps have this column optional, for those that dont want to see it?

I like to use RestFu to work out which toon I should play next, but it would also be nice to use it to determine when it was last played, for the toons that are fully rested.

RSS 2.0 Feed for Favorite CommentsNotes Sort Options
By: reubenhelms - 07-30-08 07:26 AM
Hi

I had a crack at adding the changes to do this. It "almost" works.

In RestFu:Save(), add 't.lastPlayed = time()' under the t.time assignment. This is because the existing t.time is constantly updated for all toons on the same realm in RestFu:OnUpdate()

In RestFu:OnTooltipUpdate():
Add the extra column for Time last played:

local supercat = tablet:AddCategory(
'columns', 7
)
for _,realm in ipairs(self.realmList) do
local cat = supercat:AddCategory(
'columns', 7,
'text', oneRealm and L["Name"] or realm,
'text2', L["Time played"],
'text3', L["Time last played"],
'text4', L["Time to rest"],
'text5', L["Current XP"],
'text6', L["Rest XP"],
'text7', L["Zone"],
'child_text1R', 1,
'child_text1G', 1,
'child_text1B', 0,
'child_text2R', 1,
'child_text2G', 1,
'child_text2B', 0,
'child_text3R', 1,
'child_text3G', 1,
'child_text3B', 0,
'child_text4R', 1,
'child_text4G', 0,
'child_text4B', 1,
'child_text6R', 1,
'child_text6G', 1,
'child_text6B', 1,
'child_text7R', 1,
'child_text7G', 1,
'child_text7B', 1,
'func', "RemoveRealm",
'arg1', self,
'arg2', realm
)
local now = time()

By: reubenhelms - 07-30-08 07:27 AM
.. cont

and calculate a lastPlayed value

local playedTime
local lastPlayed
if realm == self.REALM and char == self.NAME and self.timePlayed then
playedTime = self.timePlayed + time() - self.timePlayedMsgTime
lastPlayed = format("|cff00ff00%s|r", L["In Play"])
else
playedTime = data.timePlayed or 0
if (data.lastPlayed == nil) then
lastPlayed = format("|cff00ff00%s|r", "-")
else
lastPlayed = now - data.lastPlayed
if (lastPlayed > 0) then
lastPlayed = abacus:FormatDurationCondensed(lastPlayed, true, true)
else
lastPlayed = format("|cff00ff00%s|r", "-")
end
end
end

local text = ("|cff%s%s|r [|cffffffff%d|r]"):format(classColor, char, data.level or 0)
if hasHorde and hasAlly then
if data.faction == "Horde" then
text = text .. " |cffcf0000(H)|r"
elseif data.faction == "Alliance" then
text = text .. " |cffff3f3f(A)|r"
end
end
cat:AddLine(
'text', text,
'text2', abacus:FormatDurationCondensed(playedTime, true, true),
'text3', lastPlayed,
'text4', timeToMax > 0 and abacus:FormatDurationCondensed(timeToMax, true, true) or format("|cff00ff00%s|r", L["Fully rested"]),
'text5', ("%.0f%%"):format(data.currXP / data.nextXP * 100),
'text6', ("(%+.0f%%)"):format(data.restXP / data.nextXP * 100),
'text7', data.zone or L["Unknown"],
'text6R', r,
'text6G', g,
'text6B', b,
'func', "RemoveChar",
'arg1', self,
'arg2', realm,
'arg3', char
)
else
local playedTime
local lastPlayed
if realm == self.REALM and char == self.NAME and self.timePlayed then
playedTime = self.timePlayed + time() - self.timePlayedMsgTime
lastPlayed = format("|cff00ff00%s|r", L["In Play"])
else
playedTime = data.timePlayed or 0
if (data.lastPlayed == nil) then
lastPlayed = format("|cff00ff00%s|r", "-")
else
lastPlayed = now - data.lastPlayed
if (lastPlayed > 0) then
lastPlayed = abacus:FormatDurationCondensed(lastPlayed, true, true)
else
lastPlayed = format("|cff00ff00%s|r", "-")
end
end

end
cat:AddLine(
'text', ("|cff%s%s|r [|cffffffff%d|r]"):format(classColor, char, data.level),
'text2', abacus:FormatDurationCondensed(playedTime, true, true),
'text3', lastPlayed,
'text7', ("|cffffffff%s|r"):format(data.zone or L["Unknown"])
)
By: reubenhelms - 07-30-08 07:28 AM
translations for deDE.lua and enUS.lua

["Time last played"] = "Zeit spielte zuletzt",
["In Play"] = "Im Spiel",

["Time last played"] = true,
["In Play"] = true,
By: reubenhelms - 07-30-08 07:31 AM
I'd like to say it works perfectly, but it doesnt. Its supposed to say "In Play" for the currently played toon, since no time has passed for it.. its currently being played. But it seems to be displaying the "-" instead, which is supposed to be used if there is no lastPlayed value for the character, or if time() - lastPlayed should be less that zero, which should be never.
 
Stats
Files: 16
Downloads: 605,583
Favorites: 4,858

Menu
» Home



Content

New & Updated
» Fizzle


WOWInterface