Python Forum
[split] Accurate Clicks Per Second
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Accurate Clicks Per Second
#1
In My opinion it is always hard to implement code in python. I am working in python to make a click per second tool but it shows Multiple errors in integration.So I use Javascript and make this tool in a single day without any bug.

Tool Link:https://clickspeeder.com/click-per-second/

I am curious to develp the same Tool in python but fail all time anyone helps me to make other variations in python .I want to learn python
michael1789 likes this post
Reply
#2
split from https://python-forum.io/Thread-Accurate-...Per-Second as you are hijacking their thread somewhat

If you can create it in javascript then you already know the procedure. Your problem then lies not in creating the program, but converting it over to python.

As the opposite, i find it easier to implement anything in python than any other language. But that all depends on what language you are familiar with. The process of learning python requires converting known language script to python. So giving it to you does you no good. Give us your broken python script not working so we can find out where you went wrong.
Larz60+ likes this post
Recommended Tutorials:
Reply
#3
Here is the full code of the Click per second test game you can follow this and make a good tool.
Html
<div id="container">
<div id="zone"></div>
Clicks per second: <span id="counter">0</span>
</div>
CSS
body {
background: #aaa;
}
#container {
font: normal 26px sans-serif;
padding: 16px;
background: linear-gradient(#58c, #bcf);
box-shadow: 0 0 5px -1px, 0 0 5px #fff inset;
text-shadow: 0 0 5px #fff;
border-radius: 8px;
}
#zone {
height: 160px;
margin: 0 0 16px;
background: #fff;
box-shadow: 0 0 5px -1px inset, 0 0 5px #fff;
border-radius: 8px;
transition: box-shadow .5s;
}
#zone:hover {
box-shadow: 0 0 5px -1px inset, 0 0 5px #fff, 0 0 5px 1px #007 inset;
}
#counter {
font-weight: bold;
transition: opacity .5s;
}
#counter::before {
content: '';
font-weight: normal;
}
Js
var started, resetTimeoutHandle, resetTimeout = 1000,
container = document.getElementById('container'),
counter = document.getElementById('counter'),
zone = document.getElementById('zone'),
clicks = 0;

zone.onseclect = zone.onselectstart = function() {
return false;
};

function clicksPerSecond(started, clicks) {
return clicks / ((new Date()) - started) * 1000;
}

function count() {
clearTimeout(resetTimeoutHandle);
clicks++;
counter.innerText = clicksPerSecond(started, clicks);
resetTimeoutHandle = setTimeout(reset, resetTimeout);
return false;
}

function start() {
started = new Date();
clicks = 0;
counter.style.opacity = 1;
this.onmousedown = count;
this.onmousedown();
return false;
}

function reset() {
zone.onmousedown = start;
counter.style.opacity = 0.3;
}

reset();

Thankyou in advance.
Reply
#4
Here is the full code of the Click per second test game you can follow this and make a good tool.
I create a CPS test tool on this code you can use it.

Html

<div id="container">
<div id="zone"></div>
Clicks per second: <span id="counter">0</span>
</div>

CSS

body {
background: #aaa;
}
#container {
font: normal 26px sans-serif;
padding: 16px;
background: linear-gradient(#58c, #bcf);
box-shadow: 0 0 5px -1px, 0 0 5px #fff inset;
text-shadow: 0 0 5px #fff;
border-radius: 8px;
}
#zone {
height: 160px;
margin: 0 0 16px;
background: #fff;
box-shadow: 0 0 5px -1px inset, 0 0 5px #fff;
border-radius: 8px;
transition: box-shadow .5s;
}
#zone:hover {
box-shadow: 0 0 5px -1px inset, 0 0 5px #fff, 0 0 5px 1px #007 inset;
}
#counter {
font-weight: bold;
transition: opacity .5s;
}
#counter::before {
content: '';
font-weight: normal;
}

Js

var started, resetTimeoutHandle, resetTimeout = 1000,
container = document.getElementById('container'),
counter = document.getElementById('counter'),
zone = document.getElementById('zone'),
clicks = 0;

zone.onseclect = zone.onselectstart = function() {
return false;
};

function clicksPerSecond(started, clicks) {
return clicks / ((new Date()) - started) * 1000;
}

function count() {
clearTimeout(resetTimeoutHandle);
clicks++;
counter.innerText = clicksPerSecond(started, clicks);
resetTimeoutHandle = setTimeout(reset, resetTimeout);
return false;
}

function start() {
started = new Date();
clicks = 0;
counter.style.opacity = 1;
this.onmousedown = count;
this.onmousedown();
return false;
}

function reset() {
zone.onmousedown = start;
counter.style.opacity = 0.3;
}

reset();

Thank you in advance.
Reply
#5
I agree with @LaimHunt:
Html
<div id="container">
<div id="zone"></div>
Clicks per second: <span id="counter">0</span>
</div>
CSS
body {
background: #aaa;
} dordle
#container {
font: normal 26px sans-serif;
padding: 16px;
background: linear-gradient(#58c, #bcf);
box-shadow: 0 0 5px -1px, 0 0 5px #fff inset;
text-shadow: 0 0 5px #fff;
border-radius: 8px;
}
#zone {
height: 160px;
margin: 0 0 16px;
background: #fff;
box-shadow: 0 0 5px -1px inset, 0 0 5px #fff;
border-radius: 8px;
transition: box-shadow .5s;
}
#zone:hover {
box-shadow: 0 0 5px -1px inset, 0 0 5px #fff, 0 0 5px 1px #007 inset;
}
#counter {
font-weight: bold;
transition: opacity .5s;
}
#counter::before {
content: '';
font-weight: normal;
}
Js
var started, resetTimeoutHandle, resetTimeout = 1000,
container = document.getElementById('container'),
counter = document.getElementById('counter'),
zone = document.getElementById('zone'),
clicks = 0;

zone.onseclect = zone.onselectstart = function() {
return false;
};

function clicksPerSecond(started, clicks) {
return clicks / ((new Date()) - started) * 1000;
}

function count() {
clearTimeout(resetTimeoutHandle);
clicks++;
counter.innerText = clicksPerSecond(started, clicks);
resetTimeoutHandle = setTimeout(reset, resetTimeout);
return false;
}

function start() {
started = new Date();
clicks = 0;
counter.style.opacity = 1;
this.onmousedown = count;
this.onmousedown();
return false;
}
function reset() {
zone.onmousedown = start;
counter.style.opacity = 0.3;
}

reset();
Reply
#6
I agree with you, thanks for your sharing.
<Offsite link promotion link removed>
Gribouillis write Sep-06-2022, 07:38 AM:
Offsite link promotion removed. Please read What to NOT include in a post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Accurate Clicks Per Second kathyalex 4 3,079 Feb-16-2021, 04:27 PM
Last Post: SheeppOSU
  Accurate Clicks Per Second JudyLarose 8 9,203 Feb-10-2021, 03:00 AM
Last Post: deanhystad
  help with python mouse clicks and Pygame programmer229193 5 2,828 May-05-2020, 04:15 PM
Last Post: Windspar
  [PyGame] How would I make my position variable more accurate? HelpMEE 4 2,902 Dec-31-2019, 02:31 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020