BlackCipher Posted February 17, 2011 Share Posted February 17, 2011 (edited) Sorry for requesting this. I am really new to AutoIt. I have found a Script by Mega (Xenobiologist) for the circle but I have no clue how to make it do what I need. The script I was trying to edit to work as I needed is expandcollapse popupHotKeySet ("{ESC}", "quitme") ; command line param: beep (0 = off, 1 = on) Global $MakeNoise = 0 If $CmdLine[0] = 0 Then $MakeNoise = 0 ElseIf $CmdLine[1] = 1 Then $MakeNoise = 1 EndIf Global Const $PI = 3.1415926535897932384626433832795 Global $Width = @DesktopWidth, $Height = @DesktopHeight, $MidX = $Width/2, $MidY = $Height/2 Global $Radius = 5 Global $Step = $PI/6 ToolTip ("Mouse Mover!!", $MidX, $MidY) While 1 Do For $angle = 0 To 2*$PI Step $Step $Radius += 5 MouseMove ($MidX - (Cos ($angle) * $Radius), $MidY - (Sin ($angle) * $Radius), 0) If $MakeNoise = 1 Then Beep ($Radius*5, 2) EndIf Next Until $Radius >= $MidY Do For $angle = 0 To 2*$PI Step $Step $Radius -= 5 MouseMove ($MidX - (Cos ($angle) * $Radius), $MidY - (Sin ($angle) * $Radius), 0) If $MakeNoise = 1 Then Beep ($Radius*5, 2) EndIf Next Until $Radius <= 5 WEnd Func quitme() Exit EndFunc What I need to make it do is. Create a counter-clockwise circle of 300x300pixels in under a second, starting where the mouse pointer is, when I click the middle mousebutton. Direction from pointer does not matter, below the pointer would be nice. but its not a big deal. I get the idea of if Hotkey MiddlemouseButton, then execute script. But all I am doing is mangling the script. Thanks for any help. Edited February 17, 2011 by BlackCipher Link to comment Share on other sites More sharing options...
bogQ Posted February 17, 2011 Share Posted February 17, 2011 (edited) heare is something for you to work on, try to test it in paint #include <Misc.au3> HotKeySet ("{ESC}", "quitme") $onetime = 0 $rad = 20 While 1 If _IsPressed("04") Then $d = MouseGetPos() Do Sleep(10) Until Not _IsPressed("04") For $c = 0 To 360 $b = _Move($rad,$c) MouseMove($b[0]+$d[0],$b[1]+$d[1]-$rad,0) If $onetime = 0 Then MouseDown("left") $onetime = 1 EndIf Next $onetime = 0 MouseUp("left") EndIf WEnd Func _Move($Distance, $rotation) Local $a[2] $pi = 3.1415926535897932384626433832795 $a[0]= Int(-cos((2*$pi/360)*($rotation+90))*$Distance) $a[1]= Int(sin((2*$pi/360)*($rotation+90))*$Distance) Return $a EndFunc Func quitme() Exit EndFunc Edit: minor fix you can change $rad to something else to get diffrent size Edited February 17, 2011 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
BlackCipher Posted February 18, 2011 Author Share Posted February 18, 2011 heare is something for you to work on, try to test it in paint #include <Misc.au3> HotKeySet ("{ESC}", "quitme") $onetime = 0 $rad = 20 While 1 If _IsPressed("04") Then $d = MouseGetPos() Do Sleep(10) Until Not _IsPressed("04") For $c = 0 To 360 $b = _Move($rad,$c) MouseMove($b[0]+$d[0],$b[1]+$d[1]-$rad,0) If $onetime = 0 Then MouseDown("left") $onetime = 1 EndIf Next $onetime = 0 MouseUp("left") EndIf WEnd Func _Move($Distance, $rotation) Local $a[2] $pi = 3.1415926535897932384626433832795 $a[0]= Int(-cos((2*$pi/360)*($rotation+90))*$Distance) $a[1]= Int(sin((2*$pi/360)*($rotation+90))*$Distance) Return $a EndFunc Func quitme() Exit EndFunc Edit: minor fix you can change $rad to something else to get diffrent size Thanks I will mess around with it a bit. Link to comment Share on other sites More sharing options...
BlackCipher Posted February 18, 2011 Author Share Posted February 18, 2011 Waited to long before so I couldn't edit. Anyways Is there a way to add in mousemove speed. Link to comment Share on other sites More sharing options...
JoHanatCent Posted February 18, 2011 Share Posted February 18, 2011 Waited to long before so I couldn't edit. Anyways Is there a way to add in mousemove speed. MouseMove($b[0]+$d[0],$b[1]+$d[1]-$rad,50);<< Here from help file 0 = Fastest and 100 is slowest Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now