- ComputerCraft | Programmable Computers for Minecraft
- → Y.Petremann's Content
Y.Petremann's Content
There have been 10 items by Y.Petremann (Search limited from 29-March 23)
#57017 Simple bootloader
Posted by Y.Petremann on 06 December 2012 - 07:37 AM in Programs
#56909 Simple bootloader
Posted by Y.Petremann on 06 December 2012 - 12:11 AM in Programs
CODE :
/startup
-- Script at /startup or /disk/startup -- Actual boot sequence bootSequence = { {"HTTP","/boot/http" }, -- it will download scripts over http and boot it, usefull for easy installation {"LAN" ,"/boot/lan" }, -- the computer is controled by a lua interpreter over rednet, usefull for controlling a turtle with a computer -- {"DISK","/disk/startup"}, -- it will boot a disk, if installed in a disk it will make a infinite loop {"HDD" ,"/hdd/startup" }, -- the same thing as rom but you can modify programs, hdd programs are used {"ROM" ,"/rom/startup" }, -- standard boot } -- Program term.setCursorPos(1,1) term.clear() for k,d in ipairs(bootSequence) do name, path = d[1], d[2] if fs.exists(path) and not fs.isDir(path) then print("boot "..name) sleep(1) term.setCursorPos(1,1) term.clear() shell.run( path ) break else print(name.." skipped") end end/boot/lan
-- Script at /boot/lan -- Find a RedNet Modem for n,sSide in ipairs(rs.getSides()) do if peripheral.isPresent(sSide) and peripheral.getType(sSide) == "modem" then sModemSide = sSide break end end if not sModemSide then print("No wireless modem attached") return else print("Started connection on "..sModemSide) print("Started connection on "..os.getComputerID()) end -- Main lua interpreter loop local bRunning = true local tEnv = {} setmetatable( tEnv, { __index = getfenv() } ) rednet.open(sModemSide) while bRunning do local event, senderId, message, distance = os.pullEvent() if event == "rednet_message" then print("== Receive command ==") print(message) local nForcePrint = 0 local func, e = loadstring( message, "lua" ) local func2, e2 = loadstring( "return "..message, "lua" ) if not func then if func2 then print("> is a variable") func = func2 e = nil nForcePrint = 1 end else print("> is a function") if func2 then func = func2 end end if func then setfenv( func, tEnv ) local tResults = { pcall( function() return func() end ) } if tResults[1] then local n = 1 while (tResults[n + 1] ~= nil) or (n <= nForcePrint) do rednet.send(senderId, tostring( tResults[n + 1] )) print( tostring( tResults[n + 1] ) ) n = n + 1 end else rednet.send(senderId, tResults[2]) print( tResults[2] ) end else rednet.send(senderId, e) printError( e ) end end end
- Add script failed test ( so if the boot script that is booted failed it boot the next script)
- Add a separated boot sequence file
- Reboot the computer for each failed boot and boot the next entry, if correctly booted ( normaly can't fail with /rom/startup ) it reset the sequence for the next boot
- Pressing a key to skip the current entry in the boot sequence
- F2 show a menu to choose directly the entry to boot
- Verifying if the actual script is /disk/startup or if /disk/startup is the same script as /startup ( to remove infinite loop effect )
#56521 Unicode Character Support
Posted by Y.Petremann on 04 December 2012 - 03:09 PM in Suggestions
#56518 Black and white computers having lightGray and Gray colors
Posted by Y.Petremann on 04 December 2012 - 03:02 PM in Suggestions
#56517 Full ASCII support + codepage
Posted by Y.Petremann on 04 December 2012 - 02:54 PM in Suggestions
PixelToast, on 04 December 2012 - 08:02 AM, said:
No
Do you want codepage support ?That's a priority
#56516 Full ASCII support + codepage
Posted by Y.Petremann on 04 December 2012 - 02:48 PM in Suggestions
For the second part, I have seen that changing /font/default.png don't affect ComputerCraft. I have seen somes people that have changed this image to correspond to what they want in computercraft. I think that not good.
I saw a real program ( "Schism Tracker" ) that use two color characters (Back/Front) and a codepage to create his interface. Since we have Advanced computers, we could make somes more fancy "graphical" interfaces without using something else than 256 diferent characters.
#56265 Full ASCII support + codepage
Posted by Y.Petremann on 03 December 2012 - 12:47 PM in Suggestions
But I think that we must being able to use the full ASCII chart, and additionnaly, like old computer setting codepages.
If we don't change the actual character size, the codepage file would be 2ko
the graphical appearance of the characters would be defined in binary format like that by 64 bit :
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 01111110 10000001 10100101 10000001 10111101 10011001 10000001 01111110 01111110 11111111 11011011 11111111 11000011 11100111 11111111 01111110 ...
When running a program could load a codepage or modify directly the character by setting directly codes
One implementation I have though could be :
term.glyph(char,line,value) -- to change the way a glyph is draw ( don't apply directly) term.apply() -- apply modification make by glyph() term.codepage(string or filename) -- directly change all glyph depending to the codepage
Firstly it could be good for somes person making programs that require special characters, but with glyph() it could be possible to animate without rewriting text, and finaly to make localized programs.
#5694 [CC 1.33] [Beta 1.8.1] CCInput 0.27 (Big update!) - Play games on your gi...
Posted by Y.Petremann on 23 March 2012 - 02:52 PM in Peripherals and Turtle Upgrades
#5138 Unicode in computercraft
Posted by Y.Petremann on 20 March 2012 - 03:26 AM in Ask a Pro
Casper7526, on 14 March 2012 - 11:09 PM, said:
Those are all your available characters for not only ComputerCraft, but Minecraft.
I am trying to make a texture pack with the old look of character with language that use unicode ...
The character I ask for are possible in minecraft, but It could be a good idea to have computercraft unicode compatible
#4223 Unicode in computercraft
Posted by Y.Petremann on 14 March 2012 - 07:40 PM in Ask a Pro
▀█▖▗▘▙▚▛▜▝▞▟Is it posible
- ComputerCraft | Programmable Computers for Minecraft
- → Y.Petremann's Content