Jump to content

can autoit do this? - drawing lines


uzi17
 Share

Recommended Posts

i want to make something where it will draw a coloured line horizontal, and verticle on my screen, acting like a cross hair i can use in a first person shooter game. the sniper does not have a crosshair when unscoped so i thought having the lines would help.

can auto it do this? if so can someone lead me into the right direction.

thanks

Link to comment
Share on other sites

i want to make something where it will draw a coloured line horizontal, and verticle on my screen, acting like a cross hair i can use in a first person shooter game. the sniper does not have a crosshair when unscoped so i thought having the lines would help.

can auto it do this? if so can someone lead me into the right direction.

thanks

Try this:

HotKeySet("{ESC}","Quit"); Press ESC to quit
Global $CENTER_X = Int(@DesktopWidth/2)
Global $CENTER_Y = Int(@DesktopHeight/2)
$REFRESH = InputBox("DrawLines","Refresh time","5")
While 1
    DrawLines()
    Sleep(GUICtrlRead($REFRESH*1000))
WEnd

Func DrawLines()
    $DC = DllCall ("user32.dll", "int", "GetDC", "hwnd", "")
    For $INDEX = $CENTER_X - 25 To $CENTER_X + 25
        DrawPixel($DC,$INDEX,$CENTER_Y,0x00FF00)
    Next
    For $INDEX = $CENTER_Y - 25 To $CENTER_Y + 25
        DrawPixel($DC,$CENTER_X,$INDEX,0x00FF00)
    Next
EndFunc
    
Func DrawPixel($hDC,$X,$Y,$COLOR)
    DllCall ("gdi32.dll", "long", "SetPixel", "long", $hDC[0], "long", $X, "long", $Y, "long", $COLOR)
EndFunc

Func Quit()
    Exit
EndFunc
Edited by Andreik

When the words fail... music speaks.

Link to comment
Share on other sites

@Andreik

...this men will continue to ask questions without search on forum because you give him the answer :)

Cheers, FireFox.

Although many threads seem to be identical but you can not get the same thing to them. Maybe this question it was asked before, but do not want to hijack other threads with his questions.

Regards,

Andreik

When the words fail... music speaks.

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...