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

OpenPeripherals and AE problem..

Started by Haimrich, 26 November 2013 - 09:05 AM
Haimrich #1
Posted 26 November 2013 - 10:05 AM
Hi! I'm modifing an Iron Man Room Code..

local stand = peripheral.wrap("appeng_me_tilestoragebus_3")
local low = 1

if stand == nil then error("No storage bus") end

local clearStand = function()
  stand.setPriority(low)
  for i=1,8 do powerNetwork(i) end
  sleep(wait)
  for i=1,8 do cutNetwork(i) end
end

clearStand()

But it give me "attempt to call nil" at line "stand.setPriority(low)".
Is "setpriority" a problem?
Bubba #2
Posted 26 November 2013 - 10:49 AM
It is possible that the documentation on this peripheral is incorrect (it is incorrect on a lot of them). You are trying to call a method that does not exist.

In order to see what methods are available, try this code:

for k,v in pairs(peripheral.getMethods("nameofperipheral")) do write(i.."\t") end

Look and see if there are any methods concerning the priority there - it may be named differently than what is in the documentation.

It is possible that the documentation on this peripheral is incorrect (it is incorrect on a lot of them). You are trying to call a method that does not exist.

In order to see what methods are available, try this code:

for k,v in pairs(peripheral.getMethods()) do write(i.."\t") end

Look and see if there are any methods concerning the priority there - it may be named differently than what is in the documentation.
Edited on 26 November 2013 - 09:59 AM
Lyqyd #3
Posted 26 November 2013 - 10:55 AM
Looks like your code there is a little borked, Bubba. Try this:


textutils.tabulate(peripheral.getMethods("appeng_me_tilestoragebus_3"))
Bubba #4
Posted 26 November 2013 - 11:01 AM
Looks like your code there is a little borked, Bubba. Try this:


textutils.tabulate(peripheral.getMethods("appeng_me_tilestoragebus_3"))

Whoops. Forgot the peripheral name as an argument. I always forget about textutils because I've been doing for loops since the beginning :)/>
Haimrich #5
Posted 26 November 2013 - 11:06 AM
Thanks C:
There isn't the method "setPriority"..