Jump to content


natedogith1's Content

There have been 79 items by natedogith1 (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#202330 UrsaTech! CC, OC, peripherals, and furniture! [Now defunct]

Posted by natedogith1 on 05 January 2015 - 11:18 AM in Servers

There's actually an issue with the installation instructions, the link to the download for forge isn't actually the installer.
Also, I seem to be having issues with the download, (it's getting to no more than 10% (11,000 kb or so) before stopping. (I'm just downloading the files from github now...)



#196967 Pastebin command not working

Posted by natedogith1 on 25 October 2014 - 11:49 PM in Ask a Pro

View Postfergregerg, on 25 October 2014 - 04:32 PM, said:

no such program im assuming that also means it is disabled.
did you run the lua program first to get into the lua prompt before you typed 'http' and hit enter?



#196281 Filesystems

Posted by natedogith1 on 16 October 2014 - 01:28 AM in Ask a Pro

Computer Craft's file system is just your actual computer's file system. If your looking for the Java class that's used to access the real computer's file system, I believe you're looking for java.io.File



#195564 multishell access

Posted by natedogith1 on 07 October 2014 - 09:47 PM in Ask a Pro

Is there a reason you're using multishell.launch instead of shell.openTab ?



#194946 Window API under CC1.58 & earlier

Posted by natedogith1 on 02 October 2014 - 12:14 AM in Ask a Pro

It should work fine, though you might need to remove the code that checks if parent == term (the code bellow), since I don't think earlier versions of CC had term.current
	if parent == term then
		error( "term is not a recommended window parent, try term.current() instead", 2 )
	end



#194836 Creating A Un-Readable Executable File

Posted by natedogith1 on 01 October 2014 - 12:13 AM in Ask a Pro

string.dump is indeed the way to go, however I feel I should mention that most things that run lua won't let you load binaries (it's a huge security concern), though CC will.
Also, all code is readable to a human with a decompiler and an abundance of spare time



#194407 fs.new

Posted by natedogith1 on 25 September 2014 - 02:52 AM in Ask a Pro

Remember when you're calling old functions to do something with their value:
function fs.open(path, mode)
  oldfs.open(path, mode) --this will cause issues
end

function fs.open(path, mod)
  return oldfs.open(path, mode) --remembering to return the stuff
end
Also, you say the OS drops everything but itself, what do you mean by this?



#193666 Read-Only Tables?

Posted by natedogith1 on 16 September 2014 - 03:46 AM in Ask a Pro

View Postashnwill, on 16 September 2014 - 03:34 AM, said:

View Postnatedogith1, on 16 September 2014 - 03:22 AM, said:

--snippeth--
I guess I should try to override setmetatable so that people can't "unreadonly-ize" the tables, right?
Is there anything else I should watch out for?
Actually, since the metatable has a '__metatable' field, setmetatable will throw an error; however you should maybe watch out for 'rawset'.



#193664 Read-Only Tables?

Posted by natedogith1 on 16 September 2014 - 03:22 AM in Ask a Pro

function readOnly(tbl)
  return setmetatable({}, __index = tbl, __newindex =
	function(self,key,value)
	  error("not modifyable")
	end,__metatable={})
end
'__index' defines where/how to look up values
'__newindex' defines where/how to set values
'__metatable' prevents me from using getmetatable and modifying it that way
if you're interested in more about metatables, you might like to look at http://www.lua.org/m...manual.html#2.8

There are a few issues with this though, like the fact that 'pairs' doesn't work, though it does do a better job of read-only than the CC's OS



#193662 Too long without yielding error

Posted by natedogith1 on 16 September 2014 - 03:10 AM in Ask a Pro

If I'm reading decompiled source code correctly, this is sort of what happens:
start computer
wait 5000 milliseconds
if (computer is still running) {
  soft abort
  wait 1250 milliseconds
  if (computer is still running) {
	hard abort
	wait 1250 milliseconds
	if (computer is still running) {
	  force kill computer
	}
  }
}
(when it waits, it can exit early if the computer yields)
A soft abort seems to throw an error when you attempt to call a java-defined lua function (so things like turtle, term, and peripheral).
A hard abort seems to just throw an error, not really caring where in the code you are.



#193282 Logging into a website using http.post

Posted by natedogith1 on 10 September 2014 - 03:01 AM in Ask a Pro

Since you're trying to use the webpage meant for people, you'd need to parse https://github.com/login and send it back the hidden values it generates along with your username and password. So I think it'd be something along the lines of
http.post("https://github.com/login","utf8="..utf8.."&authenticity_token="..authenticity_token.."&login="..username.."&password="..password)
Though if possible, you should probably try and use GitHub's api.



#193270 Logging into a website using http.post

Posted by natedogith1 on 09 September 2014 - 11:23 PM in Ask a Pro

Are you attempting to use the web page meant for people, or the http api meant for robots?



#193212 Open Peripheral Glasses Colour Codes?

Posted by natedogith1 on 09 September 2014 - 01:02 AM in Ask a Pro

