Inventory requester

Inventory framework

As of 2017-10-23. See the latest version.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/34367/225711/Inventory%20requester.js

// ==UserScript==
// @name         Inventory requester
// @description  Inventory framework
// @author       A Meaty Alt
// @grant        none
// ==/UserScript==

function getPlayerValues(params){
    return new Promise(function(resolve){
        var id = params.match(/userID=(.*?)&/)[1];
        var hashedPassword = params.match(/password=(.*?)&/)[1];
        $.post("https://fairview.deadfrontier.com/onlinezombiemmo/get_values.php",
               "userID="+id+"&password="+hashedPassword,
               function(response){
            resolve(response);
        });
    });
}
function getItemCode(i, playerValues){
    var patternType = new RegExp("df_inv"+i+"_type=(.*?)\&");
    return playerValues.match(patternType)[1];
}
function getStorageSize(playerValues){
    return playerValues.match(/df_storage_slots=(.*?)&/)[1];
}