Advertisement
Fabianegg

adi wilk test

Feb 13th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. (() => {
  2. const price = 500000; // cena itemka, tutaj jest 500k
  3. const names = ["Mikstura wiewiórki", "dupa goryla"]; // nazwy itemków ktore maja byc sellniete po wuzej wymienionej cenie
  4.  
  5. const old_g = window._g;
  6. const itemsToSell = new Array();
  7. const sellItem = (id) => new Promise(resolve => {
  8. fetch(`/engine?t=ah&sell=${id}&price=&bo=${price}&time=48&ev=${window.g.ev}&browser_token=${window.g.browser_token}&aid=${window.g.aid}`)
  9. .then(data => data.json())
  10. .then(data => resolve(data))
  11. .catch(err => resolve());
  12. });
  13.  
  14. const getItems = () => {
  15. for(const [id, {name, loc}] of Object.entries(window.g.item)){
  16. if(loc === "g" && names.includes(name) && !itemsToSell.includes(id)){
  17. itemsToSell.push(id);
  18. }
  19. }
  20. }
  21.  
  22. const start = async () => {
  23. getItems();
  24. window._g = Function.prototype;
  25. for(const id of itemsToSell){
  26. const result = await sellItem(id);
  27. if(result !== undefined){
  28. window.parseInput(result);
  29. }
  30. }
  31. window._g = old_g;
  32. }
  33.  
  34. start();
  35. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement