<?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=17532</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=17532&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: создание команд».]]></description>
		<lastBuildDate>Sat, 31 Dec 2022 16:04:12 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: создание команд]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=156159#p156159</link>
			<description><![CDATA[<p><strong>ikryznov</strong><br />Скрипты для игр должны находиться в соответствующей ветке, переношу. А что непонятно в выводимом сообщении об ошибке? Вы его прочитали?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 31 Dec 2022 16:04:12 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=156159#p156159</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: создание команд]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=156158#p156158</link>
			<description><![CDATA[<p><a href="https://yapx.ru/album/VRG33">https://yapx.ru/album/VRG33</a> - скрин</p>]]></description>
			<author><![CDATA[null@example.com (ikryznov)]]></author>
			<pubDate>Sat, 31 Dec 2022 15:41:10 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=156158#p156158</guid>
		</item>
		<item>
			<title><![CDATA[AHK: создание команд]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=156157#p156157</link>
			<description><![CDATA[<p>Данный код выдают ошибку на скрине ниже:</p><div class="codebox"><pre><code>
#If WinActive(&quot;GTA:SA:MP&quot;)
#If
CMD.SwitchOn()
Class CMD {
	Static Status := 0
	Static List := {}

	; CMD.Register(&quot;command&quot;,&quot;testFunc&quot;) - The second parameter is a function
	; CMD.Register(&quot;command&quot;,&quot;testFunc&quot;,testObject) - The second parameter is a method
	Register(Command,Function, Object := &quot;&quot;) {
		If ( IsObject(Object) ) {
			Function := ObjBindMethod(Object,Function)
			CMD.List[Command] := Function 
			return 0
		} else if ( IsFunc(Function) ) {
			CMD.List[Command] := Function
			return 0
		} else return 1
	}
	SwitchOn() {
		If ( !CMD.Status ) {
			Static Function := ObjBindMethod(CMD,&quot;Check&quot;)
			Hotkey, If, WinActive(&quot;GTA:SA:MP&quot;)
			Hotkey, ~Enter,% Function, On, UseErrorLevel
			CMD.Status := ( ErrorLevel == 0 ) ? &quot;1&quot; : &quot;0&quot;
			return ErrorLevel
		} else return 1
	}
	SwitchOff() {
		If ( CMD.Status != 0 ) {
			Hotkey, If, WinActive(&quot;GTA:SA:MP&quot;)
			Hotkey, ~Enter, Off, UseErrorLevel
			CMD.Status := ( ErrorLevel == 0 ) ? &quot;0&quot; : &quot;1&quot;
			return ErrorLevel
		} else return 1
	}
	Check() {
		if ( isInChat() ) {
			KeyWait, Enter
			sleep 150 
			Input := readString(hGTA, dwSAMP + 0x141A78, 256)
			If ( SubStr(Input,1,1) == &quot;/&quot; &amp;&amp; RegExMatch(Input,&quot;(\w+)&quot;, Command, 2) &amp;&amp; CMD.List[Command] ) {
				writeString(hGTA, dwSAMP + 0x141A78, &quot;&quot;)
				Function := CMD.List[Command], Arguments := StrSplit(SubStr(Input,3+StrLen(Command),StrLen(Input)-2-StrLen(Command)),&quot; &quot;)
				While ( Arguments.Length() &lt; IsFunc(Function) )
					Arguments.Push(&quot;&quot;)
				%Function%(Arguments*)
			}
		}
	}
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ikryznov)]]></author>
			<pubDate>Sat, 31 Dec 2022 15:39:55 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=156157#p156157</guid>
		</item>
	</channel>
</rss>
