Просмотр исходного кода

added configuration for startup

Saegusa лет назад: 9
Родитель
Сommit
9a4e32d1ca
2 измененных файлов с 14 добавлено и 4 удалено
  1. 8 0
      config.json
  2. 6 4
      index.js

+ 8 - 0
config.json

@@ -0,0 +1,8 @@
+{
+    "modes" : {
+        "auto" : true,
+        "easy" : false
+    },
+
+    "blacklist" : [8000, 8001, 8002, 8005, 8018, 8025, 8023]
+}

+ 6 - 4
index.js

@@ -1,11 +1,13 @@
+const config = require('./config.json');
+
 module.exports = function Loot(dispatch) {
 module.exports = function Loot(dispatch) {
 
 
-    let auto = false,
-        enabled = true,
-        lootInterval,
+    let auto = config.modes.auto || false,
+        enabled = config.modes.easy || true,
+        lootInterval = auto ? setInterval(tryLootAll, 250) : null,
         location;
         location;
 
 
-    let blacklist = [8000, 8001, 8002, 8005, 8018, 8025, 8023];
+    let blacklist = config.blacklist || [8000, 8001, 8002, 8005, 8018, 8025, 8023];
 
 
     let loot = {};
     let loot = {};