Jump to content


MKlegoman357's Content

There have been 76 items by MKlegoman357 (Search limited from 25-November 19)


By content type

See this member's


Sort by                Order  

#264941 Bug? 503 Error everytime i try to reply a thread

Posted by MKlegoman357 on 19 February 2017 - 12:42 PM in Forum Discussion

And thus we never heard of vico again, since he couldn't reply to any threads, including this one...

:D

Try logging out and in. Maybe clear browser cache.



#260309 How can you tell if caps lock is on?

Posted by MKlegoman357 on 06 October 2016 - 06:40 PM in Ask a Pro

Well, there's is no way of knowing it then. Why cannot you use the "char" event, which is meant just for this?



#260159 dofile() in MC1.7.10/CC1.74

Posted by MKlegoman357 on 02 October 2016 - 06:40 PM in Ask a Pro

View PostBomb Bloke, on 02 October 2016 - 06:10 AM, said:

You didn't set (or use a modpack which pre-sets) "disable_lua51_features" to true within ComputerCraft.cfg, did you? That setting blocks access to dofile() (and a bunch of additional functions), and should only be used if you're wanting to develop code that'd (hopefully) be forwards-compatible with a hypothetical future version of ComputerCraft based on Lua 5.2 (which may or may not ever actually come into existence)... If memory serves, some Tekkit pack or other does this for no good reason.

dofile() is still a feature of Lua 5.2 and 5.3, and that ComputerCraft.cfg setting doesn't remove it.




dofile() is better if the API will have an internal state of some sort. For example, the CC's settings API stores all the settings in one place, thus if you edit a setting in one program, that setting will be immediately changed for another program. That's how some "os.loadAPI()" APIs work. When using dofile(), each program loads the API for itself, and thus gets a new API table, together with it's state, created just for it. If settings API was made to be loaded with it, each program would get it's own settings and wouldn't need to worry about other programs changing those settings.

Of course, you could simply make a "os.loadAPI()" API which would work like the vector API, which requires the program to use the vector.new() function to get a vector object with it's own state (the x, y and z coordinates).



#259724 Some questions about Top Level Corroutine Override

Posted by MKlegoman357 on 21 September 2016 - 07:52 PM in Ask a Pro

View PostSewbacca, on 21 September 2016 - 07:37 PM, said:

Also TLCO won't work in Lua 5.2.

There are many TLCO implementations and you could think of many more. It doesn't need to rely on Lua 5.1 features (like getfenv) to operate.



#259624 shell.run()

Posted by MKlegoman357 on 20 September 2016 - 04:40 AM in Ask a Pro

View PostLupus590, on 19 September 2016 - 01:50 PM, said:

you'll have no APIs with that: http://www.computerc...-a-cc-computer/

How so? All the APIs will already be loaded when any user-made programs run.



#259562 shell.run()

Posted by MKlegoman357 on 19 September 2016 - 01:21 PM in Ask a Pro

It's best to simply run 'os.run({}, "shell " .. path .. arguments)' which will run the program with the shell API and the correct shell environment.



#258591 BLAST AntiMalware Suite - 'Yet another' string.find antivirus

Posted by MKlegoman357 on 28 August 2016 - 08:48 PM in Programs

View PostLuca_S, on 26 August 2016 - 09:02 PM, said:

Also it doesn't detect fs.delete("*") as a virus?

That doesn't work, all fs functions (with the exception of fs.find()) don't handle wildcards. But shell.run("rm *") would probably be dangerous.



#258590 http post

Posted by MKlegoman357 on 28 August 2016 - 08:41 PM in Ask a Pro

ComputerCraft's http.post() sends a generic POST request to the server, so a simple Google search of "How to handle post request in PHP" should give you enough information about how to handle it.



#257841 Thoughts on No Man's Sky?

Posted by MKlegoman357 on 11 August 2016 - 02:55 PM in General

This bothers me.

I haven't gotten the game myself (don't think I will), as it doesn't look to have enough things to keep me entertained. It looks like after some time it will just get too repetitive and thus become boring.



#257746 CraftOS 2.0 - Dan's Secret Project

Posted by MKlegoman357 on 09 August 2016 - 04:19 PM in General

View PostLego Stax, on 04 August 2016 - 04:45 PM, said:

Like what Bomb Bloke said, what I mean is it would be nice to have a common API (or set of commands, whatever you want to call it) that every separate GUI framework shares (as there will probably be quite a few of them). This would allow a single coder to write their program to work properly with every GUI.
Basically, what I'm saying is that it would be nice for every GUI framework to be like XOrg in that they go as far as sharing the same commands for managing the screen or a window.
GUI frameworks could have other methods of displaying stuff outside of these commands as well, but every GUI would have to share this "common API/system".

View Postthecrimulo, on 09 August 2016 - 12:11 PM, said:

Actually, making standards, would lead to a nicer WM/DE feel, and if OSes could easily switch or simply don't have one, that'd be great

The main standard for drawing pixels will already be there, no need to create one yourself. There actually doesn't need to be any standards for any programs by default, since there will still be something similar to the window API and everything will basically work like in CC. The only thing that programs will need to adapt to is the screen size and dynamic size changes (e.g.: window gets resized, a new CCNext-multishell tab is opened). This works with CC and windowed OSes already, if you make your program adapt to display resolution and listen for "term_resize" events. This way people won't need to search for any standard if they want to make their programs compatible with a windowed OS.

Where there should be a standard, is the actual window controls and properties: allow window to be resized/fixed size, change window's title, enable/disable close/maximize/minimize buttons, etc.. Also, for OSes with a desktop a drag'n'drop functionality would be fun (e.g.: dragging a file from your desktop to a messaging app).



#256893 Post the status of your WIP project!

Posted by MKlegoman357 on 25 July 2016 - 08:55 PM in General

View PostExerro, on 25 July 2016 - 08:08 PM, said:

Nah, that's why I mentioned Lua parsing. If it can be run in CC standalone, it's most likely in Lua, and so it can be parsed as a Lua program and probably turned into something similar to its original, with the exception of variable names and similar things like that of course.

Like I said, you have to "convert" it into something primitive. For example, converting the Lua code into an assembly-like language and then either converting that into Lua or making a simple interpreter for it.



#256889 Post the status of your WIP project!

Posted by MKlegoman357 on 25 July 2016 - 07:57 PM in General

View PostExerro, on 25 July 2016 - 03:51 PM, said:

View PostEEVV, on 24 July 2016 - 06:20 PM, said:

I was going to browse the forums, but a while ago I had came up with 3 projects, and they all transitioned to a single project. Some people don't want other to let their source code to be readable, or they don't want to share the code for some reason. Here I am. I'm making an obfuscator for CC.

Obfuscated code is pretty easy to un-obfuscate for anybody, there are tools that do it for you and Lua is fairly easy to parse anyway, and you're not actually allowed to post obfuscated code on the forums.

You're thinking about compiling to Lua bytecode, which isn't really a good way to obfuscate your Lua source, but EEVV might be making a better obfuscator, that doesn't just use string.dump().

A good way to obfuscate the code would probably be to compile said code into a very primitive language, or a very primitive Lua source code, similar to how, for example, C++ is compiled into a Linux program. One complex language is "converted" into a very primitive language and thus it becomes very hard to read.



#256749 Blink - Communication API with Sender Verification!

Posted by MKlegoman357 on 24 July 2016 - 08:00 AM in APIs and Utilities

View PostKingofGamesYami, on 24 July 2016 - 01:11 AM, said:

I'm thinking about this. I don't know what the best way to set the modem is, I like it being automated myself. I see the point about wired modems though. Perhaps default to wireless, but fallback on wired if I can't find one?

The computer might have a wireless and a wired modem and the user might want to use the wired one instead of the wireless. Maybe there should be an 'open([side])' method which would open the modem on the side given or if no side was given open one automatically.



#256711 Blink - Communication API with Sender Verification!

Posted by MKlegoman357 on 23 July 2016 - 09:15 PM in APIs and Utilities

You should add ability to open the modem yourself (there might be modems already in use or I'd simply want to use a wired modem) and the send method should have a timeout (send(id, message, [timeout])) because right now the computer might hang if the receiving computer is not available.

Otherwise, great API!



#256493 Cobalt - a callback wrapper for ComputerCraft

Posted by MKlegoman357 on 20 July 2016 - 07:04 AM in Programs

View PostIncinirate, on 20 July 2016 - 12:31 AM, said:

This is true... until you realize that the server only sends packets X times a second, so even if on the server (real-life) it updates and refreshes faster, the client will only get updates X times a second. (From what I've seen X is usually around 30)

If this were true writing each pixel individually would take you about 32 seconds, which is not true at all.

Oh, misinterpreted that. Yes, there's a limit to how fast the server can send packets.



#256453 Cobalt - a callback wrapper for ComputerCraft

Posted by MKlegoman357 on 19 July 2016 - 05:41 PM in Programs

View PostPixelFox1, on 18 July 2016 - 11:56 PM, said:

1) The max FPS in ComputerCraft is 20.

View Postepicidity, on 19 July 2016 - 10:00 AM, said:

...it can render a much higher even though it will not display but all of the program code that render will still run

View PostIncinirate, on 19 July 2016 - 04:55 PM, said:

...up to 120 fps even (and beyond)) however due to the minecraft tickrate being 20, the computer's monitor can only refresh 20 times a second, which brings up the topic of things like vsync. Like, do you really even need 120fps if it only can ever be rendered at 20fps...

