Jump to content




[mc 1.6.x] Openperipheral


1184 replies to this topic

#921 TehTub

  • Members
  • 4 posts

Posted 10 December 2013 - 03:37 PM

i have an issue I believe is the result of OpenPeripherals. Some basic info

ComputerCraft version: 1.53
OpenPeripherial Version: 0.1.9
Minecraft Version: 1.5.2
This is a Tekkit 1.1.8 server running MCPC+ for bukkit compatibility.
Command Block support is enabled in both the server properties file and the ComputerCraft.cfg file.

Issue:
I'm attempting to run commands via CommandBlock API (the native support as a peripheral for Computercraft) however the only method available to me is "listMethods"

Running this code:
local cmd = peripheral.wrap("left" --CommandBlock side
for k, v in pairs(cmd) do
   print(k)
end

Outputs:
listMethods

I've searched around and saw that this was in issue before between OpenPeripherals 0.1.7 and 0.1.8 however I had assumed it was resolved. It is apparently not. Is there anything I can do to resolve this? Updating(or downgrading) is not an option since I think OP is now both client side and server side, and I can't modify my players modpack, or expect them to be able to do so themselves. Thank you for any assistance you may lend me.

#922 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 10 December 2013 - 07:50 PM

View PostTehTub, on 10 December 2013 - 03:37 PM, said:

-snip-
Same report on GitHub, I explain HOW it has been fixed

Edited by theoriginalbit, 10 December 2013 - 07:50 PM.


#923 TehTub

  • Members
  • 4 posts

Posted 10 December 2013 - 08:23 PM

View Posttheoriginalbit, on 10 December 2013 - 07:50 PM, said:

View PostTehTub, on 10 December 2013 - 03:37 PM, said:

-snip-
Same report on GitHub, I explain HOW it has been fixed

So it has been resolved in a future version. But theres no way I can fix it for my players. Thank you for your help and timly reply. Surprised my searches didn't turn up that GitHub report, else I wouldn't have wasted your time. Regardless, the Open mods are by far some of the most fun mods to play with and I'm looking forward to the combination of OpenSensors into OpenPeripherals.

Again thank you.

#924 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 10 December 2013 - 08:55 PM

View PostTehTub, on 10 December 2013 - 08:23 PM, said:

So it has been resolved in a future version. But theres no way I can fix it for my players.
Future (unreleased) version of ComputerCraft. Unfortunately there is no fix.

View PostTehTub, on 10 December 2013 - 08:23 PM, said:

Thank you for your help and timly reply. Surprised my searches didn't turn up that GitHub report, else I wouldn't have wasted your time.
No problems, it's what I'm here for :)

View PostTehTub, on 10 December 2013 - 08:23 PM, said:

Regardless, the Open mods are by far some of the most fun mods to play with and I'm looking forward to the combination of OpenSensors into OpenPeripherals.
That's good to hear :) The sensors have been merged into OpenPeripheral for quite a while now...

#925 Blargmode

  • Members
  • 5 posts

Posted 10 December 2013 - 10:04 PM

Hmm... The push() peripheral function doesn't seem to work anymore (in 1.6.4). I'm doing the exact same thing as in 1.5.2 and as it says in the documentation, but I only get the "attempt to call nil" error. Have tried with all kinds of chests and in every direction I can think of, still nothing.

Is it broken? Or maybe it has changed?

#926 Molinko

  • Members
  • 54 posts

Posted 10 December 2013 - 10:21 PM

I've notice that with Gregtech and/or IC2 Silislime and Thin Wire have recipe conflicts. Are there any plans to add alternate recipes so this doesnt happen too often?? After all Gregtech and IC2 are pretty common mods to have a recipe conflict with. Is there a workaround i can do or is there a way for me to switch the recipe?

#927 dariys

  • Members
  • 14 posts

Posted 12 December 2013 - 01:36 AM

I was trying to utilize coroutines and was planning to have some inventory management done within a coroutine. There appears to be some issue with it.

function test()
  print("Started")
 
  local c = peripheral.wrap("top")
  c.condenseItems()
 
  print("Condensed items")
 
  coroutine.yeild()
 
  print("Exiting function")
end
function test2()
  print("Started")
 
  local m = peripheral.wrap("right")
  m.transmit(1, 1, "Test")
 
  print("Trasmission complete")
 
  coroutine.yeild()
 
  print("Exiting function")
end
print("Creating coroutine")
local co = coroutine.create(test2)
print("Resuming coroutine")
coroutine.resume(co)
local status, arg1 = coroutine.resume(co)
print('Status:', status)
print('arg1: ', arg1)
local chest = peripheral.wrap("top")
chest.condenseItems()
print("Creating coroutine")
local co = coroutine.create(test)
coroutine.resume(co)
local status, arg1 = coroutine.resume(co)
print('Status:', status)
print('arg1: ', arg1)

