
OpenStuff
Активный0.0
Установок
0
Последнее обновление
2 года назад
Клиент
Оружие и броня
Технологические
Hello OpenStuff allows you to add an Armor to OpenComputer controlled in the same way as nanomachines.
================================================ = ===========================================.
on craft thanks to The assembler with pieces of Diamond armor.
-------------------------------------------------- ----------------------------------------------
API :
setColor(number:color) sets a color to the armor, color is a number between 0 and 15.
getColor() returns the current color.
displayText(string:text,number:x,number:y,number:color[0x000000-0xFFFFFF]) displays text in the player's HUD.
notDisplayText(string:text,number:x,number:y) removes the specified text at the specified coordinate.
getDimensionIndex() returns the ID of the dimension the player is in.
getPosition() returns the xyz coordinates of the player.
getBedLocation() returns the xyz coordinates of the player's bed.
hasBedLocation() returns if the player has a bed.
getDisplayName() returns the player's name.
getExperienceLevel() returns the player's XP level.
getFoodLevel() returns the player's food level.
getSaturationLevel() returns the player's saturation level.
getHealth() returns the player's health level.
Example:
In lua shell:
event.listen("modem_message",print); component.modem.open(1)
print all armor message received
component.modem.broadcast(1,"openarmor","setColor",15)
set the color armor to white
function toList(a)local b={}for c in string.gmatch(a,"[^%s]+")do if c=="true"then table.insert(b,true)elseif c=="false"then table.insert(b,false)elseif tonumber(c)~=nil then table.insert(b,tonumber(c))else table.insert(b,c)end end;return table.unpack(b)end;event.listen("modem_message",print)component.modem.open(1)while true do component.modem.broadcast(1,"openarmor",toList(io.read()))end
convert lua shell to an armor shell