Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --binds
- one = "turtle.attack()"
- two = "turtle.suck(64)"
- three = ""
- four = ""
- --variables
- botid = 2
- --functions
- function command(msg)
- rednet.send(botid, msg)
- print("--> "..msg)
- end
- function bind(key)
- command("r")
- sleep(0.1)
- if key == keys.one then
- command(one)
- elseif key == keys.two then
- command(two)
- elseif key == keys.three then
- command(three)
- elseif key == keys.four then
- command(four)
- end
- end
- --body
- rednet.open("back")
- relay = true
- while relay do
- event, key = os.pullEvent()
- if key == keys.leftAlt then
- relay = false
- term.clear()
- term.setCursorPos(1,1)
- elseif key == keys.leftCtrl then
- command("lCtrl")
- elseif key == keys.w then
- command("w")
- elseif key == keys.s then
- command("s")
- elseif key == keys.a then
- command("a")
- elseif key == keys.d then
- command("d")
- elseif key == keys.space then
- command("space")
- elseif key == keys.leftShift then
- command("lShift")
- elseif key == keys.e then
- command("e")
- elseif key == keys.f then
- command("f")
- elseif key == keys.g then
- command("g")
- elseif key == keys.q then
- command("q")
- write("slot >> ")
- sleep(0.1)
- ans = read()
- command(tostring(ans))
- elseif key == keys.r then
- command("r")
- write("command >> ")
- sleep(0.1)
- ans = read()
- command(tostring(ans))
- elseif key == keys.one then
- bind(key)
- elseif key == keys.two then
- bind(key)
- elseif key == keys.three then
- bind(key)
- elseif key == keys.four then
- bind(key)
- end
- end
Add Comment
Please, Sign In to add comment