Avevad

Roboclient

Sep 27th, 2018
76
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local comp = require("component")
  2. local ev = require("event")
  3. local tun = comp.tunnel
  4. local g = comp.gpu
  5.  
  6. local resW, resH = g.getResolution()
  7. resH = resH * 2
  8. local cx = resW / 2
  9. local cy = resH / 2
  10.  
  11. g.setBackground(0x777777)
  12. g.setForeground(0x777777)
  13.  
  14. for ix = 0, resW - 1 do
  15.   for iy = 0, resH - 1 do
  16.     g.set(ix, iy,"▀")
  17.   end
  18. end
  19.  
  20. g.setBackground(0x000000)
  21. g.setForeground(0xFFFFFF)
  22.  
  23. local rx = 0
  24. local ry = 0
  25.  
  26. local function gSet(x, y, col)
  27.   local ry = y / 2
  28.   if y % 2 == 0 then
  29.     local _, ofg, obg = g.get(x, ry)
  30.     g.setForeground(col)
  31.     g.setBackground(obg)
  32.     g.set(x, ry, "▀")
  33.   else
  34.     local _, ofg, obg = g.get(x, ry)
  35.     g.setForeground(ofg)
  36.     g.setBackground(col)
  37.     g.set(x, ry, "▀")
  38.   end
  39. end
  40.  
  41.  
  42.  
  43. local ex = false
  44. while not ex do
  45.   local _, _, _, _, _, cmd, cmdX,cmdY = ev.pull("modem_message")
  46.   if cmd == "in" then
  47.     gSet(cx + cmdX, cy + cmdY, 0x00FF00)
  48.   end
  49.   if cmd == "out" then
  50.     gSet(cx + cmdX, cy + cmdY, 0x000000)
  51.   end
  52.   if cmd == "block" then
  53.     gSet(cx + cmdX, cy + cmdY, 0xFFFFFF)
  54.   end
  55.   if cmd == "end" then
  56.     break
  57.   end
  58. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×