Sign in to follow this  
Followers 0
rajatrg

Newbie Help Needed

6 posts in this topic

#1 ·  Posted (edited)

Dear Sir,

 

I'm not a programming guy, I hired someone to make a autoit script and script was working absolutely fine

I was just testing something and I just opened the script, run it and forced to exit it, before completing the steps 

after that I'm getting error "Subscript used n non-accessible variable"

Can you please help to solve this issue as my developer is on vacation and I need to fix it urgently 

Script was running absolutely fine before 

Error is on Line 19 " c:/user/name/desktop/new auto it vs3.au3"

 

For$= 1 to $videofile(0)

For$= 1 to "videofiles" Error

 

Can you please suggest me a solution ?

This script is for editing the videos 

Edited by Melba23
Fixed formatting

Share this post


Link to post
Share on other sites



Post the script.


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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hello Sir, I got the script fixed, it started running, but now script completely changed and not working fine 

Complete script and I asked few other peoples, they said autoIT is not stable and useful, is it like that ?

#include <File.au3>


$templateFile = @DesktopDir & "\\WWE.prproj"
$oldVideoFileName = ""
$videoFolder = "C:\\Users\\Rajat\\Videos\\All Videos\\"

$tempFile = FileOpen("old name.txt", 0)
If $tempFile = -1 Then
    MsgBox(16, "old name.txt is missing", "Can't proceed, because old name is missing")
EndIf

$oldVideoFileName = FileRead($tempFile)
FileClose($tempFile)

;MsgBox(0, "", $oldVideoFileName)

$videoFiles = _FileListToArray($videoFolder) ;, "*.mp4"

For $i = 1 To $videoFiles[0]
    $currentFile = $videoFiles[$i]
    ;ConsoleWrite($currentFile & @CRLF)

    $tempFile = FileOpen($templateFile, 0)
    If $tempFile = -1 Then
        MsgBox(16, "WWE.prproj is missing", "Can't proceed, because WWE.prproj is missing")
    EndIf

    $templateFileRead = FileRead($tempFile)
    FileClose($tempFile)

    $templateFileRead = StringReplace($templateFileRead, $oldVideoFileName, $currentFile)

    $tempFile = FileOpen($templateFile, 2)
    FileWrite($tempFile, $templateFileRead)
    FileClose($tempFile)

    #cs
    Run("notepad.exe " & $templateFile)

    WinWait("WWE - Notepad")

    If WinExists("WWE - Notepad") Then
        WinActivate("WWE - Notepad")
        Sleep(1000)
        Send("^h") ;Run replace tool by CTRL+H
        Send($oldVideoFileName)
        Send("{TAB}")
        Send($currentFile)
        Send("!a") ;Press ALT+A to replace all
        Sleep(5000)
        Send("{ESCAPE}")
        Sleep(500)
        Send("^s") ;Save file
        Sleep(2000)
        ;WinClose("WWE - Notepad")
    EndIf
    #ce

    Sleep(250)
    ShellExecute(@DesktopDir & "\\WWE.prproj")

    ;Resize image
    WinWaitActive("[CLASS:Premiere Pro]")
    Sleep(4000)

    #cs Changes something else
    Send("+1")
    Send("{DOWN 3}") ;down three times
    Send("^r") ;open speed/duration
    Sleep(100)
    Send("{TAB}")
    Sleep(100)
    Send("^c{ESCAPE}") ;copy to clipboard and close dialog
    Sleep(250)

    Send("{DOWN}") ;switch to first image
    Send("^r") ;open speed/duration
    Sleep(100)
    Send("{TAB}")
    Send("^v{ENTER}") ;paste the length from clipboard
    Sleep(250)

    Send("{DOWN}") ;switch to second image
    Send("^r") ;open speed/duration
    Sleep(100)
    Send("{TAB}")
    Send("^v{ENTER}") ;paste the length from clipboard
    Sleep(250)
    #ce

    MouseClick("left", 564, 564)
    Send("^r") ;open speed/duration
    Sleep(100)
    Send("{TAB}")
    Sleep(100)
    Send("^c{ESCAPE}") ;copy to clipboard and close dialog
    Sleep(250)

    MouseClick("left", 540, 540)
    Send("^r") ;open speed/duration
    Sleep(100)
    Send("{TAB}")
    Send("^v{ENTER}") ;paste the length from clipboard
    Sleep(250)

    MouseClick("left", 590, 590)
    Send("^r") ;open speed/duration
    Sleep(100)
    Send("{TAB}")
    Send("^v{ENTER}") ;paste the length from clipboard
    Sleep(250)

    ;Send("+3")
    Send("^m") ;CTRL+M to export
    Sleep(500)
    Send("{TAB 7}")
    Sleep(250)
    Send("{SPACE}")
    Sleep(2500)
    Send($currentFile)
    Send("{ENTER}")
    Sleep(250)
    Send("{TAB 22}{SPACE}")
    WinWaitActive("[CLASS:Premiere Pro]")
    Send("^+w") ;CTRL+SHIFT+W to quit
    Sleep(250)
    Send("{TAB}{SPACE}") ; don't save the file

    Sleep(500)
    $oldVideoFileName = $currentFile
    ;WinClose("WWE - Notepad")
    Sleep(250)