OpenPeripheral's Terminal Glasses actually use a number encoding of rgb (0xrrggbb). So red would be 0xff0000, green would be 0x00ff00, blue would be 0x0000ff, and sky blue (according to wikipedia) would be 0x87CEEB
So yeah, the display column, just with an '0x' (for hexadecimal) instead of '#'



#193022 Decentralized Network

Posted by natedogith1 on 04 September 2014 - 11:50 PM in Ask a Pro

would something like so work?
if peripheral.find("modem") then
  parallel.waitForAny(
    function()
      shell.run("shell")
    end,
    function()
      shell.run("repeat")
    end )
end



#192870 Script waits longer than defined in os.sleep

Posted by natedogith1 on 03 September 2014 - 01:07 AM in Ask a Pro

Might I ask to see how you implemented my fix (I've used it myself recently and want to make sure I'm not going to break my own stuff as well)



#192869 Need a little bit help (problem with disk drives)

Posted by natedogith1 on 03 September 2014 - 01:02 AM in Ask a Pro

The reason you're getting that error is because diskSideTest returns null if it can't find anything, which disk.isPresent then tries to use and errors.

You can't have multiple threads running at once, but lua does have something called coroutines, which can be used to implement multi-tasking (as multishell and the parallel API do). Though for your example purpose, you'd be better off just starting a timer and checking to see if the event pulled was that timer.

You can "pastebin put <filename>" to upload a file to pastebin and "pastebin get <code> <filename>" to download a file from pastebin. Though if you're in a single-player world you can just modify the files in world-save/computer/computer-id and I'm not sure entirely what you mean by more easily? You could probably create a shortcut to the folder.



#192754 Bug Reporting

Posted by natedogith1 on 01 September 2014 - 04:51 AM in Ask a Pro

Huh, I wonder what issue is causing it to return nil (if github didn't require https one could probably just watch it in wireshark). I think I remember hearing about some versions of ComputerCraft having issues if both postData and headers are used in a single request.



#192751 Multitasking

Posted by natedogith1 on 01 September 2014 - 04:44 AM in Ask a Pro

Well that sucks, makes me wonder how popular servers manage to run CC computers at any decent speed though. (maybe people just aren't doing the ridiculous sort of things I like to do)
Is there any reason it's implemented as such?



#192744 Multitasking

Posted by natedogith1 on 01 September 2014 - 03:47 AM in Ask a Pro

I'm wondering if ComputerCraft actually does multitasking (I know it doesn't on a single CC computer). I feel like I've heard things about, though CC uses threads, it only running one at once. I'm trying to decide whether or not it would be worth it to make a bank of computers to allow executing processes faster (rendering 1300+ points from 3d to 2d (using OpenPeripheral Terminal Glasses) is kinda slow, as is 1900+ for drawing a terminal with Terminal Glasses)



#192740 Bug Reporting

Posted by natedogith1 on 01 September 2014 - 02:06 AM in Ask a Pro

Yeah, scopes tend to confuse me a bit as well. I'd personally probably just check if it works if I let it do everything first, then try to cut back on the scopes.



#192733 Bug Reporting

Posted by natedogith1 on 01 September 2014 - 12:25 AM in Ask a Pro

According to the documentation, it only needs pull access, so I'd go with no. It makes sense when you think about the issues section as bug reports, you'd generally like to be able to have testers that can't just modify the official sources however they wish.



#192731 Bug Reporting

Posted by natedogith1 on 31 August 2014 - 11:07 PM in Ask a Pro

The scope you need is the one that gives read access to a repository, no idea which one that is though.



#192727 Bug Reporting

Posted by natedogith1 on 31 August 2014 - 10:26 PM in Ask a Pro

if you go to https://github.com/settings/tokens/new you can create a token for yourself, and since you can set the scope you can severely limit what someone with the token can do.



#192719 Bug Reporting

Posted by natedogith1 on 31 August 2014 - 08:49 PM in Ask a Pro

View PostHbomb_79, on 31 August 2014 - 08:43 PM, said:

-- snip --

Sorry, but when you say the above shouldn't be used, what else do I put there, or is it not necessary, as you can see I'm very much new to Internet Apis etc within computer craft, I've only ever done GitHub downloading, I hope I can get your code to work, just for classification, what is the auth and oauth etc...

Like you said, the first part is very insecure, I don't want people knowing my password to GitHub, whether it is a seperate account or not, it would still have push access etc...

You'd just leave that part blank, that's why it's commented out. Instead you'd just fill in the oauthToken part with the value of your token. Though according to the github api documentation, you don't actually need push access to make an issue, you only need pull access.



#192709 Bug Reporting

Posted by natedogith1 on 31 August 2014 - 06:28 PM in Ask a Pro

View PostKingofGamesYami, on 31 August 2014 - 06:14 PM, said:

-- snip --
Tip: Use --# for comments, since the forum parses # as a comment, and lua interprets -- as a comment. It looks good when posting, and still works fine in game.
Thanks, I was wondering why people were formatting like that.