ComputerCraftããã°ã©ãã³ã°ç°å¢ã®è¨å®ã¡ã¢
ã¾ãã¯åºæ¬çãªè¨å®
- GAME_DIR\resoucepacksããã©ã«ãã«ãComputerCraft1.6xx.jar ãå±éãã¦é
ç½®ã
- 圧縮・解凍ソフト 7-Zip使ã£ã¦ãå³ã¯ãªãã¯ã§å±éãã¦ã£ã¨ãæ©ãã
- 念ã®ããComputerCraftã¨ãã©ã«ãååãå¤ãã¦ããï¼å¿ è¦ãªãããï¼
- GAME_DIR\resourcepacks\ComputerCraft\assets\computercraft\lua\rom ã«ã好ããªååã®ãã©ã«ããä½æ
- ããã§ã¯ãPocketComputerç¨ã«ãpcãã¨ããååã®ãã©ã«ããä½ã
- GAME_DIR\resourcepacks\ComputerCraft\assets\computercraft\lua\rom\pc
- ã²ã¼ã å¤ã®ããã¹ãã¨ãã£ã¿ãªã©ã§ä½æããããã°ã©ã ãã¡ã¤ã«ããã®ãpcããã©ã«ãã«ç½®ãã¨ãã²ã¼ã å ã®å ¨ã¦ã®ã³ã³ãã¥ã¼ã¿ããã/rom/pcããã£ã¬ã¯ããªã¨ãã¦ã¢ã¯ã»ã¹ã§ãã
ãã¹ãéããã¨ã§å ¥åã楽ã«ãã
ä¸è¨ãã©ã«ãã«ç½®ããããã°ã©ã ãã¡ã¤ã«ï¼ãã¨ãã°ãã¡ã¤ã«åãtestãï¼ãå®è¡ããã«ã¯ã
> /rom/pc/test
ã®ããã«æã¡è¾¼ã¾ãªãã¨ãããªãããé¢åãªãã°ãã¹ãããã«éãã¦ããã¨è¯ãã
GAME_DIR\resourcepacks\ComputerCraft\assets\computercraft\lua\rom\startupããã¡ã¤ã«ã®æ¸ãæãã
ãsPath = sPath..":/rom/pc"ãã®ãããªè¨è¿°ãããã¡ã¤ã«ä¸ã®ãshell.setPath( sPath )ãã®è¡ãããåã®ä½ç½®ã«æ¸ãè¾¼ã
ããã ãã§ãã/rom/pcãã«ããããã°ã©ã ãã¡ã¤ã«ããã¡ã¤ã«åã ãã§å®è¡ã§ããã
> test
ã®ããã«ã
ãã¡ã¤ã«åã®æ¡å¼µåãçç¥ãã¦ãå®è¡ã§ããããã«
ããã¹ãã¨ãã£ã¿ã¨ã®é¢ä¿ã§ããã¡ã¤ã«åãæ¡å¼µåã.luaãä»ãã«ããªãã¨ãããªãï¼ãããã¯æå³çã«ãããããï¼ã¨ãã«ã以ä¸ã®ããã«æ¢åããã°ã©ã ãæ¸ãæãããã¨ã§ãæ¡å¼µåãçç¥ãã¦ããã®ã¾ã¾ãã®ãã¡ã¤ã«ãå®è¡ã§ããã
- ã/rom/program/shellããã¡ã¤ã«å
ãshell.resolveProgram()ã®æ¸ãæã
- ã³ã¡ã³ãã-- Otherwise, look on the path variableã以ä¸ã®foræã®ä¸ã§ã.luaãã®å¦çã追å ã
function shell.resolveProgram( _sCommand ) -- Substitute aliases firsts if tAliases[ _sCommand ] ~= nil then _sCommand = tAliases[ _sCommand ] end -- If the path is a global path, use it directly local sStartChar = string.sub( _sCommand, 1, 1 ) if sStartChar == "/" or sStartChar == "\\" then local sPath = fs.combine( "", _sCommand ) if fs.exists( sPath ) and not fs.isDir( sPath ) then return sPath end return nil end -- Otherwise, look on the path variable for sPath in string.gmatch(sPath, "[^:]+") do sPath = fs.combine( shell.resolve( sPath ), _sCommand ) local sPathExtLua = sPath..".lua" if fs.exists( sPath ) and not fs.isDir( sPath ) then return sPath elseif fs.exists( sPathExtLua ) and not fs.isDir( sPathExtLua ) then return sPathExtLua end end -- Not found return nil end
ã¤ã¾ã
以ä¸ããã¹ã¦è¡ããã¨ã§ã
GAME_DIR\resourcepacks\ComputerCraft\assets\computercraft\lua\rom\pc\ ãã©ã«ãã«ç½®ããããtest.luaãã¨ããããã°ã©ã ãã¡ã¤ã«ãã
å
¨ã¦ã®CCã³ã³ãã¥ã¼ã¿ããã> test
ã¨æã¡è¾¼ãã ãã§å®è¡ã§ããã
ãã ãã/rom
ãã£ã¬ã¯ããªã«ããããã°ã©ã ãã¡ã¤ã«ã¯ãã²ã¼ã å
ããç·¨éã§ããªãã®ã§æ³¨æã
ã¤ã¾ããããã°ã©ã ãã¡ã¤ã«ã®ç·¨éã¯å¸¸ã«å¤é¨ã¨ãã£ã¿ã§è¡ããã¨ã«ãªãã
APIãLoadããæ¹æ³
èªåã以åã«ä½ã£ãAPIããããããä½ãããã°ã©ã ãã¡ã¤ã«ã§èªã¿è¾¼ã¿ããã¨ãã«ã¯ã次ã®ãããªè¡ãããã°ã©ã ãã¡ã¤ã«ã®åã®ã»ãã«æ¸ãè¾¼ã
os.loadAPI("/rom/pc/myapi")
- myapi.luaã¨ãããã¡ã¤ã«åã®ã¾ã¾ã ã¨ã¡ãã£ã¨ã¾ãããæ¡å¼µåç¡ãã«ãã¡ã¤ã«èªä½ã®ååãå¤æ´ãã¦ãã ããããããã¯ãos.loadAPI()ã§ã¯ãªãèªåã§APIãloadããé¢æ°ãå®ç¾©ãããã
ããã§ããã¼ãã«ãmyapiãã使ã£ã¦ãAPIãå©ç¨ã§ããã
ã·ã³ããªãã¯ãªã³ã¯ã®æ´»ç¨
ï¼ä»¥ä¸ã¯ãèªå·±è²¬ä»»ã§è¡ããã¨ãã³ãã³ãå ¥åãã¹ã«ãããã©ãã«ãèµ·ãã¦ãä¿éã¯ã§ãã¾ããï¼
GAME_DIR\resourcepacks\ComputerCraft\assets\computercraft\lua\rom\ããã£ã¬ã¯ããªã¯ã¨ã¦ãæ·±ãã¨ããã«ããã®ã§ã¢ã¯ã»ã¹ãã¥ããã
ã¾ããããã¤ãã®ãã¼ã¸ã§ã³ã®ãã¤ã³ã¯ã©ããã使ãåãã¦ããã¨ããããããã®resourcepacksãã©ã«ãã«Luaããã°ã©ã ãã¡ã¤ã«ãç½®ãã®ãããã©ãã
Luaãã¡ã¤ã«ç½®ãå ´ã¸é£ã¶ãã¨ãã§ããã·ã³ããªãã¯ãªã³ã¯ãåresoucepacksãã©ã«ãã«ä½ããã¨ã§æ¥½ããããã
- ããããããã¡ã¤ã«ç½®ãå ´ãã£ã¬ã¯ããªãä½ã£ã¦ããï¼ãã¨ãã° C:\luafiles\pcï¼
- 管çè ã¢ã¼ãã§ã³ãã³ãããã³ããèµ·å
- mklink ã³ãã³ãã®å®è¡ãæ¸å¼ã¯ä»¥ä¸ã®éã
> mklink /d <ä½ãããã·ã³ããªãã¯ãªã³ã¯> <ãã§ã«åå¨ãããã£ã¬ã¯ããª>
ãã¨ãã°ã次ã®ããã«(GAME_DIRã¯èªåã®ç°å¢ã«ç½®ãæãããã¨)
> mklink /d GAME_DIR\resourcepacks\ComputerCraft\assets\computercraft\lua\rom\pc C:\luafiles\pc
è¨ãã°ããã§ã«åå¨ãããã£ã¬ã¯ããªã«å¯¾ããã·ã§ã¼ãã«ãããªã®ã§ãåããã£ã¬ã¯ããªã«åãã£ã¦è¤æ°ã®ã·ã³ããªãã¯ãªã³ã¯ãä½ããã¨ãå¯è½ã
éãã§ãããã¤ã³ã¯ã©ããã®ãã£ã¬ã¯ããªãã¨ã«ä¸è¨ã³ãã³ããå®è¡ããã°ããã
ãã¡ã¤ã«ç½®ãå ´ãã£ã¬ã¯ããªå ã®ãã¡ã¤ã«ãæ¸ãæããã°ãããããã®ãã¤ã¯ã©ã§åæ ãããã
ãªããmklinkã³ãã³ãã®å¼æ°ã®åå¾ãå ¥ãæ¿ãã¦ãã¾ããªããã注æãæ²æ¨ãªãã¨ã«ãªãã
以ä¸ã¯Windowsã§ã®ããæ¹ã ããMacOSXãLinuxã§ãã·ã³ããªãã¯ãªã³ã¯ã使ãã¨åããã¨ãã§ããã¯ãã
Windowsã®ã·ã³ããªãã¯ãªã³ã¯ã¯ä»¥ä¸ã®å³ã®ããã«ç¢å°ä»ãã®ãã©ã«ãã§è¡¨ç¤ºãããã