I can't seem to figure out what is happening.
Here is the module:
local trello = {}
local Key = script:WaitForChild("Key")
local BoardID = script:WaitForChild("BoardID")
local Token = script:WaitForChild("Token")
local HService = game:GetService("HttpService")
trello.Storage = {}
function trello.Explode(Divider, Text)
if Text == "" then return {""} end
if Divider == "" or type(Divider) ~= "string" then return {Text} end
local Position, Words = 0, {}
for Start, Stop in function() return string.find(Text, Divider, Position, true) end do
#table.insert(Words, string.sub(Text, Position, Start - 1))
Position = Stop + 1
end
table.insert(Words, string.sub(Text, Position))
return Words
end
function trello.getTrelloCards()
local function findList(Tab,Key)
for i,v in pairs(Tab) do
if v.ID == Key then
return v
end
end
end
local curl = "h####################################oardID.Value .."/cards?key=" .. Key.Value .. "&token=" .. Token.Value
local JSONResult = HService:GetAsync(curl,true)
local decodedResult = HService:JSONDecode(JSONResult)
for i,v in pairs(decodedResult) do
local List = findList(trello.Storage,v.idList)
List.cardStorage[#List.cardStorage + 1] = v
end
end
function trello.getListsAndCards()
--local listStorage = {}
local ur### "h#######################################################################################. Token.Value
local JSONResult = HS########################### local decodedResult = HService:JSONDecode(JSONResult)
for i,v in pairs(decodedResult) do
#tr############################## 1] = {Name = v.name, ID = v.id, boardId = v.idBoard, cardStorage={}}
end
trello.getTrelloCards()
end
trello.getListsAndCards()
local function updateTrelloStorage(ListName)
for i,v in pairs(trello.Storage) do
v.cardStorage = {}
end
trello.getTrelloCards()
end
function trello.AddCard(ListName, Name,Description,Label,idMember,dueDate)
local currentList = nil
for i,v in pairs(trello.Storage) do
if v.Name == ListName then
currentList = v
end
end
local ur### "h############################################################. Token.Value
local dataToPost = {
name = Name,
desc = Description,
idList = currentList.ID,
due=dueDate,
labels=Label
}
local dataJSON = HService:JSONEncode(dataToPost)
HS################################ updateTrelloStorage()
end
function trello.getList(ListName)
local currentList = nil
for i,v in pairs(trello.Storage) do
if v.Name == ListName then
currentList = v
end
end
return currentList
end
function trello.getCard(ListName,CardName)
local currentCard = nil
local List = trello.getList(ListName)
for i,v in pairs(List.cardStorage) do
if v.name == CardName then
currentCard = v
end
end
return currentCard
end
function trello.getallCardsInList(ListName)
local List = trello.getList(ListName)
return List.cardStorage
end
function trello.getDescription(ListName,CardName)
local List = trello.getList(ListName)
for i,v in pairs(List.cardStorage) do
if v.name == CardName then
return v.desc
end
end
end
return trello
And here is the error:
22:02:49.174 - Requested module experienced an error while loading
22:02:49.174 - Stack Begin
22:02:49.174 - Script 'ServerScriptService.IFSERVERSIDE.CoreScripts.scriptcore', Line 42
22:02:49.175 - Stack End
The Noble Doughnut 2016 |