Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --precode
- shell.run("clear")
- print("V")
- A = .2 --the rate of the arrow
- Botx=1 -- coords of the arrow, or bot
- Boty=1
- char = "V" --the direction of the arrow
- --functions
- function place()
- scrap, scrap, bx, by = os.pullEvent("mouse_click")
- term.setCursorPos(bx,by)
- term.write("A")
- end
- function DrawBot(bot)
- if bot ~= nil then
- char = bot
- bot = nil
- end
- term.clear()
- term.setCursorPos(bx,by)
- term.write("A")
- term.setCursorPos(Botx,Boty)
- term.write(char)
- end
- function Move()
- if Botx > bx then
- Botx = Botx-1
- char = "<"
- DrawBot()
- sleep(A)
- elseif Botx < bx then
- Botx = Botx+1
- char = ">"
- DrawBot()
- sleep(A)
- end
- if Boty > by then
- Boty = Boty-1
- char = "^"
- DrawBot()
- sleep(A)
- elseif Boty < by then
- Boty = Boty+1
- char = "v"
- DrawBot()
- sleep(A)
- end
- end
- function Manim()
- while Botx ~= bx or Boty ~= by do
- Move()
- end
- sleep(.5)
- term.clear()
- DrawBot("V")
- end
- --run code
- while true do
- place()
- Manim()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement