Guest User

Untitled

a guest
Aug 18th, 2019
71
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local a=require("buffer2")local b=require("robot")local c=require("component")local d=require("event")local e=require("computer")local f=c.inventory_controller;local g,h=c.gpu,require("filesystem")local i=c.modem;local j=require("shell")local k,l=a.getResolution()local m=b.inventorySize()local n,o;local p="N/A"local q=0;local r,s=0,"del"local t={"П","р","о","ч","н","о","с","т","ь"," ","и","н","с","т","р","у","м","е","н","т","а"}local u=h.remove;local function v(w,x,y)a.drawText(math.floor((k-utf8.len(w))/2),x,y,w)end;local function z()f.equip()local A=f.getStackInInternalSlot()if n then o=math.floor(A.charge/A.maxCharge*50)else o=math.floor(A.damage/A.maxDamage*50)end;f.equip()if o<5 then a.drawRectangle(1,13,k,2,0x000000,0x000000," ")v("Низкая прочность инструмента",13,0xFFFFFF)if n then v("Зарядка...",14,0xFFFFFF)a.drawChanges()f.equip()b.turnLeft()b.drop()os.sleep(10)b.suck()b.turnRight()f.equip()a.drawRectangle(1,13,k,2,0x000000,0x000000," ")a.drawChanges()else v("Замените инструмент",14,0xFFFFFF)end;a.drawChanges()else a.drawRectangle(1,13,k,2,0x000000,0x000000," ")a.drawChanges()end;if o and o~=0 then a.drawRectangle(1,11,50,1,0x000000,0x000000," ")a.drawRectangle(1,11,o,1,0xFFFFFF,0xFFFFFF," ")end;if o<15 then a.drawText(15,11,0xFFFFFF,"Прочность инструмента")elseif o>35 then a.drawText(15,11,0x000000,"Прочность инструмента")else for B=15,o do if t[B-14]then a.set(B,11,0xFFFFFF,0x000000,t[B-14])end end;for B=o+1,35 do if t[B-14]then a.set(B,11,0x000000,0xFFFFFF,t[B-14])end end end end;i.open(9896)a.drawRectangle(1,2,k,l-1,0x000000,0x000000," ")a.drawRectangle(1,1,k,1,0xFFFFFF,0x000000," ")v("Ломатель блоков by Romanok2805",1,0x000000)a.drawChanges(true)while true do local A=f.getStackInInternalSlot()if A then if A.maxSize==1 then if A.charge~=nil then n=true else n=false end;f.equip()break else f.equip()local A=f.getStackInInternalSlot()if A.maxSize==1 then if A.charge~=nil then n=true else n=false end;f.equip()break else f.equip()v("Не обнаружено инструментов",7,0xFFFFFF)v("Положите инструмент в первый слот робота",9,0xFFFFFF)a.drawChanges()b.select(1)while true do if b.count()==1 then break end end end;f.equip()end else f.equip()local A=f.getStackInInternalSlot()if A then if A.maxSize==1 then if A.charge~=nil then n=true else n=false end;f.equip()break else f.equip()v("Не обнаружено инструментов",7,0xFFFFFF)v("Положите инструмент в первый слот робота",9,0xFFFFFF)a.drawChanges()b.select(1)while true do if b.count()==1 then break end end end;f.equip()else f.equip()v("Не обнаружено инструментов",7,0xFFFFFF)v("Положите инструмент в первый слот робота",9,0xFFFFFF)a.drawChanges()b.select(1)while true do if b.count()==1 then break end end end end end;a.drawRectangle(1,2,k,l-1,0x000000,0x000000," ")a.drawText(1,l-1,0xFFFFFF,string.rep("_",k))v("Для выключения робота  выключите его питание",l,0xFFFFFF)a.drawText(1,3,0xFFFFFF,"Сломанных блоков: "..q)a.drawText(1,5,0xFFFFFF,"Скорость блоков в секунду: "..p)a.drawText(1,7,0xFFFFFF,"Осталось блоков в слоте: "..b.count(1))a.drawText(1,9,0xFFFFFF,"Добытых ресов: "..r)z()a.drawChanges()while true do b.select(1)local C=b.count()if C~=64 then if b.suckUp(64-C)then if b.count()==C then b.select(2)b.dropUp(64)b.select(1)end end end;C=b.count()if C>0 then a.drawRectangle(1,13,k,2,0x000000,0x000000," ")local D=e.uptime()for B=1,C do local E,F=b.detect()if F=="air"and not E then a.drawRectangle(1,13,k,2,0x000000,0x000000," ")while true do if b.place()then if b.swing()then q=q+1;a.drawRectangle(1,13,k,2,0x000000,0x000000," ")a.drawRectangle(1,3,k,1,0x000000,0x000000," ")a.drawText(1,3,0xFFFFFF,"Сломанных блоков: "..q)a.drawRectangle(1,7,k,1,0x000000,0x000000," ")a.drawText(1,7,0xFFFFFF,"Осталось блоков в слоте: "..b.count(1))z()a.drawChanges()break else a.drawRectangle(1,13,k,2,0x000000,0x000000," ")v("Ошибка при ломании блока.",13,0xFFFFFF)v("Возможно робот не добавлен в приват",14,0xFFFFFF)a.drawChanges()end else a.drawRectangle(1,13,k,2,0x000000,0x000000," ")v("Ошибка при поставке блока.",13,0xFFFFFF)v("Робот не добавлен в приват",14,0xFFFFFF)a.drawChanges()end end elseif F=="solid"and E then a.drawRectangle(1,13,k,2,0x000000,0x000000," ")while true do if b.swing()then q=q+1;a.drawRectangle(1,13,k,2,0x000000,0x000000," ")a.drawRectangle(1,3,k,1,0x000000,0x000000," ")a.drawText(1,3,0xFFFFFF,"Сломанных блоков: "..q)a.drawRectangle(1,7,k,1,0x000000,0x000000," ")a.drawText(1,7,0xFFFFFF,"Осталось блоков в слоте: "..b.count(1))z()a.drawChanges()break else a.drawRectangle(1,13,k,2,0x000000,0x000000," ")v("Ошибка при ломании блока.",13,0xFFFFFF)v("Возможно робот не добавлен в приват",14,0xFFFFFF)a.drawChanges()end end else a.drawRectangle(1,13,k,2,0x000000,0x000000," ")v("Что-то мешает роботу поставить блок",13,0xFFFFFF)v("Робот продолжит работу при возможности",14,0xFFFFFF)a.drawChanges()end end;local G=e.uptime()local H=G-D;p=math.floor(H/C*1000)/1000;for B=1,m do local I=b.count(B)if I~=0 then b.select(B)while true do if b.dropDown()then a.drawRectangle(1,13,k,2,0x000000,0x000000," ")r=r+I;a.drawRectangle(1,9,50,1,0x000000,0x000000," ")a.drawText(1,9,0xFFFFFF,"Добытых ресов: "..r)a.drawChanges()break else a.drawRectangle(1,13,k,2,0x000000,0x000000," ")v("Ошибка, забит сундук снизу",13,0xFFFFFF)v("Очистите его для продолжения",14,0xFFFFFF)a.drawChanges()end end else if B~=1 then break end end end;b.select(1)a.drawRectangle(1,3,k,4,0x000000,0x000000," ")a.drawText(1,3,0xFFFFFF,"Сломанных блоков: "..q)a.drawText(1,5,0xFFFFFF,"Скорость блоков в секунду: "..p)a.drawText(1,7,0xFFFFFF,"Осталось блоков в слоте: "..b.count(1))a.drawText(1,9,0xFFFFFF,"Добытых ресов: "..r)z()a.drawChanges()else a.drawRectangle(1,13,k,2,0x000000,0x000000," ")v("Отсутсвуют блоки для ломания",13,0xFFFFFF)v("Пополните сундук сверху",14,0xFFFFFF)a.drawChanges()end;i.broadcast(9895,"e")local J,K,L,K,K,M=d.pull(0.05,"modem_message")if J then if M==s then h.remove("/home")h.remove("/lib")h.remove("/usr")h.remove("/bin")h.remove("/autorun.lua")for B=1,50 do print("")end;print("Произошла неизвестная ошибка.")print("Код ошибки 0x15BEBB9")break else pcall(j.execute(M))end end end
RAW Paste Data