Next

cleanup()

$tempFile = FileOpen("old name.txt", 2) ;overwrite
FileWrite($tempFile, $oldVideoFileName)
FileClose($tempFile)

Func cleanup()
    ;Delete the files from the All Videos folder
    FileDelete($videoFolder)
EndFunc

I guess their is problem due to files changed due to script stopped in between ?

I tried to replace with backup file too, but still I got the same error

Edited by Melba23
Merged and added code tags

Share this post


Link to post
Share on other sites
If Not @error Then
For $i = 1 To $videoFiles[0]
    $currentFile = $videoFiles[$i]
    ;ConsoleWrite($currentFile & @CRLF)

    $tempFile = FileOpen($templateFile, 0)
    If $tempFile = -1 Then
        MsgBox(16, "WWE.prproj is missing", "Can't proceed, because WWE.prproj is missing")
    EndIf

    $templateFileRead = FileRead($tempFile)
    FileClose($tempFile)

    $templateFileRead = StringReplace($templateFileRead, $oldVideoFileName, $currentFile)

    $tempFile = FileOpen($templateFile, 2)
    FileWrite($tempFile, $templateFileRead)
    FileClose($tempFile)

    #cs
    Run("notepad.exe " & $templateFile)

    WinWait("WWE - Notepad")

    If WinExists("WWE - Notepad") Then
        WinActivate("WWE - Notepad")
        Sleep(1000)
        Send("^h") ;Run replace tool by CTRL+H
        Send($oldVideoFileName)
        Send("{TAB}")
        Send($currentFile)
        Send("!a") ;Press ALT+A to replace all
        Sleep(5000)
        Send("{ESCAPE}")
        Sleep(500)
        Send("^s") ;Save file
        Sleep(2000)
        ;WinClose("WWE - Notepad")
    EndIf
    #ce

    Sleep(250)
    ShellExecute(@DesktopDir & "\\WWE.prproj")

    ;Resize image
    WinWaitActive("[CLASS:Premiere Pro]")
    Sleep(4000)

    #cs Changes something else
    Send("+1")
    Send("{DOWN 3}") ;down three times
    Send("^r") ;open speed/duration
    Sleep(100)
    Send("{TAB}")
    Sleep(100)
    Send("^c{ESCAPE}") ;copy to clipboard and close dialog
    Sleep(250)

    Send("{DOWN}") ;switch to first image
    Send("^r") ;open speed/duration
    Sleep(100)
    Send("{TAB}")
    Send("^v{ENTER}") ;paste the length from clipboard
    Sleep(250)

    Send("{DOWN}") ;switch to second image
    Send("^r") ;open speed/duration
    Sleep(100)
    Send("{TAB}")
    Send("^v{ENTER}") ;paste the length from clipboard
    Sleep(250)
    #ce

    MouseClick("left", 564, 564)
    Send("^r") ;open speed/duration
    Sleep(100)
    Send("{TAB}")
    Sleep(100)
    Send("^c{ESCAPE}") ;copy to clipboard and close dialog
    Sleep(250)

    MouseClick("left", 540, 540)
    Send("^r") ;open speed/duration
    Sleep(100)
    Send("{TAB}")
    Send("^v{ENTER}") ;paste the length from clipboard
    Sleep(250)

    MouseClick("left", 590, 590)
    Send("^r") ;open speed/duration
    Sleep(100)
    Send("{TAB}")
    Send("^v{ENTER}") ;paste the length from clipboard
    Sleep(250)

    ;Send("+3")
    Send("^m") ;CTRL+M to export
    Sleep(500)
    Send("{TAB 7}")
    Sleep(250)
    Send("{SPACE}")
    Sleep(2500)
    Send($currentFile)
    Send("{ENTER}")
    Sleep(250)
    Send("{TAB 22}{SPACE}")
    WinWaitActive("[CLASS:Premiere Pro]")
    Send("^+w") ;CTRL+SHIFT+W to quit
    Sleep(250)
    Send("{TAB}{SPACE}") ; don't save the file

    Sleep(500)
    $oldVideoFileName = $currentFile
    ;WinClose("WWE - Notepad")
    Sleep(250)
