Jump to content

PnWH - Politics and War Helper 2 [WIP]


Praximus Cladius
 Share

Recommended Posts

I didnt want to necro a thread from June/July. I am going to attempt to update this script to work with the current version of PnW

Most if not all the functions that it provides will be stating, if they still work. I will provide periodic updates when I work on this but my free time is limited.

If you guys/gals have any questions or anything, let me know. I will try my best to answer them.

Edited by Praximus Cladius
Updated title
  • Upvote 1
Link to comment
Share on other sites

8 hours ago, Tywin Lannister said:

Please make it happen. @seabasstion can you help out? I miss this so much. 

It still works. Just use the old one. I can't think of much else to add to it other than modernise it.

LTcxGHN.jpg

Link to comment
Share on other sites

Most of it works for the most part, there are tons of errors and other things that need tending to.

Right now, I am not sure what this was being used for. If I am reading the code correctly, it was updating a database of sorts with pricing. Which could be a database that was updating from the PnW API to be stored locally. I also do not know how often the API is updated to make sure that prices are correct. The current domain being used, is no longer active.

function checkPrices(){
    if(resCount != resources.length * 2){
        setTimeout(checkPrices, 1e3);
    }else{
        createProfitsTable();
        createBuySellTable();
        var now = new Date().getTime();
        if(GM_getValue("dblastUpdate", 0) == 0 ||  Number(GM_getValue("dblastUpdate"))+3.6e+6 < now){
            GM_setValue("dblastUpdate", now);
            GM_xmlhttpRequest({
                method: "POST",
                url: "http://www.ereptools.tk/paw/pnwhelper.php",
                data: "coal="+GM_getValue("sellcoal")+"&oil="+GM_getValue("selloil")+"&bauxite="+GM_getValue("sellbauxite")+"&iron="+GM_getValue("selliron")+"&lead="+GM_getValue("selllead")+"&uranium="+GM_getValue("selluranium")+"&food="+GM_getValue("sellfood")+"&gasoline="+GM_getValue("sellgasoline")+"&aluminum="+GM_getValue("sellaluminum")+"&steel="+GM_getValue("sellsteel")+"&munitions="+GM_getValue("sellmunitions")+"&credits="+GM_getValue("sellcredits"),
                headers: {
                    "Content-Type": "application/x-www-form-urlencoded"
                }
            });
        }
    }
}
Edited by Praximus Cladius
Link to comment
Share on other sites

3 hours ago, Tywin Lannister said:

Can you link me? Mine stopped working a long while ago. 

The link is in the original post but here is the download - https://greasyfork.org/en/scripts/8238-politics-and-war-helper

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and the Guidelines of the game and community.