<?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=Tcl_Scripting</id>
	<title>Tcl 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=Tcl_Scripting"/>
	<link rel="alternate" type="text/html" href="https://wiki.shoutirc.com/index.php?title=Tcl_Scripting&amp;action=history"/>
	<updated>2026-04-28T21:13:06Z</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=Tcl_Scripting&amp;diff=4428&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=Tcl_Scripting&amp;diff=4428&amp;oldid=prev"/>
		<updated>2013-10-25T14:14:05Z</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;{{needs-updating}}&lt;br /&gt;
* Note TCL scripting was only in RadioBot v3, this page remains in case it ever makes a comeback.&lt;br /&gt;
&lt;br /&gt;
An upcoming feature/plugin for RadioBot is the addition of Tcl Scripting.&lt;br /&gt;
Those of you familiar with the Plugin API will notice the Tcl commands are a ported/simplified version of it.&lt;br /&gt;
&lt;br /&gt;
However, there are of course some new commands specific to the Tcl scripts.&lt;br /&gt;
&lt;br /&gt;
For example bind_event/unbind_event, see [[Tcl Events]] for more information on them.&lt;br /&gt;
&lt;br /&gt;
 unbind_all_events type&lt;br /&gt;
 Removes all bound events of type - be careful though because Tcl has a global interpreter so it will remove the bound events from all scripts.&lt;br /&gt;
&lt;br /&gt;
 print string&lt;br /&gt;
 You should use this instead of puts when possible because it will go through RadioBot&amp;#039;s output buffering and logging.&lt;br /&gt;
&lt;br /&gt;
 SendPM netno nick/chan text&lt;br /&gt;
 Sends a PM or channel text to IRC. You can also use the aliases msg or privmsg.&lt;br /&gt;
&lt;br /&gt;
 SendIRC netno text&lt;br /&gt;
 Sends a raw IRC command to IRC.&lt;br /&gt;
&lt;br /&gt;
 GetBotNick netno&lt;br /&gt;
 Get&amp;#039;s the bot&amp;#039;s nick on network netno. -1 is the bot&amp;#039;s default nickname, 0+ is the bot&amp;#039;s current nickname on that network.&lt;br /&gt;
&lt;br /&gt;
 GetBotVersion&lt;br /&gt;
 The bot&amp;#039;s version as a number.&lt;br /&gt;
&lt;br /&gt;
 GetBotVersionString&lt;br /&gt;
&lt;br /&gt;
 GetIP&lt;br /&gt;
 Get the detected local IP.&lt;br /&gt;
&lt;br /&gt;
 GetPlatform&lt;br /&gt;
 Get the current platform (Win32/Linux/etc.).&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&lt;br /&gt;
&lt;br /&gt;
 LogToChan str&lt;br /&gt;
 Send string to your LogChan (if defined).&lt;br /&gt;
&lt;br /&gt;
 Rehash fn&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;
&lt;br /&gt;
 NumPlugins&lt;br /&gt;
 Returns the number of loaded plugins&lt;br /&gt;
&lt;br /&gt;
 LoadPlugin fn&lt;br /&gt;
 Load plugin with filename fn.&lt;br /&gt;
&lt;br /&gt;
 SendSock sock buf datalen&lt;br /&gt;
 Send data to a socket&lt;br /&gt;
&lt;br /&gt;
 ClearSockEntries sock&lt;br /&gt;
 Remove entries with socket sock from the SendQ.&lt;br /&gt;
&lt;br /&gt;
 IsValidUserName nick&lt;br /&gt;
 Returns 1 if nick is a valid bot username, 0 otherwise.&lt;br /&gt;
&lt;br /&gt;
 GetUserNameFromHostmask hostmask&lt;br /&gt;
 Returns the bot username associated with hostmask&lt;br /&gt;
&lt;br /&gt;
 GetUserLevel hostmask pass&lt;br /&gt;
 Returns the user level associated with hostmask and pass (leave pass out or &amp;quot;&amp;quot; if you don&amp;#039;t have the password)&lt;br /&gt;
&lt;br /&gt;
 GetUserPass nick&lt;br /&gt;
 Returns the password associated with bot user nick&lt;br /&gt;
&lt;br /&gt;
 GetConfigSection parent name&lt;br /&gt;
 Returns config sections, use NULL for parent for a root item&lt;br /&gt;
 &lt;br /&gt;
 GetConfigSectionValue section name&lt;br /&gt;
 Returns string config section value&lt;br /&gt;
 &lt;br /&gt;
 GetConfigSectionLong section name&lt;br /&gt;
 Returns integer config section value&lt;br /&gt;
 &lt;br /&gt;
 IsConfigSectionValue section name&lt;br /&gt;
 Returns 1 if value name is in section, 0 otherwise&lt;br /&gt;
 &lt;br /&gt;
 Configuration Demo:&lt;br /&gt;
 set sec [ GetConfigSection NULL &amp;quot;Base&amp;quot; ]&lt;br /&gt;
 if { $sec != &amp;quot;NULL&amp;quot; } {&lt;br /&gt;
  set val [ IsConfigSectionValue $sec &amp;quot;Nick&amp;quot; ]&lt;br /&gt;
  print &amp;quot;RadioBot Nickname is set: $val\n&amp;quot;&lt;br /&gt;
  set val [ GetConfigSectionValue $sec &amp;quot;Nick&amp;quot; ]&lt;br /&gt;
  print &amp;quot;RadioBot Nickname: $val\n&amp;quot;&lt;br /&gt;
 } else {&lt;br /&gt;
  print &amp;quot;Invalid section name!\n&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 SendPluginMessage toplug MsgID data datalen&lt;br /&gt;
 For MsgID see [[IPC Messages]] (all message ID&amp;#039;s are set as constants in the Tcl interpreter).&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 1 if IRC network netno is connected and logged in, 0 otherwise.&lt;br /&gt;
&lt;br /&gt;
 HasOwnerSupport netno&lt;br /&gt;
 Returns 1 if IRC network netno supports owner/halfop/etc., 0 otherwise.&lt;br /&gt;
&lt;br /&gt;
 GetStreamInfo&lt;br /&gt;
 How to use GetStreamInfo:&lt;br /&gt;
 &lt;br /&gt;
 set info [ GetStreamInfo ];	&lt;br /&gt;
 print &amp;quot;Current DJ: [ STATS_curdj_get $info ]\n&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 See the [[Struct:STATS|STATS]] structure to see the available field names, you retrieve them the same way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ircbot programming}}&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
</feed>