PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Finished Scripts => Topic started by: RPGamer on 07 March, 2016, 07:21:14

Title: Hub Share Distributon Graph Script Lua 5.X
Post by: RPGamer on 07 March, 2016, 07:21:14
My first script :passifier:, there might be some untested errors.  :spike:
In short, this script categorises hub users into share size groups and then displays a horizontal bar graph. Default share size groups can be modified and correspondingly you'd need to change the logical if-elseif block inside the graphbuilder function. Each "-" in the bar graph corresponds to 1 user. You can also change the reply type option by changing tSettings.bPmOnly .
Title: Re: Hub Share Distributon Graph Script Lua 5.X
Post by: the-master on 07 March, 2016, 16:48:50
lol, you forgot to set users to 0 somewhere.., every time graph is called it shows more users  ;)
         ShareSizes[1] = ShareSizes[1] + 1
ShareSizes[1] to [11] needs reset before counting.
Title: Re: Hub Share Distributon Graph Script Lua 5.X
Post by: RPGamer on 07 March, 2016, 18:40:14
@the-master
Hence the pacifier emoticon in my original post  :lol:
I've corrected it by initialising the ShareSizes every time it is called. Considering the fact that I knew nothing about Lua about 3-4 months ago, this is like a milestone for me. Any other changes that you'd like in the script, do notify me!  :D
I know quite a bit about c++ and now python too, but Lua looks like an alien to me. Will now learn about file handling so that I can make more interesting scripts!