This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
darkrising's profile picture

Dark Retriever - Program Downloader / Library

Started by darkrising, 02 December 2013 - 10:34 AM
darkrising #1
Posted 02 December 2013 - 11:34 AM
Hello, as this program has got more and more complex I thought it deserved its own thread.

This program is a program downloader with an easy to use gui and startup script generation.

It's probably easier to show you…
Spoiler







So yeah, as seen from the images, everything is split down into author -> package -> program.

You navigate the menu items by using up, down, left and right arrows. When your are in the program information window you just hit enter to download! Simple!

To download just type: pastebin get N22T449A dr

If you want your programs added to Dark Retriever just take a look at my github and submit a pull request.

The format for adding a program is:
Spoiler–GitURL can be any URL, but it must be direct
["server"]={
["GitURL"]="https://raw.github.com/darkrising/darkprograms/darkprograms/darksecurity/server.lua",
["Version"]=6.301,
["Type"]="program",
["Name"]="Dark Programs Server",
["Description"]="Dark Programs Base Security Server",
["Author"]="Darkrising",
["Package"]="Dark Security",
},
LBPHacker #2
Posted 02 December 2013 - 02:35 PM
I'll just stick to clapping and saying "awesome". I really like the design. One thing though: I'd store the versions as strings, as they are capable of holding more information than a double number.
darkrising #3
Posted 02 December 2013 - 02:46 PM
I'll just stick to clapping and saying "awesome". I really like the design. One thing though: I'd store the versions as strings, as they are capable of holding more information than a double number.

Thanks :)/>

The reason they're stored as double numbers is because my program's auto updater compares the version of the program to the downloaded one.
LBPHacker #4
Posted 02 December 2013 - 03:09 PM
-snip-
You can do that with strings as well. Split the string into numbers and compare them. There you go.
lukasdragon #5
Posted 12 April 2014 - 11:46 PM
Do you mind me modifying it to allow some of my programs to be installed too? & is it possible for you to sort of help me lol cuz when I tried doing it, it was not indexing ( I just edited the program versions file and updated the changed link in the dr
Edited on 12 April 2014 - 10:01 PM
darkrising #6
Posted 12 April 2014 - 11:50 PM
Do you mind me modifying it to allow some of my programs to be installed too?

As long as you give me credit, I don't mind :)/>

If you take a look at my Github you will find a program versions file that's where the dark retriever gets its info.
lukasdragon #7
Posted 13 April 2014 - 01:02 AM
Do you mind me modifying it to allow some of my programs to be installed too?

As long as you give me credit, I don't mind :)/>

If you take a look at my Github you will find a program versions file that's where the dark retriever gets its info.
I tried to figure it out however what exactly do I need to change? here is my copy of your My repo
Edited on 12 April 2014 - 11:15 PM
darkrising #8
Posted 13 April 2014 - 01:42 AM
Do you mind me modifying it to allow some of my programs to be installed too?

As long as you give me credit, I don't mind :)/>

If you take a look at my Github you will find a program versions file that's where the dark retriever gets its info.
I tried to figure it out however what exactly do I need to change? here is my copy of your My repo

Like in my example above:


["server"]={ --program name
["GitURL"]="https://raw.github.com/darkrising/darkprograms/darkprograms/darksecurity/server.lua", --direct url to the program.
["Version"]=6.301, --version
["Type"]="program", --category
["Name"]="Dark Programs Server", --Actual name of the program
["Description"]="Dark Programs Base Security Server", --A small description of what it does or is
["Author"]="Darkrising", --Author
["Package"]="Dark Security", --Package the program is located
},

So if you had a program called potato

["potato"]={
["GitURL"]="http://www.some.url.com/potato",
["Version"]=1.0,
["Type"]="program",
["Name"]="An epic potato program",
["Description"]="Potatos are epic",
["Author"]="MrPotato",
["Package"]="PotatoPrograms",
},


Edit also for auto-update:
SpoilerFrom my api I have this function

function gitUpdate(ProgramName, Filename, ProgramVersion)
  if http then
    local getGit = http.get("https://raw.github.com/darkrising/darkprograms/darkprograms/programVersions")
    local getGit = getGit.readAll()
    NVersion = textutils.unserialize(getGit)
    if NVersion[ProgramName].Version > ProgramVersion then
      getGit = http.get(NVersion[ProgramName].GitURL)
      getGit = getGit.readAll()
      local file = fs.open(Filename, "w")
      file.write(getGit)
      file.close()
      return true
    end
  else
    return false
  end
end

And my program calls it in the form of:

if AutoUpdate == true then 
    if ((dark.gitUpdate("server", shell.getRunningProgram(), Version) == true) or (dark.gitUpdate("dark", "dark", dark.DARKversion) == true)) then
      os.reboot()
    end
  end
Edited on 12 April 2014 - 11:46 PM
lukasdragon #9
Posted 13 April 2014 - 04:44 AM
Do you mind me modifying it to allow some of my programs to be installed too?
As long as you give me credit, I don't mind :)/>/> If you take a look at my Github you will find a program versions file that's where the dark retriever gets its info.
I tried to figure it out however what exactly do I need to change? here is my copy of your My repo
Like in my example above:
 ["server"]={ --program name ["GitURL"]="https://raw.github.com/darkrising/darkprograms/darkprograms/darksecurity/server.lua", --direct url to the program. ["Version"]=6.301, --version ["Type"]="program", --category ["Name"]="Dark Programs Server", --Actual name of the program ["Description"]="Dark Programs Base Security Server", --A small description of what it does or is ["Author"]="Darkrising", --Author ["Package"]="Dark Security", --Package the program is located }, 
So if you had a program called potato
 ["potato"]={ ["GitURL"]="http://www.some.url.com/potato", ["Version"]=1.0, ["Type"]="program", ["Name"]="An epic potato program", ["Description"]="Potatos are epic", ["Author"]="MrPotato", ["Package"]="PotatoPrograms", }, 
Edit also for auto-update:
SpoilerFrom my api I have this function
 function gitUpdate(ProgramName, Filename, ProgramVersion) if http then local getGit = http.get("https://raw.github.com/darkrising/darkprograms/darkprograms/programVersions") local getGit = getGit.readAll() NVersion = textutils.unserialize(getGit) if NVersion[ProgramName].Version > ProgramVersion then getGit = http.get(NVersion[ProgramName].GitURL) getGit = getGit.readAll() local file = fs.open(Filename, "w") file.write(getGit) file.close() return true end else return false end end 
And my program calls it in the form of:
 if AutoUpdate == true then if ((dark.gitUpdate("server", shell.getRunningProgram(), Version) == true) or (dark.gitUpdate("dark", "dark", dark.DARKversion) == true)) then os.reboot() end end 

Thanks, I got it all figured out!