Jump to content




Pastebin in code?


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

#1 DrCas

  • Members
  • 9 posts

Posted 22 November 2015 - 07:25 AM

I am making an program so I can chat wireless which is going fine, but i don't know how to use pastebin in code. So if i run the installer it will download some stuff from pastebin.
(Everything is enabled on the server, because i am the owner),
Here's my code
if fs.exists("System/Initialate") == true then
print("Booting")
shell.run("monitor","top","Initialate")
else
if fs.exists("InstallWizard") == true then
else
print("FILES CORRUPTED. DOWNLOADING INSTALLWIZARD")
-- Insert pastebin code here --
end
end


#2 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 22 November 2015 - 08:02 AM

You basically access pastebin through the shell. If you want to download a flie, simply call shell.run with the arguments you'd pass to the shell when you wan to t download a file:
shell.run("pastebin get <code> <path>")
shell.run("pastebin run <code>")


#3 Bomb Bloke

    Hobbyist Coder

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

Posted 22 November 2015 - 08:09 AM

You also have the option of using the http API to get the data within your own code - review the pastebin script's source for an example.

However, I myself usually use the pastebin script via shell.run() when I want something downloaded. The main difference in doing it yourself is that you can skip the "Connecting to pastebin.com... " messages.

Edited by Bomb Bloke, 22 November 2015 - 08:09 AM.


#4 DrCas

  • Members
  • 9 posts

Posted 22 November 2015 - 11:33 AM

View PostCreator, on 22 November 2015 - 08:02 AM, said:

You basically access pastebin through the shell. If you want to download a flie, simply call shell.run with the arguments you'd pass to the shell when you wan to t download a file:
shell.run("pastebin get <code> <path>")
shell.run("pastebin run <code>")

View PostBomb Bloke, on 22 November 2015 - 08:09 AM, said:

You also have the option of using the http API to get the data within your own code - review the pastebin script's source for an example.

However, I myself usually use the pastebin script via shell.run() when I want something downloaded. The main difference in doing it yourself is that you can skip the "Connecting to pastebin.com... " messages.
Thanks everyone! I'll upload my program and paste a link here when it is finishd :)

#5 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 22 November 2015 - 01:02 PM

If you want to use it I've made a pastebin API based on the original code, you can find it here http://pastebin.com/hbHHH9UX
Example usages






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users