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?
01 | local get = http:GetAsync( 'https://api.trello.com/1/boards/' ..module.Trello.. '/lists?key=' ..module.Key.. '&token=' ..module.Token, true ) |
02 | local tab = http:JSONDecode(get) |
03 |
04 | --Searches the board for the tab name |
05 | for _,v in pairs (tab) do --v == current board |
06 | local musget = http:GetAsync( 'https://api.trello.com/1/lists/' ..v.id.. '/cards?key=' ..module.Key.. '&token=' ..module.Token, true ) |
07 | local mustab = http:JSONDecode(musget) |
08 | --Searches for the card |
09 | for a,m in pairs (mustab) do --m == current card |
10 | if m.name:match(plr.Name .. " | " .. plr.userId) then --Finds the card |
11 | for b,c in pairs (tab) do --c == new current board |
12 | if v.name:match( '^Deleted%s?$' ) then --Finds the board to move to |
13 | m.boardid = v.id --Changes the board id, thus changing the card's board |
14 | end |
15 | end |
16 | end |
17 | end |
Hopefully the code isn't too messy.
Thanks