Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- タートルが釣りするよ
- local function turi()
- while true do -- メインループや
- print('turude')
- turtle.attack() -- 釣り開始やで
- sleep(30) -- ちょっと待つよ
- if turtle.dig() then -- 釣り上げるで
- print('tureta')
- else
- print('turen katta')
- end
- end
- end
- -- 持っとるアイテムを上のチェストに入れるよ
- local function simattyaoune()
- while true do -- このメインループや
- for i = 1, 16 do -- タートルのインベントリスロットを順番に見てくよ
- print('slot '.. tostring(i) ..' wo siraberu yo')
- if turtle.getItemDetail(i) then -- スロットが空かどうか調べるよ
- print('simau de')
- turtle.select(i)
- turtle.dropUp() -- 空じゃなかったからチェストに入れるよ
- turtle.select(1) -- 用が済んだら選択スロットを戻しとくんのが乙女のたしなみやで
- end
- sleep(1)
- end
- end
- end
- -- 燃料がなかったら補給するよ
- local function hokyu()
- while true do -- メインループや
- print('nenryo kakunin ya')
- if turtle.getFuelLevel() < 100 then -- 燃料がまだあるか見るよ
- print('hokyu surude')
- turtle.select(16) -- インベントリの最後のスロットを使うよ
- turtle.suckDown() -- 燃料無いから下のチェストから出すよ
- if turtle.refuel() then -- 燃料補給やで
- print('hokyu sitayo (FL:'.. tostring(turtle.getFuelLevel()) ..')')
- else
- print('hokyu dekin katta') -- できんかった
- end
- turtle.select(1) -- 乙女のたしなみや
- end
- sleep(60) -- しばらく待機するで
- end
- end
- parallel.waitForAny(turi, simattyaoune, hokyu)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement