help text changes

master
rnd 2018-07-27 12:22:57 +02:00
parent 34e8dcc59d
commit dd23b567eb
1 changed files with 61 additions and 52 deletions

View File

@ -140,8 +140,8 @@ local help_pages = {
" 2. [TAKE INSERT AND INVENTORY]", " 2. [TAKE INSERT AND INVENTORY]",
" 3. [BOOKS CODE TEXT WRITE OR READ]", " 3. [BOOKS CODE TEXT WRITE OR READ]",
" 4. [PLAYERS]", " 4. [PLAYERS]",
" 5. [ROBOT]", " 5. [ROBOT SPEAK LABEL APPEARANCE OTHER]",
" 6. [KEYBOARD]", " 6. [KEYBOARD AND USER INTERACTIONS]",
" 7. [TECHNIC FUNCTIONALITY]", " 7. [TECHNIC FUNCTIONALITY]",
" 8. [CRYPTOGRAPHY]", " 8. [CRYPTOGRAPHY]",
" 9. [PUZZLE]", " 9. [PUZZLE]",
@ -163,51 +163,54 @@ local help_pages = {
["TAKE INSERT AND INVENTORY"] = { ["TAKE INSERT AND INVENTORY"] = {
"back to [Commands reference]", "back to [Commands reference]",
"TAKE INSERT AND INVENTORY","", "TAKE INSERT AND INVENTORY","",
" insert.direction(item, inventory) inserts item from robot inventory to target", " insert.direction(item, inventory) inserts item from robot inventory to",
" inventory", " target inventory",
" check_inventory.direction(itemname, inventory,index) looks at node and ", " check_inventory.direction(itemname, inventory,index) looks at node and ",
" returns false/true, direction can be self, if index>0 it returns itemname.", " returns false/true, direction can be self, if index>0 it returns itemname.",
" if itemname == \"\" it checks if inventory empty", " if itemname == \"\" it checks if inventory empty",
" activate.direction(mode) activates target block", " activate.direction(mode) activates target block",
" pickup(r) picks up all items around robot in radius r<8 and returns list or nil", " pickup(r) picks up all items around robot in radius r<8 and returns list",
" craft(item,idx,mode) crafts item if required materials are present in inventory", " or nil",
" mode = 1 returns recipe, optional recipe idx", " craft(item,idx,mode) crafts item if required materials are present in",
" take.direction(item, inventory) takes item from target inventory into robot", " inventory, mode = 1 returns recipe, optional recipe idx",
" inventory", " take.direction(item, inventory) takes item from target inventory into",
" robot inventory",
}, },
["BOOKS CODE TEXT WRITE OR READ"] = { ["BOOKS CODE TEXT WRITE OR READ"] = {
"back to [Commands reference]", "back to [Commands reference]",
"BOOKS CODE TEXT WRITE OR READ","", "BOOKS CODE TEXT WRITE OR READ","",
" title,text=book.read(i) returns title,contents of book at i-th position in library", " title,text=book.read(i) returns title,contents of book at i-th position in",
" library",
" book.write(i,title,text) writes book at i-th position at spawner library", " book.write(i,title,text) writes book at i-th position at spawner library",
" code.run(text) compiles and runs the code in sandbox (privs only)", " code.run(text) compiles and runs the code in sandbox (privs only)",
" code.set(text) replaces current bytecode of robot", " code.set(text) replaces current bytecode of robot",
" find_nodes(\"default:dirt\",3) returns distance to node in radius 3 around robot", " find_nodes(\"default:dirt\",3) returns distance to node in radius 3 around",
" or false if none", " robot, or false if none found",
" read_text.direction(stringname,mode) reads text of signs, chests and other", " read_text.direction(stringname,mode) reads text of signs, chests and",
" blocks, optional stringname for other meta", " other blocks, optional stringname for other meta, mode 1 to read number",
" mode 1 read number",
" write_text.direction(text,mode) writes text to target block as infotext", " write_text.direction(text,mode) writes text to target block as infotext",
}, },
["PLAYERS"] = { ["PLAYERS"] = {
"back to [Commands reference]", "back to [Commands reference]",
"PLAYERS","", "PLAYERS","",
" find_player(3,pos) finds players in radius 3 around robot(position) and returns", " find_player(3,pos) finds players in radius 3 around robot(position) and",
" list of found player names, if none returns nil", " returns list of found player names, if none returns nil",
" attack(target) attempts to attack target player if nearby", " attack(target) attempts to attack target player if nearby",
" grab(target) attempt to grab target player if nearby and returns true if succesful", " grab(target) attempt to grab target player if nearby and returns",
" player.getpos(name) return position of player, player.connected() returns list", " true if succesful",
" of connected players names", " player.getpos(name) return position of player, player.connected()",
" returns list of connected players names",
}, },
["ROBOT"] = { ["ROBOT SPEAK LABEL APPEARANCE OTHER"] = {
"back to [Commands reference]", "back to [Commands reference]",
"ROBOT","", "ROBOT","",
" say(\"hello\") will speak", " say(\"hello\") will speak",
" self.listen(0/1) (de)attaches chat listener to robot", " self.listen(0/1) (de)attaches chat listener to robot",
" speaker, msg = self.listen_msg() retrieves last chat message if robot listens", " speaker, msg = self.listen_msg() retrieves last chat message if robot",
" has listener attached",
" self.send_mail(target,mail) sends mail to target robot", " self.send_mail(target,mail) sends mail to target robot",
" sender,mail = self.read_mail() reads mail, if any", " sender,mail = self.read_mail() reads mail, if any",
" self.pos() returns table {x=pos.x,y=pos.y,z=pos.z}", " self.pos() returns table {x=pos.x,y=pos.y,z=pos.z}",
@ -215,47 +218,53 @@ local help_pages = {
" self.operations() returns remaining robot operations", " self.operations() returns remaining robot operations",
" self.set_properties({textures=.., visual=..,visual_size=.., , ) sets visual", " self.set_properties({textures=.., visual=..,visual_size=.., , ) sets visual",
" appearance", " appearance",
" set_animation(anim_start,anim_end,anim_speed,anim_stand_start) set mesh", " self.set_animation(anim_start,anim_end,anim_speed,anim_stand_start)",
" animation", " set mesh,animation",
" self.spam(0/1) (dis)enable message repeat to all", " self.spam(0/1) (dis)enable message repeat to all",
" self.remove() stops program and removes robot object", " self.remove() stops program and removes robot object",
" self.reset() resets robot position", " self.reset() resets robot position",
" self.spawnpos() returns position of spawner block", " self.spawnpos() returns position of spawner block",
" self.viewdir() returns vector of view for robot", " self.viewdir() returns vector of view for robot",
" self.fire(speed, pitch,gravity, texture, is_entity) fires a projectile from robot", " self.fire(speed, pitch,gravity, texture, is_entity) fires a projectile",
" from robot. if is_entity false (default) it fires particle.",
" self.fire_pos() returns last hit position", " self.fire_pos() returns last hit position",
" self.label(text) changes robot label", " self.label(text) changes robot label",
" self.display_text(text,linesize,size) displays text instead of robot face, if no", " self.display_text(text,linesize,size) displays text instead of robot face,",
" size return tex", " if no size just return texture string",
" self.sound(sample,volume, opt. pos) plays sound named 'sample' at robot", " self.sound(sample,volume, opt. pos) plays sound named 'sample' at",
" location (optional pos)", " robot, location (optional pos)",
" rom is aditional table that can store persistent data, like rom.x=1", " rom is aditional table that can store persistent data, like rom.x=1",
}, },
["KEYBOARD"] = { ["KEYBOARD AND USER INTERACTIONS"] = {
"back to [Commands reference]", "back to [Commands reference]",
"KEYBOARD","", "KEYBOARD","",
" EVENTS : place spawner at coordinates (20i,40j+1,20k) to monitor events", " EVENTS : place spawner at coordinates (r*i,2*r*j+1,r*k) to monitor",
" events. value of r is ".. basic_robot.radius,
" keyboard.get() returns table {x=..,y=..,z=..,puncher = .. , type = .. }", " keyboard.get() returns table {x=..,y=..,z=..,puncher = .. , type = .. }",
" for keyboard event", " for keyboard event",
" keyboard.set(pos,type) set key at pos of type 0=air,1-6,7-15,16-271, limited to", " keyboard.set(pos,type) set key at pos of type 0=air,1-6,7-15,16-271,",
" range 10 around spawner", " limited to range 10 around spawner",
" keyboard.read(pos) return node name at pos", " keyboard.read(pos) return node name at pos",
}, },
["TECHNIC FUNCTIONALITY"] = { ["TECHNIC FUNCTIONALITY"] = {
"back to [Commands reference]", "back to [Commands reference]",
"TECHNIC FUNCTIONALITY","", "TECHNIC FUNCTIONALITY","",
" namespace 'machine'. most functions return", " All commands are in namespace 'machine', for example machine.energy()"
" true or nil, error", " most functions return: ok, error = true or nil, error",
" To use some commands fully robot must be upgraded. 1 upgrade is",
" goldblock+meseblock+diamonblock.",
" energy() displays available energy", " energy() displays available energy",
" generate_power(fuel, amount) = energy, attempt to generate power from fuel", " generate_power(fuel, amount) = energy, attempt to generate power"
" material. If amount>0 try generate amount of power using builtin generator", " from fuel material. If amount>0 try generate amount of power"
" - this requires 40 gold/mese/diamonblock upgrades for each 1 amount", " using builtin generator - this requires 40 upgrades for each"
" smelt(input,amount) = progress/true. works as a furnace, if amount>0 try to", " 1 amount",
" use power to smelt - requires 10 upgrades for each 1 amount, energy cost is:", " smelt(input,amount) = progress/true. works as a furnace, if amount>0",
" 1/40*(1+amount)", " try to use power to smelt - requires 10 upgrades for each 1 amount,",
" grind(input) - grinds input material, requires upgrades for harder material", " energy cost of smelt is: 1/40*(1+amount)",
" grind(input) - grinds input material, requires upgrades for harder"
" materials",
" compress(input) - requires upgrades - energy intensive process", " compress(input) - requires upgrades - energy intensive process",
" transfer_power(amount,target_robot_name)", " transfer_power(amount,target_robot_name)",
}, },
@ -268,8 +277,8 @@ local help_pages = {
" decrypt(input,password) attempts to decrypt encrypted text", " decrypt(input,password) attempts to decrypt encrypted text",
" scramble(input,randomseed,sgn) (de)permutes text randomly according", " scramble(input,randomseed,sgn) (de)permutes text randomly according",
" to sgn = -1,1", " to sgn = -1,1",
" basic_hash(input,n) returns simple mod hash from string input within range", " basic_hash(input,n) returns simple mod hash from string input within",
" 0...n-1", " range 0...n-1",
}, },
["PUZZLE"] = { ["PUZZLE"] = {
@ -277,14 +286,14 @@ local help_pages = {
"PUZZLE","", "PUZZLE","",
" namespace 'puzzle' - need puzzle priv", " namespace 'puzzle' - need puzzle priv",
" set_triggers({trigger1, trigger2,...}) sets and initializes spatial triggers", " set_triggers({trigger1, trigger2,...}) sets and initializes spatial triggers",
" check_triggers(pname) check if player is close to any trigger and run that", " check_triggers(pname) check if player is close to any trigger and run",
" trigger", " that trigger",
" set_node(pos,node) - set any node, limited to current protector mapblock", " set_node(pos,node) - set any node, limited to current protector"
" & get_node(pos)", " region",
" get_player(pname) return player objRef in current mapblock", " get_player(pname) return player objRef in current protector region",
" chat_send_player(pname, text)", " chat_send_player(pname, text)",
" get_node_inv(pos) / get_player_inv(pname) - return inventories of nodes/", " get_node_inv(pos) / get_player_inv(pname) - return inventories of nodes",
" players in current mapblock", " /players in current mapblock",
" get_meta(pos) - return meta of target position", " get_meta(pos) - return meta of target position",
" get_gametime() - return current gametime", " get_gametime() - return current gametime",
" ItemStack(itemname) returns ItemRef to be used with inventory", " ItemStack(itemname) returns ItemRef to be used with inventory",
@ -306,7 +315,7 @@ local robot_show_help = function(pname) --formname: robot_help
local pages = help_pages[address]; local pages = help_pages[address];
local content = table.concat(pages,",") local content = table.concat(pages,",")
local size = 8; local vsize = 7.75; local size = 9; local vsize = 8.75;
local form = "size[" .. size .. "," .. size .. "] textlist[-0.25,-0.25;" .. (size+1) .. "," .. (vsize+1) .. ";wiki;".. content .. ";1]"; local form = "size[" .. size .. "," .. size .. "] textlist[-0.25,-0.25;" .. (size+1) .. "," .. (vsize+1) .. ";wiki;".. content .. ";1]";
--minetest.chat_send_all("D " .. form) --minetest.chat_send_all("D " .. form)