Jump to content

True of false to actvate While - (Moved) - (Locked)


Recommended Posts

Hi, it's me again, I'm having a problem somewhere but I can't figure out where. I want to use global variables to say that a while is true or false, but that they can be executed together. the problem is that when I enable the first one only that works. Now if I put 2 of the 3 functions inside the while and technically "activate" the one that remains outside if it works for me. My question is can I use it independently knowing that the pixelserch works on a variable that has coordinates?

The script is this:

Global $Prueba = False

Global $Prueba2 = False

#Region ### START Koda GUI section ### Form=C:\Program Files (x86)\AutoIt3\SciTE\Koda\Forms\Moebot.kxf
 $inicio = GUICreate("MoeBot 1.1 Rev 1.0", 703, 327, -1, -1)
 $Label1 = GUICtrlCreateLabel("       Moe Bot Por Onigumo", 0, 0, 702, 52)
GUICtrlSetFont(-1, 30, 800, 2, "Verdana")
 $Group1 = GUICtrlCreateGroup("Seleccion de Acciones del Bot", 8, 56, 689, 121)
 $movimiento = GUICtrlCreateCheckbox("Movimiento", 24, 80, 137, 41)
GUICtrlSetFont(-1, 15, 800, 0, "MS Sans Serif")
 $atacar_campos = GUICtrlCreateCheckbox("Atacar Campos", 168, 80, 177, 41)
GUICtrlSetFont(-1, 15, 800, 0, "MS Sans Serif")
 $curar_tropa = GUICtrlCreateCheckbox("Curar Tropa", 352, 88, 137, 33)
GUICtrlSetFont(-1, 15, 800, 0, "MS Sans Serif")
GUICtrlCreateGroup("", -99, -99, 1, 1)
 $configurar_movimiento = GUICtrlCreateButton("Configurar Movimiento", 40, 208, 177, 41)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
 $configurar_campos = GUICtrlCreateButton("Configurar Campos", 232, 208, 201, 41)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
 $configurar_templo = GUICtrlCreateButton("Configurar Curar tropa", 448, 208, 201, 41)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While (1)
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        
        case $atacar_campos 
        if GUICtrlRead ($atacar_campos) =  1 then 
        $Prueba2 = True 
        msgbox(0, "", "Atacar campos")
        EndIf  
              
            
        ; Activar curar tropa
        case $curar_tropa 
        if GUICtrlRead ($curar_tropa) =  1 then 
        $Prueba = True 
        MsgBox(0, "", "Habilitado"    )
        if GUICtrlRead ($curar_tropa) =  4 then  
        $Prueba = False 
        msgbox(0, "", "Desabilitado"        )
        
        EndIf 
        EndIf 
            
                
        case $configurar_movimiento  
        posmovimiento()
        
        case $configurar_campos
        poscampamento()
        EndSwitch
          
    
    
    
    $moverse = PixelSearch($lockx1, $locky1, $lockx2, $locky2, $colormovimiento, 3)
    if not (@error) Then 
    movimiento()
    EndIf     
    
        
    While($Prueba2)
    $camp = PixelSearch($campx1, $campy1, $campx2, $campy2, $colorcamp)    
     if not (@error) Then 
    campamentos()
    EndIf                 
WEnd
        
While($Prueba)
   $moverse = PixelSearch($lockx1, $locky1, $lockx2, $locky2, $colormovimiento, 3)
    if not (@error) Then 
    movimiento()
    EndIf     
        
     $camp = PixelSearch($campx1, $campy1, $campx2, $campy2, $colorcamp, 2)    
     if not (@error) Then 
    campamentos()
    EndIf                 

   $curar =  PixelSearch($curarx1, $curary1, $curarx2, $curary2, $colorcuracion,  3)
   if not (@error) Then
    curartropas()
    Sleep(500)  
    ExitLoop 
 EndIf 
WEnd    
WEnd

                

Edited by Melba23
Link to post
Share on other sites
  • Moderators

Moved to the appropriate forum.

Moderation Team

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 post
Share on other sites
  • Moderators

Oni_Gabriel,

When you post code in future please use Code tags - see here how to do it.  Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. Thanks in advance for your cooperation.

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 post
Share on other sites
  • Moderators

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

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 post
Share on other sites
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...