Legebatterie

maxintosh2--mAPI

Jan 30th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. runCutLine=function(start,stop,name)
  2.  
  3. os.loadAPI("shell")
  4. data={}
  5.  
  6. if fs.exists("maxintosh/RAM/"..name) then
  7. fs.delete("maxintosh/RAM/"..name)
  8. end
  9. fs.copy(name,"maxintosh/RAM/"..name)
  10.  
  11. f=fs.open("maxintosh/RAM/"..name,"r")
  12. for i=1,start-1 do
  13. trash=f.readLine()
  14. end
  15.  
  16. for i=start,stop do
  17. data[(i-start)+1]=f.readLine()
  18. end
  19. f.close()
  20.  
  21. fs.delete("maxintosh/RAM/"..name)
  22.  
  23. f=fs.open("maxintosh/RAM/"..name,"w")
  24. for i=1,(stop-start)+1 do
  25. f.writeLine(data[i])
  26. end
  27. f.close()
  28.  
  29. shell.run("maxintosh/RAM/"..name)
  30. fs.delete("maxintosh/RAM/"..name)
  31.  
  32. end
  33.  
  34.  
  35. drawWindow=function(x,y,colWind)
  36. x2=51-(x-1)
  37. y2=19-(y-1)
  38. paintutils.drawFilledBox(x,y,x2,y2,colors[colWind])
  39. paintutils.drawBox(x,y,x2,y2,colors.black)
  40. term.setBackgroundColor(colors.red)
  41. term.setTextColor(colors.black)
  42. term.setCursorPos(x2,y)
  43. write("X")
  44. end
Advertisement
Add Comment
Please, Sign In to add comment