Running this code on a computer with a chest on top, and a modem on the right - the first coroutine (function test2) appears to work (testing wrapping a modem & trasmitting). The second coroutine call returns an error, complaining about line 5 - the call to condenseItems.

#928 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 12 December 2013 - 01:46 AM

View PostMolinko, on 10 December 2013 - 10:21 PM, said:

I've notice that with Gregtech and/or IC2 Silislime and Thin Wire have recipe conflicts. Are there any plans to add alternate recipes so this doesnt happen too often?? After all Gregtech and IC2 are pretty common mods to have a recipe conflict with. Is there a workaround i can do or is there a way for me to switch the recipe?
GregTech conflict with Sillislime is known. What is the conflict for Thin Wire?
The work around is to remove GregTech. :P

View Postdariys, on 12 December 2013 - 01:36 AM, said:

-snip-
Why are you using coroutines there? o.O Ignoring that you're using them wrong, they're pointless in this situation as well, you've got no loop!!!

In any case, which version of OpenPeripheral are you using? iirc in the latest version it is condenseAllItems not condenseItems. Although this can be confirmed by checking against the in-game list of methods on the chest.

for k,v in pairs(peripheral.getMethods("top")) do
  print(v)
  os.pullEvent("key")
end
press a key to have it advance to the next method you can call on the chest.

Edited by theoriginalbit, 12 December 2013 - 01:47 AM.


#929 dariys

  • Members
  • 14 posts

Posted 12 December 2013 - 02:09 AM

Quote

Why are you using coroutines there? o.O Ignoring that you're using them wrong, they're pointless in this situation as well, you've got no loop!!!

In any case, which version of OpenPeripheral are you using? iirc in the latest version it is condenseAllItems not condenseItems. Although this can be confirmed by checking against the in-game list of methods on the chest.

This was just a piece of sample code to demonstrate the issue. There is a call outside the coroutine in that sample, setup exactly the same, that works just fine. The one inside the coroutine fails. In fact, any of the peripheral calls that aren't computercraft appear to fail in that scenario. I was working with a chest and a nuclear reactor, and getHeat, condenseItems, pullItem, etc all were having issues being run from a coroutine, where I had gotten a set of functions that would work quite readily by themselves - once I tied them into a coroutine, I was having errors at the first peripheral call encountered.

#930 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 12 December 2013 - 02:20 AM

View Postdariys, on 12 December 2013 - 02:09 AM, said:

-snip-
What is the exact error message? attempt to index or attempt to call?

#931 dariys

  • Members
  • 14 posts

Posted 12 December 2013 - 09:54 AM

View Posttheoriginalbit, on 12 December 2013 - 02:20 AM, said:

View Postdariys, on 12 December 2013 - 02:09 AM, said:

-snip-
What is the exact error message? attempt to index or attempt to call?

I'm not sure the actual error - it's not bubbling up to the running thread. Coroutine.resume(...) is returning a status of false, and first argument of a line number. In this case, arg1 is 'coroutineTest:5: 0'. Line 5 refers to the condenseItems call. I have no idea what the 0 refers to.

#932 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 12 December 2013 - 07:35 PM

View Postdariys, on 12 December 2013 - 09:54 AM, said:

