<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.shoutirc.com/index.php?action=history&amp;feed=atom&amp;title=Lua_Scripting</id>
	<title>Lua Scripting - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.shoutirc.com/index.php?action=history&amp;feed=atom&amp;title=Lua_Scripting"/>
	<link rel="alternate" type="text/html" href="https://wiki.shoutirc.com/index.php?title=Lua_Scripting&amp;action=history"/>
	<updated>2026-04-29T13:32:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.shoutirc.com/index.php?title=Lua_Scripting&amp;diff=4506&amp;oldid=prev</id>
		<title>Indy: /* RadioBot Lua Commands */</title>
		<link rel="alternate" type="text/html" href="https://wiki.shoutirc.com/index.php?title=Lua_Scripting&amp;diff=4506&amp;oldid=prev"/>
		<updated>2014-06-09T00:16:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;RadioBot Lua Commands&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:16, 9 June 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l144&quot;&gt;Line 144:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 144:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  SendRemoteReply(sock, command, datalen, data)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  SendRemoteReply(sock, command, datalen, data)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  Sends a reply to a remote client, you will get sock in your &amp;#039;remote&amp;#039; event handler. See [[Remote Commands]] for protocol details.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  Sends a reply to a remote client, you will get sock in your &amp;#039;remote&amp;#039; event handler. See [[Remote Commands]] for protocol details.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; No return value.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; SendSMS(phone, text)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; Sends a SMS text message to the phone number given. (SMS plugin has to be loaded and configured.)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  No return value.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  No return value.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{ircbot programming}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{ircbot programming}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key drift_BotWiki:diff:1.41:old-4401:rev-4506:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://wiki.shoutirc.com/index.php?title=Lua_Scripting&amp;diff=4401&amp;oldid=prev</id>
		<title>Indy: Text replacement - &quot;IRCBot&quot; to &quot;RadioBot&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.shoutirc.com/index.php?title=Lua_Scripting&amp;diff=4401&amp;oldid=prev"/>
		<updated>2013-10-25T14:04:35Z</updated>

		<summary type="html">&lt;p&gt;Text replacement - &amp;quot;IRCBot&amp;quot; to &amp;quot;RadioBot&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==RadioBot Lua Commands==&lt;br /&gt;
