- ComputerCraft | Programmable Computers for Minecraft
- → gheotic's Content
gheotic's Content
There have been 14 items by gheotic (Search limited from 10-February 22)
#256506 Computer Controlled Seed Analyzer Weird method?
Posted by
gheotic
on 20 July 2016 - 02:59 PM
in
Ask a Pro
Just as a example:
Stats of a seed:
- Growth: 1
- Gain: 2
- Strength: 3
Program run in lua:
m = peripheral.wrap("back")
-- Running directly
m.getSpecimenStats()
1
2
3
-- Saving it as a variable
stats = m.getSpecimenStats()
stats -- Btw this comes out as a number variable
1
How can i save all variables when its, not really returning them in a array or dictionary, but just kinda printing 3 lines.
#237401 Computer not fast enough?
Posted by
gheotic
on 08 November 2015 - 04:25 AM
in
Ask a Pro
startup:5: Entity not found
p = peripheral.wrap("bottom")
while true do
local players = p.getPlayers()
if players ~= nil and players[1] ~= nil then
playerName = players[1]["name"]
player = p.getPlayerByName(playerName) -- Error occur here
end
os.sleep(0.5)
end
#236700 Where is the documentation?
Posted by
gheotic
on 30 October 2015 - 10:03 PM
in
Ask a Pro
#236573 [MC 1.7.10][CC 1.75] Peripherals++ v1.3.6, MiscPeripherals reimagined! In...
Posted by
gheotic
on 29 October 2015 - 05:16 PM
in
Peripherals and Turtle Upgrades
Wait_, on 29 October 2015 - 10:39 AM, said:
and for my own question, how does the "voice" parameter work? i've tried doing so many languages, yet none have worked. it might not be the language though, can anyone tell me?
#236486 [MC 1.7.10][CC 1.75] Peripherals++ v1.3.6, MiscPeripherals reimagined! In...
Posted by
gheotic
on 28 October 2015 - 01:01 PM
in
Peripherals and Turtle Upgrades
#236421 Peripierals++- Using the playerinterface
Posted by
gheotic
on 27 October 2015 - 11:20 AM
in
Ask a Pro
SquidDev, on 27 October 2015 - 09:55 AM, said:
local p = peripheral.wrap("left")
Supposing you have a chest to the north of your computer, you would want to input and output into that chest. You also would want to get the inventory of the desired player
p.setOutputSide("north")
p.setInputSide("north")
local inv = p.getPlayerInv("dan200")
If you want to move something from slot 1 of the chest to the player:
inv.pushToSlot(1, 64, -1) -- 64 to pass all items, -1 to pass to any slot. You can change this to force a slot and limit the number of items
If you want to pull something from slot 1 of the player to the chest, just do it in reverse:
inv.retrieveFromSlot(1, 64, -1)
Thank you! i dont know where i went wrong when trying this myself, but your script works like a charm!
#236419 Attempt to index ? (a nil value)
Posted by
gheotic
on 27 October 2015 - 11:10 AM
in
Ask a Pro
SquidDev, on 27 October 2015 - 09:49 AM, said:
p.getNearbyPlayers(5)[1]["player"]
Then one of these is nil:
p.getNearbyPlayers(5) p.getNearbyPlayers(5)[1]
The easiest thing to do would be to check each one to see if it is nil:
local players = p.getNearbyPlayers(5) if players ~= nil and players[1] ~= nil then print(players[1]["player"]) end
You might also want to loop through every possible player:
for _, player in ipairs(p.getNearbyPlayers(5)) do print(player["player"]) end
Thanks works like charm!
#236409 Peripierals++- Using the playerinterface
Posted by
gheotic
on 27 October 2015 - 08:57 AM
in
Ask a Pro
Link to documentation: http://peripheralspl...ayer_interface/
#236407 Attempt to index ? (a nil value)
Posted by
gheotic
on 27 October 2015 - 08:10 AM
in
Ask a Pro
Here is a link to the documentation for the peripheral i use.
local p = peripheral.wrap("left")
while true do
sleep(0.5)
if p.getNearbyPlayers(5)[1] == nil then
redstone.setOutput("bottom", false)
else
name = p.getNearbyPlayers(5)[1]["player"] --This is where it fails
if name == "tilde1000" then
redstone.setOutput("bottom", true)
end
end
end
#236343 OpenPeripierals- Example of working sensor program
Posted by
gheotic
on 26 October 2015 - 10:07 AM
in
Ask a Pro
Can someone help me the right direction? mabey just a simple working script.
Thank you.
- ComputerCraft | Programmable Computers for Minecraft
- → gheotic's Content


