This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Hellreaper's profile picture

Igneous extruder computer influence

Started by Hellreaper, 23 April 2016 - 09:08 PM
Hellreaper #1
Posted 23 April 2016 - 11:08 PM
Hi,

I wanted to try and have a computer change the option of an igneous extruder to have it make stone, obsidian or cobble.
But I can't seem to find how to do it. Im using wired modems and the name of the extruder is tile_thermalexpansion_machine_extruder_name_0

I tried to do this but I got stuck since I can't find the method i need(and I cant find it online either…)


local periList = peripheral.getNames()
for i=0,table.getn(periList) do
if(periList[i] == "tile_thermalexpansion_machine_extruder_name_0") then
  peripheral.wrap(periList[i])
end
end
KingofGamesYami #2
Posted 24 April 2016 - 12:17 AM
If you know the name of the peripheral (you do), you can wrap it directly:


local extruder = peripheral.wrap( "tile_thermalexpansion_machine_extruder_name_0" )

After that, to get a list of functions associated with the peripheral, you can iterate through the wrapped peripheral:


for k, v in pairs( extruder ) do
  print( k )
end


Once you know that, you can try and figure out how to call the functions the peripheral provides, with the relevant arguments.
Hellreaper #3
Posted 24 April 2016 - 11:02 AM
Well I have seen the methods from the extruder but the problem is I didnt know which one and I cant find any info on what the methods do
And I think the window is too small to show all the methods
Hellreaper #4
Posted 24 April 2016 - 12:51 PM
UPDATE: I wrote the methods available to a file (but they are on a single line)

So now im trying to filter the text so it splits on lines since I cant read the description of the methods
LewisTehMinerz #5
Posted 24 April 2016 - 01:04 PM
If you are writing to a file, just write this:


f.write( variable + "\n" )

That will add the newline (\n) character to the end of each string.
Hellreaper #6
Posted 24 April 2016 - 01:09 PM
If you are writing to a file, just write this:


f.write( variable + "\n" )

That will add the newline (\n) character to the end of each string.

The problem with that is that the methods get returned as a string… resulting in a really long unfiltered text…
Edited on 24 April 2016 - 11:21 AM
Hellreaper #7
Posted 24 April 2016 - 01:25 PM
I attached the file to this message(I cant find a way to filter it right away…)
If anyone can help me find the method I need for accessing what kind of block is being created i would appreaciate it because I cant find it

Another posibility would be to send me a PM for the server IP and I can give it you so you could check it out for yourself
I wont post the ip here since I kinda dont want to make it public…
Bomb Bloke #8
Posted 24 April 2016 - 02:32 PM
Urgh, use something like this to read the documentation.

Don't be too surprised if the function you're after doesn't actually exist. The blocks OpenPeripheral supports are sometimes recognised by class rather than specific type; it may recognise that it's a container-class block and give you some functions for inventory management, and it may recognise that it's a TE-machine-class block and give you some functions for reading energy levels or whatever, but that doesn't mean it'll recognise that it's an IE and give you options to change the block it'll generate.
Lupus590 #9
Posted 24 April 2016 - 02:36 PM
Jumping ahead here, but bear with me.

If ComputerCraft can't change the modes on the IE then you could just make multiple of them (one for each mode) and have CC control the lava and RF flow to them.
Hellreaper #10
Posted 24 April 2016 - 02:52 PM
Urgh, use something like this to read the documentation.

Don't be too surprised if the function you're after doesn't actually exist. The blocks OpenPeripheral supports are sometimes recognised by class rather than specific type; it may recognise that it's a container-class block and give you some functions for inventory management, and it may recognise that it's a TE-machine-class block and give you some functions for reading energy levels or whatever, but that doesn't mean it'll recognise that it's an IE and give you options to change the block it'll generate.

NICE, this is what I was trying to do in C++ sorting a text document (sorry) but this is WAY better

Jumping ahead here, but bear with me.

If ComputerCraft can't change the modes on the IE then you could just make multiple of them (one for each mode) and have CC control the lava and RF flow to them.

And that is indeed the case it would seem… I will have to make multple if I really want to be able to switch the modes
Edited on 24 April 2016 - 12:57 PM