mrtgtr Posted October 15, 2013 Share Posted October 15, 2013 Hi again, I took help at yesterday but I have a problem. I want to if pixelsearches is true alone or all than exit loop and check it constantly this I tried else,or... What if I did not This is about what I want in If GUICtrlRead($BUFBOX) = 1 Then PixelSearch(1000 , 136, 1000, 136, 0xDEAD73) If @error Then Send("0") ExitLoop EndIf PixelSearch(968 , 136, 968, 136, 0xDEAD73) If @error Then Send("0") ExitLoop EndIf PixelSearch(936 , 136, 936, 136, 0xDEAD73) If @error Then Send("0") ExitLoop EndIf PixelSearch(904 , 136, 904, 136, 0xDEAD73) If @error Then Send("0") ExitLoop EndIf PixelSearch(872 , 136, 872, 136, 0xDEAD73) If @error Then Send("0") ExitLoop EndIf PixelSearch(840 , 136, 840, 136, 0xDEAD73) If @error Then Send("0") ExitLoop EndIf EndIf This is my all codes expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Firefox.ico #AutoIt3Wrapper_Outfile=Firefox.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\mert\desktop\son.kxf $Firefox = GUICreate("Travian comx - Mozilla Firefox", 354, 247, 192, 124) GUISetIcon("C:\Users\mert\Desktop\Firefox.ico", -1) GUISetFont(12, 800, 0, "Trebuchet MS") $HPBOX = GUICtrlCreateCheckbox("HP", 32, 24, 97, 17) $MANABOX = GUICtrlCreateCheckbox("MANA", 32, 56, 97, 17) $BUFBOX = GUICtrlCreateCheckbox("BUF", 32, 88, 97, 17) $SPRINTBOX = GUICtrlCreateCheckbox("SPRINT", 32, 120, 97, 17) $TOPLUCEKBOX = GUICtrlCreateCheckbox("TOPLUÇEK", 224, 112, 105, 33) $CEKBOX = GUICtrlCreateCheckbox("ÇEK", 224, 72, 81, 25) $ATAKBOX = GUICtrlCreateCheckbox("ATAK", 136, 80, 73, 17) $BASLA = GUICtrlCreateButton("BAŞLA", 72, 176, 75, 25) GUICtrlSetFont(-1, 10, 800, 0, "Trebuchet MS") $DUR = GUICtrlCreateButton("DUR", 200, 176, 75, 25) GUICtrlSetFont(-1, 10, 800, 0, "Trebuchet MS") $PETBOX = GUICtrlCreateCheckbox("PET", 224, 32, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### MsgBox(0, "", $GUI_CHECKED) Global $Paused HotKeySet("{Home}", "TogglePause") HotKeySet("{End}", "Stop") ;script can be stopped by pressing - Opt("SendKeyDelay", 50) Sleep(2000) ;wait some time before starting the Script cycle, to allow the user to navigate to the correct window While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $BASLA Runner() EndSwitch WEnd Func TogglePause() WinActivate("Travian comx - Mozilla Firefox") $Paused = Not $Paused While $Paused Sleep(100) WEnd EndFunc ;==>TogglePause Func Stop() ;to allow the script to stop Exit ;same EndFunc ;==>Stop ;KOXP FONKSIYONLARI Func Runner() While 1 If GUICtrlRead($HPBOX) = 1 Then PixelSearch(160, 67, 160, 67, 0x000000) If Not @error Then Send("1") EndIf EndIf If GUICtrlRead($MANABOX) = 1 Then PixelSearch(160, 84, 160, 84, 0x000000) If Not @error Then Send("2") EndIf EndIf If GUICtrlRead($BUFBOX) = 1 Then PixelSearch(1000 , 136, 1000, 136, 0xDEAD73) If @error Then Send("0") ExitLoop EndIf PixelSearch(968 , 136, 968, 136, 0xDEAD73) If @error Then Send("0") ExitLoop EndIf PixelSearch(936 , 136, 936, 136, 0xDEAD73) If @error Then Send("0") ExitLoop EndIf PixelSearch(904 , 136, 904, 136, 0xDEAD73) If @error Then Send("0") ExitLoop EndIf PixelSearch(872 , 136, 872, 136, 0xDEAD73) If @error Then Send("0") ExitLoop EndIf PixelSearch(840 , 136, 840, 136, 0xDEAD73) If @error Then Send("0") ExitLoop EndIf EndIf If GUICtrlRead($SPRINTBOX) = 1 Then Send("5") $ATAKBOX = False EndIf If GUICtrlRead($ATAKBOX) = 1 Then Send("Z4") EndIf If GUICtrlRead($CEKBOX) = 1 Then PixelSearch(838, 714, 838, 714, 0xFFFF00) PixelSearch(836, 709, 836, 709, 0xFFFF00) PixelSearch(832, 711, 832, 711, 0xFFFF00) PixelSearch(829, 714, 829, 714, 0xFFFF00) PixelSearch(829, 714, 829, 714, 0xB8B801) PixelSearch( 59, 400, 59, 425, 0xB8B801) If Not @error Then Send("7") EndIf EndIf If GUICtrlRead($TOPLUCEKBOX) = 1 Then PixelSearch(838, 714, 838, 714, 0xFFFF00) PixelSearch(836, 709, 836, 709, 0xFFFF00) PixelSearch(832, 711, 832, 711, 0xFFFF00) PixelSearch(829, 714, 829, 714, 0xFFFF00) PixelSearch(829, 714, 829, 714, 0xB8B801) PixelSearch( 59, 436, 59, 455, 0x633131) If Not @error Then $ATAKBOX = False $PETBOX = False $BUFBOX = False Send("{8 down}") Sleep(75) Send("{8 up}") MouseMove(530, 780) MouseDown("left") Sleep(100) MouseUp("left") $ATAKBOX = True $PETBOX = True $BUFBOX = True EndIf EndIf If GUICtrlRead($PETBOX) = 1 Then PixelSearch(285, 82, 285, 82, 0x6B524A) If Not @error Then $ATAKBOX = False $TOPLUCEKBOX = False $BUFBOX = False $CEKBOX = False Send("{p DOWN}") Sleep(350) Send("{p UP}") MouseMove(829, 67) MouseDown("left") Sleep(100) MouseUp("left") Sleep(350) MouseClickDrag("left", 942, 413, 983, 183) Sleep(350) MouseMove(824, 229) MouseDown("left") Sleep(100) MouseUp("left") Sleep(100) Send("{p DOWN}") Sleep(150) Send("{p UP}") $ATAKBOX = True $TOPLUCEKBOX = True $BUFBOX = True $CEKBOX = True EndIf EndIf WEnd EndFunc ;==>Runner Link to comment Share on other sites More sharing options...
BrewManNH Posted October 15, 2013 Share Posted October 15, 2013 Please read the forum rules, game automation isn't allowed here, and this is your second script request that deals with a game. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
mrtgtr Posted October 15, 2013 Author Share Posted October 15, 2013 I think this solution is using or but script gives error when put to "or"s Link to comment Share on other sites More sharing options...
mrtgtr Posted October 15, 2013 Author Share Posted October 15, 2013 Please read the forum rules, game automation isn't allowed here, and this is your second script request that deals with a game. ok sorry delete to topics please Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 15, 2013 Moderators Share Posted October 15, 2013 mrtgtr,Please do not start a third thread on this subject - our patience has limits. 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