Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[||
- Wow's database API
- This API need:
- -Rednet (Opened)
- ||]]
- --[[
- Error codes:
- 0x0: no error
- 0x1: nil arg
- 0x2: not connected
- 0x3: Rednet not opened
- 0x4: Bad ID
- ]]
- local id = 0
- function findServerID()
- local id = rednet.lookup("HomePI", "main")
- return id
- end
- local function send(sTable)
- if sTable == nil then return 0x1 end
- rednet.send(findServerID(), sTable)
- event, msg, id = rednet.receive()
- if id ~= findServerID() then return 0x4 end
- print("Succefuly")
- if msg == 0x0 then
- end
- end
- function database(action, arg1, arg2, arg3, arg4, arg5)
- if action == "createUser" then
- if arg1 == nil or arg2 == nil or arg3 == nil or arg4 == nil or type(arg4) ~= "number" or type(arg1) ~= "string" or type(arg2) ~= "string" or type(arg3) ~= "string" then
- return 0x1
- else
- local TEMP_TABLE = {todo = action, Username = arg1, Password = arg2, Biolock = arg3, accesslevel == arg4}
- send(TEMP_TABLE)
- end
- end
- end
- function setToken(token)
- if token == nil then return 0x1 end
- end
- function connect(token)
- if token == nil then return 0x1 end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement