help text changes
parent
34e8dcc59d
commit
dd23b567eb
113
robogui.lua
113
robogui.lua
|
@ -140,8 +140,8 @@ local help_pages = {
|
|||
" 2. [TAKE INSERT AND INVENTORY]",
|
||||
" 3. [BOOKS CODE TEXT WRITE OR READ]",
|
||||
" 4. [PLAYERS]",
|
||||
" 5. [ROBOT]",
|
||||
" 6. [KEYBOARD]",
|
||||
" 5. [ROBOT SPEAK LABEL APPEARANCE OTHER]",
|
||||
" 6. [KEYBOARD AND USER INTERACTIONS]",
|
||||
" 7. [TECHNIC FUNCTIONALITY]",
|
||||
" 8. [CRYPTOGRAPHY]",
|
||||
" 9. [PUZZLE]",
|
||||
|
@ -163,51 +163,54 @@ local help_pages = {
|
|||
["TAKE INSERT AND INVENTORY"] = {
|
||||
"back to [Commands reference]",
|
||||
"TAKE INSERT AND INVENTORY","",
|
||||
" insert.direction(item, inventory) inserts item from robot inventory to target",
|
||||
" inventory",
|
||||
" insert.direction(item, inventory) inserts item from robot inventory to",
|
||||
" target inventory",
|
||||
" check_inventory.direction(itemname, inventory,index) looks at node and ",
|
||||
" returns false/true, direction can be self, if index>0 it returns itemname.",
|
||||
" if itemname == \"\" it checks if inventory empty",
|
||||
" activate.direction(mode) activates target block",
|
||||
" pickup(r) picks up all items around robot in radius r<8 and returns list or nil",
|
||||
" craft(item,idx,mode) crafts item if required materials are present in inventory",
|
||||
" mode = 1 returns recipe, optional recipe idx",
|
||||
" take.direction(item, inventory) takes item from target inventory into robot",
|
||||
" inventory",
|
||||
" pickup(r) picks up all items around robot in radius r<8 and returns list",
|
||||
" or nil",
|
||||
" craft(item,idx,mode) crafts item if required materials are present in",
|
||||
" inventory, mode = 1 returns recipe, optional recipe idx",
|
||||
" take.direction(item, inventory) takes item from target inventory into",
|
||||
" robot inventory",
|
||||
},
|
||||
|
||||
["BOOKS CODE TEXT WRITE OR READ"] = {
|
||||
"back to [Commands reference]",
|
||||
"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",
|
||||
" code.run(text) compiles and runs the code in sandbox (privs only)",
|
||||
" code.set(text) replaces current bytecode of robot",
|
||||
" find_nodes(\"default:dirt\",3) returns distance to node in radius 3 around robot",
|
||||
" or false if none",
|
||||
" read_text.direction(stringname,mode) reads text of signs, chests and other",
|
||||
" blocks, optional stringname for other meta",
|
||||
" mode 1 read number",
|
||||
" find_nodes(\"default:dirt\",3) returns distance to node in radius 3 around",
|
||||
" robot, or false if none found",
|
||||
" read_text.direction(stringname,mode) reads text of signs, chests and",
|
||||
" other blocks, optional stringname for other meta, mode 1 to read number",
|
||||
" write_text.direction(text,mode) writes text to target block as infotext",
|
||||
},
|
||||
|
||||
["PLAYERS"] = {
|
||||
"back to [Commands reference]",
|
||||
"PLAYERS","",
|
||||
" find_player(3,pos) finds players in radius 3 around robot(position) and returns",
|
||||
" list of found player names, if none returns nil",
|
||||
" find_player(3,pos) finds players in radius 3 around robot(position) and",
|
||||
" returns list of found player names, if none returns nil",
|
||||
" attack(target) attempts to attack target player if nearby",
|
||||
" grab(target) attempt to grab target player if nearby and returns true if succesful",
|
||||
" player.getpos(name) return position of player, player.connected() returns list",
|
||||
" of connected players names",
|
||||
" grab(target) attempt to grab target player if nearby and returns",
|
||||
" true if succesful",
|
||||
" 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]",
|
||||
"ROBOT","",
|
||||
" say(\"hello\") will speak",
|
||||
" 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",
|
||||
" sender,mail = self.read_mail() reads mail, if any",
|
||||
" 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.set_properties({textures=.., visual=..,visual_size=.., , ) sets visual",
|
||||
" appearance",
|
||||
" set_animation(anim_start,anim_end,anim_speed,anim_stand_start) set mesh",
|
||||
" animation",
|
||||
" self.set_animation(anim_start,anim_end,anim_speed,anim_stand_start)",
|
||||
" set mesh,animation",
|
||||
" self.spam(0/1) (dis)enable message repeat to all",
|
||||
" self.remove() stops program and removes robot object",
|
||||
" self.reset() resets robot position",
|
||||
" self.spawnpos() returns position of spawner block",
|
||||
" 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.label(text) changes robot label",
|
||||
" self.display_text(text,linesize,size) displays text instead of robot face, if no",
|
||||
" size return tex",
|
||||
" self.sound(sample,volume, opt. pos) plays sound named 'sample' at robot",
|
||||
" location (optional pos)",
|
||||
" self.display_text(text,linesize,size) displays text instead of robot face,",
|
||||
" if no size just return texture string",
|
||||
" self.sound(sample,volume, opt. pos) plays sound named 'sample' at",
|
||||
" robot, location (optional pos)",
|
||||
" rom is aditional table that can store persistent data, like rom.x=1",
|
||||
},
|
||||
|
||||
["KEYBOARD"] = {
|
||||
["KEYBOARD AND USER INTERACTIONS"] = {
|
||||
"back to [Commands reference]",
|
||||
"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 = .. }",
|
||||
" for keyboard event",
|
||||
" keyboard.set(pos,type) set key at pos of type 0=air,1-6,7-15,16-271, limited to",
|
||||
" range 10 around spawner",
|
||||
" keyboard.set(pos,type) set key at pos of type 0=air,1-6,7-15,16-271,",
|
||||
" limited to range 10 around spawner",
|
||||
" keyboard.read(pos) return node name at pos",
|
||||
},
|
||||
|
||||
["TECHNIC FUNCTIONALITY"] = {
|
||||
"back to [Commands reference]",
|
||||
"TECHNIC FUNCTIONALITY","",
|
||||
" namespace 'machine'. most functions return",
|
||||
" true or nil, error",
|
||||
" All commands are in namespace 'machine', for example machine.energy()"
|
||||
" 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",
|
||||
" generate_power(fuel, amount) = energy, attempt to generate power from fuel",
|
||||
" material. If amount>0 try generate amount of power using builtin generator",
|
||||
" - this requires 40 gold/mese/diamonblock upgrades for each 1 amount",
|
||||
" smelt(input,amount) = progress/true. works as a furnace, if amount>0 try to",
|
||||
" use power to smelt - requires 10 upgrades for each 1 amount, energy cost is:",
|
||||
" 1/40*(1+amount)",
|
||||
" grind(input) - grinds input material, requires upgrades for harder material",
|
||||
" generate_power(fuel, amount) = energy, attempt to generate power"
|
||||
" from fuel material. If amount>0 try generate amount of power"
|
||||
" using builtin generator - this requires 40 upgrades for each"
|
||||
" 1 amount",
|
||||
" smelt(input,amount) = progress/true. works as a furnace, if amount>0",
|
||||
" try to use power to smelt - requires 10 upgrades for each 1 amount,",
|
||||
" 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",
|
||||
" transfer_power(amount,target_robot_name)",
|
||||
},
|
||||
|
@ -268,8 +277,8 @@ local help_pages = {
|
|||
" decrypt(input,password) attempts to decrypt encrypted text",
|
||||
" scramble(input,randomseed,sgn) (de)permutes text randomly according",
|
||||
" to sgn = -1,1",
|
||||
" basic_hash(input,n) returns simple mod hash from string input within range",
|
||||
" 0...n-1",
|
||||
" basic_hash(input,n) returns simple mod hash from string input within",
|
||||
" range 0...n-1",
|
||||
},
|
||||
|
||||
["PUZZLE"] = {
|
||||
|
@ -277,14 +286,14 @@ local help_pages = {
|
|||
"PUZZLE","",
|
||||
" namespace 'puzzle' - need puzzle priv",
|
||||
" set_triggers({trigger1, trigger2,...}) sets and initializes spatial triggers",
|
||||
" check_triggers(pname) check if player is close to any trigger and run that",
|
||||
" trigger",
|
||||
" set_node(pos,node) - set any node, limited to current protector mapblock",
|
||||
" & get_node(pos)",
|
||||
" get_player(pname) return player objRef in current mapblock",
|
||||
" check_triggers(pname) check if player is close to any trigger and run",
|
||||
" that trigger",
|
||||
" set_node(pos,node) - set any node, limited to current protector"
|
||||
" region",
|
||||
" get_player(pname) return player objRef in current protector region",
|
||||
" chat_send_player(pname, text)",
|
||||
" get_node_inv(pos) / get_player_inv(pname) - return inventories of nodes/",
|
||||
" players in current mapblock",
|
||||
" get_node_inv(pos) / get_player_inv(pname) - return inventories of nodes",
|
||||
" /players in current mapblock",
|
||||
" get_meta(pos) - return meta of target position",
|
||||
" get_gametime() - return current gametime",
|
||||
" 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 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]";
|
||||
--minetest.chat_send_all("D " .. form)
|
||||
|
|
Loading…
Reference in New Issue