Gopher's APIs - Old, and broken, but still good. Yah. Still good.
#21
Posted 12 January 2013 - 07:49 PM
Unrelated, I belatedly updated the main post to document some new features I posted to the pastebin version a couple of weeks ago. Spawned coroutines can now have their own specified terminal redirect objects, which will automatically be used whenever the routine runs.
#22
Posted 12 January 2013 - 07:58 PM
GopherAtl, on 12 January 2013 - 07:49 PM, said:
Unrelated, I belatedly updated the main post to document some new features I posted to the pastebin version a couple of weeks ago. Spawned coroutines can now have their own specified terminal redirect objects, which will automatically be used whenever the routine runs.
#23
Posted 12 January 2013 - 08:33 PM
#25
Posted 13 January 2013 - 01:15 AM
GopherAtl, on 12 January 2013 - 05:34 AM, said:
yeah, i looked at it now and read the fine print stating "sample program" my mistake
#26
Posted 13 January 2013 - 07:38 AM
edit: I downloaded it and every time i try running it a random number is displayed :l the number is 24
edit2: got something working but now i implemented my code it doesnt work
#27
Posted 13 January 2013 - 10:09 AM
The buffer is on pastebin here: http://pastebin.com/fU9Kj9zr ( pastebin get fU9Kj9zr buffer )
here's a simple example I threw together, uses goroutines and buffers to run a shell with a background coroutine that prints the contents of the screen to a file when you press F12. (only prints the characters, not the color data - you can access color info just as easily though) Lots of detailed comments in this, plus as a bonus included my usual error logging coroutine, which is a must-have when debugging programs using goroutines.
you can grab this program from pastebin as well, here http://pastebin.com/khYEAUDM ( pastebin get khYEAUDM example ) If you're not calling os.loadAPI on buffer and goroutines in startup, or just using this as startup, you'd have to add the lines to the top to load both APIs first.
#28
Posted 14 January 2013 - 01:24 AM
#29
Posted 14 January 2013 - 09:25 PM
two basic approaches: it could run from shell, similar to the mon command to run a program on a monitor, where you say, ex, "record worms" and it runs worms, recording it. Wouldn't need goroutines for that. Other option is having goroutines run in startup, putting a video capture routine in the background, with recording toggled by pressing some key. That would use coroutines, tho not necessarily goroutine (parallel.waitForAny in startup could do the same).
Explaining in more detail than that is beyond the scope of this thread, I'm afraid!
#30
Posted 16 January 2013 - 05:14 PM
Also integrating ctrlkeys here, requested the original thread be locked. One thread will be easier to follow/manage, and my apis are increasingly designed to be used together.
#31
Posted 17 January 2013 - 12:33 PM
#32
Posted 17 January 2013 - 12:34 PM
#33
Posted 19 January 2013 - 03:28 PM
#34
Posted 19 January 2013 - 05:12 PM
#35
Posted 20 January 2013 - 05:03 AM
#36
Posted 20 January 2013 - 05:40 AM
I'm assuming you weren't checking if it was loaded already, though I'm rather surprised that would crash minecraft - just tried it myself, didn't do anything like that for me. Anywy, give the update a try.
#37
Posted 20 January 2013 - 01:14 PM
os.loadAPI("goroutine") goroutine.launch()
Edit: Trying da update...
Edit: Edit: Replicated error on a new world with that script( latest version ), and then opening a new computer. The CC computer screen went blank, and then MC crashed.
Edited by MudkipTheEpic, 20 January 2013 - 01:33 PM.
#38
Posted 20 January 2013 - 05:37 PM
...
don't do that. It is designed to run from the normal startup, after everything else has loaded. I might look into making a version meant to be installed in rom, but it would install itself very differently than this does.
:edit: I've added the check directly to the launch function which may eliminate the problem for you, but it was not intended to be run that way so. You say you placed an ew computer and opened it and it immediately crashed, so where exactly are you putting that?
#39
Posted 21 January 2013 - 04:10 AM
GopherAtl, on 20 January 2013 - 05:37 PM, said:
...
don't do that. It is designed to run from the normal startup, after everything else has loaded. I might look into making a version meant to be installed in rom, but it would install itself very differently than this does.
:edit: I've added the check directly to the launch function which may eliminate the problem for you, but it was not intended to be run that way so. You say you placed an ew computer and opened it and it immediately crashed, so where exactly are you putting that?
Actually, I installed it into a regular computer's startup, not rom/startup. Here's what I did:
- Place cpu down.
- Get goroutine off pastebin.
- Write that script in "edit startup".
- Reboot cpu. Cpu will start to flash the CraftOS screen.
Place another cpu down.- Screen will be blank, and Minecraft will crash in a few seconds.
Trying the new version now.....
Edit: You dont even have to place another CPU down! Mc crashes with no error screen. The console said it spawned 1964 coroutines..... o_O
Edited by MudkipTheEpic, 21 January 2013 - 04:15 AM.
#40
Posted 21 January 2013 - 05:09 AM
GopherAtl, on 20 January 2013 - 05:40 AM, said:
I'm assuming you weren't checking if it was loaded already, though I'm rather surprised that would crash minecraft - just tried it myself, didn't do anything like that for me. Anywy, give the update a try.
Check if it is loaded before loading. the startup code in the OP gives you code to do this.
GopherAtl, on 17 October 2012 - 01:41 AM, said:
Usage
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users