<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.minetest.org/index.php?action=history&amp;feed=atom&amp;title=Mods%2Fgeass_csm</id>
	<title>Mods/geass csm - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.minetest.org/index.php?action=history&amp;feed=atom&amp;title=Mods%2Fgeass_csm"/>
	<link rel="alternate" type="text/html" href="https://wiki.minetest.org/index.php?title=Mods/geass_csm&amp;action=history"/>
	<updated>2026-04-25T08:08:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.4</generator>
	<entry>
		<id>https://wiki.minetest.org/index.php?title=Mods/geass_csm&amp;diff=12427&amp;oldid=prev</id>
		<title>&gt;Voxel at 05:10, 18 April 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.minetest.org/index.php?title=Mods/geass_csm&amp;diff=12427&amp;oldid=prev"/>
		<updated>2021-04-18T05:10:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:10, 17 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>&gt;Voxel</name></author>
	</entry>
	<entry>
		<id>https://wiki.minetest.org/index.php?title=Mods/geass_csm&amp;diff=8662&amp;oldid=prev</id>
		<title>&gt;Voxel at 05:10, 18 April 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.minetest.org/index.php?title=Mods/geass_csm&amp;diff=8662&amp;oldid=prev"/>
		<updated>2021-04-18T05:10:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:10, 17 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>&gt;Voxel</name></author>
	</entry>
	<entry>
		<id>https://wiki.minetest.org/index.php?title=Mods/geass_csm&amp;diff=4897&amp;oldid=prev</id>
		<title>&gt;Voxel at 05:10, 18 April 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.minetest.org/index.php?title=Mods/geass_csm&amp;diff=4897&amp;oldid=prev"/>
		<updated>2021-04-18T05:10:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:10, 17 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>&gt;Voxel</name></author>
	</entry>
	<entry>
		<id>https://wiki.minetest.org/index.php?title=Mods/geass_csm&amp;diff=1132&amp;oldid=prev</id>
		<title>&gt;Voxel at 05:10, 18 April 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.minetest.org/index.php?title=Mods/geass_csm&amp;diff=1132&amp;oldid=prev"/>
		<updated>2021-04-18T05:10:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DISPLAYTITLE:Mods/geass_mod}}&lt;br /&gt;
{{Mod Data &lt;br /&gt;
| name=geass_csm&lt;br /&gt;
| luaname=geass_csm&lt;br /&gt;
| type=Misc&lt;br /&gt;
| author=quater &lt;br /&gt;
| version=[https://github.com/quater117/geass_csm/archive/master.zip 2018-01-05]&lt;br /&gt;
| forum=[https://forum.minetest.net/viewtopic.php?f=53&amp;amp;t=19296 Forum]&lt;br /&gt;
| source=[https://github.com/quater117/geass_csm GitHub]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the user-documentation about the mod '''geass_csm''' by quater.&lt;br /&gt;
This mod is inspired by [https://wiki.minetest.net/Mods/LuaCmd LuaCmd] and [https://wiki.minetest.net/Mods/basic_robot_csm basic_robot_csm]&lt;br /&gt;
== Intro ==&lt;br /&gt;
geass_csm is a mod running on the minetest-client.&lt;br /&gt;
&lt;br /&gt;
Users can write programs on this mod in [http://www.lua.org/ Lua].&lt;br /&gt;
&lt;br /&gt;
These programs are executed inside a sandbox.&lt;br /&gt;
&lt;br /&gt;
Input &amp;amp; Output happens mainly via chat, but it is also possible to play sounds, &amp;lt;br /&amp;gt;&lt;br /&gt;
and to process formspecs.&lt;br /&gt;
&lt;br /&gt;
===How to get===&lt;br /&gt;
* install a minetest-version 0.4.16dev, 0.5.0 or later&lt;br /&gt;
* download mod from github&lt;br /&gt;
* unpack in &amp;quot;minetest DIR&amp;quot;/clientmods/&lt;br /&gt;
* enable client mods in advanced settings menu or in minetest.conf&lt;br /&gt;
* inside /clientmods/mods.conf there should be a line:&lt;br /&gt;
: load_mod_geass_csm = true&lt;br /&gt;
* while playing say &amp;quot;.luac&amp;quot; or '.lua [code]'&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
The chat-command '.luac' will present an editor-form and some buttons:&lt;br /&gt;
* Button &amp;quot;'''Help'''&amp;quot; shows some helptext.&lt;br /&gt;
* Button &amp;quot;'''Halt'''&amp;quot; stops the current program.&lt;br /&gt;
* Button &amp;quot;'''Run'''&amp;quot; starts executing the code of the program and saves the program.&lt;br /&gt;
* Button &amp;quot;'''Apply'''&amp;quot; saves the program of the current tab (using mod-storage). &lt;br /&gt;
&lt;br /&gt;
Select a tab, &lt;br /&gt;
enter a program (or use cut&amp;amp;paste)&lt;br /&gt;
: e.g. core.display_chat_message(&amp;quot;Hello world !&amp;quot;)&lt;br /&gt;
press Run-button.&lt;br /&gt;
&lt;br /&gt;
== Commands ==&lt;br /&gt;
Available commands: .lua, .luaclear, .luac&amp;lt;br /&amp;gt; &lt;br /&gt;
See commands in init.lua.&amp;lt;br /&amp;gt;&lt;br /&gt;
See also&lt;br /&gt;
* [https://github.com/minetest/minetest/blob/master/doc/client_lua_api.md client_lua_api]&lt;br /&gt;
* [https://rubenwardy.com/minetest_modding_book/lua_api.html Lua Modding API Reference]&lt;br /&gt;
Lua-docs:&lt;br /&gt;
* https://www.lua.org/docs.html&lt;br /&gt;
* http://lua-users.org/wiki/&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous ===&lt;br /&gt;
Available subcommands for .luac: edit, exec, halt, load, cat, title, copy, remove, unregister, history&amp;lt;br /&amp;gt;&lt;br /&gt;
Specials contents in mod_storage:&lt;br /&gt;
* on_connect&lt;br /&gt;
* titles&lt;br /&gt;
&lt;br /&gt;
Specials variables and function:&lt;br /&gt;
* _halt()&lt;br /&gt;
* _running_script&lt;br /&gt;
* require()&lt;br /&gt;
&lt;br /&gt;
== Example of programs ==&lt;br /&gt;
When a program is started,&lt;br /&gt;
it is executed repeatedly (about once per second)&lt;br /&gt;
until stopped.&amp;lt;br /&amp;gt;&lt;br /&gt;
To stop it, press the STOP-button,&lt;br /&gt;
or use the function:&lt;br /&gt;
_halt()&lt;br /&gt;
in the program.&lt;br /&gt;
&lt;br /&gt;
===Hello world===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- First example&lt;br /&gt;
core.display_chat_message(&amp;quot;Hello world !&amp;quot;)&lt;br /&gt;
_halt()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Morse ===&lt;br /&gt;
A interessing example:&amp;lt;br /&amp;gt;&lt;br /&gt;
First type in the chat: .luac edit morse&amp;lt;br /&amp;gt;&lt;br /&gt;
To edit a new script titled 'morse'&amp;lt;br /&amp;gt;&lt;br /&gt;
Then copy &amp;amp; paste the code below and run it (this is a code for minetest 0.5.0)&amp;lt;br /&amp;gt;&lt;br /&gt;
If you want to remove this 'fonctionnality' do: .luac unregister morse&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local to_morse = {&lt;br /&gt;
  a = '.-',  b = '-...', c = '-.-.', d = '-..', e = '.', f = '..-.', g = '--.',&lt;br /&gt;
  h = '....', i = '..', j = '.---', k = '-.-', l = '.-..', m = '--', n = '-.',&lt;br /&gt;
  o = '---', p = '.--.', q = '--.-', r = '.-.', s = '...', t = '-', u = '..-',&lt;br /&gt;
  v = '...-', w = '.--', x = '-..-', y = '-.--', z = '--..', [1] = '.----',&lt;br /&gt;
  [2] = '..---', [3] = '...--', [4] = '....-', [5] = '.....', [6] = '-....',&lt;br /&gt;
  [7] = '--...', [8] = '---..', [9] = '----.', [0] = '-----', [' '] = '   '&lt;br /&gt;
}&lt;br /&gt;
local from_morse = {}&lt;br /&gt;
for k, v in pairs(to_morse) do&lt;br /&gt;
  from_morse[v] = k&lt;br /&gt;
end&lt;br /&gt;
core.register_on_sending_chat_message(&lt;br /&gt;
function(message)&lt;br /&gt;
  if message:sub(1, 1) == '!' then&lt;br /&gt;
    message = message:sub(2)&lt;br /&gt;
    message:lower()&lt;br /&gt;
    local to_send = ''&lt;br /&gt;
    for i = 1, #message do&lt;br /&gt;
      local m = to_morse[message:sub(i, i)]&lt;br /&gt;
      if m then&lt;br /&gt;
        to_send = to_send .. m .. ' '&lt;br /&gt;
      else&lt;br /&gt;
        core.display_chat_message(core.colorize('red', 'Can\'t translate: ')&lt;br /&gt;
          .. message:sub(i, i))&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    core.send_chat_message(to_send)&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
  return false&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
core.register_on_receiving_chat_message(&lt;br /&gt;
function(message)&lt;br /&gt;
  core.display_chat_message(message)&lt;br /&gt;
  local name, morse = message:match('^&amp;lt;([^&amp;gt;]*)&amp;gt;%s(.*)')&lt;br /&gt;
  if morse and (morse:sub(1, 1) == '.' or morse:sub(1, 1) == '-'&lt;br /&gt;
    or morse:sub(1, 3) == '   ') then&lt;br /&gt;
    local message = ''&lt;br /&gt;
    morse = morse:gsub('%s%s%s', ' %% ')&lt;br /&gt;
    for m in morse:gmatch('[^%s]+') do&lt;br /&gt;
      if m == '%' then&lt;br /&gt;
        m = '   '&lt;br /&gt;
      end&lt;br /&gt;
      local c = from_morse[m]&lt;br /&gt;
      if c then&lt;br /&gt;
        message = message .. c&lt;br /&gt;
      else&lt;br /&gt;
        break&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    core.display_chat_message(core.colorize('red', 'Message: ')&lt;br /&gt;
      .. core.colorize('yellow', message))&lt;br /&gt;
  end&lt;br /&gt;
  return true&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
_halt()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== rot13 ===&lt;br /&gt;
An other example:&lt;br /&gt;
Proceed as previous example&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function rot13(s)&lt;br /&gt;
  return (s:gsub(&amp;quot;%a&amp;quot;, function(c) c=c:byte() return string.char(c+(c%32&amp;lt;14 and 13 or -13)) end))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
core.register_on_sending_chat_message(&lt;br /&gt;
function(message)&lt;br /&gt;
  if message:sub(1, 5) == '/msg ' then&lt;br /&gt;
    message = message:sub(6)&lt;br /&gt;
    local name, msg = message:match('([^%s]+)%s%?(.+)')&lt;br /&gt;
    if not name then&lt;br /&gt;
      return false&lt;br /&gt;
    end&lt;br /&gt;
    core.send_chat_message('/msg ' .. name .. ' @' .. rot13(msg))&lt;br /&gt;
    return true&lt;br /&gt;
  elseif message:sub(1, 1) == '?' and message ~= '?' then&lt;br /&gt;
    message = message:sub(2)&lt;br /&gt;
    local to_send = rot13(message)&lt;br /&gt;
    core.send_chat_message('@' .. to_send)&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
  return false&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
core.register_on_receiving_chat_message(&lt;br /&gt;
function(ciphertext)&lt;br /&gt;
  core.display_chat_message(ciphertext)&lt;br /&gt;
  local name, c_msg = ciphertext:match('^&amp;lt;(.*)&amp;gt;%s@(.*)')&lt;br /&gt;
  if ciphertext:match('^PM%sfrom%s') then&lt;br /&gt;
    local name, c_msg = ciphertext:match('^PM%sfrom%s([^%s]*):%s@(.*)')&lt;br /&gt;
    if name then&lt;br /&gt;
      core.display_chat_message(core.colorize('red', 'Message: ')&lt;br /&gt;
        .. core.colorize('yellow', rot13(c_msg)))&lt;br /&gt;
    end&lt;br /&gt;
  elseif name then&lt;br /&gt;
    core.display_chat_message(core.colorize('red', 'Message: ')&lt;br /&gt;
      .. core.colorize('yellow', rot13(c_msg)))&lt;br /&gt;
    return true&lt;br /&gt;
  end&lt;br /&gt;
  return true&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
_halt()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Standard library ===&lt;br /&gt;
The player can make it own library and load it.&amp;lt;br /&amp;gt;&lt;br /&gt;
As: .luac edit std&amp;lt;br /&amp;gt;&lt;br /&gt;
And press 'Apply'&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
print = core.display_chat_message&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then: .luac edit lua_code&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require('std')&lt;br /&gt;
print('Loaded')&lt;br /&gt;
_halt()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Or in the chat: .lua require'std'; print('Quick Test')&lt;br /&gt;
&lt;br /&gt;
== Questions / Ideas / Suggestions ==&lt;br /&gt;
* A better error system&lt;br /&gt;
&lt;br /&gt;
[[Category:Mods]]&lt;/div&gt;</summary>
		<author><name>&gt;Voxel</name></author>
	</entry>
</feed>