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

Computer craft and other mods

Started by Byryndyk30, 23 October 2015 - 01:11 PM
Byryndyk30 #1
Posted 23 October 2015 - 03:11 PM
Good evening.
I decided to use the computer craft mid in his client to play with a friend. There was a question whether this mod interact with other modes, such as Ender IO, without additional add-ons? Or should I install additional mode-crossover?

Translated by Google Translator, so there may be written nonsense :)/>
Lupus590 #2
Posted 23 October 2015 - 06:22 PM
Open peripherals adds a lot of mod interaction with computer craft. http://www.computerc...openperipheral/ openmods.info

Some mods add there own interactions too, so just try wrapping things as peripherals.

If you give us a mod list, we may be able to give you a list of things that you can do with computer craft with those other mods.
Edited on 23 October 2015 - 04:25 PM
Byryndyk30 #3
Posted 23 October 2015 - 06:35 PM
Here is a list of mods. It was through the Curse, so the html file.
KingofGamesYami #4
Posted 23 October 2015 - 07:56 PM
A good test of whether a mod has added CC support for a particular block is to place the block on top of a computer and use:

print( peripheral.isPresent( "top" ) )

If the block is a peripheral, this will print true.
Byryndyk30 #5
Posted 23 October 2015 - 08:13 PM
Install OpenPeripheralCore-1.7.10-1.2, OpenPeripheralAddons-1.7.10-0.4, OpenPeripheralIntegration-1.7.10-0.3. Monitor stops working…


m = peripheral.wrap("right")
m.clear()
m.setCursorPos(1, 1)
m.write("12312313")

The monitor is to the right of the computer.
peripheral.isPresent("right") = true
peripheral.getType("right") = monitor

Why monitor stopped working …?
Byryndyk30 #6
Posted 23 October 2015 - 11:59 PM
When set to 1, the monitor unit - it works.
When set 4 block monitors - is not working.
what am I doing wrong?
https://youtu.be/cQQZw76TAok
Edited on 23 October 2015 - 10:38 PM
HPWebcamAble #7
Posted 24 October 2015 - 01:29 AM
Monitors sometimes don't work, its a known bug.

Change the text scale of the monitor, then try printing your text:

m.setTextScale(5)
m.setTextScale(1) --# Default is 1, largest is 5

m.write("123123")
Byryndyk30 #8
Posted 24 October 2015 - 01:46 AM
Monitors sometimes don't work, its a known bug.

Change the text scale of the monitor, then try printing your text:

m.setTextScale(5)
m.setTextScale(1) --# Default is 1, largest is 5

m.write("123123")
Thank you.
Another question. Is it possible to send a signal to a particular wire in a bundle of wires from mod ProjectRed? Or one side - 1 wire color?
HPWebcamAble #9
Posted 24 October 2015 - 01:51 AM
Is it possible to send a signal to a particular wire in a bundle of wires from mod ProjectRed? Or one side - 1 wire color?

Yes, the redstone API has functions to interact with regular redstone dust, and things like bundled wire (other mods add it too)
http://www.computercraft.info/wiki/Redstone_(API)

Take a look at the 'bundledOutput' functions
Bomb Bloke #10
Posted 24 October 2015 - 01:52 AM
Yes, the redstone API has functions for that.

rs.setBundledOutput("left", colours.red)

You can use the functions in the colours API to manage multiple colours through the one side.

rs.setBundledOutput("left", colours.combine(colours.red, colours.green))

Edit: :ph34r:/>'d
Edited on 23 October 2015 - 11:53 PM
Byryndyk30 #11
Posted 24 October 2015 - 02:02 AM
Thank you.
I think I learned the basic.
Let's see what I can do :)/>
Byryndyk30 #12
Posted 24 October 2015 - 04:52 PM
Hello again, it's me again :)/>.
Slowly advance in the study of mod.
Stuck on Computercraft + railcraft iron tank.
Most of all, I did not understand how to get value from the table in lua. I looked through many sites. I try a few different ways. But output still gives not what I need.
Here's the code:

