Jump to content
McKay Development

EnelGy

Member
  • Posts

    38
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

EnelGy's Achievements

  1. So the bot should be outside the laravel project and to communicate with it I need to install http and express to the bots file ? To be sure, Do I do something like this ? (This http request is in laravel) (port: 3000 is the bots http port) Http::post('http://localhost:3000/send', [ tradelink: tradelink, items: (some ids of items) ]); Then my bot get this and use posted array to create the trade offer ? I feel like this is so complicated and not very secure
  2. Hey, could someone tell me, how should I communicate with steam bot through laravel/vue.js ? Also where should I store the bots folder ? (I guess it should be somewhere outside the laravel project for better security and dont know how would I turn on the bot, but not sure, correct me if I am wrong) For instance when a user clicks some button, I want to create trade-offer (where my bot gives to the user some item) - bots folder is probably outside the laravel (not in laravel project, but somewhere in the server) - i can call some function or ajax request from the click, but dont know what exactly should I do, how to commuicate with the bot
  3. So this only doesn't work on localhost ?
  4. Currently, I am using vue.js and want to ask if is it possible to fetch users inventory using axios -> when i try this, it gives me these errors If is there any other way to achieve loading users inventory using vue/axios, please suggest me
  5. For the first request I make usual request $steam = "http://steamcommunity.com/inventory/" . $steamid . "/440/2?l=english?count=1000"; $json = file_get_contents($steam); $data = json_decode($json, true); Then I get more_items = 1; last_assetid=123 and I want to do another request which starts with the last_assetid. I know that next $steam should have ?start_assetid=123, but don't have any idea how Would I do it to keep the old content. Please suggest me
  6. @Dr. McKay Do I need any API to get users content of inventory ?
  7. I really dont know how is that possible... Earlier I have set offer.data('cancelTime', 120000); and after first succesfully completed trade, I was keeping getting this...the offer.state "Canceled" (all the time I restart my bot, first trade works, others it cancels) manager.getUserInventoryContents(offer.partner.getSteamID64(), 440, 2, true, function (err, myInv){ if (err) { console.log(err); } else { // I need to send X ref var volume = entryCost; // amount = number in args[0] // Filter out all the ref var ref = myInv.filter(function (item) { return item.market_hash_name.match("Refined Metal") }); console.log(ref.length); console.log(volume); // Let the user know we don't have enough ref if (ref.length < volume) { unmuteChannel(); console.log('Not enough Keys'); message.reply(notEnough); console.log('------------------------'); return true; // Give up } // Start a new trade offer // Add what we should do to the current trade console.log('Adding '+volume+' Keys'); offer.addTheirItems(ref.slice(0, volume)) // Send the offer offer.send(function (err, status){ if (err) { console.log(err); } else { console.log('Trade offer #'+ offer.id+ ' sent successfully'); // Register the offer id, save it to JSON file client.tradeLinks ['lastguy'] = { name: message.author.tag, tradelink: _message, lastoffer: offer.id } fs.writeFile ('tradeLinks.json', JSON.stringify(client.tradeLinks, null, 4), err => { if (err) throw err; }) message.reply(readyOffer + offer.id + '>'); // Cancels after 2 minutes //offer.data('cancelTime', 120000); // Starts the function myTimer() every 1 seconds to know the status that is on start var myVar = setInterval(myTimer, 1000); function myTimer() { if (ifvartruefalse === "canceled") { clearInterval(myVar); ifvartruefalse = ""; message.channel.send(cancelOffer); unmuteChannel(); console.log('------------------------'); return; } else if (ifvartruefalse === "false"){ clearInterval(myVar); ifvartruefalse = ""; message.reply(deletingCF); unmuteChannel(); console.log('------------------------'); return; } else if (ifvartruefalse === "invalid"){ clearInterval(myVar); ifvartruefalse = ""; message.reply(invalidItems); unmuteChannel(); console.log('------------------------'); return; } else if (ifvartruefalse === "true"){ clearInterval(myVar); message.channel.send(joined); ifvartruefalse = ""; unmuteChannel(); // What to do after user accept the trade var memberilius = `<@${message.author.id}>`; client.raffle[(idraf - 1).toString()][`slot${slot}`] = memberilius fs.writeFile ('raffle.json', JSON.stringify(client.raffle, null, 4), err => { if (err) throw err; }) //return; } //return; } } }); } }); as you can see there is checking on ifvartruefalse to check the result from etradeofferstate (is its true, then offer state is accepted) var ifvartruefalse = ""; manager.on('sentOfferChanged', function(offer, oldState) { console.log(TradeOfferManager.ETradeOfferState[offer.state]); if (offer.id === client.tradeLinks["lastguy"].lastoffer) { client.tradeLinks["lastguy"] = { name:"", tradelink:"", lastoffer:"" } fs.writeFile ('tradeLinks.json', JSON.stringify(client.tradeLinks, null, 4), err => { if (err) throw err; }) if (TradeOfferManager.ETradeOfferState[offer.state] === "Declined") { if (offer.itemsToGive.length == 0){ ifvartruefalse = "false"; console.log('User/Bot declined'); return; } } else if (TradeOfferManager.ETradeOfferState[offer.state] === "Accepted"){ if (offer.itemsToGive.length == 0){ console.log("User accepted"); ifvartruefalse = "true"; return; } } else if (TradeOfferManager.ETradeOfferState[offer.state] === "InvalidItems") { if (offer.itemsToGive.length == 0){ console.log("Invalid items"); ifvartruefalse = "invalid"; return; } } else if (TradeOfferManager.ETradeOfferState[offer.state] === "Canceled") { if (offer.itemsToGive.length == 0){ ifvartruefalse = "canceled"; console.log('Bot canceled the offer after 2 mins'); } } } }); Could someone please help me ? There is no reason that the bot cancel...
  8. Got error called "Error: Invalid input SteamID [object Object]" and don't know what to do... My code: manager.getUserInventoryContents(offer.partner.getSteamID64(), 440, 2, true, function (err, myInv){ if (err) { console.log(err); } else { // I need to send X ref var volume = entryCost; // amount = number in args[2] // Filter out all the ref var ref = myInv.filter(function (item) { return item.market_hash_name.match('Mann Co. Supply Crate Key') }); // Let the user know we don't have enough ref if (ref.length < volume) { unmuteChannel(); console.log('Not enough Keys'); message.reply(notEnough); console.log('------------------------'); return true; // Give up } // Start a new trade offer // Add what we should to the current trade console.log('Adding '+volume+' Keys'); offer.addTheirItems(ref.slice(0, volume)) // Send the offer offer.send(function (err, status){ if (err) { console.log(err); } else { console.log('Trade offer #'+ offer.id+ ' sent successfully'); // Register the offer id, save it to JSON file client.tradeLinks ['lastguy'] = { name: message.author.tag, tradelink: _message, lastoffer: offer.id } fs.writeFile ('tradeLinks.json', JSON.stringify(client.tradeLinks, null, 4), err => { if (err) throw err; }) message.reply(readyOffer + offer.id + '>'); // Cancels after 2 minutes offer.data('cancelTime', 120000); // Starts the function myTimer() every 3 seconds to know the status thats on start var myVar = setInterval(myTimer, 3000); function myTimer() { if (ifvartruefalse === "canceled") { clearInterval(myVar); ifvartruefalse = ""; message.channel.send(cancelOffer); unmuteChannel(); console.log('------------------------'); return; } else if (ifvartruefalse === "false"){ clearInterval(myVar); ifvartruefalse = ""; message.reply(deletingCF); unmuteChannel(); console.log('------------------------'); return; } else if (ifvartruefalse === "invalid"){ clearInterval(myVar); ifvartruefalse = ""; message.reply(invalidItems); unmuteChannel(); console.log('------------------------'); return; } else if (ifvartruefalse === "true"){ clearInterval(myVar); ifvartruefalse = ""; message.channel.send(joined); unmuteChannel(); var theTimeout; } return; } } }); } });
  9. I set some sessionExpired function, that reconnect the bot to steam when its expired. But when it expires, it reconnect the bot multiple times. The command below send about 20 messages that theres an error, and the error is fixed. Also in console it looks like (picture). Does anyone know wheres the problem ? community.on("sessionExpired", function(err) { client.channels.cache.get("753653286283903126").send('<:false:750799883572609245> **There was an error, fixing the error... <:repairing:755511536423927909>**') .then(sentMessage => sentMessage.delete({ timeout: 4000 })) .catch(console.error) client.channels.cache.get("753653286283903126").send('<:true:750799921497505913> **Error is fixed, you can try again !**') .then(sentMessage => sentMessage.delete({ timeout: 4500 })) .catch(console.error) client.channels.cache.get("753653286283903126").updateOverwrite(message.guild.roles.everyone, { SEND_MESSAGES: true }) .then(channel => console.log('Channel unmute')) .catch(console.error); if (client2.steamID == undefined) { client2.logOn(logInOptions); client2.on('loggedOn', () => { console.log('Steam Bot is running !'); client2.setPersona(SteamUser.EPersonaState.Online); client2.gamesPlayed(440); }); } else { client2.webLogOn(); //relogin to Steam or refresh tradeoffer-manager cookies } //add your handling code here, for example: if (sendofferError == true){ //do stuff } })
  10. Hey, I keep getting error 429 even if I set pollInterval to 5000ms, where can be problem ? let manager = new TradeOfferManager({ steam: client2, community: community, language: 'en', pollInterval: 5000 });
×
×
  • Create New...