It is currently April 24th, 2024, 3:57 am

Skin that counts hours of playing games?

Get help with creating, editing & fixing problems with skins
soyelrafa
Posts: 96
Joined: March 1st, 2017, 3:09 pm

Re: Skin that counts hours of playing games?

Post by soyelrafa »

Here I go again, now I get a file named ListOfGames.lua that have these entries:

Code: Select all

Entry{
      gamename = "ABZU",
      program = "ABZU.exe",
      publisher = "CSLI",
      year = 1992
    }


Entry{
      gamename = "AGE OF EMPIRES II HD EDITION",
      program = "AOE2.exe",
      publisher = "CSLI",
      year = 1992
    }
And in my lua script I have:

Code: Select all

mNombreValor = ABZU

local gamenames = {}     
function Entry (b)
  if b.gamename then gamenames[b.gamename] = true end
end
    dofile("ListOfGames.lua")
    for name in pairs(gamenames) do 
    if gamename == mNombreValor then
    print(name)
end
end
With this I get printed:

Code: Select all

AGE OF EMPIRES II HD EDITION
ABZU
But I only want to get ABZU, that is my mNombreValor. It is something wrong I am doing, or simply I can't get that?
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Skin that counts hours of playing games?

Post by balala »

soyelrafa wrote:I solved it with:

Code: Select all

SKIN:Bang('!SetVariable Game1 '..Juego2)
I must change to take the form you write there? If yes I suppose it will be:

Code: Select all

SKIN:Bang('!SetVariable', 'Game1', ..Juego2)
No, at all! Both forms of the !SetVariable bang will work. They are similar. So leave it as it is.
soyelrafa
Posts: 96
Joined: March 1st, 2017, 3:09 pm

Re: Skin that counts hours of playing games?

Post by soyelrafa »

balala wrote:No, at all! Both forms of the !SetVariable bang will work. They are similar. So leave it as it is.
Hello, thanks for the answer, I will leave it then.

Do you have some hint for my last problem? :D
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Skin that counts hours of playing games?

Post by balala »

soyelrafa wrote:Do you have some hint for my last problem? :D
Not yet, but I'm trying to figure out something...
soyelrafa
Posts: 96
Joined: March 1st, 2017, 3:09 pm

Re: Skin that counts hours of playing games?

Post by soyelrafa »

balala wrote:Not yet, but I'm trying to figure out something...
I understand that. Thanks for your time again :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Skin that counts hours of playing games?

Post by balala »

Could you please post the whole code of the skin and the lua file. Also post the code of the related files if there is any.
soyelrafa
Posts: 96
Joined: March 1st, 2017, 3:09 pm

Re: Skin that counts hours of playing games?

Post by soyelrafa »

balala wrote:Could you please post the whole code of the skin and the lua file. Also post the code of the related files if there is any.
I send you a PM :thumbup: