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

startup:29: attempt to index? (nil value)

Started by majo, 10 June 2014 - 05:17 PM
majo #1
Posted 10 June 2014 - 07:17 PM
Hey guys, I've found a nice program for CC that could give me informations about machines, power, crafting etc. but I have a problem with it (title). Could you look at this? Http://Pastebin.Com/QWqDv2Ck Btw. I'm using CC 1.58, OpenModsLib 0.4b and other addons for this version, I know that version is old but there is the same problem on the latest version of CC and addons.
GamerNebulae #2
Posted 10 June 2014 - 07:21 PM
It basically means that it doesn't know what to do with

mon.clear()
Are you sure that you declared all the variables right?
majo #3
Posted 10 June 2014 - 09:03 PM
Man, I'm really beginner in lua, it's not my program, I've just found it on the polish youtuber's channel. I know that is something wrong with this line, but I really don't know what.
Lyqyd #4
Posted 10 June 2014 - 09:14 PM
What were the names of the monitors on the wired network when you hooked them up? I'd bet none of them were monitor_6. You'll need to adjust the peripheral names there to reflect which ones are actually connected.
GamerNebulae #5
Posted 10 June 2014 - 09:25 PM
Man, I'm really beginner in lua, it's not my program, I've just found it on the polish youtuber's channel. I know that is something wrong with this line, but I really don't know what.

That's the problem. Try to understand how peripherals work a little bit, change some variables and it works. That's the problem with getting random programs from people. They are always adapted to the way they play the game.
majo #6
Posted 10 June 2014 - 09:48 PM
This was working for other people (I don't know how). I was trying to change names of monitors on that which my adv. computer was showing, monitor_0 etc, but then I got other errors, like something's wrong in the line 339 or in these lines near to 29 (30, 31…).
GamerNebulae #7
Posted 10 June 2014 - 10:06 PM
This was working for other people (I don't know how). I was trying to change names of monitors on that which my adv. computer was showing, monitor_0 etc, but then I got other errors, like something's wrong in the line 339 or in these lines near to 29 (30, 31…).

Paste full errors please. Otherwise we don't know what the hell is happening.
majo #8
Posted 10 June 2014 - 10:11 PM
Ok, I changed some names, but now there is error in line 132 (startup:132: attempt to index ? (a nil value). I changed names on these which my wired modems showed me (monitor_0, monitor_1 etc.). There is new code: http://pastebin.com/ztaMVkW7 Now I really don't know what is going wrong.
Btw. If I didn't paste full error, it means that is the same error which was (now with other line) :P/>
Edited on 10 June 2014 - 08:53 PM
GamerNebulae #9
Posted 10 June 2014 - 10:57 PM
You didn't give the functions any variables.

function disTankBar(tankProc,monBar,x1PosBar,x2PosBar,yPosBar)
  ...
end
The words between the parenthesis are variables that are used within that function.
majo #10
Posted 10 June 2014 - 11:02 PM
Eh, it means that this program is not usable for me. I don't know how to make it work, other people have written that it is working, but it doesn't for me :/
Edited on 10 June 2014 - 09:02 PM
GamerNebulae #11
Posted 10 June 2014 - 11:17 PM
Eh, it means that this program is not usable for me. I don't know how to make it work, other people have written that it is working, but it doesn't for me :/

Better stolen then bad made up (really bad translated Dutch saying). But if you want any tips, tricks or help, my Skype is ivohuntjens. If you learn the basics, I'll teach you some good tricks.
majo #12
Posted 10 June 2014 - 11:20 PM
Thanks for Skype id but I think that I won't learn lua right now (I don't have time to do + I will have a summer job soon). I will ask on other forums, maybe they could correct it to be useful. Or maybe you know similar program? I just need information about available power in my system :c I was trying Redstone Flux Control Center and similar EUCC but it's not this, I need everything on one monitor like in topic's program.
Edited on 10 June 2014 - 09:21 PM
GamerNebulae #13
Posted 10 June 2014 - 11:21 PM
Thanks for Skype id but I think that I won't learn lua right now (I don't have time to do + I will have a summer job soon). I will ask on other forums, maybe they could correct it to be useful. Or maybe you know similar program? I just need information about available power in my system :c

You ONLY need to know how much EU / RF/ MJ / whatever there is in a storage device?
majo #14
Posted 10 June 2014 - 11:34 PM
Yes, maybe in multi storages including MFSU, Redstone Energy Cell etc. And I would like to have it in one program :x
@edit: Or I will just Energy Cells from ThermalExpansion and Cubes from Mekanism + universal cables from Mekanism to storage energy, to get information about energy I will use Redstone Flux Control Center :)/>
Edited on 10 June 2014 - 09:47 PM
majo #15
Posted 11 June 2014 - 10:04 PM
Hey! I've just solved this problem! :)/> I had to change only lines 21, 22, 23, 24 from monitor_6 etc to monitor_0, monitor_1 etc :D/> Now it's working fine, it is showing me all needed info.