diff --git a/Projects/MMLLib/libmml.lpr b/Projects/MMLLib/libmml.lpr index e64938c..36fb1e3 100644 --- a/Projects/MMLLib/libmml.lpr +++ b/Projects/MMLLib/libmml.lpr @@ -193,6 +193,8 @@ exports { Finder } findColor, findColors, + findColorTolerance, + findColorsTolerance, { Mem Management } fpc_freemem_, diff --git a/Projects/MMLLib/pymml/mml.py b/Projects/MMLLib/pymml/mml.py index 238f258..7931cd9 100755 --- a/Projects/MMLLib/pymml/mml.py +++ b/Projects/MMLLib/pymml/mml.py @@ -26,34 +26,36 @@ class MMLCore(object): def __del__(self): del self.dll -DLL = MMLCore('../libmml.so') -c = Color(DLL) -ret = c.find((0, 0, 100, 100), 0) -print ret - -ret = c.findAll((0, 0, 100, 100), 0) -print ret - - -m = Mouse(DLL) - - -print m[(Mouse.Pos, Mouse.Left, Mouse.Right)] -m[(Mouse.Pos, Mouse.Right)] = ((300,300), True) -print m.getButtonStates() -sleep(0.5) -m.setPos((200,200)) - -sleep(2) - -# Reset all buttons.. -m[(Mouse.Left, Mouse.Right, Mouse.Middle)] = [False for x in range(3)] -for v in zip((Mouse.Left, Mouse.Right), m[(Mouse.Left, Mouse.Right)]): - print v -print m.getPos() - -if hasattr(ret,'__iter__'): - m.setPos(ret) - -del DLL +if __name__ == '__main__': + DLL = MMLCore('../libmml.so') + + c = Color(DLL) + ret = c.find((0, 0, 100, 100), 0) + print ret + + ret = c.findAll((0, 0, 100, 100), 0) + print ret + + + m = Mouse(DLL) + + + print m[(Mouse.Pos, Mouse.Left, Mouse.Right)] + m[(Mouse.Pos, Mouse.Right)] = ((300,300), True) + print m.getButtonStates() + sleep(0.5) + m.setPos((200,200)) + + sleep(2) + + # Reset all buttons.. + m[(Mouse.Left, Mouse.Right, Mouse.Middle)] = [False for x in range(3)] + for v in zip((Mouse.Left, Mouse.Right), m[(Mouse.Left, Mouse.Right)]): + print v + print m.getPos() + + if hasattr(ret,'__iter__'): + m.setPos(ret) + + del DLL