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

touchpoint error

Started by CCJJSax, 09 December 2013 - 05:35 PM
CCJJSax #1
Posted 09 December 2013 - 06:35 PM
I'm hesitant to post this cause the code is rather long. But I have been trying to add buttons using Lyqyd's touchpoint API. When I push a button it bugs on line 104 of touchpoint.

My main program http://pastebin.com/jtavdHcW (see spoiler for where I think some key points of this is.)
Spoilerline 60. confirm() function uses some touchpoint, but I don't think it's the cause. this isn't working much so I don't think I'm calling it.
line 86. display() function is where I add the buttons.
line 221. main chunk. Does more than just buttons.

I really hope these lines help you out.
I set the paste to expire in a month (for you potential viewers of this post from the future)

Lyqyd's touchpoint API CC page http://www.computerc...touchpoint-api/
Direct link to pastebin link for Lyqyd's touchpoint http://pastebin.com/pFHeia96 ( I wanted to give proper credit )

Spoilerthe error I get is

touchpoint:104: attempt to index ? (a nil value)

itemList.lua (I wouldn't bother looking at the spoiler)

SpoilerI'm almost 100% positive it's not here, good thing too because its nearly 700 KB of data, and pastebin basic only allows up to 500 KB per paste.

note that the program is largely unfinished and dirty right now. feedback is always appreciated however. I hope I covered all the bases.
Edited on 09 December 2013 - 05:38 PM
Kingdaro #2
Posted 09 December 2013 - 07:01 PM
I believe the problem is in line 236:
touch:toggleButton(p1)
The variable "p1" isn't actually in this scope. Touchpoint tries to toggle self.buttonList[nil], essentially.
CCJJSax #3
Posted 09 December 2013 - 07:18 PM
I believe the problem is in line 236:
touch:toggleButton(p1)
The variable "p1" isn't actually in this scope. Touchpoint tries to toggle self.buttonList[nil], essentially.

I don't know why I didn't see that before lol. thanks. You're right.