<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=16823</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16823&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Виджет / GUI на рабочий стол, данные со страницы».]]></description>
		<lastBuildDate>Mon, 13 Dec 2021 19:25:09 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151169#p151169</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Понял</p>]]></description>
			<author><![CDATA[null@example.com (Michael)]]></author>
			<pubDate>Mon, 13 Dec 2021 19:25:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151169#p151169</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151168#p151168</link>
			<description><![CDATA[<p>Я понял, вы хотите в этой теме решить все вопросы, связанные с написанием скриптов на AHK. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> Вообще, программирование предполагает способность иногда думать и искать решения самостоятельно.<br />У нас есть <a href="https://forum.script-coding.com/rules.html#3.11.">правило</a>: одна тема — один вопрос.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 13 Dec 2021 19:21:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151168#p151168</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151167#p151167</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Готово. Обновляется раз в секунду.<br />Пытаюсь добавить еще один курс (Биткоина) по аналогии.<br />Ошибка при компиляции:<br /></p><div class="codebox"><pre><code>Duplicate function definition.
Specifically: WebRequest(url, method := &quot;GET&quot;, HeadersArray := &quot;&quot;, body := &quot;&quot;, ByRef error := &quot;&quot;)</code></pre></div><p>Вот код:<br /></p><div class="codebox"><pre><code>#SingleInstance Force
#NoEnv
SetBatchLines -1

Name = Test

GroupAdd, AppGroup, % Name

Gui +AlwaysOnTop
;Gui Color, 0x000000
Gui Add, Text, vText1 x8 y8 w250 h60 +0x200, uuu
Gui Add, Text, vText2 x8 y58 w250 h60 +0x200,
Menu, Tray, NoIcon
Gui Show, w246 h365, % Name

SetTimer, Price1, 1000

Price1:
url := &quot;https://www.cryptometer.io/data/binance/eth/usdt&quot;

html := WebRequest(url,, {&quot;Pragma&quot;: &quot;no-cache&quot;, &quot;Cache-Control&quot;: &quot;no-cache, no-store&quot;})
RegExMatch(html, &quot;class=&quot;&quot;lastprice&quot;&quot;&gt;\K[\d,.]+&quot;, Price1)

WebRequest(url, method := &quot;GET&quot;, HeadersArray := &quot;&quot;, body := &quot;&quot;, ByRef error := &quot;&quot;) {
   Whr := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
   Whr.Open(method, url, true)
   for name, value in HeadersArray
      Whr.SetRequestHeader(name, value)
   Whr.Send(body)
   Whr.WaitForResponse()
   status := Whr.status
   if (status != 200)
      error := &quot;HttpRequest error, status: &quot; . status
   Arr := Whr.responseBody
   pData := NumGet(ComObjValue(arr) + 8 + A_PtrSize)
   length := arr.MaxIndex() + 1
   Return StrGet(pData, length, &quot;UTF-8&quot;)
}

GuiControl,, Text2, % Price1

SetTimer, Price2, 1000

Price2:
url := &quot;https://www.cryptometer.io/data/binance/eth/usdt&quot;

html := WebRequest(url,, {&quot;Pragma&quot;: &quot;no-cache&quot;, &quot;Cache-Control&quot;: &quot;no-cache, no-store&quot;})
RegExMatch(html, &quot;class=&quot;&quot;lastprice&quot;&quot;&gt;\K[\d,.]+&quot;, Price2)

WebRequest(url, method := &quot;GET&quot;, HeadersArray := &quot;&quot;, body := &quot;&quot;, ByRef error := &quot;&quot;) {
   Whr := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
   Whr.Open(method, url, true)
   for name, value in HeadersArray
      Whr.SetRequestHeader(name, value)
   Whr.Send(body)
   Whr.WaitForResponse()
   status := Whr.status
   if (status != 200)
      error := &quot;HttpRequest error, status: &quot; . status
   Arr := Whr.responseBody
   pData := NumGet(ComObjValue(arr) + 8 + A_PtrSize)
   length := arr.MaxIndex() + 1
   Return StrGet(pData, length, &quot;UTF-8&quot;)
}

GuiControl,, Text2, % Price2</code></pre></div><p>В чем может быть проблема?</p>]]></description>
			<author><![CDATA[null@example.com (Michael)]]></author>
			<pubDate>Mon, 13 Dec 2021 19:16:37 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151167#p151167</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151166#p151166</link>
			<description><![CDATA[<p>Смотрите в сторону SetTimer. Но если сайт слишком часто долбить запросами, ему это может не понравиться.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 13 Dec 2021 19:05:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151166#p151166</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151165#p151165</link>
			<description><![CDATA[<p>Почитал, понял ошибку.<br />Показывает курс при старте программы:<br /></p><div class="codebox"><pre><code>#SingleInstance Force
#NoEnv
SetBatchLines -1

Name = Test

GroupAdd, AppGroup, % Name

Gui +AlwaysOnTop
;Gui Color, 0x000000
Gui Add, Text, vText x8 y8 w250 h60 +0x200,
Menu, Tray, NoIcon
Gui Show, w246 h365, % Name

Price:
url := &quot;https://www.cryptometer.io/data/binance/eth/usdt&quot;

html := WebRequest(url,, {&quot;Pragma&quot;: &quot;no-cache&quot;, &quot;Cache-Control&quot;: &quot;no-cache, no-store&quot;})
RegExMatch(html, &quot;class=&quot;&quot;lastprice&quot;&quot;&gt;\K[\d,.]+&quot;, Price)

WebRequest(url, method := &quot;GET&quot;, HeadersArray := &quot;&quot;, body := &quot;&quot;, ByRef error := &quot;&quot;) {
   Whr := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
   Whr.Open(method, url, true)
   for name, value in HeadersArray
      Whr.SetRequestHeader(name, value)
   Whr.Send(body)
   Whr.WaitForResponse()
   status := Whr.status
   if (status != 200)
      error := &quot;HttpRequest error, status: &quot; . status
   Arr := Whr.responseBody
   pData := NumGet(ComObjValue(arr) + 8 + A_PtrSize)
   length := arr.MaxIndex() + 1
   Return StrGet(pData, length, &quot;UTF-8&quot;)
}

GuiControl,, Text, % Price</code></pre></div><p>Только он статичный, запрос делается один раз, а как сделать ежесекундно (обновляемый автоматически)? Хотя бы в какую сторону копать?</p>]]></description>
			<author><![CDATA[null@example.com (Michael)]]></author>
			<pubDate>Mon, 13 Dec 2021 19:02:02 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151165#p151165</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151164#p151164</link>
			<description><![CDATA[<p>Наверно, стоит почитать, что такое Return, и для чего оно нужно. А также ExitApp.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 13 Dec 2021 18:56:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151164#p151164</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151163#p151163</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>А если убрать Return, тогда перестаёт появляться?</p></blockquote></div><p>Нет, всё также появляется, попробовал в своём скрипте без Return - никаких изменений...<br />Не пойму, как это связано.</p>]]></description>
			<author><![CDATA[null@example.com (Michael)]]></author>
			<pubDate>Mon, 13 Dec 2021 18:53:23 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151163#p151163</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151162#p151162</link>
			<description><![CDATA[<p>Я в вас верю, вы способны пройти этот челлендж! <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 13 Dec 2021 18:49:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151162#p151162</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151161#p151161</link>
			<description><![CDATA[<p>А если убрать Return, тогда перестаёт появляться?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 13 Dec 2021 18:48:20 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151161#p151161</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151160#p151160</link>
			<description><![CDATA[<p>Потому что добавил Return в конец. Что и сделал в моем скрипте...<br />Мне уже самому смешно, что мне такие вопросы задаете, чувствую себя умственно-отсталым...)))</p>]]></description>
			<author><![CDATA[null@example.com (Michael)]]></author>
			<pubDate>Mon, 13 Dec 2021 18:45:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151160#p151160</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151159#p151159</link>
			<description><![CDATA[<p>А почему второе сообщение стало появляться?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 13 Dec 2021 18:39:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151159#p151159</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151158#p151158</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br /></p><div class="codebox"><pre><code>MsgBox, Вы увидите это сообщение

MsgBox, Это сообщение не появится, как думаете, почему?
Return</code></pre></div><p>Вот так я вижу сначала первое, потом второе.<br />В моем случае это почему-то не работает:<br /></p><div class="codebox"><pre><code>#SingleInstance Force
#NoEnv
SetBatchLines -1

Name = Test

GroupAdd, AppGroup, % Name

;Gui +AlwaysOnTop
;Gui Color, 0x000000
Gui Add, Text, vText x8 y8 w250 h60 +0x200, % Price
Menu, Tray, NoIcon

Gui Show, w246 h365, % Name
return

GuiClose:
ExitApp

Price:
url := &quot;https://www.cryptometer.io/data/binance/eth/usdt&quot;

html := WebRequest(url,, {&quot;Pragma&quot;: &quot;no-cache&quot;, &quot;Cache-Control&quot;: &quot;no-cache, no-store&quot;})
RegExMatch(html, &quot;class=&quot;&quot;lastprice&quot;&quot;&gt;\K[\d,.]+&quot;, Price)
GuiControl,, Text, % Price

;MsgBox, % Price

WebRequest(url, method := &quot;GET&quot;, HeadersArray := &quot;&quot;, body := &quot;&quot;, ByRef error := &quot;&quot;) {
   Whr := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
   Whr.Open(method, url, true)
   for name, value in HeadersArray
      Whr.SetRequestHeader(name, value)
   Whr.Send(body)
   Whr.WaitForResponse()
   status := Whr.status
   if (status != 200)
      error := &quot;HttpRequest error, status: &quot; . status
   Arr := Whr.responseBody
   pData := NumGet(ComObjValue(arr) + 8 + A_PtrSize)
   length := arr.MaxIndex() + 1
   Return StrGet(pData, length, &quot;UTF-8&quot;)
}
return</code></pre></div><p>Знаю, вокруг да около хожу, проблемы не вижу... Туплю...</p>]]></description>
			<author><![CDATA[null@example.com (Michael)]]></author>
			<pubDate>Mon, 13 Dec 2021 18:36:50 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151158#p151158</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151157#p151157</link>
			<description><![CDATA[<div class="quotebox"><cite>Michael пишет:</cite><blockquote><p>Потому что нету Return.</p></blockquote></div><p>Уверены? А с return как будет?<br /></p><div class="codebox"><pre><code>MsgBox, Вы увидите это сообщение
Return

MsgBox, Это сообщение не появится, как думаете, почему?
Return</code></pre></div><p>Так?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 13 Dec 2021 18:31:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151157#p151157</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151156#p151156</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Потому что нету Return.<br />Но с ним тоже ничего не показывает:<br /></p><div class="codebox"><pre><code>#SingleInstance Force
#NoEnv
SetBatchLines -1

Name = Test

GroupAdd, AppGroup, % Name

;Gui +AlwaysOnTop
;Gui Color, 0x000000
Gui Add, Text, vText x8 y8 w250 h60 +0x200, % Price
Menu, Tray, NoIcon

Gui Show, w246 h365, % Name
Return

GuiClose:
ExitApp

Price:
url := &quot;https://www.cryptometer.io/data/binance/eth/usdt&quot;

html := WebRequest(url,, {&quot;Pragma&quot;: &quot;no-cache&quot;, &quot;Cache-Control&quot;: &quot;no-cache, no-store&quot;})
RegExMatch(html, &quot;class=&quot;&quot;lastprice&quot;&quot;&gt;\K[\d,.]+&quot;, Price)
GuiControl,, Text, % Price
return
;MsgBox, % Price

WebRequest(url, method := &quot;GET&quot;, HeadersArray := &quot;&quot;, body := &quot;&quot;, ByRef error := &quot;&quot;) {
   Whr := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
   Whr.Open(method, url, true)
   for name, value in HeadersArray
      Whr.SetRequestHeader(name, value)
   Whr.Send(body)
   Whr.WaitForResponse()
   status := Whr.status
   if (status != 200)
      error := &quot;HttpRequest error, status: &quot; . status
   Arr := Whr.responseBody
   pData := NumGet(ComObjValue(arr) + 8 + A_PtrSize)
   length := arr.MaxIndex() + 1
   Return StrGet(pData, length, &quot;UTF-8&quot;)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Michael)]]></author>
			<pubDate>Mon, 13 Dec 2021 18:29:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151156#p151156</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Виджет / GUI на рабочий стол, данные со страницы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151155#p151155</link>
			<description><![CDATA[<div class="codebox"><pre><code>MsgBox, Вы увидите это сообщение
Return

MsgBox, Это сообщение не появится, как думаете, почему?</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 13 Dec 2021 18:25:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151155#p151155</guid>
		</item>
	</channel>
</rss>
