Hello all, I’m trying to create a simple app that determines how many Clicks per minute you can do using your left and right mouse buttons. Im just using print to display the clicks/minute.So far ive created something that just increases a variable by 1 every click and spits it out in the terminal. I dont know how to divide that variable by how long my task has been running to show your cpm. my code is as foolows so far
from direct.showbase.ShowBase import ShowBase
from direct.showbase import DirectObject
from direct.task import Task
hitcount = 0
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
base.disableMouse()
class Hello(DirectObject.DirectObject):
def __init__(self):
self.accept('mouse1',self.printHello)
self.accept('mouse3',self.printHello)
def printHello(task):
global hitcount
hitcount += 1
print hitcount
h = Hello()
app = MyApp()
app.run()
Worked great! Thanks . Now im tryig to pack it with packpanda – dir but i get a “cannot copy game to C:\Windows\System32\packpanda-TMP” error. im not quite sure what to do to fix this D: ive yet to reinstall panda3d ill give it a shot. any other opinions would be great!