Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- Computer ID = 4 - Turtle
- --# load the touchpoint API
- os.unloadAPI("touchpoint")
- os.loadAPI("touchpoint")
- local monSide = "back"
- local wlmSide = "left"
- -- Connecting Peripheral
- local wirelessModem = peripheral.wrap(wlmSide)
- local replyChannel = 1
- local listenChannel = 3
- local turtle = 4
- --Fill this table with the names of mobs
- local currMob = "NONE"
- --The ID of the turtle with the safari nets
- --The side your modem is on
- local function setCurrMobMoni(currMob)
- currMob=currMob
- print (string.match(currMob,"Pech"))
- print ("")
- if string.match(currMob,"Pech") == "Pech" then
- currMob="Pech"
- end
- local t = touchpoint.new(monSide)
- momo = peripheral.wrap(monSide)
- mX = momo.getSize()
- x = math.floor(mX/2) - math.floor(string.len(currMob)/2)
- sx=x
- fx = sx + #currMob + 1
- t:add(currMob, nil, sx, 2, fx, 4, colors.red, colors.red)
- t:draw()
- t=nil
- end
- while true do
- wirelessModem.open(listenChannel)--Open channel 3 so that we can listen on it
- event, modemSide, senderChannel, replyChannel, mySerMes, senderDistance = os.pullEvent("modem_message")
- myCopy=textutils.unserialize(mySerMes)
- if myCopy.message == "curMob" then
- setCurrMobMoni(myCopy.argument)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement