let img; let update; let playerID; let lastPowerID = 0; async function useInv(id, type) { try { const resp = await $.ajax({ url: `${window.api}player/inv/${type}/${id}`, type: "GET", xhrFields: { withCredentials: true }, }); msg(resp.Status, resp.Message); } catch (err) { msg( err.responseJSON?.Status || "Erro", err.responseJSON?.Message || "Algo deu errado.", ); } } function invpower() { $.ajax({ url: `${window.api}player/inv/ph`, type: "GET", xhrFields: { withCredentials: true }, success(resp) { const $invpower = $("#powers ul"); let latestId = lastPowerID; resp.InvPws.forEach((item) => { if (item.id > lastPowerID) { const $li = $("