Jump to content

Request: Make Circle when press middle mouse.


Recommended Posts

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

HotKeySet ("{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 by BlackCipher
Link to comment
Share on other sites

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 by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...