tank = peripheral.wrap("bottom")
info = tank.getTankInfo()
v = info[1]
print(v)
This code gives the answer:

table: 78cc7983
Can someone show me how to get the value of steam, in normal numbers?
TYKUHN2 #13
Posted 24 October 2015 - 05:04 PM
Try info[1][1] becuase info[1] is another table.
I don't know the peripheral API of a tank so I cannot help you beyond saying it's another table.
Byryndyk30 #14
Posted 24 October 2015 - 05:15 PM
Here's the code:

tank =peripheral.wrap("bottom")
info = tank.getTankInfo()
v = info
v1 = info[1]
v2 = info[1][1]
print("v - ",v)
print("v1 - ",v1)
print("v2 - ", v2)
Here's the answer to this code

v - table: 1d531c0c
v1 - table: 7bd881b6
v2 -
TYKUHN2 #15
Posted 24 October 2015 - 05:33 PM
Run this code

for k, v in pairs(info) do
    print("Type = "..type(v).." Value = "..v)
end
HPWebcamAble #16
Posted 24 October 2015 - 05:55 PM
Run this code

for k, v in pairs(info) do
	print("Type = "..type(v).." Value = "..v)
end

Or better yet, save the whole table to a file:

tank =peripheral.wrap("bottom")
info = tank.getTankInfo()

local f = fs.open("infoFile","w")
f.write( textutils.serialize(info) )
f.close()
After running this, what does the file 'infoFile' look like?
Byryndyk30 #17
Posted 24 October 2015 - 06:12 PM
infoFile:

{
	   {
			    capacity = 10368000,
			    contents = {
					  rawName = "Steam",
					  amount = 8107280,
					  name = "steam",
					  id = 27,
				 },
		  },
}
I read about the work with the files, and I think I can continue to do everything himself :)/>
TYKUHN2 #18
Posted 24 October 2015 - 06:27 PM
That is an awkward table but here it goes.

for k,v in pairs(info) do
	if v[contents][rawName] == "Steam" then
		steamAmount = v[contents][amount]
		break
	end
end

Though the method seems kinda badly made, as far as I can tell, the only useful information is info[1] so this should work as well

if info[1][contents][rawName] == "Steam" then
	steamMount = v[contents][amount]
end
Edited on 24 October 2015 - 04:35 PM
Byryndyk30 #19
Posted 24 October 2015 - 06:50 PM
I'm a little hard to understand what you're writing code snippets …
Correct me if I do something wrong written.

tank = peripheral.wrap("bottom")
info = tank.getTankInfo()
print(info[contents][amount])
This code produces the error:

test:3: attempt to index ? (a nil value)
TYKUHN2 #20
Posted 24 October 2015 - 06:57 PM
info[contents] doesn't exist
info[1][contents] exists because contents is inside a table.
Byryndyk30 #21
Posted 24 October 2015 - 07:04 PM