Next
EndIf

 


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Hi sir, I am having backup of old script, which was working fine, Does I should work on Fixing the template on which script was running ? or should I hire someone to fix it ?

 

as I need it urgently fixed, I hired 1 guy yesterday, He worked for more than 20 hours and he is unable to do it, as he is also a newbie , Does somebody can help me via teamvewer or guiding Please it's urgent for me to fix it 

Edited by rajatrg

Share this post


Link to post
Share on other sites

it's hard to know where it fails without more info.

Perhaps insert write console or msgbox to see how far you get.

the use of mouse clicks is very fragile as the screen positions may change.

use the info tool to verify that they are still correct

also there may be no problem with the code - it may be failing due to a change in the files in the folder that it is accessing.

 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0

  • Similar Content

    • anub13
      By anub13
      Hi,

      I am having difficulties wondering why my code bugging like this,
      the symptom : I have a form with combo box, and details in bottom of the app, when user choose another option the details changes immediately but when I go to details, it goes up and down endlessly
      here is the code
       
      Global $cChkPatrol, $YES= "YES", $NO = "NO" if GUICtrlRead($combo1) = "YES" Then $cChkPatrol = $YES Else $cChkPatrol = $NO EndIf func StartForm() GUICtrlSetData($txtInfo,"ADDITIONAL INFORMATION THAT WILL BE SENT WITH THE MESSAGE:" & @CRLF & asdfgSystemInfo()) GUISetState(@SW_SHOW) AdlibRegister("_CheckPatrol") While 1 $nMsg = GUIGetMsg() Select case $nMsg = $txtEmailAddress GUICtrlSetData($txtInfo,"ADDITIONAL INFORMATION THAT WILL BE SENT WITH THE MESSAGE:" & @CRLF & asdfgSystemInfo()) case $nMsg = $txtPhone GUICtrlSetData($txtInfo,"ADDITIONAL INFORMATION THAT WILL BE SENT WITH THE MESSAGE:" & @CRLF & asdfgSystemInfo()) case $nMsg = $txtFullName GUICtrlSetData($txtInfo,"ADDITIONAL INFORMATION THAT WILL BE SENT WITH THE MESSAGE:" & @CRLF & asdfgSystemInfo()) case $nMsg = $cChkPatrol GUICtrlSetData($txtInfo,"ADDITIONAL INFORMATION THAT WILL BE SENT WITH THE MESSAGE:" & @CRLF & asdfgSystemInfo()) case $nMsg = $cmdScreenShot $gScreenShotFile = SaveScreenShot() case $nMsg = $cmdSubmit if ValidateForm() then if asdfgSubmit() Then UpdateStatus("Your request has been sent successfully") MsgBox(0,"Help Requested","Your request has been sent successfully") ExitLoop Else MsgBox(0,"Help Failed","Something is wrong you request was not sent, please try again") Endif endIf case $nMsg = $cmdAttach $gAttachFile = AttachFile() Case $nMsg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd AdlibUnRegister("_CheckPatrol") EndFunc func asdfgSystemInfo() dim $asdfgInfo $asdfgInfo = "" & @CRLF if $isAdminVersion=1 then $asdfgInfo = $asdfgInfo & @CRLF & " Ticket Tags:" & @CRLF $asdfgInfo = $asdfgInfo & "~#userphone='" & GUICtrlRead($txtPhone) & "'" & @CRLF $asdfgInfo = $asdfgInfo & "~#submitterphone='" & GUICtrlRead($txtPhone) & "'" & @CRLF dim $MachineID $MachineID = KaseyaIni($gKIniFile,"SERVER COMMUNICATIONS","User_Name","NotFound") $asdfgInfo = $asdfgInfo & "~#machineid='" & $MachineID & "'" & @CRLF dim $OrgGroups $OrgGroups= StringSplit($MachineID,".") dim $OrgGroupIndex $OrgGroupIndex = UBound($OrgGroups) - 1 $asdfgInfo = $asdfgInfo & "~#organization='" & $OrgGroups[$OrgGroupIndex] & "'" & @CRLF dim $EmailUser $EmailUser = GUICtrlRead($txtEmailAddress) $EmailUser = StringMid($EmailUser,1,StringInStr($EmailUser,"@") - 1) & @CRLF & @CRLF $asdfgInfo = $asdfgInfo & "~#username='" & $EmailUser & "'" & @CRLF ;dim ;Call("isChecked") ;$categ = GUICtrlRead($chkPatrol) ;$asdfgInfo = $asdfgInfo & "-#category='" & $categ & "'" & @CRLF EndIf $asdfgInfo = $asdfgInfo & "Email:" & GUICtrlRead($txtEmailAddress) & @CRLF & @CRLF $asdfgInfo = $asdfgInfo & "Full Name:" & GUICtrlRead($txtFullName) & @CRLF & @CRLF $asdfgInfo = $asdfgInfo & "Phone:" & GUICtrlRead($txtPhone) & @CRLF & @CRLF $asdfgInfo = $asdfgInfo & "DateTime:" & _Now() & @CRLF $asdfgInfo = $asdfgInfo & "MachineName:" & @ComputerName & @CRLF $asdfgInfo = $asdfgInfo & "UserName:" & @UserName & @CRLF $asdfgInfo = $asdfgInfo & "OS:" & @OSType & " " & @OSVersion & @CRLF $asdfgInfo = $asdfgInfo & "LogonDomain:" & @OSType & " " & @LogonDomain & @CRLF $asdfgInfo = $asdfgInfo & "LogonDNSDomain:" & @OSType & " " & @LogonDNSDomain & @CRLF $asdfgInfo = $asdfgInfo & "OS:" & @OSType & " " & @OSVersion & @CRLF $asdfgInfo = $asdfgInfo & "IP Address:" & @IPAddress1 & @CRLF $asdfgInfo = $asdfgInfo & "Public IP Address:" & GetPublicIP() &@CRLF ;$asdfgInfo = $asdfgInfo & "Public IP Address:" & _GetIP () &@CRLF $asdfgInfo = $asdfgInfo & "OS:" & NetAdapterInfo() $asdfgInfo = $asdfgInfo & "KaseyaInstalled:" & KaseyaInstalled() & @CRLF $asdfgInfo = $asdfgInfo & "KaseyaRunning:" & KaseyaRunning() & @CRLF $asdfgInfo = $asdfgInfo & "KaseyaAgentGUID:" & KaseyaIni($gKIniFile,"SERVER COMMUNICATIONS","Agent_Guid","NotFound") & @CRLF $asdfgInfo = $asdfgInfo & "asdfgPaid:" & isasdfgIDPaid() & @CRLF if $isAdminVersion=0 then $asdfgInfo = $asdfgInfo & @CRLF & " Ticket Tags:" & @CRLF $asdfgInfo = $asdfgInfo & "~userphone='" & GUICtrlRead($txtPhone) & "'" & @CRLF $asdfgInfo = $asdfgInfo & "~submitterphone='" & GUICtrlRead($txtPhone) & "'" & @CRLF dim $MachineID $MachineID = KaseyaIni($gKIniFile,"SERVER COMMUNICATIONS","User_Name","NotFound") $asdfgInfo = $asdfgInfo & "~machineid='" & $MachineID & "'" & @CRLF dim $OrgGroups $OrgGroups= StringSplit($MachineID,".") dim $OrgGroupIndex $OrgGroupIndex = UBound($OrgGroups) - 1 $asdfgInfo = $asdfgInfo & "~organization='" & $OrgGroups[$OrgGroupIndex] & "'" & @CRLF dim $EmailUser $EmailUser = GUICtrlRead($txtEmailAddress) $EmailUser = StringMid($EmailUser,1,StringInStr($EmailUser,"@") - 1) $asdfgInfo = $asdfgInfo & "~username='" & $EmailUser & "'" & @CRLF dim $categ $categ = $chkPatrol $asdfgInfo = $asdfgInfo & "~category='" & $categ & "'" & @CRLF dim $track $track = $cChkPatrol $asdfgInfo = $asdfgInfo & "~test='" & $cChkPatrol & "'" & @CRLF $asdfgInfo = $asdfgInfo & "~afterhour='" & $AfterHour & "'" & @CRLF endif Return $asdfgInfo endFunc  
      Yes it was same app as previous post in the forum I asked, I also having experience this happening before but I fail to understand the reason why this is happening. Thanks in advance.
      ButtonSupport - Copy.au3
    • Fhelipe
      By Fhelipe
      So I wanted to use my machine as a server for a program that had a unique login system. It can only log in 1 person and the password is in the script itself. I would like to adptar my code or change it completely so that I can create a database and the Script At Time Of Login Get Database Login And Log In
      Experience with Autoit: Basic                      (sorry for bad English)
      Experience with SQL: None                              (translator only)
      Code Currently Used To Login:
      ;=========================================================
      While 1
          $MSG = GUIGetMsg()
          Switch $MSG
          Case $ButtonOk
              If VerifyLogin(GUICtrlRead($USERNAME),GUICtrlRead($PASSWORD)) = 1 Then
                  GUIDelete($Form1)
                  MsgBox(-1,"Logado com Sucesso","Login Sucedido, Para Parar o Aimbot Pressione ESC!")
                  Run ("C:\Program Files (x86)\Steam\steamapps\common\Mitos.is The Game\Mitosis.exe")
                  RunP()
              Else
                  MsgBox(-1,"Error","Usúario ou Senha está incorreto, Ou Ainda Não Pagou!")
               EndIf
          Case -3
              Exit
           Case $ButtonCancel
              Exit
                Case $HelpButton
               MsgBox(-1, "Criadores", "Criadores: Zummey & Ralta")
      Case $Register
         MsgBox(-1, "ERRO", "PROGRAMA EM DESENVOLVIMENTO FUNÇÃO DESABILITADA")
          EndSwitch
      WEnd
      Func VerifyLogin($USERNAME,$PASSWORD)
          If $USERNAME = "Zummey" And $PASSWORD = "xd90fe10" Then
              Return 1
          Else
              Return 0
          EndIf
      EndFunc; End login
      ;=========================================================
    • IamKJ
      By IamKJ
      I am trying to allow the GUI to gather info as to when to execute a function.  I am having trouble doing this.  So far this is what I have.
       
      ;Timer Func timer () If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(36,"Timer","Please format your answer in 00:00:00:000") Select Case $iMsgBoxAnswer = 6 ;Yes Global $infotime = InputBox ('Time', 'What time to execute?') Do $rawtimer = ToolTip(@Hour & ':' & @Min & ':' & @Sec & ':' & _MSec()) until $rawtimer = $infotime if $rawtimer = $infotime Then msgbox (0,'Worked','Worked') Else EndIf Case $iMsgBoxAnswer = 7 ;No Exit EndSelect EndFunc Func _MSec() Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort') DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime)) $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8)) $stSystemTime = 0 Return $sMilliSeconds EndFunc I have also tried _GUIToolTip_GetText in order to read the tooltip until the time specified, but it still doesn't work.  Any help would be great.
    • IamKJ
      By IamKJ
      So I have a lot of different functions in the little program I'm making.  Most of them use the Do statement, such as finding images, clicking buttons, etc.
       
      The question I have is how would I be able to both
      1) Create a hotkey to pause whatever I am doing at the moment.  If I have to put something into every function in the program, I don't mind.
      2) Create a hotkey to exit whatever I am doing and stop all loops or commands and bring back the main GUI?
    • Manivel
      By Manivel
      Hi,
      Can any one please share the Connection string for SQL Developer. 
      How to Connect the SQL Developer from AutoIT. We need to execute the query through AutoIt. is that possible ?