Raquel 0 Posted July 28, 2010 Hi There! I'm having a little trouble getting my script to work. I'm fairly new to AutoIT, a few friends have helped me pull together this script but they're all busy now and I've gotten lost, could someone take me under their wing and guide me a little here and there? I'm willing to pay you $5 to $10 donations here or there via paypal once the code works if we could work outside the forum on a one on one email to email basis. Please reply to this post if you're familiar with AutoIT and I will email you the .pdf file (124k) as I can not upload the file here since the size limit for the upload is 64k. I look forward to hearing from you all! Thanks a lot! Share this post Link to post Share on other sites
smashly 12 Posted July 28, 2010 Hi, You'd probably be better off just posting your code or a code snippet your having trouble with in the forum. Also explaining what your having trouble grasping and trying to accomplish. Providing your trying yourself and your code isn't malicious or game bot then you'll more then likely get better input and better understanding of ways to write your code yourself. (I could be wrong but I think your allowed upto 1MB total for attachments in the forum and using code brackets doesn't count towards that 1MB.) Cheers Share this post Link to post Share on other sites
Raquel 0 Posted July 28, 2010 Hey There! Here's the code below. Thanks a lot! expandcollapse popup#AutoIt3Wrapper_icon=C:\Program Files\AutoIt3\Icons\Misc\Computer.ico #include <file.au3> Global $PrimaryIni = @ScriptDir & '\Noveat.ini' Global $Extracted_Articles_Location = IniRead($PrimaryIni,'MAIN','Extracted_Articles','ERROR') Global $PAGE_MASTER_PHP = @DesktopDir & '\PAGE-MASTER-PHP.htm' ;'C:\Users\styles3000\Desktop\PAGE-MASTER-PHP.htm' Global $HOME_MASTER_PHP = @DesktopDir & '\HOME-MASTER-PHP.htm' ;'C:\Users\styles3000\Desktop\HOME-MASTER-PHP.htm' FileInstall('.\PAGE-MASTER-PHP.htm', @DesktopDir&'\PAGE-MASTER-PHP.htm') FileInstall('.\HOME-MASTER-PHP.htm', @DesktopDir&'\HOME-MASTER-PHP.htm') sleep(5000) ;You may have to create a separate script to run prior to this one in order to establish the appropriate folders. ; I want to design a exe file that is able to load onto any computer and creates the necessary destination files so the program can run. $sTotalFiles = _GetFileCount("C:\Users\styles3000\Desktop\Extracted Articles\"); ;MsgBox(0,'Total Files',$sTotalFiles) sleep(5000) $Firstline = 'christmas greetings' DirCreate('C:\Users\styles3000\Desktop\Extracted Articles\'&$Firstline);Create this folder on the desktop FileCopy($HOME_MASTER_PHP, _ ;Takes the file on the desktop and copies it instead of using the original. 'C:\Users\styles3000\Desktop\'&$Firstline&'\index.htm',8) sleep(5000) For $i = 1 To $sTotalFiles FileCopy($PAGE_MASTER_PHP, _;Takes the file on the desktop and copies it instead of using the original. 'C:\Users\styles3000\Desktop\'&$Firstline& '\index' & $i & '.htm',8) Next sleep(7000) $sTotalFiles = _GetFileCount("C:\Users\styles3000\Desktop\Extracted Articles\") ;MsgBox(0,'Total Files',$sTotalFiles) sleep(7000) $Firstline = 'christmas greetings' DirCreate('C:\Users\styles3000\Desktop\'&$Firstline) FileCopy('C:\Users\styles3000\Desktop\HOME-MASTER-PHP2.htm', _ 'C:\Users\styles3000\Desktop\'&$Firstline&'\index.htm',8) sleep(5000) For $i = 1 To $sTotalFiles FileCopy($PAGE_MASTER_PHP, _ 'C:\Users\styles3000\Desktop\' & $Firstline & '\index' & $i & '.htm',8) Next ;This is where AutoIT extracts and inserts the text from the files extracted from $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0001.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index1.htm' ;$sDir_Title_Extract = "C:\sTemp\" ;$sFile_Title_Extract = '0001.txt' ;$sDir_Title_Insert = 'C:\Temp\' ;$sFile_Title_Insert = 'index.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0002.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index2.htm' ;$sDir_Title_Extract = "C:\Temp\" ;$sFile_Title_Extract = '0001.txt' ;$sDir_Title_Insert = 'C:\Temp\' ;$sFile_Title_Insert = 'index.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0003.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index3.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0004.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index4.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0005.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index5.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0006.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index6.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0007.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index7.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0008.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index8.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0009.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index9.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0010.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index10.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0011.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index11.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0012.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index12.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0013.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index13.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0014.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index14.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0015.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index15.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0016.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index16.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0017.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index17.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking $sDir_Title_Extract = $Extracted_Articles_Location $sFile_Title_Extract = '0018.txt' $sDir_Title_Insert = 'D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\' $sFile_Title_Insert = 'index18.htm' $sTitle_Ins = _GetTitle( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $sTitle_Rep = _GetTitle( $sDir_Title_Insert & $sFile_Title_Insert ) ;Get the string to be replaced $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,$sTitle_Rep,$sTitle_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;----------------- CONTENT ------------------------- $sContent_Ins = _Get_Content( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#ARTICLE_CONTENT1#',$sContent_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking ;------------------ AUTHOR ---------------------------- $sAuthor_Ins = _Get_Author( $sDir_Title_Extract & $sFile_Title_Extract ) ;Get the String to be inserted $retval = _ReplaceStringInFile($sDir_Title_Insert & $sFile_Title_Insert,'#authorname#',$sAuthor_Ins,0,1) ;replace the title string if $retval = -1 then msgbox(0, "ERROR", "The pattern could not be replaced in file: " & $sDir_Title_Insert & $sFile_Title_Insert & " Error: " & @error) ;Error checking sleep(5000) ;-------This is where "rename files4" begans--------- $sKeywordsDir = $Extracted_Articles_Location $sIndexDir = "D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\" $sTitleDir = "D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\" $search = FileFindFirstFile($sKeywordsDir&"*.*") $FileCount = '1' While 1 $file = FileFindNextFile($search) If @error Then ExitLoop ;MsgBox(4096, "File:", $file) $Title = _GetTitle($sKeywordsDir&$file) $Title = StringReplace($Title,'"',"'") $Title = StringReplace($Title,'?','') $Title = StringReplace($Title,':','') ;MsgBox(0,'',$Title) sleep(3000) FileMove($sIndexDir&"index"&$FileCount&".htm", $sTitleDir&$title&".htm",1) sleep(5000) $FileCount = $FileCount+1 WEnd FileClose($search) FileDelete("D:\Objects To Burn\Adsense\websites\HOME-MASTER-PHP2") sleep(3000) FileDelete("D:\Objects To Burn\Adsense\websites\PAGE-MASTER-PHP2") sleep(3000) FileDelete("D:\Documents and Settings\Taevon Jones\Desktop\Copy of OutputofFreshkeywords.txt") sleep(3000) FileDelete("D:\Documents and Settings\Taevon Jones\Desktop\OutputofFreshkeywords.txt") sleep(3000) DirRemove($Extracted_Articles_Location) sleep(3000) DirCreate($Extracted_Articles_Location) Func _StringBetween($s_String, $s_Start, $s_End = 0) $s_Start = StringInStr($s_String, $s_Start) + StringLen($s_Start) Return StringMid($s_String, $s_Start, StringInStr($s_String, $s_End) - $s_Start) EndFunc ;==>_StringBetween Func _Get_Author($File) $text = FileRead($File) $posStart = StringInStr($text,'<authorname>') $posEnd = StringInStr($text,'</authorname>') If $posStart = 0 or $posEnd = 0 Then MsgBox(0,'ERROR','This File doesnt Contain content') $result = '' ; This File doesnt Contain a Title Else $result = StringMid($text,$posStart+12,$posEnd-($posStart+12)) EndIf $result= StringLower($result) Return $result EndFunc Func _Get_Content($File) $text = FileRead($File) $posStart = StringInStr($text,'<content>') $posEnd = StringInStr($text,'</content>') If $posStart = 0 or $posEnd = 0 Then MsgBox(0,'ERROR','This File doesnt Contain content') $result = '' ; This File doesnt Contain a Title Else $result = StringMid($text,$posStart+9,$posEnd-($posStart+9)) EndIf $result= StringLower($result) Return $result EndFunc Func _GetFileCount($Directory) Local $sTotalFiles = 0 $search = FileFindFirstFile($Directory&"*.*") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $attrib = FileGetAttrib($Directory&$file) If StringInStr($attrib,"D") < 1 Then $sTotalFiles = $sTotalFiles+1 EndIf WEnd FileClose($search) Return $sTotalFiles EndFunc Func _GetTitle($File) $text = FileRead($File) $posStart = StringInStr($text,'<title>') $posEnd = StringInStr($text,'</title>') If $posStart = 0 or $posEnd = 0 Then MsgBox(0,'ERROR','This File doesnt Contain a Title') $result = '' ; This File doesnt Contain a Title Else $result = StringMid($text,$posStart+7,$posEnd-($posStart+7)) EndIf $result= StringLower($result) Return $result EndFunc Share this post Link to post Share on other sites
PsaltyDS 39 Posted July 28, 2010 What does it do? No, I'm not going to run it just to see. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Share this post Link to post Share on other sites
Raquel 0 Posted July 29, 2010 Its a script that makes you a website with multiple back pages that all link together. As for me,I'm just an employee with really no programming experience ,I work for a small company named Jones Inc., and we've come to this forum looking to hire an expert on AutoIT on a project by project basis. We'll pay you $30 upon completion of the any script we need help building or adjusting ($5 upfront and $25 at the completion of the project). If you show yourself trustworthy , we'll pay you more as the projects come. We need someone who can take the ideas, words and pictures of our mind and make AutoIT scripts do what we need it to do for the company. Please spread the word, this job is on a first come first serve basis. As far as the script its already done(sort of), it just needs some tweaking in order to turn it into an .exe file. I look forward to hearing from you all! Thanks a lot! Share this post Link to post Share on other sites
PsaltyDS 39 Posted July 29, 2010 Don't do this in "General Help and Support". Take it to the chat forum, or try the Rent-A-Coder link in my sig. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Share this post Link to post Share on other sites