Mazdryk Posted September 15, 2013 Share Posted September 15, 2013 #include <Misc.au3>HotKeySet("{F9}", "_exit")Hotkeyset ("{1}", "_fight" )AutoItSetOption( "PixelCoordMode", 1)$wgh = WinGetHandle("filegrabber")$color1 = "ox400000"While 1Sleep (1000) ;Keeps script runningWEndFunc _Fight()$Black3 = PixelSearch(883, 920, 883, 920, $color1,100, 1, $wgh)$Black4 = PixelSearch(883, 924, 883, 924, $color1,100, 1, $wgh)If (IsArray($Black3) = 0 or IsArray($Black4) = 0) ThenSend ("{F4 DOWN}")Sleep (100)Send ("{F4 UP}")Else$Black = PixelSearch(828, 920, 828, 920, $color1,100, 1, $wgh)$Black2 = PixelSearch(828, 924, 828, 924, $color1,100, 1, $wgh)If (IsArray($Black) = 0 or IsArray($Black2) = 0) ThenSend ("{F3 DOWN}")Sleep (100)Send ("{F3 UP}")elseSend ("{2 DOWN}")Sleep (100)Send ("{2 UP}")endifEndFuncFunc _exit()Sleep(3000)Exit 0EndFuncGIVES me ERRORLine 39EndFuncError: "if" statement has no matching "Endif" statement. Link to comment Share on other sites More sharing options...
ahmed9100 Posted September 15, 2013 Share Posted September 15, 2013 here it is expandcollapse popup#include <Misc.au3> HotKeySet("{F9}", "_exit") Hotkeyset ("{1}", "_fight" ) AutoItSetOption( "PixelCoordMode", 1) $wgh = WinGetHandle("filegrabber") $color1 = "ox400000" While 1 Sleep (1000) ;Keeps script running WEnd Func _Fight() $Black3 = PixelSearch(883, 920, 883, 920, $color1,100, 1, $wgh) $Black4 = PixelSearch(883, 924, 883, 924, $color1,100, 1, $wgh) If (IsArray($Black3) = 0 or IsArray($Black4) = 0) Then Send ("{F4 DOWN}") Sleep (100) Send ("{F4 UP}") Else $Black = PixelSearch(828, 920, 828, 920, $color1,100, 1, $wgh) $Black2 = PixelSearch(828, 924, 828, 924, $color1,100, 1, $wgh) If (IsArray($Black) = 0 or IsArray($Black2) = 0) Then Send ("{F3 DOWN}") Sleep (100) Send ("{F3 UP}") else Send ("{2 DOWN}") Sleep (100) Send ("{2 UP}") endif EndIf EndFunc Func _exit() Sleep(3000) Exit 0 EndFunc Link to comment Share on other sites More sharing options...
TheSaint Posted September 15, 2013 Share Posted September 15, 2013 (edited) @ahmed9100 - We have policies here about Game Automation, so at the very least, when you see a function called 'Fight' and it's pixel related, you should ask questions, and await an appropriate response before giving help. @Mazdryk - You obviously know enough of the rules here, to use the window name of FileGrabber, but seemingly neglected to rename your function so it didn't look like game related. Of course, this could all just be a coincidence with the word Fight, but I doubt it. I'll leave it up to a MOD to decide if you transgressed. I recall welcoming you in another post, which I should perhaps check. EDIT Yep, as I suspected, a >locked topic and warning. Edited September 15, 2013 by TheSaint Draygoes 1 Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 15, 2013 Moderators Share Posted September 15, 2013 Mazdryk,This is the last time you get asked to read the Forum rules - next time you get a holiday to force the issue. ahmed9100,Sensible advice there - please note it for the future. 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