Jump to content
Sign in to follow this  
bb05

Rapidshare Help

Recommended Posts

bb05

Hey everyone, back again with a little bit of an idea. <_<

want to download 1 file over and over every 2 minutes, then pause for an hour, and repeat. I was taking a look at this topic and saw this code:

#include <IE.au3>
#include <String.au3>

FileOpen ("links.txt", 0)
$LINE = FileReadLine ("link.txt", 1)
$Ventana = _IECreate ($LINE)
$Free = _IEGetObjByName ($Ventana, "dl.start", 1)
_IEAction ($Free, "click")
_IELoadWait ($Ventana)
$Img = _IEImgGetCollection($Ventana, 2)
$ImgLink = $Img.src
InetGet($ImgLink, @HomeDrive & "\" & "OCR.jpg")
FileInstall("gocr.exe", @HomeDrive & "\gocr.exe")
FileInstall("djpeg.exe", @HomeDrive & "\djpeg.exe")
RunWait(@ComSpec & " /c " & @HomeDrive & '\djpeg.exe' & " " & @HomeDrive & '\OCR.jpg' & " " & @HomeDrive & '\OCR.pnm' , "", @SW_HIDE)
RunWait(@ComSpec & " /c " & @HomeDrive & '\gocr.exe' & " -o " & @HomeDrive & '\OCR.txt ' & @HomeDrive & "\OCR.pnm" , "", @SW_HIDE)
FileDelete(@HomeDrive & "\OCR.jpg")
FileDelete(@HomeDrive & "\OCR.pnm")
FileDelete(@HomeDrive & "\djpeg.exe")
FileDelete(@HomeDrive & "\gocr.exe")
FileOpen(@HomeDrive & "\OCR.txt", 0)
$OCRtext = FileReadLine (@HomeDrive & "\OCR.txt", 1)
$InputTextBox = _IEGetObjByName ($Ventana, "accesscode")
_IEFormElementSetValue ($InputTextBox, $OCRtext)
$DownloadButton = _IEGetObjByName ($Ventana, "actionstring")
_IEAction($DownloadButton, "click")

Now i believe that it would be possible to set variables in order to see how many times the program has gone through.

So like

-Loop 1 for 60 minute timer

-- Loop 2 for 2 minute timer

--- code

-- Test Loop 2

-Test Loop 1

Any help would be greatly appreciated.

Just for reference, I do need to use While and Wend correct or would there be a better solution?

Edited by bb05

Share this post


Link to post
Share on other sites
Nahuel

Yeah, you'd need a loop. But you can also do it with AdlibEnable(). Look in the help file for TimerInit() and TimerDiff(). You'll be able to come up with something <_<

Share this post


Link to post
Share on other sites
bb05

ok, so here's my updated code. not really sure how i would go any further with it, or if its even correct, but here it is:

AdlibEnable("Loop1")
Func(2minloop)
$begin = TimerInit()
    Sleep(160000)
$dif = TimerDiff()
    
Func(hourloop)
$begin = TimerInit()
    Sleep(3600000)
$dif = TimerDiff()


#include <IE.au3>
#include <String.au3>

FileOpen ("links.txt", 0)
$LINE = FileReadLine ("link.txt", 1)
$Ventana = _IECreate ($LINE)
$Free = _IEGetObjByName ($Ventana, "dl.start", 1)
_IEAction ($Free, "click")
_IELoadWait ($Ventana)
$Img = _IEImgGetCollection($Ventana, 2)
$ImgLink = $Img.src
InetGet($ImgLink, @HomeDrive & "\" & "OCR.jpg")
FileInstall("gocr.exe", @HomeDrive & "\gocr.exe")
FileInstall("djpeg.exe", @HomeDrive & "\djpeg.exe")
RunWait(@ComSpec & " /c " & @HomeDrive & '\djpeg.exe' & " " & @HomeDrive & '\OCR.jpg' & " " & @HomeDrive & '\OCR.pnm' , "", @SW_HIDE)
RunWait(@ComSpec & " /c " & @HomeDrive & '\gocr.exe' & " -o " & @HomeDrive & '\OCR.txt ' & @HomeDrive & "\OCR.pnm" , "", @SW_HIDE)
FileDelete(@HomeDrive & "\OCR.jpg")
FileDelete(@HomeDrive & "\OCR.pnm")
FileDelete(@HomeDrive & "\djpeg.exe")
FileDelete(@HomeDrive & "\gocr.exe")
FileOpen(@HomeDrive & "\OCR.txt", 0)
$OCRtext = FileReadLine (@HomeDrive & "\OCR.txt", 1)
$InputTextBox = _IEGetObjByName ($Ventana, "accesscode")
_IEFormElementSetValue ($InputTextBox, $OCRtext)
$DownloadButton = _IEGetObjByName ($Ventana, "actionstring")
_IEAction($DownloadButton, "click")

EndFunc

EndFunc

Share this post


Link to post
Share on other sites
Nahuel

Mmm... that doesn't do anything <_< Did you read the helpfile for TimerInit() and TimerDiff()???

This is more like what I had in mind:

#include <IE.au3>
#include <String.au3>
Global $Diff=0
While 1
    $Diff=0
    $Time=TimerInit()
    While $Diff < 2000
        $Diff=TimerDiff($Time)
        Sleep(100)
    WEnd
    MsgBox(0,"","Ok, now we are downloading")
WEnd

Share this post


Link to post
Share on other sites
bb05

i did read the help files on timediff() but they didnt have the greatest examples <_< so i wasnt completely sure of how-to use the codes, hence the post here.

one of the things that is really confusing me is how i will be able to have to while statements running inside of each other and then testing to see which while statement is suppose to be running (eg: not have the 2 minute timer run when the hour timer is suppose to run and vise versa.)

Share this post


Link to post
Share on other sites
ericg32

If you want to get really simple.. Write a script that downloads the file.. waits 2 minutes.. downloads it again..

THEN schdules itself to run at the appoited time.. SUppose you want it to run at 12 past the hour.. jsut get the currnt hour.. +1/ fix it up for 23 -> then add an entry into the windwos scheduler

Share this post


Link to post
Share on other sites
bb05

ok i attempted to accomplish what you said but i am not having any luck getting this to work. i am still a little new to auto-it. not requesting for someone to do this for me.. but if they want to.. i wouldnt complain either, lol.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.