Jump to content


Zenon's Content

There have been 49 items by Zenon (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#229086 Computer Cleaner

Posted by Zenon on 05 August 2015 - 11:10 PM in Programs

View PostScoptile, on 22 July 2015 - 07:15 PM, said:

Well it still says 'Poof!' so thats a plus

Gotta have that "Poof!" in there :P



#228881 EnderDice! A Simple Dice Roller *Updated To Beta V2.0*

Posted by Zenon on 04 August 2015 - 01:46 AM in Programs

View PostWait_, on 03 August 2015 - 08:15 AM, said:

i'm inspired o.O
can i make something like this?
i'd credit you in the post

Yeah, if you want to directly use this thatd be fine aswell

View Postnitrogenfingers, on 24 July 2015 - 03:25 AM, said:

If this is aspiring to be more of a dice rolling program than just an RNG I'd recommend adding a feature to roll multiple dice; 3d6+1d8 etc.

Thanks for the suggestion! I took about a two week break to play Dark Age Of Camelot, but Ill be coding again soon ;)

View PostAtenefyr, on 25 July 2015 - 03:12 PM, said:

RIP
Spoiler

Ill try to fix this tomorrow, gonna spend some time coding this and making it a little nicer :D



#227119 CCEmuRedux - ComputerCraft Emulator Redux

Posted by Zenon on 23 July 2015 - 12:31 AM in General

