Jump to content




"pastebin" erroring



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

#1 NOTUSEDPLEASEDELETE

  • Members
  • 70 posts

Posted 22 January 2014 - 12:49 AM

The program "pastebin" errors with:

pastebin:101: attempt to index ? (a nil value)


#2 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 22 January 2014 - 03:07 AM

You probably overwritten the program yourself, because pastebin works for me and everyone else who don't have a modified pastebin

#3 CometWolf

  • Members
  • 1,283 posts

Posted 22 January 2014 - 03:53 AM

Can't really overwrite a program in rom/programs, as it is read-only. Unless he did it externally i guess. He could however have put a program named pastebin in the root folder.

Try running edit pastebin and see if there's anything in the file.

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 22 January 2014 - 04:51 AM

It could be a replacement in root, or an overridden function. But I think it's rather more likely that he just threw some parameters at it that it can't make sense of.

What exactly led up to that error? You've only told a fraction of the story, Flick.

#5 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 22 January 2014 - 05:20 AM

Yea, taking a look at the pastebin file reveals this:
    -- GET the contents from pastebin
    local res = get(sCode)
    if res then	   
	    local file = fs.open( sPath, "w" )
	    file.write( res ) --this is line 101
	    file.close()
	   
	    print( "Downloaded as "..sFile )
    end

Which seems an unlikely error really, unless the path you're providing is full of weird characters maybe. You've probably got a custom rom or something. The programs are pretty well built to prevent errors.

#6 CometWolf

  • Members
  • 1,283 posts

Posted 22 January 2014 - 05:31 AM

Judging by the code Oeed posted, this might be the result of trying to save a paste to a non-existant folder.

#7 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 22 January 2014 - 05:47 AM

View PostCometWolf, on 22 January 2014 - 05:31 AM, said:

Judging by the code Oeed posted, this might be the result of trying to save a paste to a non-existant folder.

I just tried doing that, it throws a different error (line 92). But that's something that should be fxied.

For everyone's reference, here's the code of the vanilla pastebin (1.56).

Spoiler

It's even numbered :P

I keep a copy of the rom in a folder, it's very useful to reference. Especially if you don't have access to the wiki.

Edited by oeed, 22 January 2014 - 05:48 AM.


#8 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 22 January 2014 - 10:12 AM

Moved to Ask a Pro. Try reproducing this on a computer with no startup file after a fresh boot.

#9 NOTUSEDPLEASEDELETE

  • Members
  • 70 posts

Posted 31 January 2014 - 05:40 PM

Works now! Thanks for trying to help. Could this please be locked?

#10 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 31 January 2014 - 06:06 PM

View PostFlick, on 31 January 2014 - 05:40 PM, said:

Works now! Thanks for trying to help. Could this please be locked?

I've already done it, but in the future click the 'Report' button in the bottom right of the post and type 'Please lock this'.

Edited by oeed, 31 January 2014 - 06:06 PM.


#11 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 31 January 2014 - 06:48 PM

We generally don't lock Ask a Pro threads anyhow.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users