RogerRabbitsClone Posted May 31, 2011 Share Posted May 31, 2011 im trying to get this to read me the weather as a wake up call (like that scene in iron man where his computer is on his window)i have my computer hooked up to a fla tscreen+surround sound but i would like to get it to only read part of the table rather then everything, ie 'weather line' rather then 'barometer'. is this just a parameter in IE_bodyyreadtext? #include <IE.au3> $oIE = _IEcreate ("http://mobile.weather.gov/port_mp_ns.php?select=3&CityName=Hayward&site=MTR&State=CA&warnzone=CAZ508") $stext = _IEBodyReadText($oIE) Speak ("good morning Sir, Begining your Morning weather reoprt " & $stext) Func Speak($sText) Local $o_speech = ObjCreate("SAPI.SpVoice") With $o_speech .Rate=.01 .Volume=100 .Speak ($sText) EndWith EndFunc sleep (3000) ShellExecute ("http://www.accuweather.com/us/ca/hayward/94540/city-weather-forecast.asp") <--a good way to start you day Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 31, 2011 Share Posted May 31, 2011 All of the text is packed into a single element, so you have to parse it out with String functions, for example: #include <IE.au3> #include <Array.au3> $oIE = _IEcreate ("http://mobile.weather.gov/port_mp_ns.php?select=3&CityName=Hayward&site=MTR&State=CA&warnzone=CAZ508") $sText = _IEBodyReadText($oIE) $aText = StringRegExp($sText, "(?:Weather\: |Temperature\: )(.+)", 3) Speak ("Weather is " & $aText[0] & ", and temperature is " & $aText[1]) Func Speak($sText) Local $o_speech = ObjCreate("SAPI.SpVoice") With $o_speech .Rate=.01 .Volume=100 .Speak ($sText) EndWith EndFunc 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 Link to comment Share on other sites More sharing options...
RogerRabbitsClone Posted June 1, 2011 Author Share Posted June 1, 2011 thank you! until now i did not know such a function existed. and i just want to put it out there, that i have had more help from the autoit community then any other language ive ever tried to learn. thank you all. <--a good way to start you day Link to comment Share on other sites More sharing options...
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