Sliding Average snippet

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
benhumphreys
Prole
Posts: 31
Joined: Thu Sep 13, 2012 2:10 am

Sliding Average snippet

Post by benhumphreys »

I made a simple module that lets you make a sliding average within a certain limit.

sliding.lua snippet

I made it to be able to average the number of clicks/button presses in a window of a certain number of seconds.
So every time in your update() step, you save the number of clicks that happened since your last update.

I'm still not very confident that this is a good solution. Could someone take a look and see if I'm doing anything stupid, or if there's a more elegant solution?
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 63 guests