Advertisement
Guest User

Untitled

a guest
Mar 11th, 2022
34
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None
  1. function sendKeys() {
  2. //console.log('here 1')
  3. manager.loadInventory(440, 2, true, (err,inventory) => {
  4.  
  5. if(err){
  6. console.log(err);
  7.  
  8. } else {
  9.  
  10. const offer = manager.createOffer(a[0]);
  11. inventory.forEach(function(item) {
  12.  
  13. if (item.market_name === 'Mann Co. Supply Crate Key') {
  14.  
  15. offer.addMyItem(item);
  16. offer.send((err, status) => {
  17. if(err) {
  18. console.log(err);
  19.  
  20. } else{
  21. console.log(status)
  22.  
  23. const removeLines = (data, lines = []) => { //
  24. return data
  25. .split('\n')
  26. .filter((val, idx) => lines.indexOf(idx) === -1)
  27. .join('\n');
  28. }
  29. fs.readFile('data.txt', 'utf8', (err, data) => {
  30. if (err) throw err;
  31. fs.writeFile('data.txt', removeLines(data, [0]), 'utf8', function(err) {
  32. if (err) throw err;
  33. });
  34. }) //
  35. }
  36. });
  37. }
  38. });
  39. }
  40. });
  41. }
Advertisement
RAW Paste Data Copied
Advertisement