Jump to content
McKay Development

Lonster_Monster

Member
  • Content Count

    25
  • Joined

  • Last visited

Recent Profile Visitors

123 profile views
  1. I am working on a site and want to get steam items with nodejsand express i understand how to get item inventory and i am using the get-steam-inventory npmmodule and not sure on why the backpack is not being generated in the express below is the price.js file i have for price.pug and in the pug file i call each item in items and cannot get the value of length any help would be appreciated var express = require('express'); var router = express.Router(); //var pages = require('../pages/Pages.json'); //var quality = require('../public/730/quality.json') var fs = require('fs'); var data; var steamid; var backpack; var appid = 440; const steaminventory = require('get-steam-inventory'); /* GET users listing. */ router.get('/', function(req, res, next) { // render template steamid = req.user.steamid var path = './public/json/'+steamid+'.json'; checkFile(path); res.render('price', {user: req.user, items: req.backpack}); console.log(backpack) }); function checkFile(path) { try { if (fs.statSync(path)) { fs.readFile(path,"utf8", (err, backpack) => { if (err) throw err; backpack = backpack }); } } catch(err) { steaminventory.getinventory(appid, steamid, function(err, items){ if(err) { return console.log("Error, while getting user items. Please check settings or user inventory is hidden."); } else { if (items){ fs.writeFile(path, JSON.stringify(items.raw, null, 4), { flag: 'w' }, function (err) { if (err) throw err; console.log('\x1b[32m','The file has been saved!','\x1b[0m'); }); } checkFile(path) } }) } } module.exports = router;
  2. i actually tried using it and when it wouldnt work (i think it was didnt call the request module) and figured out how to do it with the https module and the problem i have been getting is i created a function cand when i call it to be executed it doesnt want to execute
  3. I have a site i am creating in nodejs based on my code in php and wandering how to call steam api json json like https://steamcommunity.com/profiles/76561198076819824/inventory/json/440/2/I know how to use Express js but i am unfamiliar with how to Call GET for JSON
  4. I know the steam api doesnt have an api to send steam tradeoffers in php how can i send one by trade link? I want to have a site that u Select items to buy and it will send trade offers with those items and wandering how to do it from php with the trade offer link
  5. ok thanks i just wanted to make sure if that was correct on the link thanks alot
  6. I am not new to the steam bots but i am new to making it send steam offers and dont know how to do that with my bots
  7. What is the Best way to call steam api for steam items i have been using $id = "76561198147982809"; $query = "http://steamcommunity.com/profiles/".$id."/inventory/json/440/2/";; $json = file_get_contents($query); $data = json_decode($json, true); to get my bots inventory of course has 0 tradable items and get the failed error alot failed to open stream: HTTP request failed! HTTP/1.0 429 Too Many Requests is calling the http://steamcommunity.com/profiles/[steamid]/inventory/json/440/2/ the best way i am creating a website like scrap.tf for my steam bots to buy and sell items if there is a better way Please let me know i know some about the steam API but not the most about it and not sure which would be best if i use that and also if i upload my site onto my host will it do the errors alot or just when client calls the json i used?
  8. It will be a js file i want to make a trade logger but dont know how to call the (offer) from another file i dont know how to export it
  9. I have the processOffer i want to export the (offer) part to another file how would i do that?
  10. I have been working on a tradelog code and i need to get the (offer) from the trade when it processes the trade i dont know the correct way to export the offer from manager.on('newOffer', (offer) => { processOffer(offer); });
  11. I finally fixed the problem in var item = ourItems[i].market_name; var des = ourItems[i].descriptions; console.log(item) console.log(des) if (item == stock[item] && des == stock[item].description){ if (item == Prices[item] && des == Prices[item].description){ console.log(Prices[item].sell) } } changed the code to the code below and i think it is cool how i can call stuff like this now const filestockname = './/settings/Prices/Prices.json'; const filestock = require(filestockname); for (var i in ourItems) { var item = ourItems[i].market_name; var des = ourItems[i].description console.log(item) console.log(des) if (filestock[item]){ fs.readFile(filestockname, (err, data) => { if (err) throw err; console.log('File read'); }); filestock[item].description = des console.log('writing to ' + filestockname); fs.writeFile(filestockname, JSON.stringify(filestock, null, 2), function (err) { if (err) return console.log(err); console.log('writing to ' + filestockname); }); } } that is only for the our items side i didnt post for the their items side of the trade becaseu it is basically the same
  12. so say i wanted to do the code i have above, what exactly would i do i mean as an object like i am wanting Sorry if it is a noob question i am still kinda new to nodejs i have been making my own bot for about a year leanring new stuff in it
  13. i have a genuine killer exclusive with the australium paint on it i done var item = ourItems[i].market_name; var des = ourItems[i].descriptions; console.log(item) console.log(des) if (item == stock[item] && des == stock[item].description){ if (item == Prices[item] && des == Prices[item].description){ console.log(Prices[item].sell) } } when it does the console log on item and des it shows "Genuine Killer Exclusive": [ { type: "text", value: "Paint Color: Australium Gold", color: "756b5e", app_data: "" }, { type: "text", value: "Break news, spirits and heads.", app_data: "" } ] i put the descriiption text in the stock under the item name and is the value of description like below { "Genuine Killer Exclusive": { "instock": 0, "stocklimit":1, "description": [ { "type": "text", "value": "Paint Color: Australium Gold", "color": "756b5e", "app_data": "" }, { "type": "text", "value": "Break news, spirits and heads.", "app_data": "" } ] } } the problem is with the "" around type, value, color, app_data, type, value, app_data it acts as if that is not the value but json wont work without the " " around the certain words SOLUTION:
  14. is that all the steam API Key is for and is it needed to make a trade offer in nodejs? i have gotten around the steam API key but wandering if it is needed for making trade offers?
  15. If u R Using Nodejs which is i would say U R becasue the forum is for Dr Mckays nodejs Npm packages here is a npm packge that uses bp.tf api https://www.npmjs.com/package/backpack.tf
×
×
  • Create New...