easycode Posted January 16, 2013 Share Posted January 16, 2013 (edited) hello every1!Im pretty new at AutoIT and im trying to learn by myself how to do nice script!well, i will show a exemple of what i want to do with auoit.Image ex:P.S: Sry for the pic.. xD i tried my best.. >.<Ok what i want to do with this? I will try explain my best. The guy in the middle is inside of a rectangle and the round balls are , let see..., well they can be gifts. So what i wanna do is : i want the "guy" search for that round balls and then when he found they, i want he pick the gifts.well i tried a few things , like pixelsearch & pixelchecksum but i cant get this to work.Im asking then for a few ideas to make this work and few tips how i can make this possible.Ty every1!I got something to work:expandcollapse popupGlobal $box = PixelSearch(7,54,1026,627,0x62667C) HotKeySet ("{1}","quit") winwait("mytest","") WinWaitActive("mytest","") sleep(1000) while 1 bonus_box() WEnd Func bonus_box () while 1 If PixelSearch(7,54,1026,627,0x62667C) <> $box Then ;so what im thinking is: if the pixelsearch is diferent to $box ; the program go search from the correct match at that coord MouseClick("left",894,596,1) sleep(20000) MouseClick("left",953,548,1) sleep(20000) MouseClick("left",979,599,1) sleep(20000) MouseClick("left",960,611,1) sleep(20000) MouseClick("left",978,575,1) sleep(20000) MouseClick("left",885,532,1) sleep(20000) MouseClick("left",938,536,1) sleep(20000) MouseClick("left",956,554,1) sleep(20000) MouseClick("left",895,533,1) sleep(20000) MouseClick("left",852,561,1) sleep(20000) MouseClick("left",877,593,1) sleep(20000) MouseClick("left",917,599,1) sleep(20000) MouseClick("left",850,611,1) sleep(20000) MouseClick("left",852,566,1) sleep(20000) MouseClick("left",913,567,1) sleep(20000) ElseIf IsArray ($box) = True Then ; well this is suposse to check if the program finally got a match, if true the MouseClick("left",$box[0],$box[1],3) ;the program go and click at the box to get the box, am i right? EndIf WEnd EndFuncOk, so i can now make the thing move but now im getting a problem.When the "thing" starts walk around and pass for a gift box he just ignore the gift box >.<!Can some1 tell me how to write the code to make the "thing" pick up the gift box and continue walking normaly? Edited January 17, 2013 by easycode Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 17, 2013 Moderators Share Posted January 17, 2013 easycode,Welcome to the AutoIt forum. This looks very much like a game that you are trying to automate. Please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game automation - before you post again. Thread locked. See you soon with a legitimate question I hope. 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...
Recommended Posts