1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
|
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Eggdrop Autoscripts — Eggdrop 1.10.1rc2 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/eggdrop.css?v=ab48a1b6" />
<script src="../_static/documentation_options.js?v=290de6c6"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Users and Flags" href="users.html" />
<link rel="prev" title="The Party Line" href="partyline.html" />
</head><body>
<div class="header-wrapper" role="banner">
<div class="header">
<div class="headertitle"><a
href="../index.html">Eggdrop 1.10.1rc2 documentation</a></div>
<div class="rel" role="navigation" aria-label="related navigation">
<a href="partyline.html" title="The Party Line"
accesskey="P">previous</a> |
<a href="users.html" title="Users and Flags"
accesskey="N">next</a>
</div>
</div>
</div>
<div class="content-wrapper">
<div class="content">
<div class="sidebar">
<h3>Table of Contents</h3>
<p class="caption" role="heading"><span class="caption-text">Installing Eggdrop</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../install/readme.html">README</a></li>
<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Installing Eggdrop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../install/upgrading.html">Upgrading Eggdrop</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Using Eggdrop</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="features.html">Eggdrop Features</a></li>
<li class="toctree-l1"><a class="reference internal" href="core.html">Eggdrop Core Settings</a></li>
<li class="toctree-l1"><a class="reference internal" href="partyline.html">The Party Line</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Eggdrop Autoscripts</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#autoscripts-usage">Autoscripts usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="#autoscripts-file-structure">Autoscripts File Structure</a></li>
<li class="toctree-l2"><a class="reference internal" href="#development-hints">Development hints</a></li>
<li class="toctree-l2"><a class="reference internal" href="#tcl-commands">Tcl Commands</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="users.html">Users and Flags</a></li>
<li class="toctree-l1"><a class="reference internal" href="bans.html">Bans, Invites, and Exempts</a></li>
<li class="toctree-l1"><a class="reference internal" href="botnet.html">Botnet Sharing and Linking</a></li>
<li class="toctree-l1"><a class="reference internal" href="ipv6.html">IPv6 support</a></li>
<li class="toctree-l1"><a class="reference internal" href="tls.html">TLS support</a></li>
<li class="toctree-l1"><a class="reference internal" href="ircv3.html">IRCv3 support</a></li>
<li class="toctree-l1"><a class="reference internal" href="accounts.html">Account tracking in Eggdrop</a></li>
<li class="toctree-l1"><a class="reference internal" href="pbkdf2info.html">Encryption/Hashing</a></li>
<li class="toctree-l1"><a class="reference internal" href="python.html">Using the Python Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="twitchinfo.html">Twitch</a></li>
<li class="toctree-l1"><a class="reference internal" href="tricks.html">Advanced Tips</a></li>
<li class="toctree-l1"><a class="reference internal" href="text-sub.html">Textfile Substitutions</a></li>
<li class="toctree-l1"><a class="reference internal" href="tcl-commands.html">Eggdrop Tcl Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="twitch-tcl-commands.html">Eggdrop Twitch Tcl Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="patch.html">Patching Eggdrop</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Tutorials</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorials/setup.html">Setting Up Eggdrop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorials/firststeps.html">Common First Steps</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorials/tlssetup.html">Enabling TLS Security on Eggdrop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorials/userfilesharing.html">Sharing Userfiles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorials/firstscript.html">Writing an Eggdrop Tcl Script</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorials/module.html">Writing a Basic Eggdrop Module</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Eggdrop Modules</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../modules/index.html">Eggdrop Module Information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/included.html">Modules included with Eggdrop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/writing.html">How to Write an Eggdrop Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules/internals.html">Eggdrop Bind Internals</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">About Eggdrop</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../about/about.html">About Eggdrop</a></li>
<li class="toctree-l1"><a class="reference internal" href="../about/legal.html">Boring legal stuff</a></li>
</ul>
<div role="search">
<h3 style="margin-top: 1.5em;">Search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="eggdrop-autoscripts">
<h1>Eggdrop Autoscripts<a class="headerlink" href="#eggdrop-autoscripts" title="Link to this heading">¶</a></h1>
<p>Since it’s inception, users have needed to load a Tcl script into Eggdrop by downloading a Tcl file, editing the file to customize settings, and then sourceing that file in the config file. In v1.10, the Autoscripts system was added to make this process a little more user-friendly. The autoscripts system helps by:</p>
<ul class="simple">
<li><p>Centralizing commonly-used scripts in a single location</p></li>
<li><p>Allowing scripts to be downloaded via the partyline</p></li>
<li><p>Allowing script settings to be configured via the partyline</p></li>
<li><p>Allowing user-written scripts to be managed by the autoscripts system</p></li>
<li><p>Providing a documented API to write autoscripts-compatible scripts</p></li>
</ul>
<section id="autoscripts-usage">
<h2>Autoscripts usage<a class="headerlink" href="#autoscripts-usage" title="Link to this heading">¶</a></h2>
<p>To view available autoscript commands, type <code class="docutils literal notranslate"><span class="pre">.autoscript</span></code> on the partyline. This will open up a special Eggdrop console that doesn’t require you to prefix commands with a ‘.’ . The following sub-commands are available for use with script:</p>
<section id="remote">
<h3>remote<a class="headerlink" href="#remote" title="Link to this heading">¶</a></h3>
<p>This command will list scripts hosted on the Eggdrop website that are available to be downloaded and installed on your Eggdrop.</p>
</section>
<section id="fetch-script">
<h3>fetch <script><a class="headerlink" href="#fetch-script" title="Link to this heading">¶</a></h3>
<p>This command will download the specified script from the Eggdrop website and place it into the autoscript/ directory.</p>
</section>
<section id="list">
<h3>list<a class="headerlink" href="#list" title="Link to this heading">¶</a></h3>
<p>This command will list scripts locallt present in the autoscripts/ directory, available to be configured and loaded.</p>
</section>
<section id="config-script">
<h3>config <script><a class="headerlink" href="#config-script" title="Link to this heading">¶</a></h3>
<p>This command will list settings available for configuration for the provided script.</p>
</section>
<section id="set-script-setting">
<h3>set <script> <setting><a class="headerlink" href="#set-script-setting" title="Link to this heading">¶</a></h3>
<p>This command will set <code class="docutils literal notranslate"><span class="pre">setting</span></code> for <code class="docutils literal notranslate"><span class="pre">script</span></code> to the provided value. To activate this change, use the <code class="docutils literal notranslate"><span class="pre">load</span></code> command.</p>
</section>
<section id="load-script">
<h3>load <script><a class="headerlink" href="#load-script" title="Link to this heading">¶</a></h3>
<p>This command will activate the script for use. You can also use this command to reload a script after modifying a script variable.</p>
</section>
<section id="unload-script">
<h3>unload <script><a class="headerlink" href="#unload-script" title="Link to this heading">¶</a></h3>
<p>This command will prevent the script from being loaded the next time Eggdrop starts. To fully unload a script, Eggdrop must be restarted!</p>
</section>
<section id="clean-script">
<h3>clean <script><a class="headerlink" href="#clean-script" title="Link to this heading">¶</a></h3>
<p>This command will delete the script from the filesystem. After running this command, you will have to re-download and re-configure the script if you wish to use it again.</p>
</section>
<section id="update-script">
<h3>update [script]<a class="headerlink" href="#update-script" title="Link to this heading">¶</a></h3>
<p>If no script is specified, this command checks if there any downloaded script has a newer version available. If a script is specified, autoscript will fetch and install the updated script.</p>
</section>
</section>
<section id="autoscripts-file-structure">
<h2>Autoscripts File Structure<a class="headerlink" href="#autoscripts-file-structure" title="Link to this heading">¶</a></h2>
<p>An autoscripts package requires (minimum) two files: the Tcl script, and a json manifest file.</p>
<section id="tcl-file">
<h3>Tcl File<a class="headerlink" href="#tcl-file" title="Link to this heading">¶</a></h3>
<p>Nothing new or novel here; this is where your Tcl code goes. The one change to this file is that any setting intended should now be located in the manifest.json file, not the Tcl script file. All variables will be added to the global namespace. For this reason, we suggest wrapping a custom autoscript inside a <code class="docutils literal notranslate"><span class="pre">namespace</span> <span class="pre">eval</span> <span class="pre"><scriptname></span> <span class="pre">{}</span></code> statement as an autoscript best practice, which will lessen the chance of a variable name colliding with a variable from a separate script.</p>
</section>
<section id="manifest-json">
<h3>Manifest.json<a class="headerlink" href="#manifest-json" title="Link to this heading">¶</a></h3>
<p>Every autoscripts package must have a manifest.json file. This file contains metadata for the script such as version and description information, as well as the user-configurable settings for use with th script. A simple example of a manifest.json file is as follows:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">"schema"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="s2">"name"</span><span class="p">:</span> <span class="s2">"woobie"</span><span class="p">,</span>
<span class="s2">"version_major"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="s2">"version_minor"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">"description"</span><span class="p">:</span> <span class="s2">"An example script to help developers write autoscript packages"</span><span class="p">,</span>
<span class="s2">"long_description"</span><span class="p">:</span> <span class="s2">"This is an example script to help understand the autoscript system. Yeah, it doesn't really do anything, but that's besides the point. It could, and that should be enough for anyone"</span>
<span class="s2">"config"</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">"loaded"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">"udef"</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">"myflag"</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">"type"</span><span class="p">:</span> <span class="s2">"flag"</span><span class="p">,</span>
<span class="s2">"description"</span><span class="p">:</span> <span class="s2">"Activate the script on <channel> by doing"</span>
<span class="p">},</span>
<span class="s2">"mystr1"</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">"type"</span><span class="p">:</span> <span class="s2">"str"</span><span class="p">,</span>
<span class="s2">"description"</span><span class="p">:</span> <span class="s2">"Flood limit, modify the channel value for this doing"</span><span class="p">,</span>
<span class="s2">"value"</span><span class="p">:</span> <span class="s2">"</span><span class="si">{10:6}</span><span class="s2">"</span>
<span class="p">},</span>
<span class="s2">"mystr2"</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">"type"</span><span class="p">:</span> <span class="s2">"str"</span><span class="p">,</span>
<span class="s2">"description"</span><span class="p">:</span> <span class="s2">"Change that with"</span><span class="p">,</span>
<span class="s2">"value"</span><span class="p">:</span> <span class="s2">"Just my string"</span>
<span class="p">}</span>
<span class="s2">"myint1"</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">"type"</span><span class="p">:</span> <span class="s2">"int"</span><span class="p">,</span>
<span class="s2">"description"</span><span class="p">:</span> <span class="s2">"Number of allowed kicks, could be change with"</span><span class="p">,</span>
<span class="s2">"value"</span><span class="p">:</span> <span class="mi">4</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="s2">"requires"</span><span class="p">:</span> <span class="s2">"tls"</span><span class="p">,</span>
<span class="s2">"vars"</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">"woobie_dict"</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">"description"</span><span class="p">:</span> <span class="s2">"A setting that accepts a dict as a value"</span><span class="p">,</span>
<span class="s2">"value"</span><span class="p">:</span> <span class="s2">"{quiet q}"</span>
<span class="p">},</span>
<span class="s2">"woobie_setting"</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">"description"</span><span class="p">:</span> <span class="s2">"A normal setting to enable or disable something"</span><span class="p">,</span>
<span class="s2">"value"</span><span class="p">:</span> <span class="s2">"1"</span>
<span class="p">},</span>
<span class="s2">"woobie_string"</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">"description"</span><span class="p">:</span> <span class="s2">"A setting taking a string, like a filename or something"</span><span class="p">,</span>
<span class="s2">"value"</span><span class="p">:</span> <span class="s2">"woobie"</span>
<span class="p">},</span>
<span class="s2">"woobie(array)"</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">"description"</span><span class="p">:</span> <span class="s2">"A setting that is set as an array"</span><span class="p">,</span>
<span class="s2">"value"</span><span class="p">:</span><span class="s2">"another string"</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p>schema</p></td>
<td><p>The schema version of autoscript (currently 1)</p></td>
</tr>
<tr class="row-even"><td><p>name</p></td>
<td><p>The name of the script. Must match the script name (if the script is foo.tcl, then this must be foo)</p></td>
</tr>
<tr class="row-odd"><td><p>version_major</p></td>
<td><p>The major version integer (ie, 1 for 1.6)</p></td>
</tr>
<tr class="row-even"><td><p>version_minor</p></td>
<td><p>The minor version integer (ie, 6 for 1.6)</p></td>
</tr>
<tr class="row-odd"><td><p>description</p></td>
<td><p>A one-line summary of what the script does. This will be shown when available scripts are listed on the partyline via .script list.</p></td>
</tr>
<tr class="row-even"><td><p>long_description</p></td>
<td><p>A longer description of what the script does, similar to a README. This will be shown when a script is viewed via .script config.</p></td>
</tr>
<tr class="row-odd"><td><p>config-loaded</p></td>
<td><p>Whether this script is currently loaded or not. It should be default set to 0.</p></td>
</tr>
<tr class="row-even"><td><p>config-udef-<varname>-type</p></td>
<td><p>Type of the user-defined channel setting, could be flag, str or int.</p></td>
</tr>
<tr class="row-odd"><td><p>config-udef-<varname>-description</p></td>
<td><p>Description of user-defined channel setting used by the script. The description is appended with “ .chanset <channel> <varname> value” in case of int or str, and with “ .channel <channel> +<varname>” when flag</p></td>
</tr>
<tr class="row-even"><td><p>config-udef-<varname>-value</p></td>
<td><p>Default value of user-defined channel setting used by the script. This is displayed when configuration settings are displayed to the user on the partyline.</p></td>
</tr>
<tr class="row-odd"><td><p>config-requires</p></td>
<td><p>Any Tcl package required for use by the script, such as tls, http, json, etc.</p></td>
</tr>
<tr class="row-even"><td><p>config-vars-<varname></p></td>
<td><p>A setting intended to be modified by the user. The ‘description’ field should describe what the setting does, and the ‘value’ field stores the current value. These settings are displayed when the configuration settings are displayed to the user on the partyline.</p></td>
</tr>
<tr class="row-odd"><td><p>config-vars-<varname>-description</p></td>
<td><p>A description of the setting, displayed in the configuration listing for the script.</p></td>
</tr>
<tr class="row-even"><td><p>config-vars-<varname>-value</p></td>
<td><p>The value the setting is set to</p></td>
</tr>
</tbody>
</table>
</section>
<section id="file-placement">
<h3>File placement<a class="headerlink" href="#file-placement" title="Link to this heading">¶</a></h3>
<p>Autoscript files are stored in the autoscript directory. The path structure is eggdrop/autoscript/<scriptname>/[script files]. If the autoscript <code class="docutils literal notranslate"><span class="pre">fetch</span></code> command is used, a .tgz file will be downloaded and extracted to the proper location automatically. If you wish to manually add a script, create a directory with the same name as the script, and then place the script and manifest files inside the directory. The directory name must exactly match the script name (without the .tcl extension)! If the Tcl script to be loaded is called <code class="docutils literal notranslate"><span class="pre">myscript_goodversion_specialfeature.tcl</span></code>, then the directory must also called <code class="docutils literal notranslate"><span class="pre">myscript_goodversion_specialfeature</span></code>.</p>
</section>
</section>
<section id="development-hints">
<h2>Development hints<a class="headerlink" href="#development-hints" title="Link to this heading">¶</a></h2>
<ul class="simple">
<li><p>An autoscript should not require a user to manually open the script in an editor for any reason. Design your script as such!</p></li>
<li><p>Use <a class="reference external" href="https://docs.eggheads.org/using/tcl-commands.html#setudef-flag-int-str-name">user defined channel flags</a> to enable/disable a script for a particular channel, they’re easy!</p></li>
<li><p>Don’t use <cite>global</cite> statements. Based on the manifest, variables are created by autoscript in the global namespace before the script is loaded. Instead of the <cite>global</cite> command, use the <cite>variable</cite> command to access a global variable inside a proc. And because Tcl is awesome, each variable must be declared on its own line, not all on a single line like you can do with <cite>global</cite>. Sorry!</p></li>
<li><p>While we’re talking about variables… make them unique to prevent collisions! We recommend prefixing the script name in front of a variable, such as myscript_setting or ms_setting. Alternatively, you can wrap your autoscript inside a <code class="docutils literal notranslate"><span class="pre">namespace</span> <span class="pre">eval</span> <span class="pre"><scriptname></span> <span class="pre">{}</span></code> statement, which create a private namespace for your script to operate within.</p></li>
</ul>
</section>
<section id="tcl-commands">
<h2>Tcl Commands<a class="headerlink" href="#tcl-commands" title="Link to this heading">¶</a></h2>
<p>The autoscripts Tcl script adds three new commands for use with Tcl scripts:</p>
<section id="egg-loaded">
<h3>egg_loaded<a class="headerlink" href="#egg-loaded" title="Link to this heading">¶</a></h3>
<blockquote>
<div><p>Description: lists all scripts currently loaded via the autoscripts system</p>
<p>Returns: A Tcl list of script names currently loaded via autoscripts</p>
</div></blockquote>
</section>
<section id="egg-unloaded">
<h3>egg_unloaded<a class="headerlink" href="#egg-unloaded" title="Link to this heading">¶</a></h3>
<blockquote>
<div><p>Description: lists all scripts downloaded to the local machine via the autoscripts system but not currently loaded by Eggdrop</p>
<p>Returns: A Tcl list of script names downloaded but not currently loaded via autoscripts</p>
</div></blockquote>
</section>
<section id="egg-all">
<h3>egg_all<a class="headerlink" href="#egg-all" title="Link to this heading">¶</a></h3>
<blockquote>
<div><p>Description: lists all script downloaded to the localm machine via the autoscripts system, regardless if they are running or not</p>
<p>Returns: A Tcl list of all script namees download via autoscripts</p>
</div></blockquote>
</section>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
<div class="footer-wrapper">
<div class="footer">
<div class="left">
<div role="navigation" aria-label="related navigaton">
<a href="partyline.html" title="The Party Line"
>previous</a> |
<a href="users.html" title="Users and Flags"
>next</a>
</div>
<div role="note" aria-label="source link">
</div>
</div>
<div class="right">
<div class="footer" role="contentinfo">
© Copyright 2025, Eggheads.
Last updated on Aug 15, 2025.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.2.3.
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</body>
</html>
|