function tools(gemes)
i=0;
while i<gemes do
sleep(1);
redstone.setOutput("right",true);
sleep(1);
redstone.setOutput("right",false);
i=i+1;
end
end
function sticks(numstk)
stk=0;
while stk<numstk do
sleep(1);
redstone.setOutput("bottom",true);
sleep(1);
redstone.setOutput("bottom",false);
stk=stk+1;
end
end
term.clear();
term.setCursorPos(1,1);
write("What tool do you want?");
term.setCursorPos(1,2);
input=read();
if input=="pickaxe" then
tools(3);
sleep(1);
sticks(2);
os.reboot();
end
if input=="axe" then
tools(3);
sleep(1);
sticks(2);
os.reboot();
end
if input=="sword" then
tools(2);
sleep(1);
sticks(1);
os.reboot();
end
if input=="shovel" then
tools(1);
sleep(1);
sticks(2);
os.reboot();
end
if input=="hoe" then
tools(2);
sleep(1);
sticks(2);
os.reboot();
end
