<?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=Plugin%3ALua</id>
	<title>Plugin:Lua - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.shoutirc.com/index.php?action=history&amp;feed=atom&amp;title=Plugin%3ALua"/>
	<link rel="alternate" type="text/html" href="https://wiki.shoutirc.com/index.php?title=Plugin:Lua&amp;action=history"/>
	<updated>2026-04-29T01:53:37Z</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=Plugin:Lua&amp;diff=4416&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=Plugin:Lua&amp;diff=4416&amp;oldid=prev"/>
		<updated>2013-10-25T14:11:54Z</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;The [[Plugin:Lua|Lua]] plugin lets you write custom scripts in the Lua scripting language.&amp;lt;br /&amp;gt;&lt;br /&gt;
Scripts go in the lua_scripts subfolder in your RadioBot folder.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once your script is loaded, the bot will call the function &amp;#039;init&amp;#039; in your script. It should return 1 if the script loaded successfully or 0 if there was an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is OK to not include an &amp;#039;init&amp;#039; function if you don&amp;#039;t need it.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the bot is shutting down it will call the &amp;#039;quit&amp;#039; function (again, you can leave it out if you don&amp;#039;t need it). The &amp;#039;quit&amp;#039; function has no return value.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Built-in Functions and Events==&lt;br /&gt;
Besides the built-in functionality of Lua, the bot adds many commands. You can find a list [[Lua Scripting|here]].&amp;lt;br /&amp;gt;&lt;br /&gt;
By binding events you can have your script handle things like custom !triggers, channel joins/parts, etc. A list of the currently supported events is [[Lua Events|here]].&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Here is an example barebones file:&lt;br /&gt;
 function init()&lt;br /&gt;
 	ib_print(&amp;quot;Script loaded.&amp;quot;)&lt;br /&gt;
 	return 1;&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function quit()&lt;br /&gt;
 	ib_print(&amp;quot;Goodbye&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Sample script implementing a custom PM trigger:&lt;br /&gt;
&lt;br /&gt;
 function pm_handler(hostmask, nick, uflags, netno, text)&lt;br /&gt;
 	SendPM(netno, nick, &amp;quot;Thanks for the PM&amp;quot;)&lt;br /&gt;
 	return 0;&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function init()&lt;br /&gt;
 	bind_event(&amp;quot;on_pm&amp;quot;, &amp;quot;pm_handler&amp;quot;, &amp;quot;!test&amp;quot;)&lt;br /&gt;
 	return 1;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ircbot programming}}&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
</feed>