Advertisement
Guest User

ZanqualCopyright

a guest
Dec 13th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.28 KB | None | 0 0
  1. function ifd(variable,value,competense,api)
  2.   if variable == nil or value == nil or competense == nil or api == nil then
  3.     printError("Usage:\n ifd\( <variable> , <value> , <competense> , <api>\)")
  4.   else
  5.     if competense == "=" then
  6.       if variable == value then
  7.         os.loadAPI(api)
  8.       end
  9.     elseif competense == "<" then
  10.       if variable < value then
  11.         os.loadAPI(api)
  12.       end
  13.     elseif competense == ">" then
  14.       if variable > value then
  15.         os.loadAPI(api)
  16.       end
  17.     elseif competense == "isnot" then
  18.       if variable ~= value then
  19.         os.loadAPI(api)
  20.       end
  21.     end
  22.   end
  23. end
  24.  
  25. function ford(variable,number1,number2,api)
  26.   if variable == nil or number1 == nil or number2 == nil or api == nil then
  27.     printError("Usage:\n ford( <variable> , <number 1> , <number 2> , <api>)")
  28.   else
  29.     for variable = number1, number2 do
  30.       os.loadAPI(api)
  31.     end
  32.   end
  33. end
  34.  
  35. local function p(txt) return print(txt) end
  36. local function scp(x,y) return term.setCursorPos(x,y) end
  37. local function stc(c) return term.setTextColor(c) end
  38. local function s(sl) return sleep(sl) end
  39. local function sbc(c) return term.setBackgoundColor(c) end
  40. local function gcp(xy) return xy = term.getCursorPos() end
  41. local function w(txt) return write(txt) end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement