Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How could I move cards with the trello API from roblox?

Asked by 6 years ago

I have been tinkering around with the Trello API for a while now, and I have been trying to use a feature of it. I have made the script select the card and I want to move it to a different board. The current setup I have right now doesn't work. Any help?

local get = http:GetAsync('https://api.trello.com/1/boards/'..module.Trello..'/lists?key='..module.Key..'&token='..module.Token,true)
    local tab = http:JSONDecode(get)

    --Searches the board for the tab name       
    for _,v in pairs(tab) do --v == current board
        local musget = http:GetAsync('https://api.trello.com/1/lists/'..v.id..'/cards?key='..module.Key..'&token='..module.Token,true)
        local mustab = http:JSONDecode(musget)
        --Searches for the card
        for a,m in pairs(mustab) do --m == current card
            if m.name:match(plr.Name .. " | ".. plr.userId) then --Finds the card
                for b,c in pairs(tab) do --c == new current board
                    if v.name:match('^Deleted%s?$') then --Finds the board to move to
                        m.boardid = v.id --Changes the board id, thus changing the card's board
                    end
                end
            end
        end

Hopefully the code isn't too messy.

Thanks

Answer this question