Jump to content

Anyone Made This?


Recommended Posts

I did some searches and found these 2 links:

http://www.autoitscript.com/forum/index.ph...;hl=Draw+Region

#70464

Hope I helped you!

AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

Thank you, but The first 2 don't return the top bottom left right, and the 3rd doesn't even work >.< And by return left right top bottom, its for using pixel search. So i draw a region, then it will give me the top bottom left right coords.

Link to comment
Share on other sites

  • Moderators

Godly,

Take a look at this crosshairs UDF. It both draws lines on the screen and gets mouse coords on a click. I realise it is long way from what you are looking for, but it could very well offer you some very good pointers on how to get there.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Try this .... and watch the console output of SciTE ... btw ... if you like minimize SciTE and play around the desktop .... the check console output ....

... OLD SCHOOL PROG-STYLE ! ... hope it's what you're looking for ... ^_^

#Include <Misc.au3>

$dll = DllOpen("user32.dll")
Opt("OnExitFunc", "endscript")
HotKeySet("{ESC}", "endscript")

Global $X0,$Y0,$X1,$Y1,$DOWN,$UP,$pos,$FIRST

$DOWN=False
$UP=False
$FIRST=False
$X0=-1
$Y0=-1
$X1=$X0
$Y1=$Y0

While 1
    Sleep ( 250 )
    _BoxMouse()
    
;YOUR CODE HERE !!!!
    
;
    


    
    
    
WEnd
Exit


Func _BoxMouse()
        $DOWN=False
    If _IsPressed("01", $dll) Then
        $DOWN=True
        If $FIRST=False Then
            $pos = MouseGetPos()
            $X0=$pos[0]
            $Y0=$pos[1]
            $FIRST=True
        ;FIRST TIME MOUSE BUTTON COMES DOWN (LEFT CLICK)!!!!
            
            
        EndIf

    ElseIf  $FIRST=True Then
        If $DOWN=False Then
            $UP=True
            $pos = MouseGetPos()
            $X1=$pos[0]
            $Y1=$pos[1]
            
            ConsoleWrite("Mouse x0,y0:" & $X0 & "," & $Y0 & "   x1,y1:" & $X1 & "," & $Y1 & @CRLF)
            
        ;MOUSE COMES FROM DOWN STATE TO UP STATE !!!!
            
        ; *********************
;~          ASSIGN HERE THE VALUES OF X0,Y0 AND X1,Y1 BEFORE RESETING THEM !!!!


        ;**********************
            
        ;RESET VALUE ...
            $DOWN=False
            $UP=False
            $FIRST=False
            $X0=-1
            $Y0=-1
            $X1=$X0
            $Y1=$Y0
        Else
            $UP=False
        EndIf   
    EndIf
    
EndFunc


Func endscript()
    DllClose($dll)
    ConsoleWrite("APP closed OK!" & @CRLF)
    Exit
EndFunc

[s][font="Impact"]░▒▓▓►DrKovra◄▓▓▒░[/font][/s]The only thing I [sup]know [/sup]is that I don't know [sub]nothing[/sub]--------------- __________------------------------------ __________---------------

Link to comment
Share on other sites

Try this .... and watch the console output of SciTE ... btw ... if you like minimize SciTE and play around the desktop .... the check console output ....

... OLD SCHOOL PROG-STYLE ! ... hope it's what you're looking for ... ^_^

#Include <Misc.au3>

$dll = DllOpen("user32.dll")
Opt("OnExitFunc", "endscript")
HotKeySet("{ESC}", "endscript")

Global $X0,$Y0,$X1,$Y1,$DOWN,$UP,$pos,$FIRST

$DOWN=False
$UP=False
$FIRST=False
$X0=-1
$Y0=-1
$X1=$X0
$Y1=$Y0

While 1
    Sleep ( 250 )
    _BoxMouse()
    
;YOUR CODE HERE !!!!
    
;
    


    
    
    
WEnd
Exit


Func _BoxMouse()
        $DOWN=False
    If _IsPressed("01", $dll) Then
        $DOWN=True
        If $FIRST=False Then
            $pos = MouseGetPos()
            $X0=$pos[0]
            $Y0=$pos[1]
            $FIRST=True
    ;FIRST TIME MOUSE BUTTON COMES DOWN (LEFT CLICK)!!!!
            
            
        EndIf

    ElseIf  $FIRST=True Then
        If $DOWN=False Then
            $UP=True
            $pos = MouseGetPos()
            $X1=$pos[0]
            $Y1=$pos[1]
            
            ConsoleWrite("Mouse x0,y0:" & $X0 & "," & $Y0 & "   x1,y1:" & $X1 & "," & $Y1 & @CRLF)
            
    ;MOUSE COMES FROM DOWN STATE TO UP STATE !!!!
            
    ; *********************
;~          ASSIGN HERE THE VALUES OF X0,Y0 AND X1,Y1 BEFORE RESETING THEM !!!!


    ;**********************
            
    ;RESET VALUE ...
            $DOWN=False
            $UP=False
            $FIRST=False
            $X0=-1
            $Y0=-1
            $X1=$X0
            $Y1=$Y0
        Else
            $UP=False
        EndIf   
    EndIf
    
EndFunc


Func endscript()
    DllClose($dll)
    ConsoleWrite("APP closed OK!" & @CRLF)
    Exit
EndFunc
Exactly what I'm looking for thanks!
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...