Hotwc Posted August 9, 2009 Share Posted August 9, 2009 (edited) This is a Script someone wrote to create a crosshair on your screen: 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,0x000000) Next For $INDEX = $CENTER_Y - 25 To $CENTER_Y + 25 DrawPixel($DC,$CENTER_X,$INDEX,0x000000) 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 How would I modify the location of this, for Example, I want to move the crosshair up Edited August 9, 2009 by Hotwc Link to comment Share on other sites More sharing options...
dantay9 Posted August 9, 2009 Share Posted August 9, 2009 Change $Center_X and $Center_Y. Link to comment Share on other sites More sharing options...
Hotwc Posted August 9, 2009 Author Share Posted August 9, 2009 (edited) I figured that, but what options do I have to Change it? Like what would I replace $Center_X with? Edited August 9, 2009 by Hotwc Link to comment Share on other sites More sharing options...
eEniquEe Posted August 9, 2009 Share Posted August 9, 2009 I figured that, but what options do I have to Change it? Like what would I replace $Center_X with? With anything you want. It's up to your imagination. $CENTER_X, and $CENTER_Y are simply just the (x, y)-coordinate of the "crosshair". The following script will move the "crosshair" from middle of the screen to the left after the given amount of time. 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)) $CENTER_X -= 1 ;new line added WEnd Func DrawLines() $DC = DllCall ("user32.dll", "int", "GetDC", "hwnd", "") For $INDEX = $Center_X - 25 To $CENTER_X + 25 DrawPixel($DC,$INDEX,$CENTER_Y,0x000000) Next For $INDEX = $CENTER_Y - 25 To $CENTER_Y + 25 DrawPixel($DC,$CENTER_X,$INDEX,0x000000) 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 Link to comment Share on other sites More sharing options...
Hotwc Posted August 10, 2009 Author Share Posted August 10, 2009 With anything you want. It's up to your imagination. $CENTER_X, and $CENTER_Y are simply just the (x, y)-coordinate of the "crosshair". The following script will move the "crosshair" from middle of the screen to the left after the given amount of time. 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)) $CENTER_X -= 1 ;new line added WEnd Func DrawLines() $DC = DllCall ("user32.dll", "int", "GetDC", "hwnd", "") For $INDEX = $Center_X - 25 To $CENTER_X + 25 DrawPixel($DC,$INDEX,$CENTER_Y,0x000000) Next For $INDEX = $CENTER_Y - 25 To $CENTER_Y + 25 DrawPixel($DC,$CENTER_X,$INDEX,0x000000) 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 What you modified broke the script, it make multiple crosshairs How do I define where the Origin is Link to comment Share on other sites More sharing options...
Hotwc Posted August 10, 2009 Author Share Posted August 10, 2009 Anyone can help? Link to comment Share on other sites More sharing options...
Hotwc Posted August 11, 2009 Author Share Posted August 11, 2009 LOL? Link to comment Share on other sites More sharing options...
hot202 Posted August 18, 2009 Share Posted August 18, 2009 this dont work anyway it dont go ontop of a game screen 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