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

Looking for temperature program

Started by TheFirstTempest, 26 February 2015 - 05:25 AM
TheFirstTempest #1
Posted 26 February 2015 - 06:25 AM
Hello Computercraft Professionals,

I am currently looking for a way to have my computer/monitor read and display a temperature readout from the temperature blocks in the Atomic Science Mod coming from Tekkit. I have tried messing around with the programming and OpenCCSensors but I have been unsuccessful. Any assistance would be greatly appreciated.
KingofGamesYami #2
Posted 26 February 2015 - 04:57 PM
1. Do you have OpenPeripherals?

2. What is the result of this:

local methods = peripheral.isPresent( "side" ) and peripheral.getMethods( "side" ) or {"No Methods"}
textutils.pagedTabulate( methods )
Lyqyd #3
Posted 26 February 2015 - 08:37 PM
I'll have to look into Atomic Science. We don't explicitly support that mod (yet!), so if it isn't using an interface we do already support, OpenCCSensors won't be able to read anything from it. If they have a sensible API to get information from their stuff, it shouldn't be too hard to add some sensing for it.

If you file an issue on OpenCCSensors' github repo (owned by Cloudhunter), it will be a more effective reminder for me to look in to this. Thanks!
TheFirstTempest #4
Posted 27 February 2015 - 03:32 AM
1. Do you have OpenPeripherals?

2. What is the result of this:

local methods = peripheral.isPresent( "side" ) and peripheral.getMethods( "side" ) or {"No Methods"}
textutils.pagedTabulate( methods )

I do have Open Peripherals.

I put in the code exactly as you said as a program. Named it temp, and ran it. At first it gave me "No Methods", but then I placed a sensor on top of it from OpenPeripherals. It spat out this:

getAdvanced Methods Data getMinecartData
getMinecartIds getMobData
getMobIds getPlayerData
getPlayerNames listMethods
sonicScan
Bomb Bloke #5
Posted 27 February 2015 - 06:23 AM
If you type into the command line eg:

openp/docs top getMinecardIds

… you should get some specifics on the usage of that function.
TheFirstTempest #6
Posted 27 February 2015 - 08:45 AM
If you type into the command line eg:

openp/docs top getMinecardIds

… you should get some specifics on the usage of that function.

Im not really sure how this is supposed to help me :(/> I did use it, and looked into the commands, but I don't know what to do with this information really.
TheFirstTempest #7
Posted 28 February 2015 - 01:41 AM
I managed to get something working with OpenPeripherals and the computer, but I still am not sure if Atomic Science can be read by OP and if that data can be read by the computer Craft terminals
TheFirstTempest #8
Posted 28 February 2015 - 03:58 AM
Sorry for the triple post. I found on the Atomic science thread on the minecraft forums that the mod author, Calclavia, said back in 2013 that they were adding Computercraft support. I don't know, but it might be worth a look for anyone that can help with possible codeing for me. I also attempted to use a peripheral proxy block attached to a temp block with a wired modem and hooked it up to the side of a pc. Im not sure what code to call, but they are connected.
Edited on 28 February 2015 - 03:12 AM
TheFirstTempest #9
Posted 05 March 2015 - 11:05 PM
Anyone?
Bomb Bloke #10
Posted 05 March 2015 - 11:51 PM
First check whether or not the block you want to use as a peripheral works as a peripheral - the code Yami gave you will indicate that, by either listing out a bunch of functions, or not. If you get "No methods" then that simply means your current mod cocktail isn't going to let you read the temperature directly.

If you get a bunch of functions, then try the command I gave you. If that works, then you 1) know that it's OpenPeripheral that's allowing ComputerCraft to interact with the block, and 2) you've got a description of whatever function you chose.

The peripheral proxy block is intended for use in situations where you want to place the computer somewhere a distance away from the block you wish to use as a peripheral. Normally you'd do this by placing wired modems on both the computer and peripheral, then linking them together with networking cable. However, you can only place wired modems on full blocks - so eg thaumcraft jars are a no-go. This is where the proxy comes in: You place that next to the desired peripheral, then the modem goes on that.

If a block won't act as a peripheral when placed directly beside a computer, then the peripheral proxy isn't going to help with the situation.

Even if the Atomic Science blocks don't work as peripherals, an OpenCCSensors device might be able to read the information you want remotely. Refer to this thread, and bear in mind that a sensor from OpenPeripherals isn't the same thing.
Edited on 05 March 2015 - 10:54 PM
TheFirstTempest #11
Posted 12 March 2015 - 02:15 AM
Well I did get that list of functions back. But I still am not familiar enough with coding in order to send and receive the information and display it.
blackrabt #12
Posted 13 March 2015 - 11:18 AM
I want to take a look into this. Could you tell me which version of the mods (atomic science and OpenCC) and minecraft you are using? Caveat: Not a pro, but still hope to make myself useful.
Edited on 13 March 2015 - 10:20 AM
TheFirstTempest #13
Posted 13 March 2015 - 09:19 PM
Whatever verseion the Tekkit modpack is using is what they are. I believe tekkit is running 1.6.4
blackrabt #14
Posted 15 March 2015 - 05:53 AM
I was able to get (via peripheral proxy):
getWarningTemperaturefunction
isAboveWarningTemperaturefunction
setWarningTemperaturefunction
getTermperaturefunction

However my tests with getTemperature keep returning nil. It may be stored as a table. Just print gives a blank space and textutils serialize returns nil. Also you don't have to include function, getTemperature seems to work just as well.


From the mod jar, I hope that is allowed.

  public String[] getMethodNames()
  {
    return new String[] { "getTemperature", "getWarningTemperature", "setWarningTemperature", "isAboveWarningTemperature" };
  }
 
Edited on 15 March 2015 - 10:29 AM