Wyvern67

API mp

Jan 20th, 2013
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | None | 0 0
  1. function mprint(data, m)
  2.  if m==nil then print("You forgot the m argument, faggot.") end
  3.  
  4.  local dummy,i=m.getCursorPos()
  5.     m.write(data)
  6.     if i<12 then m.setCursorPos(1, i+1) end
  7.     if i>=12 then m.scroll(1) m.setCursorPos(1,12) end
  8. end
  9.  
  10. function mprintFile(dir, m)
  11.     file=fs.open(dir, "r")
  12.  
  13.     m.clear()
  14.     m.setCursorPos(1,1)
  15.     line="Debut"
  16.     while not (line==nil) do
  17.       sleep(0.2)
  18.       line=file.readLine()
  19.       mp.mprint(line, m)
  20.     end
  21.     fs.delete(file)
  22. end
Add Comment
Please, Sign In to add comment