Jump to content




Github Repository Downloader

utility lua computer

13 replies to this topic

#1 max96at

  • New Members
  • 15 posts
  • LocationAustria

Posted 11 September 2012 - 05:40 PM

Github Repositor Downloader


Did you ever wish you could download a program pack or

a custom ComputerCraft OS someone put up on github ingame?

Now you finally can!!!



News:
  • Updated to version 1.1

Features:
  • Download entire Github repositories by typing to your ComputerCraft computer
  • If you're playing on a server that has HTTP API enabled you can use this program to easily get your programs on a computer even if you can't access the server's files
  • Choose which branch you wan't and if you prefer just downloading a subdirectory of the repo that's possible too
  • Select where to place the repository on your computer
  • You can even blacklist paths for files that should not be downloaded
Requirements:
  • The HTTP API needs to be enabled in your ComputerCraft config
Credits:
  • m1cr0man for helping me understand lua better, optimizing parts of my code and saying "I don't ragequit on code, code ragequits on me" after hours of debugging
  • All the guys and girls at #computercraft for answering my questions and finding bugs in my program
Downloads: Changelog:
Spoiler


#2 Kolpa

  • New Members
  • 260 posts
  • LocationGermany

Posted 11 September 2012 - 06:07 PM

ah i did something similar for the team-econ installer was thinking about releasing it here but well :)/>

#3 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 11 September 2012 - 11:29 PM

View PostKolpa, on 11 September 2012 - 06:07 PM, said:

ah i did something similar for the team-econ installer was thinking about releasing it here but well :)/>
Yeah, my git API accomplished the same thing, but bit by bit. Good job.

#4 gknova61

  • Members
  • 74 posts

Posted 13 September 2012 - 08:00 AM

I've actually been thinking of using Github as a repository for my lua programs but thought it useless as I didn't have a way of downloading the repo and having it update on all my computers I have the software deployed to. 1dy later, someone comes out with this! This must be a dream. *Do not pinch me*

#5 oggehej

  • New Members
  • 2 posts

Posted 31 October 2012 - 12:33 PM

Just getting the error: OS:333: Not an HTTP URL
Did I do something wrong? I downloaded it via the pastebin command.

#6 Kolpa

  • New Members
  • 260 posts
  • LocationGermany

Posted 02 November 2012 - 07:39 AM

github is using https calls you will have to upgrade your computer craft version to support https

#7 oggehej

  • New Members
  • 2 posts

Posted 03 November 2012 - 12:21 PM

View PostKolpa, on 02 November 2012 - 07:39 AM, said:

github is using https calls you will have to upgrade your computer craft version to support https
Can't do it since i'm on an tekkit server, but thanks anyway.

#8 Kolpa

  • New Members
  • 260 posts
  • LocationGermany

Posted 04 November 2012 - 06:59 AM

take a look at this library for lua only json http://regex.info/blog/lua/json if you want to move away from regex

you can also load it like this
local dec = http.get("http://regex.info/code/JSON.lua")
local JSON = loadstring(dec:readAll())()


#9 jclark

  • New Members
  • 7 posts

Posted 04 November 2012 - 08:07 AM

Kolpa -

Do you have that JSON library working in CC? I can load the library, but I can't encode anything. Here's a simple test program:

Spoiler

This (and every variation I can think of) fails with
string:255: JSON:encode must be called in method format
. Looking at the code for JSON.lua, it's clear that encode is getting a value for self that it doesn't expect (line 797), but I don't know why. I'm pretty sure I'm using JSON:encode exactly as the sample code suggests.

I'm running CC1.45 on MC 1.3.2.

Thanks,
Jason

#10 Kolpa

  • New Members
  • 260 posts
  • LocationGermany

Posted 04 November 2012 - 10:34 AM

the whole thing working with an github downloader

https://github.com/K...o%20updater.lua

what you are trying to do is probably decoding not encoding :D/>

also though
JSON:encode(t)
doesnt seem to work this does:
JSON:encode_pretty(t)
if you really want to encode

#11 jclark

  • New Members
  • 7 posts

Posted 04 November 2012 - 02:45 PM

View PostKolpa, on 04 November 2012 - 10:34 AM, said:

the whole thing working with an github downloader

https://github.com/K...o%20updater.lua


Cool, but I only see decode

Quote

what you are trying to do is probably decoding not encoding :D/>

No, look at my code - I am trying to encode a lua table into JSON. I'll decode it later (on the other side of a rednet connection).

Quote

also though
JSON:encode(t)
doesnt seem to work this does:
JSON:encode_pretty(t)
if you really want to encode

Well, that does work - but trying to immediately decode it with JSON:decode() fails with the same error. Both encode() and decode() start with
if type(self) ~= 'table' or self.__index ~= OBJDEF then
but encode_pretty does not. Guess it's time to read the lua docs on objects and figure out why this fails. Interesting to note that your code works for you, with the call to decode().

#12 Leo Verto

  • Members
  • 620 posts
  • LocationOver there

Posted 05 November 2012 - 01:14 AM

Really nice program, going to use this for my project soon.

#13 ElvishJerricco

  • Members
  • 803 posts

Posted 10 November 2012 - 03:34 PM

Thank you for this very useful tool! =D

#14 RootUser

  • Members
  • 11 posts

Posted 13 September 2015 - 09:02 PM

Ohh... awesome... i'll use it in my installer





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users