diff --git a/main.ts b/main.ts
index aed73c7..e818232 100644
--- a/main.ts
+++ b/main.ts
@@ -127,6 +127,10 @@ interface Colour {
// ]);
// Menu.setApplicationMenu(menu);
+// const { app, autoUpdater } = require("electron");
+// const server = "hazel-i9aodbuhq.now.sh";
+// const feed = `${server}/update/${process.platform}/${app.getVersion()}`;
+
const ipcMain = require("electron").ipcMain;
const { session } = require("electron");
let responsedata;
@@ -346,12 +350,14 @@ ipcMain.on("ping-async", async (event, message) => {
console.log("hello");
let sessionid = message[0];
let accountName = message[1];
- let league = message[2].split(" ").join("+");
+ // let league = message[2].split(" ").join("+");
+ let league = message[2];
// let currencyCutoff = message[3];
event.sender.send("ping-async-stash", [
"Starting",
accountName,
- league
+ league,
+ message[2]
// currencyCutoff
]);
// const { net } = require("electron");
@@ -381,25 +387,36 @@ ipcMain.on("ping-async", async (event, message) => {
// console.log(message);
//TODO
// get the number of tabs, concat the response data
- let urls: string[] = [
- "https://www.pathofexile.com/character-window/get-stash-items?league=" +
- message[2] +
- "&accountName=qqazraelz&tabs=1&tabIndex=1",
- "https://www.pathofexile.com/character-window/get-stash-items?league=" +
- message[2] +
- "&accountName=qqazraelz&tabs=1&tabIndex=2"
- ];
-
+ // let urls: string[] = [
+ // "https://www.pathofexile.com/character-window/get-stash-items?league=" +
+ // message[2] +
+ // "&accountName=qqazraelz&tabs=1&tabIndex=1",
+ // "https://www.pathofexile.com/character-window/get-stash-items?league=" +
+ // message[2] +
+ // "&accountName=qqazraelz&tabs=1&tabIndex=2"
+ // ];
+ let poeninjaleaguename = message[2];
+ if (poeninjaleaguename.includes("SSF Metamorph HC")){
+ poeninjaleaguename="Metamorph";
+ }
+ if (poeninjaleaguename.includes("SSF ")) {
+ poeninjaleaguename = poeninjaleaguename.replace("SSF ", "");
+ }
+ if (poeninjaleaguename == "Hardcore Metamorph") {
+ poeninjaleaguename = "Metamorph";
+ }
+
+ console.log(message[2],poeninjaleaguename)
// https://www.pathofexile.com/character-window/get-stash-items?league=Blight&accountName=qqazraelz&tabs=0
// {"numTabs":39}
let baseURL =
"https://poe.ninja/api/data/ItemOverview?league=" +
- encodeURI(message[2]) +
+ encodeURI(poeninjaleaguename) +
"&type=";
let urlendings: string[] = [
"Currency", // currency has currencyoveriew and Itemoveriew updated
"https://poe.ninja/api/data/currencyoverview?league=" +
- encodeURI(message[2]) +
+ encodeURI(poeninjaleaguename) +
"&type=Fragment", //currency is different url
"Oil",
"Fossil",
@@ -413,7 +430,8 @@ ipcMain.on("ping-async", async (event, message) => {
"UniqueArmour",
"UniqueAccessory",
"UniqueFlask",
- "Incubator"
+ "Incubator",
+ "SkillGem"
];
let poeNinjaResponseArray;
@@ -432,11 +450,13 @@ ipcMain.on("ping-async", async (event, message) => {
let uniqueflaskDataResponse;
let incubatorDataResponse;
let essenceDataResponse;
+ let skillgemDataResponse;
let stashdata;
+
event.sender.send("ping-async-stash", [
"getting poeninja data,",
accountName,
- encodeURI(message[2])
+ encodeURI(poeninjaleaguename)
// currencyCutoff
]);
await axios
@@ -455,7 +475,8 @@ ipcMain.on("ping-async", async (event, message) => {
axios.get(baseURL + urlendings[11]), //uniquearmours
axios.get(baseURL + urlendings[12]), //uniqueaccessory
axios.get(baseURL + urlendings[13]), //UniqueFlask
- axios.get(baseURL + urlendings[14]) //incubator
+ axios.get(baseURL + urlendings[14]), //incubator
+ axios.get(baseURL + urlendings[15]) //Skill Gems
])
// .catch(e => {
// console.log("Error: ", e.response.data);
@@ -479,6 +500,7 @@ ipcMain.on("ping-async", async (event, message) => {
this.uniqueaccessoriesDataResponse = responseArr[12].data; //access
this.uniqueflaskDataResponse = responseArr[13].data; //flask
this.incubatorDataResponse = responseArr[14].data; //incubator
+ this.skillgemDataResponse = responseArr[15].data; //skillgem
// console.log("Fragments: ", responseArr[1].data);
// console.log("Oils: ", responseArr[2].data);
// console.log("Fossils: ", responseArr[3].data);
@@ -508,7 +530,8 @@ ipcMain.on("ping-async", async (event, message) => {
responseArr[11].data,
responseArr[12].data,
responseArr[13].data,
- responseArr[14].data
+ responseArr[14].data,
+ responseArr[15].data
]; //Changedd to .data
})
.catch(e => {
@@ -518,11 +541,10 @@ ipcMain.on("ping-async", async (event, message) => {
"error in poeninja data"
]);
});
- event.sender.send(
- "ping-async-stash",
+ event.sender.send("ping-async-stash", [
"backend poedata going to sleep for 2 seconds now",
this.poeNinjaResponseArray
- );
+ ]);
await sleep(2000);
// .then(
// axios.spread(function(resp2, reposResponse) {
@@ -793,6 +815,138 @@ ipcMain.on("ping-sync", (event, message) => {
event.returnValue = message;
});
+ipcMain.on("get-stash-names", async (event, message) => {
+ console.log("hello");
+ let sessionid = message[0];
+ let accountName = message[1];
+ let league = message[2].split(" ").join("+");
+ // let currencyCutoff = message[3];
+ event.sender.send("ping-async-stash", [
+ "Starting",
+ accountName,
+ league,
+ message[2]
+ // currencyCutoff
+ ]);
+
+ event.sender.send("ping-async-stash", "starting stash");
+ await axios
+ .get(
+ "https://www.pathofexile.com/character-window/get-stash-items?league=" +
+ league +
+ "&accountName=" +
+ accountName +
+ "&tabs=1&tabIndex=1",
+ {
+ headers: {
+ cookie: "POESESSID=" + sessionid //the token is a variable which holds the token
+ }
+ }
+ )
+ .then(async response => {
+ // // var finalObj = finalObj.concat(response); // should concat the data
+ console.log(response);
+ // // message = response.data as RootObject;
+ // let stashdatatemp = [];
+ // this.stashdata = response.data;
+ event.sender.send("get-stash-names", [response.data, "got stash data"]);
+ // event.sender.send("ping-async-stashprogressbar", [
+ // 0,
+ // stashurlsFull.length
+ // ]);
+ // await sleep(10000);
+ // // get stash data
+ // let responseNumTabsTotal = response.data.numTabs;
+ // // event.returnValue = [
+ // // ["Stash " + x],
+ // // ["Left! total-index= " + (stashurlsFull.length - x)]
+ // // ];
+ // event.returnValue = ["hi"];
+ // // let numTabsResponse =
+ // for (let x = 0; x < Number(responseNumTabsTotal); x++) {
+ // stashurlsFull.push(
+ // "https://www.pathofexile.com/character-window/get-stash-items?league=" +
+ // league +
+ // "&accountName=" +
+ // accountName +
+ // "&tabs=0&tabIndex=" +
+ // x
+ // );
+ // }
+ // let stashtotaltoget = stashurlsFull.length;
+ // if (Number(responseNumTabsTotal) > 40) {
+ // stashtotaltoget = 40;
+ // responseNumTabsTotal = 40;
+ // }
+ // console.log(responseNumTabsTotal, stashtotaltoget);
+ // console.log(stashurlsFull);
+ // // get all stash data
+ // let promisesurls = [];
+ // for (let x = 0; x < stashurlsFull.length; x++) {
+ // await axios
+ // .get(stashurlsFull[x], {
+ // headers: {
+ // cookie: "POESESSID=" + sessionid //the token is a variable which holds the token
+ // }
+ // })
+ // .then(response => {
+ // //this will be executed only when all requests are complete
+ // // console.log("Currency: ", responseArr[0].data);
+ // this.fullstashdata = response; // currency
+ // // console.log(response.data);
+ // stashdatatemp.push(response);
+ // console.log(
+ // response.headers["x-rate-limit-account"],
+ // "x-rate-limit-account"
+ // );
+ // console.log(
+ // response.headers["x-rate-limit-account-state"],
+ // "x-rate-limit-account-state"
+ // );
+ // console.log("Stash " + x);
+ // console.log("Left! total-index= " + (stashurlsFull.length - x));
+ // event.sender.send("ping-async-stash", [
+ // "Stash " + x,
+ // "Left! total-index= " + (stashurlsFull.length - x)
+ // ]);
+ // event.sender.send("ping-async-stash", response);
+ // event.sender.send("ping-async-stashprogressbar", [
+ // x,
+ // stashurlsFull.length
+ // ]);
+ // })
+ // .catch(e => {
+ // console.log("Error: in stash responses", e.response.data);
+ // event.sender.send("ping-async-stash", [
+ // e.response.data,
+ // "error in stash response"
+ // ]);
+ // });
+ // // console.log(stashdatatemp);
+ // await sleep(1350);
+ // }
+ // event.sender.send("ping-async-stashprogressbar", [
+ // stashurlsFull.length,
+ // stashurlsFull.length
+ // ]);
+ // event.sender.send(
+ // "ping-async",
+ // this.stashdata,
+ // this.poeNinjaResponseArray,
+ // stashdatatemp
+ // );
+ })
+ .catch(e => {
+ console.log("Error: ", e.response.data);
+ // console.log("pathofexile.com Probably Down....");
+ event.sender.send("get-stash-names", [
+ e.response.data,
+ "get stash names error?"
+ ]);
+ event.sender.send("get-stash-names", null);
+ });
+});
+
// import { PythonShell } from "python-shell";
let win, serve;
const args = process.argv.slice(1);
diff --git a/package.json b/package.json
index ca55c64..41b6340 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "zombpoe",
- "version": "0.0.6",
+ "version": "0.0.7",
"description": "Path of exile poe.ninja and stash program Angular 8 with Electron (Typescript + SASS + Hot Reload)",
"homepage": "https://github.com/zombodotcom/Zombpoe",
"author": {
diff --git a/src/app/displaylist/dev.code-workspace b/src/app/displaylist/dev.code-workspace
new file mode 100644
index 0000000..543a322
--- /dev/null
+++ b/src/app/displaylist/dev.code-workspace
@@ -0,0 +1,8 @@
+{
+ "folders": [
+ {
+ "path": "X:\\angularapps\\gits\\Zombpoe"
+ }
+ ],
+ "settings": {}
+}
diff --git a/src/app/displaylist/displaylist.component.html b/src/app/displaylist/displaylist.component.html
index dd0b048..9cd39c2 100644
--- a/src/app/displaylist/displaylist.component.html
+++ b/src/app/displaylist/displaylist.component.html
@@ -12,16 +12,9 @@
-->
-
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tab Selection
+
+ {{tabname.n}} {{tabname.type}}
+
+
+ {{tabslist.length}} Tabs
+
+
+ {{item.n}} {{item.type}}
+
+
+
+
+
+
+
+
+ Refresh Interval
+
+ {{time}}
+
+
+
+
+
+
+
+
@@ -242,6 +307,7 @@
+
|