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

Need help with a code

Started by Snappletree_HD, 05 January 2016 - 11:07 PM
Snappletree_HD #1
Posted 06 January 2016 - 12:07 AM
My friend made a cc code for me a long time ago when i tried to use it recently it isn't working can someone help me. Line 1 is causing the problem for me.

-- FarmControl
-- By Anavrins
buttons = dofile("/libs/buttonLib")		
gui = {}
toDraw = {}
defaults = {}
screen = term
screensize = 1
tabs = 1
tabIndex = 1
redraw = true
cableside = "back"
cablestate = 0
crashlogPath = "/.crashlog"
visualBundledCable = true
clickEvent = "mouse_click"
mX, mY = screen.getSize()
cX, cY = math.ceil(mX / 2), math.ceil(mY / 2)
Edited by
Lyqyd #2
Posted 06 January 2016 - 12:49 AM
Moved to Ask a Pro.
HPWebcamAble #3
Posted 06 January 2016 - 01:38 AM
According to the comment at the top, this was made by [member='Anavrins'], who is a semi-active member on the forums. Just a wanted to mention.

So line four is 'local gui = {}', which shouldn't cause a problem. However line 3 includes a 'dofile', which might error if the directory or file doesn't exist. Possibly other reasons too.
What is the exact error you are getting?

Also, this is clearly not the entire code. If it's more than 30 lines or so, put it on www.pastebin.com and stick a link here so we can see the whole thing.
Snappletree_HD #4
Posted 06 January 2016 - 09:18 PM
the paste bin is http://pastebin.com/996k2K8B. The error I'm getting is "buttonLib:2: attempt to index ? (nail value)
Edited by
Bomb Bloke #5
Posted 06 January 2016 - 10:48 PM
In that case, we may need to see the source of "buttonLib".
Snappletree_HD #6
Posted 07 January 2016 - 12:10 AM
There isn't a source of buttonLib I'm thinking you need to download your own button api.
KingofGamesYami #7
Posted 07 January 2016 - 01:22 AM
There isn't a source of buttonLib I'm thinking you need to download your own button api.

You couldn't have an error with buttonLib in the name if buttonLib didn't exist.

pastebin put libs/buttonLib
HPWebcamAble #8
Posted 07 January 2016 - 01:27 AM
There isn't a source of buttonLib I'm thinking you need to download your own button api.

You might want to directly message Anavrins, looks like he was on today but obviously didn't see this topic.

I imagine he'll be able to answer any questions about this pretty thoroughly.
Edited on 07 January 2016 - 12:27 AM
Anavrins #9
Posted 07 January 2016 - 02:39 AM
Here's the api I used in this
qV2wdxV7
You can change the path of the file as long as you change dofile("libs/buttonLib") accordingly.
Edited on 07 January 2016 - 01:45 AM
Bomb Bloke #10
Posted 07 January 2016 - 03:07 AM
So, line two:

-- By Anavrins

Well, Anavrins, I'm sorry, but you're a nail value.

Snappletree_HD, you may need to redownload that file using the paste ID above.
Snappletree_HD #11
Posted 08 January 2016 - 12:15 AM
Got the button part to work but the code doesn't output the redstone signals and the little button on the top left crashes the program :(/>
Edited on 07 January 2016 - 11:46 PM
Anavrins #12
Posted 09 January 2016 - 04:18 AM
Do you still play on Paradise Reloaded?, I might hop on to check it out.
Haven't tried this thing in ages. :P/>
Snappletree_HD #13
Posted 10 January 2016 - 12:42 PM
the server is down and we are changing mod packs. I love the code because it does what i want it to do XD if only it could emit the redstone signal with the corresponding color wire
Edited on 10 January 2016 - 11:43 AM
Lupus590 #14
Posted 10 January 2016 - 02:46 PM
Just going to leave this here: http://computercraft.info/wiki/Redstone_%28API%29