Jump to content

KennethF

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by KennethF

  1. Hey - fair enough - but there was alot of variables I did not understand in your script - so I started from scratch and by looking at all your other scripts and some examples in the help file, I made this script.. - All I need to do now is write all the missing lines for the different cities.., maybe find out how to display status in a status windows and figure out how to show the program running so I can terminate it without using the taskmanager.. - but right now it looks like its working.. I really really really appreciate ALL your help !!! - It was a BIG help for me.. !!! Please look at the script and please comment.. :-) While 1 ;Comment: Check London to start image capture If FileExists ( 'c:\ftp\london\1.txt' ) Then Run ( 'c:\ftp\program\httpcmd.exe root:test@192.168.1.10') Filemove ( "c:\ftp\london\1.txt", "c:\ftp\london\2.txt", 0) EndIf ;Comment: Check Paris to start image capture If FileExists ( 'c:\ftp\paris\1.txt' ) Then Run ( 'c:\ftp\program\httpcmd.exe root:test@192.168.1.11') Run ( 'c:\ftp\program\httpcmd.exe root:test@192.168.1.12') Run ( 'c:\ftp\program\httpcmd.exe root:test@192.168.1.13') Filemove ( "c:\ftp\paris\1.txt", "c:\ftp\paris\2.txt", 0) EndIf ;Comment: Check London for JPG images If FileExists ( 'c:\ftp\london\*.jpg' ) Then FileMove ( "c:\ftp\london\2.txt", "c:\ftp\london\3.txt", 0) EndIf ;Comment: Check Paris for three JPG images $search = FileFindFirstFile("c:\ftp\paris\*.jpg") Local $Count=0 While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $Count+=1 WEnd ; Close the search handle FileClose($search) IF $Count>=3 Then FileMove ( "c:\ftp\paris\2.txt", "c:\ftp\paris\3.txt", 0) EndIf WEnd
  2. Somehow the #.jpg continues to go one step up in even in different directories.. - Example.. If I put 1.exe into LONDON it changes to 2.txt. Then I put a 1.txt into PARIS and it changes to 3.txt (but it should have changed to 2.txt). Then I put 1.txt into MOSCOW but it changes to 4.txt (It should also only change to 2.txt) The txt file can only have three names.. - 1.txt or 2.txt or 3.txt Maybe its easier if I write the whole purpose of the program For Paris: 1. A truck in Paris runs onto a weight - once weighted a program (not this one) puts a file named 1.txt into the c:\ftp\paris directory 2. This AUTOIT program (the one you are making for me) monitors all the city names for a file named 1.txt. When it sees the file c:\ftp\paris\1.txt it renames the filename to 2.txt and starts an external DOS exe file with some parameters. This program sends a TCP packet to an IP camera with alot of parameters (This program works if i just make one line in a DOS windows with all parameters. 3. Every time the IP camera recieves the packet it will FTP a JPG image to the PARIS directory. 4. When this AUTOIT program sees that there is ONE jpg file in the PARIS directory it renames the file 2.txt to 3.txt 5. The program that placed the file 1.txt is still monitoring all the city name directories.. - When it sees a file named 3.txt it copies all the JPG files in the Paris directory and deletes all files including the 3.txt file. 6. The Paris directory is now ready for another sequence again. For London: 1. A truck in London runs onto a weight - once weighted a program (not this one) puts a file named 1.txt into the c:\ftp\london directory 2. This AUTOIT program (the one you are making for me) monitors all the city names for a file named 1.txt. When it sees the file c:\ftp\london\1.txt it renames the file to 2.txt and starts an external DOS exe file with some parameters. This program sends a TCP packet to an IP camera with alot of parameters (This program works if i just make one line in a DOS windows with all parameters. In London however there is more than one camera. So the program needs to start the EXE file two times more with different IP adresses but same parameters. 3. Every time any of the LONDON IP camera recieves the packet it will FTP a JPG image to the LONDON directory. 4. When this AUTOIT program sees that there is three jpg file in the LONDON directory it renames the file 2.txt to 3.txt 5. The program that placed the file 1.txt is still monitoring all the city name directories.. - When it sees a file named 3.txt it copies all the JPG files in the Paris directory and deletes all files including the 3.txt file. 6. The LONDON directory is now ready for another sequence again. All this should happen for all 15 city names... :-) Hope I makes more sence now.. - and hoping you still want to help programming this for me.. :-) PS. Also if it is possible I would like a Window/program to be seen in Windows when this program runs.. - More so I can see that it is actually running - and If i choose I can close it.. :-) PS2. In the end when everything works a Nice feature that would be nice to have is that inside the program windows a state of all the city names would be displayed and a status saying NOTHING, 1.txt, 2.txt or 3.txt - that way it would be easy to see if everything is running smoothly.. :-) Best regards, Kenneth
  3. This error pop ups when i compile the exe file.. ? C:\FTP\AutoIT\Test5.au3(31,58) : ERROR: _FileListToArray(): undefined function. $FileList = _FileListToArray ( $_FolderPath, '*.jpg' )
  4. Btw. - I was just looking at your script.. - It needs to call the start.exe with different IP for each city.. Example: Check city "london" for 1.txt IF exist then call start.exe 192.168.1.10/parameter Checi city "Moscow" for 1.txt IF exist then call start.exe 192.168.42.5/parameter Hope you are still willing to help me.. Best regards, Kenneth
  5. Yes ! - this is just great.. Then I just need it to detect # of JPGs - usally 1-3 jpgs per cityname and if they are there rename 2.txt to 3.txt And just loop the entire program Can you fix that also.. ?.. :-) Best regards, Kenneth
  6. Hey it worked.. - great..!!! - however I´am having alot of thinking - how does it work with all that scripting.. What if I want to make it more sort of a line by line programming without all those variables.. more beginners programming.. - and if the location1 instead is the name of a city and then another cityname.. Really looking forward to hearing from you.. :-) Best regards, Kenneth.. :-)
  7. Hi there.. - I´am totally new to this AutoIT software.. I hope someone can help me with this little task.. I need a program that can check if a file exists and if so - then execute a external program with some parameters.. Basically this is what the program should do: 1. Check directory c:\ftp\location1\ for a file named 1.txt 2. If the file exist then execute this program c:\ftp\program\start.exe root:test@192.168.1.100/start and rename the file 1.txt to 2.txt Next 3. Check directory c:\ftp\localtion2\ for a file named 1.txt 4. If the file exist then execute this program c:\ftp\program\start.exe root:test@192.168.1.101/start and remame the file 1.txt to 2.txt Continue this way for about 15 directories And then 5. Check directory c:\ftp\localtion1\ if there is 3 JPG files in here - then rename the file 2.txt to 3.txt 6. Check directory c:\ftp\localtion2\ if there is 1 JPG file in here - then rename the file 2.exe to 3.txt Continue for all the directories.. about 15. and then finally start all over in a loop monitoring these directories.. I tried doing something like this - but cant figure out how to do the rest.. ************************ If FileExists("c:\ftp\location1\1.txt") Then Run ("notepad.exe") If FileExists("c:\ftp\location2\1.txt" Then run ("notepad.exe") EndIf PS. Just using notepad.exe instead of the start.exe file to see the result.. Hope that someone can help me.. :-) Best regards, Kenneth
×
×
  • Create New...