Jump to content




[mc 1.6.x] Openperipheral


  • This topic is locked This topic is locked
1184 replies to this topic

#601 Darvid

  • Members
  • 3 posts

Posted 02 August 2013 - 11:45 AM

Hey, I'm attempting to read the tank levels of a buildcraft machine (a squeezer to be exact), and so I'm trying to use the getTanks method, but when I attempt to run it, I'm told it requires a parameter, and I can't find out what it wants. I know it needs a string, but beyond that I can't tell what it wants passed to it, I can't find any documentation to help me, and the one video I found that briefly touched on this topic was interfacing with a tank, and he passed it "unknown", which does not work in my situation. Can anyone advise me on what I'm supposed to pass the function? Or preferably tell me where to find the info myself.

#602 KaoS

    Diabolical Coder

  • Members
  • 1,510 posts
  • LocationThat dark shadow under your bed...

Posted 02 August 2013 - 02:08 PM

getTanks needs a side I believe. Please take a look here for all your documentation needs. Mikee did a very good job on the documentation I think

#603 Woodside235

  • Members
  • 9 posts

Posted 02 August 2013 - 03:03 PM

View PostMikeemoo, on 25 May 2013 - 07:30 PM, said:

Also, at the moment I'm very aware that this is overpowered considering it costs nothing! I'll probably add a way for it to sink some resources. It'll probably be something like.. you drop redstone onto the computer and it'll give you a few thousand credits you can use for api calls.

If you do this can you add an option to turn it off for creative mode?
Also, this mod is freaking brilliant.

#604 Darvid

  • Members
  • 3 posts

Posted 02 August 2013 - 10:55 PM

View PostKaoS, on 02 August 2013 - 02:08 PM, said:

getTanks needs a side I believe. Please take a look here for all your documentation needs. Mikee did a very good job on the documentation I think

You sir are a lifesaver, both for the advice and the link, thank you. Funny thing, I had actually found that site before, but didn't understand how it was formatted, I get it now.

#605 Heavens

  • Members
  • 4 posts

Posted 04 August 2013 - 09:48 PM

I also do have a question about tanks especially about the Railcraft ones.
I've already made a topic over at ask a pro:
Spoiler

Am I doing something wrong or is there a bug with those tanks?
When I write the table to a monitor all I get is 1,0.

Thanks :)

#606 KaoS

    Diabolical Coder

  • Members
  • 1,510 posts
  • LocationThat dark shadow under your bed...

Posted 04 August 2013 - 11:37 PM

monitor.write(k, v)
should be
monitor.write(k.." - "..v)
because write does not accept multiple params

#607 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 05 August 2013 - 08:46 AM

View PostHeavens, on 04 August 2013 - 09:48 PM, said:

I also do have a question about tanks especially about the Railcraft ones.
I've already made a topic over at ask a pro:
Spoiler

Am I doing something wrong or is there a bug with those tanks?
When I write the table to a monitor all I get is 1,0.

Thanks :)

Hover over parameters in the documentation.

"side" should be a global side ("north", "south", "east", "west", "up" or "down")

#608 Heavens

  • Members
  • 4 posts

Posted 05 August 2013 - 09:11 AM

I'm sorry but I'm kinda lost here :D

With your line I get:
watertank:6 attempt to concatenate string and table

So basically it's a table inside a table? Which puts me back to the problem of not understanding how to handle tables -.-
Note to self: read a book on tables

#609 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 05 August 2013 - 01:31 PM

Yay, I named the 'Advanced Combat Processor' :)

#610 lendrick

  • New Members
  • 1 posts

Posted 05 August 2013 - 05:02 PM

I'm running OpenPeripheral in FTB Unleashed, and I'm trying to build a mob defense system. I find the proximity sensor very useful for this, but it would be a bit easier to work with if there were an isHostile() function (perhaps also isNeutral()). Right now I have to program it specifically by mob name, and it would be nice if it just worked on all hostile entities. Is that something that would be doable?

#611 DarkEspeon

  • Members
  • 57 posts

Posted 05 August 2013 - 09:48 PM

local ironTankValve = peripheral.wrap("back")
local monitor = peripheral.wrap("top")
local tableInfo = ironTankValve.getTanks("back")

for k, v in pairs(tableInfo) do
  monitor.write(k, v)
end

Try this
local ironTankValve = peripheral.wrap("back")
local monitor = peripheral.wrap("top")
local tableInfo = ironTankValve.getTanks("unknown")

for k, v in pairs(tableInfo) do
  for x, y in pairs(v) do
	monitor.write(k .. ":" .. x .. ":" .. y)
  end
end
use unknown for getTanks so it doesn't matter, it will just get the tanks no matter what.

#612 AlFox

  • New Members
  • 1 posts

Posted 06 August 2013 - 05:10 AM

Hi, Mikeemoo!
Can you give a pastebin of this video?
https://www.youtube....h?v=mpDSdBWtHbA

#613 Nathan1852

  • Members
  • 30 posts

Posted 06 August 2013 - 05:11 AM

