33 posts
Posted 22 December 2013 - 07:15 PM
A lot of the example code use some pretty interesting ways to display text and graphs usually on advanced computers.
I'm just trying to print a variable ;)/>
What am I doing wrong here? Either the variable is empty, or I'm doing something syntactically incorrect.. ;)/>
(It's my first program that actually does something)
pastebin.com/sfNtsJ3cThanks for any help.
Edited on 22 December 2013 - 06:15 PM
331 posts
Posted 22 December 2013 - 07:18 PM
call the function
local power = batbox.getStored()
edit: You may also want to add that into your while loop so the variable keeps updating with the current powerr
Edited on 22 December 2013 - 06:18 PM
882 posts
Location
Behind you.
Posted 22 December 2013 - 07:27 PM
local power = batbox.getStored() sets power to a number
Where you have print(power), change it to print(power())
33 posts
Posted 22 December 2013 - 07:52 PM
Yeah I've made those changes (including adding it to the while loop) but am now getting an error:
test:5: attempt to call nil
pastebin: jAMpt8vc
Edited on 22 December 2013 - 06:54 PM
7508 posts
Location
Australia
Posted 22 December 2013 - 08:21 PM
You may be using a newer version of OpenPeripheral, use getEUStored or getStoredEU (I can't remember which way around it is)
Edited on 23 December 2013 - 06:12 AM
33 posts
Posted 23 December 2013 - 02:16 AM
No worries thanks for the heads up.
(That may have been my original issue as I was originally copying code from oldish posts).
33 posts
Posted 23 December 2013 - 02:29 AM
Something weird going on, I am on an FTB server for 1.6.4 - latest version which came out last week - I'd imagine it's not using a version of OpenP that's too cutting edge given the 1.6.4 nature of it though.
I also tried MFSU Monitor here:
http://www.computerc...post__p__157694This is giving me the same issue.
Having written something to return the methods the correct method seems to be "getEUStored", however I'm still getting the attempt to call nil from that above program.
Edited on 23 December 2013 - 01:44 AM
33 posts
Posted 23 December 2013 - 02:54 AM
http://pastebin.com/pfqSjABJFinally got this working, thanks for all the help - onto the next iterations - I'll be back when I've made it 50 times more complicated lol
Edited on 23 December 2013 - 01:58 AM