tank = peripheral.wrap("bottom")
info = tank.getTankInfo()
print(info[1][contents])
Do not print anything … (
TYKUHN2 #22
Posted 24 October 2015 - 07:24 PM
You're looking for info[1][contents][amount]

Info is the biggest table
1 is a table inside of info
contents is a table inside of 1
amount is a numerical value inside contents
Byryndyk30 #23
Posted 24 October 2015 - 07:43 PM
Before your posts, I tried this code:

tank = peripheral.wrap("bottom")
info = tank.getTankInfo()
print(info[1][contents][amount])
This code produces the error:

test:3: attempt to index ? (a nil value)
Edited on 24 October 2015 - 05:44 PM
TYKUHN2 #24
Posted 24 October 2015 - 08:16 PM
According to your infoFile that code is correct, ensure the tank still has contents, and that there are no copying errors.
Byryndyk30 #25
Posted 24 October 2015 - 08:39 PM
infoFile:
https://yadi.sk/i/UVPDHmYijyPkC

Code:
https://yadi.sk/i/OCTdc-yhjyPRC

Result:
https://yadi.sk/i/BoxxkIwNjyPYM

What is wrong?…((

I take a screenshot to avoid typos…
HPWebcamAble #26
Posted 24 October 2015 - 09:30 PM
According to your infoFile that code is correct

No, its not.

You need to index strings, not variables:

print(info[1]["contents"]["amount"])
Which is the same thing as

print( info[1].contents.amount )
Byryndyk30 #27
Posted 24 October 2015 - 09:41 PM
You are amazing!

print( info[1].contents.amount )
Working!

Thanks to all who helped to understand.
It seems to understand how to work with tables in Lua. The websites that I read do not understand anything (
Byryndyk30 #28
Posted 27 October 2015 - 11:10 PM
Hello again, it's me again))
Hyde saw such a thing as the Peripheral cable. for connecting a computer to one side of multiple devices. But mod was the old version of the game. Is it possible to do now is without any mods?

If possible - tell me how.
If not - tell me how to install mod that used to connect multiple devices to one side Comp
Bomb Bloke #29
Posted 27 October 2015 - 11:43 PM
Sounds like you're talking about a wired modem, which is part of vanilla ComputerCraft.
Byryndyk30 #30
Posted 28 October 2015 - 12:24 AM
Oh. I thought that it is only used to connect multiple computers in a network.
Can you explain then how to connect to the left side of the computer 2 different monitor for example?

Perhaps my posts seem a bit strange, surprising. They have been translated by Google translator )))
Edited on 27 October 2015 - 11:27 PM
HPWebcamAble #31
Posted 28 October 2015 - 12:42 AM
Can you explain then how to connect to the left side of the computer 2 different monitor for example?
  1. Put a wired modem on the computer
  2. Put a wired modem on the peripheral (in this case, the monitor)
  3. Right click the modem on the peripheral to activate it
  4. Note the name of it (shown in chat), something like 'monitor_1'
  5. Connect the two modems with networking cable
  6. In the computer, wrap the peripheral like so:

local monitor = peripheral.wrap( "monitor_1" ) --# Replace 'monitor_1' with the name of the peripheral

You can now use it like a regular wrapped peripheral
Byryndyk30 #32
Posted 28 October 2015 - 12:44 AM
Thank you. Hyde I've read - this is not shown))
Byryndyk30 #33
Posted 01 November 2015 - 02:48 PM
And again, that's me!))
Tell me how to clear the list of devices used by a computer and connected with the aid of a modem?

Explain.
I have 60 boilers. All of them are connected to a computer with a modem. Counter boilers 0 - 59. When I break one boiler or a modem and set it back, it takes a number 60, not the one who should be free between 0 and 59. How do you get to take your old boiler room, or how to remove all of these 0 - 59 boilers that used the numbering starts with 0?
Lupus590 #34
Posted 01 November 2015 - 03:39 PM
I'm guessing that you'd have to reassemble the entire CC network. To take apart everything and reconnect it.

Alternatively you may be able to disconnect and reconnect the numbers above the missing number.
E.G. I have 0,1,2,4,5 I want another at 3 so I disconnect 4 and 5, connect 3 and reconnect 4 and 5.
Edited on 01 November 2015 - 03:39 PM
SquidDev #35
Posted 01 November 2015 - 04:37 PM
And again, that's me!))
Tell me how to clear the list of devices used by a computer and connected with the aid of a modem?

Explain.
I have 60 boilers. All of them are connected to a computer with a modem. Counter boilers 0 - 59. When I break one boiler or a modem and set it back, it takes a number 60, not the one who should be free between 0 and 59. How do you get to take your old boiler room, or how to remove all of these 0 - 59 boilers that used the numbering starts with 0?

In your "computer" folder, there should be a file called "lastid_boilerorsomething.txt". If you delete that, and break and replace every boiler (or set it to 58 and just replace the boiler that should be 59), then you should have your original network. Its a bit of a pain, but the only way due to how CC handles id allocation.

However, it would be better to modify your program to allow changing boiler IDs to support anything, rather than 0-59.
Byryndyk30 #36
Posted 01 November 2015 - 04:42 PM
Thank you.