Jump to content

"Or" operator, something like


mrtgtr
 Share

Recommended Posts

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

#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

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 Gude
How 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

  • Moderators

mrtgtr,

Please do not start a third thread on this subject - our patience has limits. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...