I'm not sure the actual error - it's not bubbling up to the running thread. Coroutine.resume(...) is returning a status of false, and first argument of a line number. In this case, arg1 is 'coroutineTest:5: 0'. Line 5 refers to the condenseItems call. I have no idea what the 0 refers to.
Ugh that stupid bug with the error messages, that was fixed SO long ago :( can you check the server's (or client if its not on a server) log and see if there is any more information there (I cannot remember if there is or not)

Also what version of OpenPeripheral do you have, I'll run my own tests.

#933 dariys

  • Members
  • 14 posts

Posted 13 December 2013 - 12:42 AM

View Posttheoriginalbit, on 12 December 2013 - 07:35 PM, said:

Ugh that stupid bug with the error messages, that was fixed SO long ago :( can you check the server's (or client if its not on a server) log and see if there is any more information there (I cannot remember if there is or not)

Also what version of OpenPeripheral do you have, I'll run my own tests.

I've seen it on computercraft 1.57 with openperipherals snapshot 103, and then upgraded last night to computercraft 1.58 with snapshot 107.

There do not appear to be any errors in any of the logs associated with the program failure.

#934 Ashton

  • Members
  • 44 posts

Posted 13 December 2013 - 01:19 AM

IF this has been asked before I appologize, but is there any way to change the range of the remote? (perhaps to infinite) I've made it uncraftable, used only for admin purposes (actually all of CC is uncraftable, it's just for running the back-side of dungeons on my server), so it would be nice to access the PCs from anywhere in the game without having to fight the wireless modems and adding tons of code...

#935 kelevra.1337

  • Members
  • 31 posts

Posted 13 December 2013 - 06:02 PM

Hey everyone,

I havent used openperipherals for a while and was quite confused about the new method names and all that stuff. Since i couldnt find any documentation outside of the game and the one inside was way to messy for me i wrote a small function to save all the data provided by getAdvancedMethodsData kinda sorted in a file.

function getInfo(AdvancedMethodsData,filename)
local file = fs.open(filename,"w")
for i,v in pairs(AdvancedMethodsData) do
  file.write("["..tostring(i).."] = ")
  file.write(v["name"].." args: ")
  if type(v["args"]) == "table" then
   for a,s in pairs(v["args"]) do
	file.write(s["name"]..",")
   end
  end
  file.write("Description: ")
  file.writeLine(v["description"])
end
file.close()
end

-- Example

local mec = peripheral.wrap("front")
local data = mec.getAdvancedMethodsData()
getInfo(data, "d")

Not sure if this is helpfull but it sure helped me.

TL;dr: function that spitts out info about openperipheral functions.

#936 SnowsongWolf

  • Members
  • 8 posts

Posted 14 December 2013 - 03:17 PM

I'm having issues with getTankInfo(), specifically that the resulting table has a string that I think is supposed to point to another table returned. This is my code:

term.clear()
term.setCursorPos(1,1)
local tank = peripheral.wrap("back")
local dirs = {"north", "south", "east", "west", "up", "down", "unknown"}
for _, side in pairs(dirs) do
  print(side..": "..tostring(tank.getTankInfo(side)))
end
print ("")
unkTank = tank.getTankInfo("unknown")
for i,v in pairs(unkTank) do
  print (i..": "..tostring(v))
end

And when I run it this is the output:
north: table: 494fded9
south: table: 7fb8a36e
east: table: 20999e7d
west: table: 4f4e4954
up: table: 7bf694a5
down: table: 330b9d3f
unknown: table: 18f030e3

1: net.minecraftforge.fluids.FluidTankInfo@411993df

I'm using the version of OpenPeripheral in the Direwolf20 1.6.4 pack (1.0.0 since 1.0.2 has a memory issue).

**EDIT** The above example was using a BC tank filled with some lava but it gives similar output with a Railcraft tank (showing 2 entries in the Unknown side table, both strings again).

Edited by SnowsongWolf, 14 December 2013 - 03:35 PM.


#937 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 14 December 2013 - 03:40 PM

When you tostring() a table, it returns a string that has "table: " and an eight-digit hex identifier. You need to actually iterate the values in that subtable or use textutils.serialize before you try to print it.

#938 gknova61

  • Members
  • 74 posts

Posted 14 December 2013 - 05:04 PM

Does OpenPeripheral 1.6.2 still support Ironchests? It's not in the docs.

Edited by gknova61, 14 December 2013 - 05:04 PM.


#939 Blargmode

  • Members
  • 5 posts

Posted 14 December 2013 - 07:12 PM

View Postkelevra.1337, on 13 December 2013 - 06:02 PM, said:

Hey everyone,

I havent used openperipherals for a while and was quite confused about the new method names and all that stuff. Since i couldnt find any documentation outside of the game and the one inside was way to messy for me i wrote a small function to save all the data provided by getAdvancedMethodsData kinda sorted in a file.

function getInfo(AdvancedMethodsData,filename)
local file = fs.open(filename,"w")
for i,v in pairs(AdvancedMethodsData) do
  file.write("["..tostring(i).."] = ")
  file.write(v["name"].." args: ")
  if type(v["args"]) == "table" then
   for a,s in pairs(v["args"]) do
	file.write(s["name"]..",")
   end
  end
  file.write("Description: ")
  file.writeLine(v["description"])
end
file.close()
end

-- Example

local mec = peripheral.wrap("front")
local data = mec.getAdvancedMethodsData()
getInfo(data, "d")

Not sure if this is helpfull but it sure helped me.

TL;dr: function that spitts out info about openperipheral functions.

Tanks! I found it very helpful as well :)

#940 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 14 December 2013 - 09:45 PM

View PostAshton, on 13 December 2013 - 01:19 AM, said:

IF this has been asked before I appologize, but is there any way to change the range of the remote?
Not that I know of, and its not going to happen anytime in the near future.

View Postgknova61, on 14 December 2013 - 05:04 PM, said:

Does OpenPeripheral 1.6.2 still support Ironchests? It's not in the docs.
of course. OpenPeripheral supports ANY inventory.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users