You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>LuaLink provides a way to access and use plugins' APIs in your scripts. This feature is very powerful and makes it easy to integrate scripts with other plugins. It must be noted this has not been thoroughly tested yet and some issues may arise. Please be cautious when using this feature.</p>
<p>Current implementation, despite being relatively simple and fully functional, is still marked as experimental.
263
+
We may introuduce breaking changes to the way dependencies are declared and exposed to scripts.</p>
264
+
</div>
265
+
</div>
266
+
</div>
267
+
<br/>
268
+
<!--
269
+
## Declaring Dependencies
270
+
To declare a dependency, you must create an `init.lua` file in your script's folder. In this example we will use **[PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.19978/)**.
<p>Importing any class that belongs to an installed plugin should work out of the box. In this example we will use <strong><ahref="https://www.spigotmc.org/resources/placeholderapi.19978/">PlaceholderAPI</a></strong>, a plugin you should be already familiar with.</p>
287
+
<p>Assuming the plugin is <strong>installed</strong> and <strong>enabled</strong> on the server, we should be able to call its API like any other function.</p>
<p>There are a couple of things to keep in mind when using LuaLink.</p>
298
298
<ul>
299
-
<li>Script life-cycle can be managed using <codev-pre>/lualink load</code>, <codev-pre>/lualink unload</code> and <codev-pre>/lualink reload</code>commands.<br/>
300
-
<sup>More on this can be found on the <strong><ahref="../commands/">Commands</a></strong> page.</sup></li>
301
-
<li>Each script is stored in a separate folder inside the <codev-pre>plugins/LuaLink/scripts</code> directory, and libraries are stored in the <codev-pre>plugins/LuaLink/libs</code>directory.<br/>
302
-
<sup>More about libraries can be found on the <strong><ahref="../libraries/">Libraries</a></strong> page.</sup></li>
303
-
<li>Entry point of the script (or library) is a file named <codev-pre>main.lua</code>.<br/>
304
-
<sup>More files can be created and loaded using the <codev-pre>require</code> keyword.</sup></li>
299
+
<li>Each script is stored in a separate folder inside the <codev-pre>plugins/LuaLink/scripts</code>directory.<br/>
300
+
<sup>For example <codev-pre>/plugins/LuaLink/scripts/example/main.lua</code> will be loaded as <codev-pre>example</code> script.</sup></li>
301
+
<li>Script life-cycle can be managed using <codev-pre>/lualink</code>command.<br/>
302
+
<sup>Full command reference is available on the <strong><ahref="../commands/">Commands</a></strong> page.</sup></li>
303
+
<li>Entry point of the script is a file named <codev-pre>main.lua</code>.<br/>
304
+
<sup>More files can be imported using the <codev-pre>require</code> keyword.</sup></li>
305
305
</ul>
306
306
<br/>
307
307
<doc-anchor-targetid="script-life-cycle">
@@ -410,7 +410,7 @@ <h3>
410
410
aliases = {"e", "print"},
411
411
permission = "scripts.command.echo",
412
412
description = "Prints specified message to the sender.",
413
-
usage = "/echo [player]",
413
+
usage = "/echo [message]",
414
414
tabComplete = onTabComplete
415
415
})</code></pre>
416
416
</doc-codeblock></div>
@@ -424,7 +424,7 @@ <h3>
424
424
<p>Bukkit events can be hooked into relatively easily.</p>
425
425
<divclass="codeblock-wrapper"><doc-codeblock>
426
426
<preclass="language-lua"><codev-preclass="language-lua">-- Called when player joins the server.
0 commit comments