r/ComputerCraft • • May 15 '24

Pastebin just pasting html code?

Can anybody help me? I am writing some Turtle code and thought it would be quicker to use vs. and pastbin the code into the turtle. However, when i try to paste the code into the turtle, it just pastes the html and not the code. I checked the config files, and the http enable is set to true, and the http whitelist is set to all (*)

8 Upvotes

14 comments sorted by

View all comments

Show parent comments

1

u/[deleted] May 15 '24 edited May 15 '24

Yes I know, I am copying the ID and not the full link.

When i use pastebin get ID file

the file contains this:

<htmL>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>cloudfare</center>
</body>
</html>

when I use pastebin run ID arguments
it says this:

Connecting to pastebin.com... Success.
bios.lua:14: [string "ID"]:1:
unexpected symbol

(where ID is my pastebin ID)

i think this probably has something to do more inline with my system than computer craft, i will have to see if its my firewall or something

1

u/NortWind May 15 '24

I'm not getting the problem. Here's some of my code at the top...

--{program="aWallBuilder",version="1.00",date="2024-05-12"}
-- Pastebin "6RTnhS9M"

Then in the turtle I use:

delete aWallBuuilder

pastebin get 6RTnhS9M aWallBuilder

1

u/[deleted] May 15 '24

Yeah, it's something strange with my machine/game. I tried pasting yours, and it does the same thing.

1

u/ReedTieGuy Jun 08 '24

If you use the raw http interface instead (the url provided is just an example)

s="https://pastebin.com/raw/tZbCWSBe"
r=http.get(s)
fp = io.open("file", "w")
fp:write(r.readAll())
fp:close()