Does the .getTanks("unknown") still work in 1.6.2 for Endertanks?
I couldn't get it to work

Also nothing relatet to Forestry will work...

#614 lefty

  • New Members
  • 2 posts

Posted 06 August 2013 - 10:45 AM

Does anyone else get an smp crash on startup: testing 0.1.10/0.1.11 because of mps
http://pastebin.com/uDsqDnNf ?

#615 KiwiUSA

  • New Members
  • 1 posts

Posted 06 August 2013 - 08:00 PM

Hi all, new here so apologies if I missed something in the thread.

Is there a way to measure the "Network Saturation" of a Thermal Expansion Redstone Energy Conduit?


http://thermalexpans....com/Multimeter


#616 btbenedi

  • Members
  • 3 posts

Posted 07 August 2013 - 11:43 AM

View Postbtbenedi, on 01 August 2013 - 05:26 PM, said:

I saw in another thread that a bug with Command Blocks was mentioned where peripheral.getMethods(side) was returning "listMethods" instead of "getCommand,setCommand,runCommand" and you (edit: Mikeemo) noted that it would be fixed the in the next release. We are currently running 0.1.9 and this bug exists.

The next release, 0.2.0, after you mentioned this, went from minecraft version 1.5 to 1.6.

Since FTB is using OP and will be 1.5 for a little bit, is it possible to get a release that is 1.5.2 compatible that contains this fix? It would be greatly appreciated since the server I am an Admin on is switching from FTB Ultimate to FTB Unleashed, we would love to include OP obviously (I mean Glass?! seriously, that's epic) and we would hate to exclude OP just for this little bug.

We are planning on using command blocks as proximity sensors on the server using a dynamic /testfor command.

Could I get an answer to this please? :) It would be greatly appreciated!

#617 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 07 August 2013 - 01:20 PM

View Postbtbenedi, on 07 August 2013 - 11:43 AM, said:

View Postbtbenedi, on 01 August 2013 - 05:26 PM, said:

I saw in another thread that a bug with Command Blocks was mentioned where peripheral.getMethods(side) was returning "listMethods" instead of "getCommand,setCommand,runCommand" and you (edit: Mikeemo) noted that it would be fixed the in the next release. We are currently running 0.1.9 and this bug exists.

The next release, 0.2.0, after you mentioned this, went from minecraft version 1.5 to 1.6.

Since FTB is using OP and will be 1.5 for a little bit, is it possible to get a release that is 1.5.2 compatible that contains this fix? It would be greatly appreciated since the server I am an Admin on is switching from FTB Ultimate to FTB Unleashed, we would love to include OP obviously (I mean Glass?! seriously, that's epic) and we would hate to exclude OP just for this little bug.

We are planning on using command blocks as proximity sensors on the server using a dynamic /testfor command.

Could I get an answer to this please? :) It would be greatly appreciated!

Is/will be fixed in 1.6.2. I wont be backporting the fix to 1.5.2 though.

#618 lefty

  • New Members
  • 2 posts

Posted 07 August 2013 - 04:45 PM

View PostMikeemoo, on 07 August 2013 - 01:20 PM, said:

Is/will be fixed in 1.6.2. I wont be backporting the fix to 1.5.2 though.
What about the smp startup crash? :/ http://pastebin.com/uDsqDnNf

#619 Frederikam

  • Members
  • 112 posts
  • LocationDenmark

Posted 08 August 2013 - 07:27 AM

I'm having a bit of problem with the colors on the terminal glasses, I.E. if i type in;

terminalGlassesBridge.addText(0, 0, "Hello World", 1)

The text color is black, where '1' would normally stand for white. If I would be to use 32768 instead of 1 I would get green text, where 32768 is black.

Also every time I clear the glasses to rewrite a line I get a flicking effect, is there any way to avoid that? I'm using code similar to this;

glasses = peripheral.wrap("left")
while true do
    glasses.clear()
    glasses.addText(0, 0, "Hello World", 1)
    os.sleep(0.5)
end


#620 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 08 August 2013 - 07:32 AM

View PostFrederikam, on 08 August 2013 - 07:27 AM, said:

The text color is black, where '1' would normally stand for white. If I would be to use 32768 instead of 1 I would get green text, where 32768 is black.
That is because this does not use the ComputerCraft/minecraft colouring system of just 16 colours.... you can have all 16,777,216 colours (256^3, rgb, I'm ignoring alpha)... this is because it uses the HEX colour system where the colour is formatted as #RRGGBB... each set of two is a hex number between 00 (dec 0) and FF (dec 255)... I've created a useful function if you know some RGB values that converts from RGB into hex...

local function rgbToHex( _r, _g, _b )
  return bit.bor(bit.blshift(bit.bor(bit.blshift(_r, 8), _g), 8), _B)/>/>/>
end

View PostFrederikam, on 08 August 2013 - 07:27 AM, said:

Also every time I clear the glasses to rewrite a line I get a flicking effect, is there any way to avoid that?
Don't clear it! If you store the returned object from the addText/addBox call there are setters for it that allow you to change it without causing a flicker





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users