Advertisement
untoha

PC_greetings.vbs

Nov 30th, 2017
544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' на русском языке системы OS, sapi не говорит по русски, поэтому селектами
  2.  
  3. set sapi=CreateObject("sapi.spvoice")
  4. Dim wd
  5. Dim mon
  6. Dim workornot
  7.  
  8. WScript.Sleep 10000    ' чтобы система прогрузилась
  9.  
  10. Select Case Weekday(now)
  11.     Case 1
  12.             wd = "Sunday"
  13.             workornot = "it's weekend and you can chill a. bit!"
  14.     Case 2
  15.             wd = "Monday"
  16.             workornot = "and it's time to work!"
  17.     Case 3
  18.             wd = "Tuesday"
  19.             workornot = "and it's time to work!"
  20.     Case 4
  21.             wd = "Wednesday"
  22.             workornot = "and it's time to work!"
  23.     Case 5
  24.             wd = "Thursday"
  25.             workornot = "and it's time to work!"
  26.     Case 6
  27.             wd = "Friday"
  28.             workornot = "and it's time to work!"
  29.     Case 7
  30.             wd = "Saturday"
  31.             workornot = "it's weekend and you can chill a. bit!"
  32. End Select
  33.  
  34. Select Case Month(Date)
  35.     Case 1
  36.             mon = "January"
  37.     Case 2
  38.             mon = "February"
  39.     Case 3
  40.             mon = "March"
  41.     Case 4
  42.             mon = "April"
  43.     Case 5
  44.             mon = "May"
  45.     Case 6
  46.             mon = "June"
  47.     Case 7
  48.             mon = "July"
  49.     Case 8
  50.             mon = "August"
  51.     Case 9
  52.             mon = "September"
  53.     Case 10
  54.             mon = "October"
  55.     Case 11
  56.             mon = "November"
  57.     Case 12
  58.             mon = "December"
  59. End Select
  60.  
  61. sapi.Speak "Good morning, Antonn! Today is "&wd&" . "&Day(Date)&" , "&mon&" . "&workornot
  62.  
  63. if Weekday(now) = 3 then
  64.     sapi.Speak "Also, today is maintenance!"
  65. end if
  66.  
  67. WScript.Sleep 1000
  68.  
  69. Dim o
  70. Set o = CreateObject("MSXML2.XMLHTTP")
  71. o.open "GET", "http://untoha.ru/stock/brent_lastdealprice_WTI.php", False
  72. ' http://www.cmegroup.com/CmeWS/mvc/Quotes/FutureContracts/XNYM/G?quoteCodes=clk8
  73. o.send
  74. ' Dim res
  75. 'res = Split(o.responseText,":")   
  76. 'sapi.Speak "Last deal, Oil price is, " & Mid(Split(res(5),",")(0),2,5)
  77. sapi.Speak "Last deal, Oil price is, " & o.responseText
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement