Jump to content


gheotic's Content

There have been 14 items by gheotic (Search limited from 10-February 22)


By content type

See this member's

Sort by                Order  

#256542 Computer Controlled Seed Analyzer Weird method?

Posted by gheotic on 20 July 2016 - 08:17 PM in Ask a Pro

Thank you! Exactly what i was looking for :D



#256506 Computer Controlled Seed Analyzer Weird method?

Posted by gheotic on 20 July 2016 - 02:59 PM in Ask a Pro

Recently I found out about the Computer Controlled Seed Analyzer from agricraft where you get analyze and get stats of the seeds. My problem with it is that when ever you run the method called: "getSpecimenStats()" in lua mode, it's printing out 3 lines on the screen with the 3 different stats, or thats what it looks like.

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.



#237617 How to: Create a MySQL Database Login

Posted by gheotic on 10 November 2015 - 11:51 AM in Tutorials

I'm getting this error:
Parse error: syntax error, unexpected '='
on line 24... Who do i fix this?



#237545 Computer not fast enough?

Posted by gheotic on 09 November 2015 - 08:40 AM in Ask a Pro

Well that sound like a good solution for my problems :D Now it would be nice to get pass this school day, so i can get home to test it out!



#237419 Computer not fast enough?

Posted by gheotic on 08 November 2015 - 11:39 AM in Ask a Pro

I don't think there is a command called that?



#237401 Computer not fast enough?

Posted by gheotic on 08 November 2015 - 04:25 AM in Ask a Pro

I'm trying to make the sensor from openPeripheral detect when players are walking above it, and it all works very well. Except if they move too fast. First it looks for players, then it takes the first playerName in the table and use it in a command to get more information about that one player. The problem is that the computer isn't fast enough to get players nearby and get further information before that player is gone. So it throw this error:
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

I'm trying to get into computercraft, i got the direwolf20 1.7.1 modpack, with Peripherals++ and Openperipheral. I would say that i'm fairly experienced with programming, but i've a hard time finding the documentation, for the peripherals... I know that peripherals++ got a website with the main functions, but not the return values. Then with openperipheral it's even harder, what i have done is using the autocomplete function in the advance computer in lua mode. Is there easy way to find the documentation for all functions, and their returned values?



#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

View PostWait_, on 29 October 2015 - 10:39 AM, said:

i've managed to deal with the high cpu, and as i have found out there is currently no crafting for the nanobots.

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?
Well that sucks but thanks for your help



#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

How do you craft the nano swarm bot?



#236421 Peripierals++- Using the playerinterface

Posted by gheotic on 27 October 2015 - 11:20 AM in Ask a Pro

View PostSquidDev, on 27 October 2015 - 09:55 AM, said:

First wrap the peripheral as normal:
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

View PostSquidDev, on 27 October 2015 - 09:49 AM, said:

If this bit is erroring:
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

Does anyone have a simple working script, that uses the playerinterface from the peripheral++ mod?

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

Where is the problem in this program?
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

I have got the direwolf20 1.7.1, with computercraft and openperipherals with the block called sensor. What i want to know is how to actually use it. I have spent a few hours trying to do a simple script, without luck. I have tried other user scripts, none which worked... When i use any of the functions it returns somthing like this: "1: table: (anumber)".
Can someone help me the right direction? mabey just a simple working script.
Thank you.