orcnaydn Posted August 16, 2019 Report Share Posted August 16, 2019 I want to someone type my bot !selltf, his sell max 15 sets per game how can i do that?My Code; Inventory.prototype.getCustomerSets = function(ignore, sid64, callback, permit){ let self=this; this.community.getUserInventoryContents(sid64, 753, 6, true, (err, items) => { if(err){ callback(err); } else { items = items.filter(item => { if(item.getTag("item_class").internal_name == "item_class_2" && item.getTag("cardborder").internal_name == "cardborder_0"){ return item; } }); let customer_sets=[], customer_cards={}; items.forEach( card => { const appid=card.market_hash_name.split("-")[0]; if(!customer_cards[appid]){customer_cards[appid]={};} if(!customer_cards[appid][card.market_hash_name]){customer_cards[appid][card.market_hash_name]=[];} customer_cards[appid][card.market_hash_name].push(card); }); for(let appid in customer_cards){ if(self.card_db[appid]){ if(Object.keys(customer_cards[appid]).length == self.card_db[appid]){ let customerHave = Math.min.apply( Math, values(customer_cards[appid]).map( card => card.length ) ), botHave = self.AvailableSets[appid] ? self.AvailableSets[appid].length : 0, limit = permit ? (self.maxStock+permit) : self.maxStock, falt = limit-botHave; customerHave = !ignore ? ( (falt > 0) ? ( Math.min( ...[ falt, customerHave ] ) ) : 0 ) : customerHave; for (let i=0;i<customerHave;i++) { let currentCustomerSet=[] for(let card in customer_cards[appid]){ currentCustomerSet.push(customer_cards[appid][card][i]); } customer_sets.push(currentCustomerSet); } } } else { self.getAppIdCount(appid); } } callback(null, customer_sets); } }); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.