ForsakenGod Posted January 4, 2010 Posted January 4, 2010 Hello , I would like to make an automatic update for my programm . What it now does it collects ignored pages (adresses) and put them into an html file line by line and afterwards (if they match criteria) ignores them in next searches. Now i would like to send this *.html file if it reaches for eq. 50 KB it should be send by smtp . The problem is i have absolutely no idea how to do an function that limits if its bigger than 50 kb and i also newer worked with an silent sending via smtp. Thanks in advance Unreal
botanic Posted January 4, 2010 Posted January 4, 2010 Hello , I would like to make an automatic update for my programm . What it now does it collects ignored pages (adresses) and put them into an html file line by line and afterwards (if they match criteria) ignores them in next searches. Now i would like to send this *.html file if it reaches for eq. 50 KB it should be send by smtp . The problem is i have absolutely no idea how to do an function that limits if its bigger than 50 kb and i also newer worked with an silent sending via smtp.Thanks in advanceUnrealwrite it to a file and use FileGetSize or StringLen if you want to just get the size of a string, 50 kilobits = 6400 byte so "if StringLen($String) > 6400 then @error"
ForsakenGod Posted January 4, 2010 Author Posted January 4, 2010 write it to a file and use FileGetSize or StringLen if you want to just get the size of a string, 50 kilobits = 6400 byte so "if StringLen($String) > 6400 then @error" Oh thanks cool and any idea how to make it send then ? Func Checker() While 1 $size = FileGetSize($file) If $size > 6400 Then _SMTP here EndIf WEnd EndFunc Like this and let it still run right . Thanks any idea how to send it via smtp than ?
botanic Posted January 4, 2010 Posted January 4, 2010 http://www.autoitscript.com/forum/index.php?showtopic=23860&view=findpost&p=166575 2nd result searching for autoit smtp on the forums
ForsakenGod Posted January 4, 2010 Author Posted January 4, 2010 (edited) http://www.autoitscript.com/forum/index.php?showtopic=23860&view=findpost&p=1665752nd result searching for autoit smtp on the forumsThank you ) ANd last question Anyone has an suggestion how to allow 2 function run (the same code ? ) I belive it was somethink with DIM Edited January 4, 2010 by ForsakenGod
James Posted January 4, 2010 Posted January 4, 2010 Anyone has an suggestion how to allow 2 function run (the same code ? ) I belive it was somethink with DIMAutoIt doesn't work like that. No multi threading sorry Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
ForsakenGod Posted January 4, 2010 Author Posted January 4, 2010 AutoIt doesn't work like that. No multi threading sorry Well afterwards is there some way to make my script work ? Like to example . The programm is collecting web adresses and if the file it creates reaches over 50 kb it should send it delete it and continue ?
James Posted January 4, 2010 Posted January 4, 2010 Well afterwards is there some way to make my script work ? Like to example . The programm is collecting web adresses and if the file it creates reaches over 50 kb it should send it delete it and continue ? FileGetSize(), FileDelete() and then you need to work out the SMTP part provided to you earlier Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
ForsakenGod Posted January 4, 2010 Author Posted January 4, 2010 FileGetSize(), FileDelete() and then you need to work out the SMTP part provided to you earlier Thanks Working on it already x)
ForsakenGod Posted January 4, 2010 Author Posted January 4, 2010 (edited) Global $log = "log.html" If $velkostsuboru > 1000 Then FileClose($log) Odoslanie() EndIf I got a little problem . It now checks the size of the file but it cannot be send cause some other pgoramm is using the file already any suggestions ? You see i close the file but anyway Edited January 4, 2010 by ForsakenGod
ForsakenGod Posted January 4, 2010 Author Posted January 4, 2010 (edited) Global $log = "log.html" FileWrite($log,"") FileOpen($log, 1) Sleep(100) FileWrite($log, @YEAR & "-" & @MON & "-" & @MDAY) While 1 ;www data capturing loop here some exeption etc and then it says what to write to log and what not so for ex. If 1=1 Then _Adress('adress') Wend Func Adress($adress) FileWrite($log, $adress) $velkostsuboru = FileGetSize($log) If $velkostsuboru > 1000 Then FileClose($log) Odoslanie() ;; This function starts the sending EndIf EndFUnc Here is an short example as sending script i use the one mentioned above . Thanks in advance Edited January 4, 2010 by ForsakenGod
James Posted January 4, 2010 Posted January 4, 2010 Couple of things. Firstly, it's "address" Next, this line: If 1=1 Then _Adress('adress') Could quite simply be replaced with just: _Adress('adress') And next, FileWrite($log,"") FileOpen($log, 1) Is being called the wrong way, it should be: FileOpen($log, 1) FileWrite($log,"") Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
ForsakenGod Posted January 4, 2010 Author Posted January 4, 2010 Couple of things. Firstly, it's "address" Next, this line: If 1=1 Then _Adress('adress') Could quite simply be replaced with just: _Adress('adress') And next, FileWrite($log,"") FileOpen($log, 1) Is being called the wrong way, it should be: FileOpen($log, 1) FileWrite($log,"") Thanks but anyway ... it still does not want to send the file even if i close it
James Posted January 4, 2010 Posted January 4, 2010 Thanks but anyway ... it still does not want to send the file even if i close it Well what errors do you get? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
ForsakenGod Posted January 4, 2010 Author Posted January 4, 2010 When it comes to the sending part it says that it cannot attatch the file because other programm is using it but you see that b4 i run the sending func i close the file
James Posted January 4, 2010 Posted January 4, 2010 When it comes to the sending part it says that it cannot attatch the file because other programm is using it but you see that b4 i run the sending func i close the fileDo you mind sharing the script you're using? PM it to me if you don't want public sharing Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted January 4, 2010 Posted January 4, 2010 Do you mind sharing the script you're using? PM it to me if you don't want public sharing How about making a copy of the file in the @TempDir then sending that one? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
ForsakenGod Posted January 4, 2010 Author Posted January 4, 2010 (edited) Ok will try out Edited January 4, 2010 by ForsakenGod
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now