Those of you familiar with the Plugin API will notice that many of the Lua commands are ported/simplified versions of API functions.&amp;lt;br /&amp;gt;&lt;br /&gt;
If you see anything in the [http://api.shoutirc.com Plugin API] that you would like to see implemented but isn&amp;#039;t here let us know and we&amp;#039;ll add it.&amp;lt;br /&amp;gt;&lt;br /&gt;
However, there are of course some new commands specific to the Lua scripts.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 bind_event(&amp;quot;event_type&amp;quot;, &amp;quot;handler_function&amp;quot;)&lt;br /&gt;
 bind_event(&amp;quot;event_type&amp;quot;, &amp;quot;handler_function&amp;quot;, &amp;quot;match text&amp;quot;)&lt;br /&gt;
 Registers an event handler. Examples: on_pm, on_text, on_join, etc. See [[Lua Events]] for more information.&lt;br /&gt;
 For events with text matching like on_pm and on_text you can include a 3rd parameter (wildcards supported) to match that text.&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 unbind_event(&amp;quot;event_type&amp;quot;, &amp;quot;handler_function&amp;quot;)&lt;br /&gt;
 unbind_event(&amp;quot;event_type&amp;quot;, &amp;quot;handler_function&amp;quot;, &amp;quot;match text&amp;quot;)&lt;br /&gt;
 Removes a previously registered event handler. Binds are automatically removed when scripts are unloaded, so you won&amp;#039;t need to use this 99% of the time.&lt;br /&gt;
 You must use the same parameters as you used in bind_event for this to work, including if you used match text.&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 ib_print(&amp;quot;string&amp;quot;)&lt;br /&gt;
 You should use this instead of print when possible so it will go through RadioBot&amp;#039;s output buffering and logging.&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 SetDoSpam(dospam)&lt;br /&gt;
 Sets the global DoSpam flag (dospam type: boolean)&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 SetDoSpamChannel(dospam, netno, &amp;quot;#channel&amp;quot;)&lt;br /&gt;
 Sets a channel&amp;#039;s DoSpam flag (dospam type: boolean)&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 SetDoOnJoin(doonjoin)&lt;br /&gt;
 Sets the global DoOnJoin flag (doonjoin type: boolean)&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 SetDoOnJoinChannel(doonjoin, netno, &amp;quot;#channel&amp;quot;)&lt;br /&gt;
 Sets a channel&amp;#039;s DoOnJoin flag (doonjoin type: boolean)&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 SendPM(netno, &amp;quot;nick/chan&amp;quot;, &amp;quot;text&amp;quot;)&lt;br /&gt;
 Sends a PM or channel message. You can also use the aliases msg or privmsg.&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 SendNotice(netno, &amp;quot;nick/chan&amp;quot;, &amp;quot;text&amp;quot;)&lt;br /&gt;
 Sends a NOTICE to a nick or channel. You can also use the alias notice.&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 SendAction(netno, &amp;quot;nick/chan&amp;quot;, &amp;quot;text&amp;quot;)&lt;br /&gt;
 Sends a ACTION to a person or channel. This is like /me in mIRC.&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 SendIRC(netno, &amp;quot;text&amp;quot;)&lt;br /&gt;
 Sends a raw IRC command.&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 SendIRC2(netno, &amp;quot;text&amp;quot;, priority, delay)&lt;br /&gt;
 Sends a raw IRC command with priority and optional delay. (The PRIORITY_* values are defined in Lua for your convenience. See the plugin API page for details.)&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 GetCurrentNick(netno)&lt;br /&gt;
 Get&amp;#039;s the bot&amp;#039;s current nick on network netno, or nil if your netno is out of bounds.&lt;br /&gt;
&lt;br /&gt;
 GetDefaultNick(netno)&lt;br /&gt;
 Get&amp;#039;s the bot&amp;#039;s default nick on network netno. -1 is the bot&amp;#039;s global default nickname.&lt;br /&gt;
&lt;br /&gt;
 GetBotVersion()&lt;br /&gt;
 The bot&amp;#039;s version as a unsigned number.&lt;br /&gt;
&lt;br /&gt;
 GetBotVersionString()&lt;br /&gt;
 The bot&amp;#039;s version as a string.&lt;br /&gt;
&lt;br /&gt;
 GetIP()&lt;br /&gt;
 Get the detected local IP.&lt;br /&gt;
&lt;br /&gt;
 GetBasePath()&lt;br /&gt;
 Get the bot&amp;#039;s working directory.&lt;br /&gt;
&lt;br /&gt;
 get_argc()&lt;br /&gt;
 Returns the argc value of the bot.&lt;br /&gt;
&lt;br /&gt;
 get_argv(num)&lt;br /&gt;
 Returns item num from the argv[] array (as string), or nil if your num is out of bounds.&lt;br /&gt;
&lt;br /&gt;
 LoadMessage(&amp;quot;message_name&amp;quot;, max_length)&lt;br /&gt;
 Returns a message from ircbot.text, or nil if it does not exist.&lt;br /&gt;
 max_length is important as it sets the internal text buffer size to use.&lt;br /&gt;
&lt;br /&gt;
 LogToChan(&amp;quot;string&amp;quot;)&lt;br /&gt;
 Send string to your LogChan (if enabled).&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 Rehash(&amp;quot;fn&amp;quot;)&lt;br /&gt;
 Rehash your ircbot.text (make fn &amp;quot;&amp;quot; to rehash the current ircbot.text, or specify a new filename to load a new one instead).&lt;br /&gt;
 Returns: no return value&lt;br /&gt;
&lt;br /&gt;
 IsValidUserName(&amp;quot;nick&amp;quot;)&lt;br /&gt;
 Returns true if nick is an existing RadioBot username, false otherwise.&lt;br /&gt;
&lt;br /&gt;
 GetUserNameFromHostmask(&amp;quot;hostmask&amp;quot;)&lt;br /&gt;
 Returns the bot username associated with hostmask, or nil if no matching user was found.&lt;br /&gt;
&lt;br /&gt;
 GetUserFlags(&amp;quot;hostmask&amp;quot;)&lt;br /&gt;
 Returns the user flags as an unsigned integer associated with hostmask, will return the Default Flags if no matching user.&lt;br /&gt;
&lt;br /&gt;
 GetUserFlagsString(&amp;quot;hostmask&amp;quot;)&lt;br /&gt;
 Returns the user flags as a string associated with hostmask, will return the Default Flags if no matching user.&lt;br /&gt;
 &lt;br /&gt;
 GetConfigSectionValue(&amp;quot;section&amp;quot;, &amp;quot;name&amp;quot;)&lt;br /&gt;
 Returns string config section value, or nil if item does not exist or isn&amp;#039;t a string.&lt;br /&gt;
 &lt;br /&gt;
 GetConfigSectionLong(&amp;quot;section&amp;quot;, &amp;quot;name&amp;quot;)&lt;br /&gt;
 Returns integer config section value, or -1 if item does not exist.&lt;br /&gt;
 &lt;br /&gt;
 IsConfigSectionValue(&amp;quot;section&amp;quot;, &amp;quot;name&amp;quot;)&lt;br /&gt;
 Returns true if value name is in section, false otherwise&lt;br /&gt;
 &lt;br /&gt;
 Configuration Demo:&lt;br /&gt;
 GetConfigSectionLong(&amp;quot;AutoDJ/Options&amp;quot;, &amp;quot;EnableVoice&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
 NumNetworks()&lt;br /&gt;
 Returns the number of IRC networks that are set up.&lt;br /&gt;
&lt;br /&gt;
 IsNetworkReady(netno)&lt;br /&gt;
 Returns true if IRC network netno is connected and logged in, false otherwise.&lt;br /&gt;
&lt;br /&gt;
 ProcText(&amp;quot;string&amp;quot;, max_length)&lt;br /&gt;
 Returns text processed through the RadioBot variable parser (%dj, %song, %version, other [[Built-In Variables]]).&lt;br /&gt;
 max_length is important as it sets the internal text buffer size to use.&lt;br /&gt;
&lt;br /&gt;
 GetStreamInfo()&lt;br /&gt;
 Returns a table containing information about your radio stream. See the STATS structure in the [http://api.shoutirc.com/group__ss.html Plugin API documentation] for key names and descriptions.&lt;br /&gt;
&lt;br /&gt;
 AreRatingsEanbled()&lt;br /&gt;
 Returns true if song ratings are enabled, false otherwise.&lt;br /&gt;
&lt;br /&gt;
 GetMaxRating()&lt;br /&gt;
 Returns an integer with the maximum song rating (by default: 5)&lt;br /&gt;
&lt;br /&gt;
 GetSongRating(&amp;quot;song&amp;quot;)&lt;br /&gt;
 Returns a table with keys &amp;#039;rating&amp;#039; and &amp;#039;votes&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
 genrand_int32()&lt;br /&gt;
 Returns an unsigned integer with a random number from 0 to 0xFFFFFFFF from the bot&amp;#039;s random number generator.&lt;br /&gt;
&lt;br /&gt;
 SendRemoteReply(sock, command, datalen)&lt;br /&gt;
 SendRemoteReply(sock, command, datalen, data)&lt;br /&gt;
 Sends a reply to a remote client, you will get sock in your &amp;#039;remote&amp;#039; event handler. See [[Remote Commands]] for protocol details.&lt;br /&gt;
 No return value.&lt;br /&gt;
&lt;br /&gt;
{{ircbot programming}}&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
</feed>