Jump to content




Failing for no reason


  • You cannot reply to this topic
8 replies to this topic

#1 Creeper9207

  • Members
  • 211 posts

Posted 17 May 2015 - 03:38 PM

I get an Attempt to index ? (a function value) on line 5 for no reason

Code (screenshot API)
Spoiler


#2 Creeper9207

  • Members
  • 211 posts

Posted 17 May 2015 - 03:46 PM

Also, Can someone PLEASE give me some kind of walkthrough on how taking a cc screenshot would work? :(

#3 flaghacker

  • Members
  • 655 posts

Posted 17 May 2015 - 04:16 PM

1)
term.native is a function, not a table. To receive the table you want, you must call that function:
term = term.native ()
The error message explains this too, you're "attempting to index (use as a table) a function"

2)
Overwrite all of term's functions to write to a buffer while still writing to the screen. When you want to take a screenshot, simply read the buffer.

Edited by flaghacker, 17 May 2015 - 04:18 PM.


#4 Creeper9207

  • Members
  • 211 posts

Posted 17 May 2015 - 04:21 PM

1) thanks!
2) i have no idea how to do that, please explain

Edited by Creeper9207, 17 May 2015 - 04:24 PM.


#5 flaghacker

  • Members
  • 655 posts

Posted 17 May 2015 - 04:34 PM

1) np
2) I would like to write an explenation here, but I'm on my phone right now and typing goes sloooow... Maybe you can take a look at this program to get an idea about how it's done?

#6 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 17 May 2015 - 04:43 PM

It is important to note that term.native was a table until the version that added term.current() and changed how terminal redirecting worked.

#7 flaghacker

  • Members
  • 655 posts

Posted 17 May 2015 - 05:48 PM

View PostLyqyd, on 17 May 2015 - 04:43 PM, said:

It is important to note that term.native was a table until the version that added term.current() and changed how terminal redirecting worked.

I figured it was enough to link him to the wiki page, thanks for the clarification though.

#8 Creeper9207

  • Members
  • 211 posts

Posted 17 May 2015 - 05:57 PM

thanks for the effort, but that program's pastebin was 404

#9 Creeper9207

  • Members
  • 211 posts

Posted 17 May 2015 - 07:27 PM

SOLVED thank you for the help





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users