Sign in to follow this  
Followers 0
BlackCipher

Request: Make Circle when press middle mouse.

5 posts in this topic

#1 ·  Posted (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

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 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.

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Waited to long before so I couldn't edit.

Anyways Is there a way to add in mousemove speed.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0