What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Total Time Played - Benchmarking , List.ToString() issue

HB9803K83

New Member
Joined
Apr 22, 2011
Messages
8
Reaction score
0
I am not sure how much I collect due to disconnects therefore I would like to have a value of bot running time , to make it easy to parse I will log it with character name my problem is Lua.LuaGetReturnValue("/script RequestTimePlayed()) returns me a list and cannot use it like
Lua.LuaGetReturnValue("blabla").ToString to log it

I am totally noob at c# but I have to get it done so , lets say I am learning actively by getting the work done

please could you advise me Thank you

Me.Says("ThankYouVeryMuch")
 
I think the first item in the list is the total time and the second the current time on this level.
See Events/T - WoWWiki - Your guide to the World of Warcraft

A haven't dealt with the LuaGetReturnValue method, yet but here is how you can receive the value of an item in the list.

Code:
var returnValues = Lua.LuaGetReturnValue("/script RequestTimePlayed()");
string totalPlayed = returnValues[0].ToString();
string currentLevelPlayed = returnValues[1].ToString();
 
That isn't an event, take a look at the RequestTimePlayed API, and you'll see, that it fires an event called TIME_PLAYED_MSG (api states: "Requests information from the server about the player character's total time spent online. Information is not returned immediately; the TIME_PLAYED_MSG event fires when the requested data is available.")
what you want to do, is call that RequestTimePlayed, while hooked to TIME_PLAYED_MSG, then get the first argument (for total time played) or second argument (for level time played)
 
Back
Top