False. The computer can render as fast as the server (the actual real-life computer) can process the statements and the computer's screen/monitor will refresh as fast as possible. Probably the only point where tickrate matters are timers (which accepts 0.05 as the lowest possible value). Actually, that's where the "myth" comes from: you cannot make a timer lower than 0.05 thus getting only 20FPS. But you can kind of overcome this issue by constantly yielding and pulling events until the computer waits the amount of time you want. Although, this solution isn't an ideal one anyway.



#256358 Computers as memory peripherals

Posted by MKlegoman357 on 18 July 2016 - 06:18 PM in Suggestions

View PostKingofGamesYami, on 18 July 2016 - 05:02 PM, said:

Don't make me laugh. I just pick up your computer, place a disk drive, empty startup disk, place computer, I have all your data. Done.

Not with the new settings, where you can disable disk startup.



#256329 Table index is nil when using dofile

Posted by MKlegoman357 on 18 July 2016 - 08:07 AM in Ask a Pro

First of all, when saving the bytecode you have to save it using a "wb" mode, because it contains bytes that will be corrupted if using "w" mode. Second, dofile, loadfile and any other function will not work because they open the file in "r" mode, not "rb" mode which is required to properly load the bytecode.



#256241 Windows 10 venting

Posted by MKlegoman357 on 15 July 2016 - 09:44 PM in General

View PostDog, on 13 July 2016 - 09:03 PM, said:

To disable automatic updates in Win10, set your connection to 'Metered' - then you control when updates are downloaded. You still can't pick and choose between updates, but it's better than nothing...

View PostMKlegoman357, on 08 April 2016 - 07:22 PM, said:

Automatic Windows updates never bothered me, until now, as I'll be on a metered connection for about two weeks. So I went online to look for a 'hack' to disable them and instead found that the "Ask me to download and install" option is still actually a part of windows updates.

View PostBomb Bloke, on 08 April 2016 - 11:05 PM, said:

Good to know, but I notice that applies to professional versions only.

View PostDog, on 09 April 2016 - 06:03 PM, said:

Thanks for the link, MKlegoman357 - very informative :)

Disabling automatic updates worked fine for me. When there are updates Windows will pop a notification and wait for you to actually approve you want to download those updates. Though you cannot select which updates to install.



#256128 Editing my WIP editor in the WIP editor.

Posted by MKlegoman357 on 14 July 2016 - 11:10 AM in Media

View PostThe Crazy Phoenix, on 14 July 2016 - 08:49 AM, said:

Just today I wrote some sort of "Lua Compiler" that runs string.dump on a function loaded from a file. It then saves it into a file which can be directly executed.
Guess what I did next? I compiled the compiler. I may publish it if I can figure out how because it actually shrinks the size of larger programs.

Obfuscated code is not allowed on the forums. Also, how does this relate to the topic?



#256066 Converting text in a file

Posted by MKlegoman357 on 13 July 2016 - 09:42 AM in Ask a Pro

View PostLyqyd, on 13 July 2016 - 12:29 AM, said:

He's not calling io.lines, he's calling handle:lines() on a handle opened with io.open. The handle:lines() call does not require an argument, though.

He is calling io.lines() in the first post.



#255775 Java in ComputerCraft?

Posted by MKlegoman357 on 08 July 2016 - 04:40 PM in Suggestions

There's this.



#254800 Problem with table ?

Posted by MKlegoman357 on 25 June 2016 - 07:18 PM in Ask a Pro

Common, this is Lua:

MiningSave[1], MiningSave[2] = MiningSave[2], MiningSave[1]



#254791 GUI API doesent work

Posted by MKlegoman357 on 25 June 2016 - 04:36 PM in Ask a Pro

Like KingofGamesYami suggested, just pass the actual function and then call it like in my example.



#254785 GUI API doesent work

Posted by MKlegoman357 on 25 June 2016 - 01:43 PM in Ask a Pro

View PostWilma456, on 25 June 2016 - 01:06 PM, said:

in this function, the argument are not used, Its only there, because I had no errors.

I'm talking about the 'gui.addScrollFunc()' function. What is it doing? How is it using the function 'test'? You can treat functions just like any other variable. For example:

local function hello ( name )
  print( "Hello, " .. name .. "!" )
end

local function foo ( fn )
  fn( "World" )
end

foo( hello ) --> Hello, World!