This really is just a fantastic emulator, no input lag, no bugs (that I've encountered), and the ability to make an advanced computer, aswell as multiple of them. Really, really well done.



#227083 FS API Help Please

Posted by Zenon on 22 July 2015 - 08:28 PM in Ask a Pro

Spoiler
I meant not having something like this
print("Hi")
Becuase that would show up weird :P

Spoiler
I did mean a wrapped monitor, thats why I didnt use "m" so they would know I meant a monitor, though I shouldve explained better. Also, I assumed that monitors had a print function aswell as write, like the default terminal, but I havent used monitors much lol . . . Thanks for the heads up. :D



#227073 FS API Help Please

Posted by Zenon on 22 July 2015 - 07:53 PM in Ask a Pro

View PostAppleManYT, on 22 July 2015 - 11:44 AM, said:

Hello everybody!
i want to make a simple program that can read a line of text from a file, for example if i had a program called "read" and had a file called "text" when i run "read" it prints out on the screen all the text in the "text" file. This is really basic but i just can't figure it out! Please Help! :) :) :)

Thanks, Apple

Alright, well, first you need to have JUST TEXT in the "text" file, then you could do something like this:
file = fs.open("text")
fileText = file.readAll()
monitor.print(fileText)
Though doing that could make the text not fit, you could also read individual lines with "fs.readLine()" then print that on a new line each time. Hope that helped! ^.^



#227072 Not sure what i've missed here.

Posted by Zenon on 22 July 2015 - 07:40 PM in Ask a Pro

You cant do this:
mon.write("m..":"s.."
I dont know what youre trying to do there, but if you want to combine things do this:
mon.write(var1.."string"..var2.."string2)
Or something of the like



#226915 Updater Help

Posted by Zenon on 22 July 2015 - 01:07 AM in Ask a Pro

View PostBomb Bloke, on 22 July 2015 - 12:42 AM, said:

Er, instead of doing that, would you not just want to do something like this?:

print(program)

shell.run("pastebin", "get", name[2], "updatetest")
WOW I feel like an idiot. Thanks Bomb Bloke, youre always helpful :P



#226902 Updater Help

Posted by Zenon on 21 July 2015 - 09:30 PM in Ask a Pro

View PostMKlegoman357, on 21 July 2015 - 08:43 PM, said:

If you're running the program with shell.run or through an actual shell all the passed arguments will be strings. Now here:

local name = {...}
program = name[1]

the 'program' variable holds the first argument passed to the program. So if I run the program like so:

# through the code:
shell.run("updater", "my_super_program")

#or through the shell:
> updater my_super_program

the 'program' variable ends up with a string value "my_super_program". After that you try to index that string with the number key '1':

print(tostring(program[1]))

and then with the number key '2':

shell.run("pastebin", "get", program[2], "updatetest")

I don't know what you are expecting to find after indexing a string with those keys, but you can be sure that they will be nil.
Ohhh I didnt realize it was making it a string . . . Do you know a way to "unstring" a string? Or would I be better off doing what Im doing in a different way?



#226895 Updater Help

Posted by Zenon on 21 July 2015 - 08:13 PM in Ask a Pro

View PostKingofGamesYami, on 21 July 2015 - 07:48 PM, said:

Is there an error, or does it do something you don't want it to? Please be specific in describing what you want to happen and what does happen.
No error, just doesnt work . . . Though where it prints it says nil, which leaves me to believe its trying to print the table program[1] instead of the input table, although if I use the second code it will use the input table (Im describing that horribly, though hopefully you understand it)

Edit: As for what I want to happen:
I want to use this program by using shell.run, with a singular arguement:
shell.run("themccm/updater", <insert program>)
I want to do this so I can run the program within a program, or seperately, and update the program without having to make a seperate updater for each program.



#226884 Parallel API

Posted by Zenon on 21 July 2015 - 07:21 PM in Ask a Pro

View Postflaghacker, on 21 July 2015 - 06:15 AM, said:

parallel.waitForAll(e(), r())
Remove the parentheses after 'e' and 'r'. Here you're calling them, but you want to pass them to the function instead. Fixed code:
parallel.waitForAll(e, r)
Yeah, I saw that while looking around . . . thats why I made the second code



#226873 Updater Help

Posted by Zenon on 21 July 2015 - 06:33 PM in Ask a Pro

Hi all! Making an updater (as you might have seen in my last post) and am just wondering why this isnt working. Code:
Spoiler

But it works if I do this:
Spoiler

Here is the pastebin its running

Any help is appreciated, because I cant really think of any reason why it wont work :P
Thanks in advance!



#226837 Cant Use Pastebin In An API?

Posted by Zenon on 21 July 2015 - 04:50 PM in Ask a Pro

View PostH4X0RZ, on 21 July 2015 - 03:06 AM, said:

Are you calling the function just as checkUpdate() outside the API or as APINAME.checkUpdate()?

--Derp. You said you can access other API functions...--

I think the shell API is not "exposed" to other APIs. Try using os.run maybe.

View PostLyqyd, on 21 July 2015 - 04:01 AM, said:

The shell "API" is an interface exposed to programs running under a shell instance, not an actual API that's available globally. For such a simple task, use http.get instead of os.run.

Thanks guys!

Edit: Heh. Thats way above my paygrade, Ill just use a seperate program until Im a little more into lua lol



#226730 Cant Use Pastebin In An API?

Posted by Zenon on 21 July 2015 - 02:59 AM in Ask a Pro

Hi all! I decided to make an autoupdater, and figured it best to only make it one program. I also figured that I may aswell make it in my api so I dont have to have an entirely seperate program. The problem comes in when I do this:
Spoiler
Now, running this normally will work . . . Just not when I load it as an api. Anyone know how I would get that to work?

Note: It returns the error
attempt to index nil ? (a nil value)
And I can use other functions in my api, so it isnt that.
--Wont be on again until tomorrow so dont think Im ignoring you if you reply. Thanks in advance!



#226727 Parallel API

Posted by Zenon on 21 July 2015 - 02:47 AM in Ask a Pro

View PostH4X0RZ, on 21 July 2015 - 01:27 AM, said:

You need to place content of the functions into an infinite loop. Also, you should not add parentheses. If you really have to call the function with arguments, you have to use an anonymous function.

local f1 = function()
  while true do
	--do the event stuff here
  end
end

local f2 = function(...)
  --the same as above
end

parallel.waitForAll(f1, function()
	f2("Random","arguments","foo","bar")
  end)

Thanks a bunch!



#226716 Parallel API

Posted by Zenon on 21 July 2015 - 01:00 AM in Ask a Pro

Hi all! I was just reading up on parallel api, and was making a little test code . . .

This will wait for input, though it wont respond to getting it:
Spoiler

This wont draw errors, but wont wait for input:
Spoiler

Any ideas? Thanks in advance!



#226513 Cant Load API?

Posted by Zenon on 20 July 2015 - 01:57 AM in Ask a Pro

Wait! I figured it out, you need to do "API.clear()" etc. instead of "themccm/API.clear()"

View PostDragon53535, on 20 July 2015 - 01:55 AM, said:

Lets see if I can list some errors.

Line 38+84: Should be API.clear() since you're loading the api as a table called API. Just calling clear will give you an attempt to call nil error.
Lines 78&79+87+95-98+101+115-116+119+121+125+131+132: Same error. API.lineUp()
Lines 90&91+111&113+128: API.lineDown()


The reason why the original computer worked and the others didn't: You ran your api code and the functions were loaded into the global environment.
If you notice, you can run the functions on the current code (Without the functions inside the code, the api functions) if you run the api program first.

Thanks, figured that out just a second ago lol



#226510 Cant Load API?

Posted by Zenon on 20 July 2015 - 01:44 AM in Ask a Pro

View PostBomb Bloke, on 20 July 2015 - 01:41 AM, said:

So which line, exactly, is throwing the error?

Is your original computer still able to run the code ok after you reboot it?
Any lines with the functions I defined in the API, starting with 38 but if I redifine the function that was causing the error in the program (in the case of line 38; clear()) it will work just fine.

Edit: No, the original cant after rebooting it either



#226506 Cant Load API?

Posted by Zenon on 20 July 2015 - 01:36 AM in Ask a Pro

View PostWait_, on 20 July 2015 - 01:32 AM, said:

you never loaded the api in the first place when you wrote 'os.unloadAPI()' from here:

View PosttheMCcm, on 20 July 2015 - 01:28 AM, said:

--------------------------------------------------
--API Load--
file = fs.exists("themccm")
if file == false then
fs.makeDir("themccm")
end
file = fs.exists("themccm/API")
if file == false then
shell.run("pastebin", "get", "5ww6Pb8i", "themccm/API")
end
os.unloadAPI("themccm/API") --you didn't load the api before this
os.loadAPI("themccm/API")
That isnt the issue, even without unloading it if you are on another comp, even if it has the api, it wont work



#226504 Cant Load API?

Posted by Zenon on 20 July 2015 - 01:28 AM in Ask a Pro

Hi All! I made myself a few functions that I always seem to be using, and put them into a program that I am using as an API. My own computer that I made the API on will work, however any other computers will draw errors from it; "attempt to index nil ?" Run it and see for your self

Program Code:
Spoiler
"API" Code:
Spoiler

Anyone know whats up and how to fix it? Thanks!



#226476 EnderDice! A Simple Dice Roller *Updated To Beta V2.0*

Posted by Zenon on 19 July 2015 - 08:50 PM in Programs

Beta Is Here! This program is starting to look like something of a final product, and as such is now a beta program.



#226468 Colors Help

Posted by Zenon on 19 July 2015 - 08:09 PM in Ask a Pro

View PostKingofGamesYami, on 19 July 2015 - 08:06 PM, said:

local input = read()
if colors[ input ] then
  term.setTextColor( colors[ input ] )
end
Thanks a Bunch! You saved me a lot of writing haha



#226454 Colors Help

Posted by Zenon on 19 July 2015 - 07:30 PM in Ask a Pro

Hi all! I was just wondering if anybody knew how to set a color up to equal input?
Example:
input = read()
term.setTextColor(color.input)
^That^ doesnt seem to work, so I was wondering if there was another way of doing that instead of the following:
input = read()
if input == "red" then
term.setTextColor(colors.red)
end

Thanks in advance!



#226440 [UnNeeded]Saving Information Between Sessions

Posted by Zenon on 19 July 2015 - 06:56 PM in Ask a Pro

View PostDragon53535, on 19 July 2015 - 06:54 PM, said:

You have to save things into a file to be able to use them between sessions. That's how a normal computer does it as well. So if I were to make a game that saved your progress, that progress would be in a file somewhere. The only question though, is what way you decide to take it. I would use the FS API, probably using this Tutorial.

Thanks for your reply, Ive used fs before, just didnt think of it at the time lol



#226434 [UnNeeded]Saving Information Between Sessions

Posted by Zenon on 19 July 2015 - 06:16 PM in Ask a Pro

Hi all! Just wondering if anyone knew how to save variables between sessions, as I want to make my program remember what color, or username, etc. the user chose. Thanks in advance!

Edit: I google this more and finally found a solution using files, sorry for posting a thread that didnt need to be posted D:



#226425 Pyg Latin Translator

Posted by Zenon on 19 July 2015 - 04:51 PM in Programs

View PostAtenefyr, on 19 July 2015 - 04:46 PM, said:

View PosttheMCcm, on 19 July 2015 - 04:42 PM, said:

It's both, really up to the person spelling it as far as I can tell. :P
Could just be "igpay atinlay" or "ygpay atinlay"

DunDunDun!