Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luca28pet/precisecpscounter
A PocketMine-MP plugin that measures CPS (clicks per second)
https://github.com/luca28pet/precisecpscounter
pocketmine pocketmine-mp pocketmine-mp-plugin pocketmine-plugin
Last synced: about 1 month ago
JSON representation
A PocketMine-MP plugin that measures CPS (clicks per second)
- Host: GitHub
- URL: https://github.com/luca28pet/precisecpscounter
- Owner: luca28pet
- License: agpl-3.0
- Created: 2019-12-15T00:18:39.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-28T23:27:01.000Z (about 1 year ago)
- Last Synced: 2024-09-26T10:20:42.107Z (about 2 months ago)
- Topics: pocketmine, pocketmine-mp, pocketmine-mp-plugin, pocketmine-plugin
- Language: PHP
- Homepage:
- Size: 20.5 KB
- Stars: 16
- Watchers: 3
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PreciseCpsCounter
Latest development phars: https://poggit.pmmp.io/ci/luca28pet/PreciseCpsCounterScoreHud addon: https://gist.github.com/luca28pet/34ae893290041a8d238860c5c91b4a60
**PreciseCpsCounter** is an API that can measure the CPS (clicks per second) of a player (all left clicks are taken into account).
You can use PreciseCpsCounter from other plugins to get the CPS of a player using the public function getCps:`public function getCps(Player $player, float $deltaTime = 1.0, int $roundPrecision = 1) : float;`
An example of how you can use this plugin:
- Sending the CPS in a popup every second.
```
$this->getScheduler()->scheduleRepeatingTask(new ClosureTask(function() : void{
foreach($this->getServer()->getOnlinePlayers() as $p){
$p->sendPopup('CPS: '.$this->getCps($p));
}
}), 20);
```Apparently, it does not work with CPSs greater than 30.
## Known Issues
**Incorrect CPS measurement when hitting blocks**
If a click is well-timed and you manage to initiate the breaking of 2 (or more) blocks with one click, it will result as 2+ clicks because the client sends two PlayerActionPackets.
You can workaround this by disabling count-left-click-on-block in the config.yml file, but it will not take into account any left click on blocks.