Jump to content

Search the Community

Showing results for tags 'increment'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

Categories

  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 2 results

  1. Hi Everyone! Been away from scripting for a bit and am a bit rusty. I was trying to get downloaded image filenames to increment by one. I was hoping to be able to check the last filename and continue from there if the program was closed and reopened again. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $biolister = GUICreate("Form1", 125, 97, 192, 124) GUISetBkColor(0x99B4D1) $start = GUICtrlCreateButton("Start", 8, 40, 41, 33) GUICtrlSetBkColor(-1, 0x00FFFF) $stop = GUICtrlCreateButton("Stop", 72, 40, 41, 33) GUICtrlSetBkColor(-1, 0xFF0000) $Bio = GUICtrlCreateLabel("Bio Lister", 24, 8, 80, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $filename = 0 $sImgDir = "C:\filepathname\"&$filename&".jpg" $sImgUrl = "http://lorempixel.com/400/200" $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $stop Exit case $start InetGet($sImgUrl, $simgdir, 1, 0) if fileexists( $simgdir & $filename) then $filename + 1 EndSwitch WEnd
  2. First off I tried searching both the forums and the help file and I just know it's in one of them. If somebody could please help me find it I would be much grateful. Simply put, I am trying to increment a number that is read from an ini file. The script is to read the initial value, add one to it, and save the new value. The area dealing with this is the last line of code below. Here is my code: #Include <Restart.au3> Global $CommandIni = "DropRun.ini" ; Check that CommandIni exists, if not create file with default values. If FileExists($CommandIni) Then Global $Commands = IniReadSection($CommandIni, @ComputerName) IniWrite($CommandIni, @ComputerName & "_Log", "Start", $CommandIni & " found and read.") Else Local $defCmds[2][2] = [ ["Completed", "1"], ["Command1", "cmd.exe"] ] IniWriteSection($CommandIni, @ComputerName, $defCmds, 0) IniWrite($CommandIni, @ComputerName & "_Log", "Error", $CommandIni & " not found. Attempted to create file.") EndIf ; Check if already completed, if not run the commands. If $Commands[1][1] = "0" Then IniWrite($CommandIni, @ComputerName & "_Log", "Reading", "Entered Command section.") For $i = 2 To $Commands[0][0] ; Check if line is commented out. If StringInStr($Commands[$i][0], ";") Then ContinueLoop Local $exitCode = RunWait($Commands[$i][1]) IniWrite($CommandIni, @ComputerName & "_Log", "Command" & $i-1, $exitCode) Next IniWrite($CommandIni, @ComputerName, "Completed", "1") EndIf Sleep(300000) ; Log number of times script restarted. $Restarts = IniRead($CommandIni, @ComputerName & "_Log", "Restarts", "0") IniWrite($CommandIni, @ComputerName & "_Log", "Restarts", $Restarts+1) _ScriptRestart()The script uses the Also, if anybody has suggestions on how to simplify this I'd also greatly appreciate it. P.S. Sorry I couldn't get the code to paste pretty =S
×
×
  • Create New...