PR3BI Posted January 23, 2010 Share Posted January 23, 2010 Hey guys. I'm just wondering this one thing, because I saw a script by a guy ( I cannot remember :/ ). And his script was a bot that you could set where you wanted your bot to pixelsearch and what colors to look for etc. But what I was wondering was if anyone could show me a script where you press hold your mouse cursor where you want the pixels to search. I point my cursor where I want the pixelsearch to search left and I hit F1 or whatever button assigned for it. And I just continue with my Up, Right and Bottom coords. I tried to do this myself, by using MouseGetCoord but of course, failed epicly NOTE! I'm not asking you to make me an entire script, only the function and explained command, so that I'll understand. pl0x? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 23, 2010 Moderators Share Posted January 23, 2010 PR3BI, Does this help you get started? HotKeySet("{ESC}", "On_Exit") HotKeySet("{F1}", "_Get_Coords") While 1 Sleep(10) WEnd Func _Get_Coords() $aPos = MouseGetPos() ConsoleWrite("Mouse is at " & $aPos[0] & " - " & $aPos[1] & @CRLF) EndFunc Func On_Exit() Exit EndFunc M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
PR3BI Posted January 23, 2010 Author Share Posted January 23, 2010 $pos = MouseGetPos() HotKeySet("{ESC}", "terminate") HotKeySet("{F1}", "pos") While 1 Sleep(20) WEnd Func pos() $target = PixelSearch($pos[0], $pos[1], $pos[2], $pos[3], 0xDEFFD6) If Not @error Then MouseMove($target[0], $target[1], 0) EndIf EndFunc Func terminate() Exit EndFuncPR3BI, Does this help you get started? HotKeySet("{ESC}", "On_Exit") HotKeySet("{F1}", "_Get_Coords") While 1 Sleep(10) WEnd Func _Get_Coords() $aPos = MouseGetPos() ConsoleWrite("Mouse is at " & $aPos[0] & " - " & $aPos[1] & @CRLF) EndFunc Func On_Exit() Exit EndFunc M23 Firstly, thank you so much for replying, M23. This is somewhat what I am looking for, but it's hard to explain - I'm bad to explain things :') But more specificly, I want the script to USE the coordinates my mouse is currently on. So lets say that I'm making a simple bot that works with any flash game etc. What I want is to make my 4 Pixelsearch locations ( Pixelsearch (Left, Up, Right, Bottom ). When I press F1 once, the script saves that Left coordinate. Second time, Up. Next time, Right and the last time Bottom. Do you understand? Hard to explain ^^. Here's an example of what I tried to script, but failed epicly. Anyway, thanks a lot! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 23, 2010 Moderators Share Posted January 23, 2010 PR3BI, First time you press F1 you mark the top-left corner of the area to search - second time the bottom-right: expandcollapse popupHotKeySet("{ESC}", "On_Exit") HotKeySet("{F1}", "_Get_Coords") Global $iState = 1, $iColor = 0xFFFFFF ; or whatever you want Global $aCoords[4][2], $iLeft, $iTop While 1 Sleep(10) WEnd Func _Get_Coords() $iState = Not $iState Switch $iState Case 0 $aPos = MouseGetPos() $iLeft = $aPos[0] $iTop = $aPos[1] ConsoleWrite("Left coordinate is at " & $aPos[0] & @CRLF & "Top coordinate is at " & $aPos[1] & @CRLF) Case 1 $aPos = MouseGetPos() ConsoleWrite("Right coordinate is at " & $aPos[0] & @CRLF & "Bottom coordinate is at " & $aPos[1] & @CRLF) $aPos = PixelSearch($iLeft, $iTop, $aPos[0], $aPos[1], $iColor) If @error Then ConsoleWrite("Colour not found" & @CRLF) Else ConsoleWrite("Colour found at " & $aPos[0] & " x " & $aPos[1] & @CRLF) EndIf EndSwitch EndFunc Func On_Exit() Exit EndFunc Getting closer? Ask if anything is unclear. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Sobiech Posted January 24, 2010 Share Posted January 24, 2010 Hmmm i think the tooltip is better for this, than ConsoleWrite I saw nice UDF for this, but i forget a title This world is crazy Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 24, 2010 Moderators Share Posted January 24, 2010 Sobiech,I quite agree that ToolTips would be a sensible way to do this in a finished product - the ConsoleWrite commands are just to show what is going on. Remember the OP wants to do this himself, he does not want a fully packaged solution. I saw nice UDF for thisQuite correct, about 2 posta above this one! M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Sobiech Posted January 24, 2010 Share Posted January 24, 2010 Sobiech,I quite agree that ToolTips would be a sensible way to do this in a finished product - the ConsoleWrite commands are just to show what is going on. Remember the OP wants to do this himself, he does not want a fully packaged solution. Quite correct, about 2 posta above this one! M23HEREhttp://www.autoitscript.com/forum/index.php?showtopic=93527&st=0&p=701504&hl=Smoke_N&fromsearch=1&#entry701504This is awesome Tool for getting informations from screen / window Good Luck This world is crazy 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