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
<td><doc-anchor-triggerto="#importing-and-requiring">3. Importing and Requiring</doc-anchor-trigger></td>
274
274
</tr>
275
275
<tr>
276
276
<td><doc-anchor-triggerto="#constructors-and-instances">4. Constructors and Instances</doc-anchor-trigger></td>
@@ -296,12 +296,12 @@ <h3>
296
296
</doc-anchor-target>
297
297
<p>There are a couple of things to keep in mind when using LuaLink.</p>
298
298
<ul>
299
-
<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/>
300
-
<sup>More about libraries can be found on the <strong><ahref="../libraries/">Libraries</a></strong> page.</sup></li>
301
-
<li>Entry point of the script (or library) is a file named <codev-pre>main.lua</code> or <codev-pre>init.lua</code>.<br/>
302
-
<sup>It doesn't matter which file you choose as the entry point, but you should be consistent with your naming convention.</sup></li>
303
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/>
304
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>
305
305
</ul>
306
306
<br/>
307
307
<doc-anchor-targetid="script-life-cycle">
@@ -314,12 +314,12 @@ <h3>
314
314
<divclass="codeblock-wrapper"><doc-codeblock>
315
315
<preclass="language-lua"><codev-preclass="language-lua">-- Called after the script has been successfully loaded.
316
316
script:onLoad(function()
317
-
script:logger:info("Script has been loaded.")
317
+
script.logger:info("Script has been loaded.")
318
318
end)
319
319
320
320
-- Called before the script is attempted to be unloaded.
321
321
script:onUnload(function()
322
-
script:logger:info("Script is about to be unloaded.")
322
+
script.logger:info("Script is about to be unloaded.")
323
323
end)</code></pre>
324
324
</doc-codeblock></div>
325
325
<br/>
@@ -353,7 +353,8 @@ <h3>
353
353
counter:increment()
354
354
counter:increment()
355
355
-- Printing current value of the counter to the console.
356
-
script.logger.info(counter:get() ..</code></pre>
356
+
script.logger:info(counter:get() .. " is the current value of the counter.")
0 commit comments