Add: Gif tracking for profile statistics and getProfileStats()#7019
Add: Gif tracking for profile statistics and getProfileStats()#7019vadi2 merged 3 commits intoMudlet:developmentfrom guhitb:development
Conversation
|
Not sure how the copyright headers work. CodeFactor result |
If you take a look at the /***************************************************************************
* Copyright (C) YEAR by NAME - EMAIL *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *You just have to replace Each year that you modify a file you are supposed to update the date ranges - I'm fairly good at doing that myself but some other contributors don't seem to bother, possibly, some maintain, this is because they can be identified from the Git history of the project. To see what this looks like you might like to consider the /***************************************************************************
* Copyright (C) 2008-2013 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2013-2016, 2018-2023 by Stephen Lyons *
* - slysven@virginmedia.com *
* Copyright (C) 2014 by Ahmed Charles - acharles@outlook.com *
* Copyright (C) 2016-2018 by Ian Adkins - ieadkins@gmail.com *
* Copyright (C) 2017 by Chris Reid - WackyWormer@hotmail.com *
* * |
|
Thanks for your help 😄 |
|
I've tested it by placing this script on a button local saveto = getMudletHomeDir().."/kymip.gif"
local url = "https://media.tenor.com/n3qkDYO5jbMAAAAi/doge.gif"
if downloadHandler then killAnonymousEventHandler(downloadHandler) end
downloadHandler = registerAnonymousEventHandler("sysDownloadDone",
function(_, filename)
if filename ~= saveto then
return true
end
local width, height = getImageSize(saveto)
local x = math.random(0, 500)
local y = math.random(0, 500)
local name = string.rep("a",x)
createLabel(name, x, y, width, height, 0)
setMovie(name, saveto)
setLabelReleaseCallback(name, function()
if math.random() <0.5 then
echo("Removing Gif\n")
deleteLabel(name)
else
echo("Pausing Gif\n")
pauseMovie(name)
end
end)
end, true)
local pfs = getProfileStats()
echo("getProfileStats().gifs.active: ")
echo(getProfileStats().gifs.active)
echo("\ngetProfileStats().gifs().total: ")
echo(getProfileStats().gifs.total)
echo("\n")
echo("Adding Gif\n")
downloadFile(saveto, url)mudlet-.3.mp4Is this correct? |
|
/create links |
|
/tip $80 @guhitb |
|
🎉🎈 @guhitb has been awarded $80! 🎈🎊 |
…t#7019) <!-- Keep the title short & concise so anyone non-technical can understand it, the title appears in PTB changelogs --> #### Brief overview of PR changes/additions - Created GifTracker to monitor each QMovie created with setMovie() - Updated Profile statistics to display gif usage - Updated Lua getProfileStats() to include gif usage #### Motivation for adding to Mudlet Statistics should measure Gifs, they are expensive #### Other info (issues closed, discussion etc) /claim Mudlet#5924
Brief overview of PR changes/additions
Motivation for adding to Mudlet
Statistics should measure Gifs, they are expensive
Other info (issues closed, discussion etc)
/claim #5924