Jump to content

Recommended Posts

Posted (edited)

Hi all this is my first script on autoit

its good ? any tip to avoid problems?

this make a loop right? so if u want to stop it. i need to creat a Func to check when finished?

 

 
Func _Exit()    
 IF my_fat_cat = still_fat
    Exit 0
Else
Call("check")
EndFunc

 
 
 
#include <MsgBoxConstants.au3>
Fentrar()

Func Fentrar()
   If PixelGetColor (1404, 80) = 0x12648F Then ;na_cidade
      Call("Fentrar2")
   Else ;noceu
      MouseClick("left", 1404, 80, 1)
      Sleep(15000)
      Call("Fentrar2")
         EndIf
EndFunc



Func Fentrar2()
MouseClick("left", 1054, 73, 1)
Sleep(5000)
MouseClick("left", 880, 442, 1)
Call("Fprecheck")
EndFunc
 
Func Fprecheck()
   If PixelGetColor (1200, 98) = 0x4C6E8E Then
      Call("Fcheck")
   Else
      Call("Fentrar2")
   EndIf
EndFunc
Func Fcheck()
   If PixelGetColor (1253, 928) = 0x4C608E Then ;morto
      Call("Fmove")
   Else ;tovivo
      Call("Fauto")
   EndIf
EndFunc



Func Fmove()
      MouseClick("left", 1222, 184, 1)
      Sleep(2000)
      MouseClick("left", 1054, 73, 1)
      Sleep(25000)
      MouseClick("left", 1054, 73, 1)
      Call("Fcheck")
      EndFunc


Func Fauto()
        If PixelGetColor (1432, 902) = 0x291800 Then
         MouseClick("left", 1432, 902, 1)
         Sleep(1000)
         Call("Fcheck")
      Else
         Call("Fcheck")
        EndIf
     EndFunc
Edited by Melba23
Added tags
Posted

Welcome to the forum.

Please use code tags when you post your code (look at my signature)

And before you post your code please use Tidy in SciTE by using CTRL+T.

Thanks.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Welcome to Autoit and the forum!

Which program do you try to automate? Mouseclick etc. are not very reliable because they depend on Window position and screen resolution.

Most of the time there are better ways to automate a program.

My UDFs and Tutorials:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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