Jump to content

Search the Community

Showing results for tags 'if'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start






  1. I'm new to Auotit but I have built a simple script that "runs" a different "batch" file based on certain days of the workweek. The script works now, but I was wanting to eliminate the need for a manual date entry. For example "First Batch' needs to run every Tuesday thru Thursday however "Second Batch" needs to run only on Friday and "Third Batch" needs to run only on Monday. In addition the 1st batch file runs on Tuesday, say 06/06 (the "FW" section) but then needs to actually report (the F4 date) the next weekday so this Batch actually needs 2 dates verified. What I'm trying to do is w
  2. hello again, it has been a long time since i have been here and a long time since i last used autoit. ever so often when the time allows me to, then i follow up on an idea that i had a long time ago. i have done all the work on paper but now it is up to writing it in autoit and i keep stumbling over many little issues here and there. sometimes after a few days i will try again and get a step further but sometimes it just will not help no matter how long i try and think about a solution. for most of you it will be the basics but for me it is not all that easy, but at least i give it a try.
  3. Hey Guys, I want to add a new checkbox with its own variable every time the add button is clicked. The added checkboxes should remain when I close the window or exit the script and when I reopen I should be able to add new checkboxes aswell. here is what I have so far.. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <MsgBoxConstants.au3> #include <GuiButton.au3> $test = GUICreate("adding test", 475, 345, 500, 175) $Check1 = GUICtrlC
  4. Is there a way to create an IF loop comparing multiple values in a single statement? Something like below. IF $x <> "1" OR "2" OR "3" Then ConsoleWrite("Success") EndIf Thanks!
  5. Hello all! I hope everyone is enjoying their holiday festivities. I'm working on a script that involves copying a string of text from an Excel workbook and searching for it in a particular website's search tool. If a result is found, it will do something. If not, it will do something else. So far, it can successfully execute the search -- and then it shows me the results in an array. Screenshot of the successful search: The search results in an array: Here's the code (sorry for all my comments): ;~ All the functions this app performs require the
  6. I've to upload different number of photos online in different assignments. There is a problem that all photos cannot be selected at once to upload. I have to choose and upload photos one by one. For this purpose I have made a script to automate whatever I have to do manually for choosing and uploading photos one by one. Please see my script below and check the last "MouseClick" command. This command clicks the button to choose and upload next photo. The problem I'm facing is; the last "MouseClick" works 1 step extra when all photos have been selected and uploaded. I mean if 7 photos are t
  7. Hi guys, I'm learning about GUI's, I'm trying the below code, the idea being if I press the letter "e" while I have the GUI open I want the label color to change to green (I'm using a UDF for label colors). But every time I press "e" on my keyboard I just get a "ding" sound from my speakers and nothing changes with the label. I've looked at using something like "While GUIGetMsg() <> $GUI_EVENT_CLOSE" as I've seen it in other code instead of "While 1", but I don't think it's relevant. #include <GUIConstantsEx.au3>; for GUI... #include <GUIRichLabel.au3>; UDF fo
  8. Hi, i'm curious if this is even possible, i want to do an action if the ini file contains current values under a section. for my test i'm looking for 100,200,300,400,500 and if any of those excits i want to pop a msgbox with the number in the section. i can in my example find one, but it does not check everyone. why? what am i missing? Local $iscore810[5] = [100,200,300,400,500] Local $iMax800 = 5 While 1 ;~     Send("{pause}") ;;func les ini fil     $var = IniReadSection("Area.ini", "modus")     If
  9. So can anyone help me ? I need to restart program when condition is not met ...
  10. my esteemed autoits, i need your help once again. The bold and italics below are what i will be referring to. I need a message box to exit the script if Cancel is pressed and to continue the script if OK is pressed. I have tried multiple ways to do this to no avail. Can someone please breakdown how i go about this via Message box, and or Input box as I'm sure they will follow the same logic. I appreciate your time and assistance. Example: global $url, $username, $password, $sspassword $url = "https://securegateway.fairview.org" $username = "XXX" $password = "YYY"
  11. Hello everyone I would like to have some help regarding my issue. I am trying to extract some information from excel sheet, I use _Excel_RangeFind then I get the array for the value then I check the array. In case the array is true the next will be to get some information based on the extracted array if no array because the value is not found it gives a messages box that the value is not found. My problem that the button works for one time only if i tried any value which exist in the sheet it gives me that value not found. I suspect that there is a problem regarding While l
  12. can anyone help me plz how can you put mouseclick in if statement or is it possible example: if Mouseclick = "left" then Tooltip(" you click left mouse") thank you
  13. I know on other languages when you try to use a string like this Global $sString = "Some String" If ($sString) Then ; ... EndIf The compiler will fail because string cannot be used in an expression where it needs a bool (something along those lines). But I see instances in other languages where using $sString in an expression will work and implicitly use the length of the string (or because there is some value in that variable). I'm wondering why AutoIt doesn't do the same. If the $sString is used like in my example (or some other expression where it wants a bool t
  14. Hello, i am creating a program that 1. it will check if the computer is connected to the internet 2. will display a message if it is connected 3.if not connected then it will continue to check until the computer connects to the internet then it runs the function which would have been executed if the computer was connected to the internet. what i tried. i connected my computer to the internet and run the code. Which displayed the msgbox that am connected i later turn my internet off and run the cold , i saw it running in process list.. i waited for 5 minutes and it w
  15. Is there possibility to do it like this? Cause as I see compiler doesn't see If statement in case of #include functions. It includes these two files all time. If $var == True Then #include 'func/funcsByTabs/main_Moda.au3' Else #include 'func/funcsByTabs/main_Others.au3' EndIf
  16. Okay so here's the problem. I have a script I'm testing out where I want it to search for a certain color and if it finds that certain color I want it to check for a second color. I only want it to check for the second color after checking for the first color. If it finds the first color it will check for the second color and whether or not that second color is present it will cause certain actions to be undertaken. Well at least that's what I want it to do. I want this all to be done in a loop where it's constantly checking for the first color. However, once it does find the first color
  17. Hi all, I'm going crazy while I try and work out why a fairly simply if condition isn't working. I will try and explain it clearly, in the hope someone can find out the cause. The portion of the script for these if conditions is copied in below. The first PixelGetColor func is denoted in Screenshot 1, the RED dot signifies where the color is extracted from. The second PixelGetColor func is denoted in Screenshot 2, the YELLOW dot signifies where the color is extracted from. The script is tested for 3 scenarios, where 1. no resource is found (Screenshot 1), 2. multiple resources are found (
  18. Hi, I want to tell pixelsearch to search for red color shades in for example 5 different x,y,h,w of the screen. If color red was not found in these 5 area, then do something. I wrote this, but it's working only if the first case is not found. Is select a good choice? or it's better to use switch or if or something else? ŔćEdit: all "do something"s are same function. (search for red color untill in these 5 areas, it couldnot find red color, then if it couldn't find red color, perform that 1 function) Thanks Select Case 1 $color1 = PixelSearch(67, 614, 77, 617, 0xE
  19. so right now i have a small project and i wanted to print this text out every second. i have made a random number for the sleep function. but when i want to print out with the while loop it just doesn't work. Run("notepad.exe") Sleep(1000) Local $rndSleep = Int (Random(180000,240000,1000)) While $rndSleep <> 0 $rndSleep - 1 If Mod ( $rndSleep, 1000 ) == 0 Then Send("This note will show the sleeptime before closing the tabs, you got " & $rndSleep & " seconds left.") EndIf WEnd plis halp me
  20. #include <Misc.au3> While 1 If _IsPressed(59) Then Send("{B}") MouseDown("left") Else Send("{B}") MouseUp("left") EndIf WEnd I want the script to do this: - if I press "Y", send "B" once and hold left click down until i release "Y". - if I take my hands off of "Y" key, then send "B" once again and release left click. but the script I made has problems. when I run the script, it starts sending "B" repeatedly, and my left click won't work. I'm not smart enough to figure out what the pro
  21. Basically i am trying to make a script that detects if the currently active window is 1920 x 1080 or bigger. If it detects a window that is active, that is indeed that size. It will do some stuff. The problem i am having is that it is detecting my desktop whenever i click on my desktop, so it's doing stuff when i don't want it to. So all i need to know, is how can i do a simple check to see if a window = a title. Here is what i have so far $wintitledesktop = WinGetTitle("[ACTIVE]") If not $wintitledesktop = "Program Manager" Then ;does stuff endif Prog
  22. Hello reader, I would like to know if and/or how it is possible to check if recycle bin has files or folders in it. So my code would eventually be like this (if these were the commands) if fileshere then FileRecycleEmpty() ;empties recylce bin endif
  23. Hi all, I'm looking for some help to finish my last bit of code. So far my code scrapes an XML from a webpage and then sends and email on a trigger but what i need to do is find a way to see if a string is in the XML. example Global $Site = IniRead("settings.ini", "Site", "web", "") ;============================================================ while 1 if @HOUR >= 05 and @HOUR <= 18 then $sXML = BinaryToString(InetRead($Site)) $Day = StringRegExpReplace($sXML, '(?is).*<availability.*?day="([^"]+).*
  24. So I need some help... basically all I want to do is have Autoit generate a random number between 1 and 3 and then have an if statement that reads the random number... and lets say if it = 3 it will say the number 3 in a msgbox (like this) sleep(500) Random(1,3) If Random = 2 Then MsgBox(0,"","2") EndIf If Random = 1 Then MsgBox(0,"","1") EndIf If Random = 3 Then MsgBox(0,"","3") EndIf can anyone help me? (thanks in advance!)
  25. Hello, I am relatively new to autoit (and this type of programming in general, typically do front end web dev). I have been tasked with writing some scripts to login to, navigate, and download files from some private websites. I have been hacking my way through these projects with plenty of wrong turns, cursing, and confusion. I currently have a script that works, but utilizes some rather lengthy Sleep times to manage varying page loading times. During page loads, there will often be text that says "Page Loading" I am trying to write some code to check whether this exists after particular st
  • Create New...