174 posts
Posted 20 January 2013 - 04:11 AM
Every time i try to run peripheral.getMethods() on an ICBMLauncher it just returns "table: 502cb323" or something like that. Am i doing something wrong?
7508 posts
Location
Australia
Posted 20 January 2013 - 04:15 AM
no this is correct… peripheral.getMethods() returns a table of all the methods you can call on the peripheral… to look at these functions names just do this
for k,_ in pairs( peripheral.getMethods( side ) ) do
print( k )
end
174 posts
Posted 20 January 2013 - 04:19 AM
Oh… ok then.
2005 posts
Posted 20 January 2013 - 04:36 AM
To actually use those methods, you'll need to assign the table:
local tpm = peripheral.getMethods(side)
for k in pairs(tpm) do
print(k)
end
Use tpm.methodName() to call the method listed as methodName (or tpm.whatever() to call whatever).
Edited on 20 January 2013 - 03:36 AM
174 posts
Posted 20 January 2013 - 04:43 AM
Ok new problem. The methods are all just numbers. So how do I use it?
7508 posts
Location
Australia
Posted 20 January 2013 - 04:49 AM
Ok new problem. The methods are all just numbers. So how do I use it?
is that using the loop? if it is make this change
for _, v in pairs( peripheral.getMethods( side ) ) do
print( v )
end
that will get you the method names…. i forgot that ICBM has their methods thing done wrong…
EDIT:
how all peripherals react with the getMethods…
{ function name, the actual function! }
how ICBM reacts with the getMethods…
{ function name }
it doesn't actually get the methods, it gets their name…… stupid ICBM devs…
Edited on 20 January 2013 - 03:51 AM
174 posts
Posted 20 January 2013 - 04:59 AM
Yes! Got it working now!