Автоматический загрузчик данных с cbr.ru
;
; AutoIt Version: 3.0
; Language: English
; Platform: Win9x/NT
; Author: Jonathan Bennett (jon@hiddensoft.com)
;
; Script Function:
; Plays with the calculator.
;
; Prompt the user to run the script - use a Yes/No prompt (4 - see help file)
$answer = MsgBox(4, "AutoIt Example (English Only)", "This script will run the calculator and type in 2 x 4 x 8 x 16 and then quit. Run?")
; Check the user's answer to the prompt (see the help file for MsgBox return values)
; If "No" was clicked (7) then exit the script
If $answer = 7 Then
MsgBox(0, "AutoIt", "OK. Bye!")
Exit
EndIf
; Run the calculator
; Run("iexplore")
; Wait for the calulator become active - it is titled "Calculator" on English systems
; WinWaitActive("Calculator")
sleep(5000)
; Now that the calc window is active type 2 x 4 x 8 x 16
; Use AutoItSetOption to slow down the typing speed so we can see it :)
AutoItSetOption("SendKeyDelay", 50)
for $i = 1 to 31
Send("!{A}")
Sleep(1000)
Send("{H}")
Send("FW")
Sleep(3000)
if $i<10 then
$i1="0"&$i
else
$i1=$i
endif
Send("http://www.cbr.ru/currency_base/daily.aspx?C_month=01&C_year=2009&date_req="&$i1&"%2F01%2F2009")
Send("{ENTER}")
Sleep(30000)
Send("{TAB 32}")
Send("{ENTER}")
Send("{TAB }")
Send("{ENTER}")
sleep(5000)
Send("!{I}")
Sleep(1000)
send ("=$B"&(25*$i+1))
Send("{TAB 2}")
Send("{ENTER}")
next
;Send("http://www.hse.ru")
;Send("{ENTER}")
;Sleep(2000)
; Now quit by sending a "close" request to the calc
; WinClose("Calculator")
; Now wait for calc to close before continuing
; WinWaitClose("Calculator")
; Finished!
Добавлено: 13/2/2009 Просмотров: 5667