<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Рандом без повторений]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=9494</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=9494&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Рандом без повторений».]]></description>
		<lastBuildDate>Fri, 18 Apr 2014 15:47:21 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81932#p81932</link>
			<description><![CDATA[<p>С кодами напутал. Там коды не нужны, там карты вместо букв прорисованы, как в моём скрипте.<br /></p><div class="codebox"><pre><code>FontFile := &quot;D:\Downloads\CARDS.TTF&quot;  ; указать путь к файлу со шрифтом
FontName := &quot;Playing Cards&quot;           ; указать имя шрифта из файла

if !DllCall(&quot;AddFontResourceEx&quot;, Str, FontFile, UInt, FR_PRIVATE := 0x10, Ptr, 0)
{
   MsgBox, % &quot;Не удалось установить шрифт. Ошибка &quot; . A_LastError
   return
}

SendMessage, WM_FONTCHANGE := 0x1D, 0, 0,, % &quot;ahk_id&quot; HWND_BROADCAST := 0xFFFF

Gui, -Caption +ToolWindow +LastFound +AlwaysOnTop
Gui, Color, 0x0000FD
Gui, Font, s80 q3, % FontName
Gui, Add, Text, cRed, F  ; шестёрка бубей
WinSet, TransColor, 0x0000FD
Gui, Show
Return

Esc::ExitApp</code></pre></div><p>Шестёрка бубей — F. Её код 0x46.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 18 Apr 2014 15:47:21 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81932#p81932</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81931#p81931</link>
			<description><![CDATA[<div class="codebox"><pre><code>FontFile := &quot;D:\Downloads\CARDS.TTF&quot;  ; указать путь к файлу со шрифтом
FontName := &quot;Playing Cards&quot;           ; указать имя шрифта из файла

if !DllCall(&quot;AddFontResourceEx&quot;, Str, FontFile, UInt, FR_PRIVATE := 0x10, Ptr, 0)
{
   MsgBox, % &quot;Не удалось установить шрифт. Ошибка &quot; . A_LastError
   return
}

SendMessage, WM_FONTCHANGE := 0x1D, 0, 0,, % &quot;ahk_id&quot; HWND_BROADCAST := 0xFFFF</code></pre></div><p>Блин почему то не меняет шрифт, но и ошибки не выдаёт.</p><p>А вообще свой шрифт удобно, можно по порядку как надо раскидать.<br />В аттаче шрифт можете проверить, у меня не отображается 6 бубей код 0x26, хотя в таблице символов её видно.<br /></p><div class="codebox"><pre><code>
Loop % mi := 52
    deck .= 0x20+A_Index &quot;|&quot;
 
size := 122, i := 0, deck := RTrim(deck,&quot;|&quot;) 

Gui, -DPIScale
Gui, Font, s40, Playing Cards 
Gui, Add, Text, h%size% w%size% +0x201 Border vcard1 g1 
Gui, Add, Text, hp wp x+5 +0x201 Border vcard2 g2
Gui, Add, Text, hp wp x+5 +0x201 Border vcard3 g3
Gui, Font, s16, Arial
Gui, Add, Text, % &quot;xs y+5 h&quot; size / 3 &quot; w&quot; size * 3 + 10 &quot; Border +0x201 vText gBegin&quot; 
Gui, Show   

Begin:
    Sort, deck, Random D|  
    Global arr := StrSplit(deck, &quot;|&quot;), i := 0, cards := [], mi
    GuiControl,, Text, Полная колода
    Loop 3
        GuiControl,, card%A_Index% 
    Return
    
1:: 
2::
3:: next(A_ThisLabel), cards := []
4:: GoTo Begin

next(count)  {    
    Loop % i + count &gt; mi ? mi - i : count
        cards[A_Index] := arr[++i] 
    Loop 3
    { 
        GuiControl, % cards[A_Index] &gt; 0x003a ? &quot;+cBlack&quot; : &quot;+cRed&quot;, card%A_Index% 
        GuiControl,, card%A_Index%, % Chr(cards[A_Index])
        GuiControl, +Redraw, card%A_Index% 
    }
    GuiControl,, Text, % i = mi ? &quot;Пустая колода&quot; : &quot;Осталось &quot; mi - i &quot; карт(ы)&quot; 
} 
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Fri, 18 Apr 2014 15:16:06 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81931#p81931</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81930#p81930</link>
			<description><![CDATA[<p>Тут дело даже не в привлекательности, а в том, что их только по букве Q опознать можно. А так лысый мужик какой-то.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Fri, 18 Apr 2014 14:41:43 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81930#p81930</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81929#p81929</link>
			<description><![CDATA[<p>Хм, я их в плане привлекательности как-то не догадался оценить. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 18 Apr 2014 14:14:27 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81929#p81929</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81928#p81928</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p><a href="http://www.dafont.com/playing-cards.font">Playing Cards</a></p></blockquote></div><p>Какие-то дамы лысые в этом шрифте. Скорее на мужиков смахивают.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Fri, 18 Apr 2014 12:59:20 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81928#p81928</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81926#p81926</link>
			<description><![CDATA[<p><a href="http://www.dafont.com/playing-cards.font">Playing Cards</a><br /></p><div class="codebox"><pre><code>FontFile := &quot;D:\Downloads\CARDS.TTF&quot;  ; указать путь к файлу со шрифтом
FontName := &quot;Playing Cards&quot;           ; указать имя шрифта из файла

if !DllCall(&quot;AddFontResourceEx&quot;, Str, FontFile, UInt, FR_PRIVATE := 0x10, Ptr, 0)
{
   MsgBox, % &quot;Не удалось установить шрифт. Ошибка &quot; . A_LastError
   return
}

SendMessage, WM_FONTCHANGE := 0x1D, 0, 0,, % &quot;ahk_id&quot; HWND_BROADCAST := 0xFFFF

Gui, -Caption +ToolWindow +LastFound +AlwaysOnTop
Gui, Color, 0x0000FD
Gui, Font, s80 q3, % FontName
Gui, Add, Text, cRed, K
Gui, Add, Text, x+1 cRed, Y
Gui, Add, Text, x+1 cBlack, m
Gui, Add, Text, x+1 cBlack, n
WinSet, TransColor, 0x0000FD
Gui, Show
Return

Esc::ExitApp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 18 Apr 2014 11:24:49 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81926#p81926</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81925#p81925</link>
			<description><![CDATA[<p>О, Спасибо. А Я на русском найти не мог <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" />.<br />Кстати, а как использовать в ГУИ шрифт файла, который не установлен в системе? Помнится где то видел решение.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Fri, 18 Apr 2014 10:44:44 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81925#p81925</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81924#p81924</link>
			<description><![CDATA[<p>А так не пробовали: <a href="http://yandex.ru/yandsearch?text=playing%20cards%20font&amp;clid=1955453&amp;lr=53">http://yandex.ru/yandsearch?text=playin … &amp;lr=53</a>?</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Fri, 18 Apr 2014 10:33:12 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81924#p81924</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81923#p81923</link>
			<description><![CDATA[<p>Так в том и вопрос, какой шрифт искать, где скачать?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Fri, 18 Apr 2014 09:23:47 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81923#p81923</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81922#p81922</link>
			<description><![CDATA[<p>Шрифт, наверно, скачать и установить.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Fri, 18 Apr 2014 09:20:55 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81922#p81922</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81919#p81919</link>
			<description><![CDATA[<p>В смысле, что скачать, чтобы хоть в &quot;Таблица символов&quot; увидеть.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Fri, 18 Apr 2014 06:43:43 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81919#p81919</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81916#p81916</link>
			<description><![CDATA[<p>В смысле, AHK v1, похоже, вообще не поддерживает utf-32:<br /></p><div class="codebox"><pre><code>VarSetCapacity(sim, 4, 0)
NumPut(0x1f0a0, sim, &quot;Int&quot;)
MsgBox, % StrLen(StrGet(&amp;sim, 1, &quot;CP12000&quot;))   ; 12000 — utf-32</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 17 Apr 2014 18:51:44 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81916#p81916</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81915#p81915</link>
			<description><![CDATA[<p>Кроме того chr поддерживает utf-32 только в v2<br /></p><div class="codebox"><pre><code>MsgBox % StrLen(Chr(0x12345))</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (bWRmeA)]]></author>
			<pubDate>Thu, 17 Apr 2014 17:59:48 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81915#p81915</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81914#p81914</link>
			<description><![CDATA[<p>Нужно найти и использовать шрифт, в котором есть эти символы.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 17 Apr 2014 17:42:17 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81914#p81914</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Рандом без повторений]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=81905#p81905</link>
			<description><![CDATA[<p>Кстати вопрос по анк, есть ведь 6-ти значные <a href="http://ru.wikipedia.org/wiki/Игральные_карты#Unicode">Unicode</a> (Для самих карт есть специальный диапазон от U+01F0A0 до U+01F0FF), как их отобразить в гуи?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 17 Apr 2014 14:57:14 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=81905#p81905</guid>
		</item>
	</channel>
</rss>
