-
-
Save RottenMind/af81fc904efb7cef9597 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by RottenMind on 15.1.2015. | |
* Copied from MAC-NW, can be used to detect bag space for inventory sell option. | |
*/ | |
function Inventory_bags() { | |
var _pbags = client.dataModel.model.ent.main.inventory.playerbags; | |
var _delay = 400; | |
var _sellCount = 0; | |
var _classType = unsafeWindow.client.dataModel.model.ent.main.classtype; | |
var _bagCount = unsafeWindow.client.dataModel.model.ent.main.inventory.playerbags.length; | |
var _bagSpace = 0; | |
var _tmpBag = []; | |
$.each(_pbags, function (bi, bag) { | |
bag.slots.forEach(function (slot) { | |
if (slot === null) { | |
_bagSpace++; | |
} else { | |
_tmpBag[_tmpBag.length] = slot; | |
} | |
}); | |
}); | |
//console.log('Checking for','slot name:', _bagSpace); | |
return _bagSpace; | |
} | |
var Inventory_bagspace = Inventory_bags() //this line run function and get bagspace, must checked before professio reward collection | |
console.log('Checking for','slot name:', Inventory_bagspace); // testline what shows (console shows bagspace) that MAC-NW did original Function pretty well |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment