Dmitry S 4 years ago
parent
commit
4bfdf9c9c6
5 changed files with 153 additions and 153 deletions
  1. 3 0
      .gitignore
  2. 80 75
      config.js
  3. 56 56
      index.js
  4. 6 16
      manifest.json
  5. 8 6
      module.json

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+.eslintrc.json
+manifest-generator.bat
+manifest-generator.js

+ 80 - 75
config.js

@@ -1,76 +1,81 @@
-module.exports = {
-    enable: true,
-    enableAuto: true,
-	interval: 30,
-	throttleMax: 45,
-	scanInterval: 60,
-	radius: 180,
-
-    blacklist: [
-        7214, // Scroll of Resurrection
-		//91344, // Fashion Coupon
-        //139113, 166718, 213026, // 행운의 상자 (K TERA)
-        //169886, 169887, 169888, 169889, 169890, 169891, // Locked ???? Strongbox
-
-		//98512, // Pansophic Ash	
-		//98513, // Essence
-		//98590, // Veilthroch
-
-        //98599, // Devil's Claws
-        //98600, // Dragon Skull
-		
-		88784, // Powerful Transcendent Mask
-		88785, // Keen Transcendent Mask
-		88786, // Bitter Trasncendent Mask
-		88787, // Energetic Transcendent Mask
-		
-		88849, // Powerful Bahaar's Mask
-        88850, // Keen Bahaar's Mask
-        88851, // Bitter Bahaar's Mask
-        88852, // Energetic Bahaar's Mask
-		
-		201656, // Hidden Weapon Sheath
-		202017, // Transparent Mask
-		
-		88827, // Belt Amplifier I
-		88832, // Belt Amplifier II
-		88831, // Circlet Amplifier I
-		88836, // Circlet Amplifier II
-		88829, // Earring Amplifier I
-		88834, // Earring Amplifier II
-		88828, // Necklace Amplifier I
-		88833, // Necklace Amplifier II
-		88830, // Ring Amplifier I
-		88835, // Ring Amplifier II     
-		
-		88837, // Accessory Amplifier Coin
-		
-		//98653, // Supreme Metal
-		//98654, // Springy Draco Limb
-		//98655, // Weight Pendulum
-        98656, // Sacred Mallet
-		
-		//88840, // Bahaar's Amplifier Coin
-		88841, // Bahaar's Handwear Amplifier
-		88842, // Bahaar's Footwear Amplifier
-		
-		//98667, // Skill Optimization Scroll I
-		//98669, // Skill Optimization Scroll II
-		
-		//89040, // yellow relic
-		//89020, // blue power relic
-		//89010, // green crit relic
-		//89000, // green power relic
-		//89030, // blue crit relic
-		
-		//89130, // blue crit halidom
-		//89110, // green crit halidom
-		//89140, // yellow halidom
-		//89120, // blue power halidom
-		//89100 // green power halidom
-		
-		98671, // Refined Lepidoptera Crystal Dust (EAR)
-		98672, // Refined Lepidoptera Crystal Powder (RING)
-		
-    ]
+module.exports = {
+    enable: true,
+    enableAuto: true,
+	interval: 30,
+	throttleMax: 45,
+	scanInterval: 60,
+	radius: 180,
+
+    blacklist: [
+        7214, // Scroll of Resurrection
+		//91344, // Fashion Coupon
+        //139113, 166718, 213026, // 행운의 상자 (K TERA)
+        //169886, 169887, 169888, 169889, 169890, 169891, // Locked ???? Strongbox
+
+		//98512, // Pansophic Ash	
+		//98513, // Essence
+		//98590, // Veilthroch
+
+        //98599, // Devil's Claws
+        //98600, // Dragon Skull
+		
+		88784, // Powerful Transcendent Mask
+		88785, // Keen Transcendent Mask
+		88786, // Bitter Trasncendent Mask
+		88787, // Energetic Transcendent Mask
+		
+		88849, // Powerful Bahaar's Mask
+        88850, // Keen Bahaar's Mask
+        88851, // Bitter Bahaar's Mask
+        88852, // Energetic Bahaar's Mask
+		
+		201656, // Hidden Weapon Sheath
+		202017, // Transparent Mask
+		
+		88827, // Belt Amplifier I
+		88832, // Belt Amplifier II
+		88831, // Circlet Amplifier I
+		88836, // Circlet Amplifier II
+		88829, // Earring Amplifier I
+		88834, // Earring Amplifier II
+		88828, // Necklace Amplifier I
+		88833, // Necklace Amplifier II
+		88830, // Ring Amplifier I
+		88835, // Ring Amplifier II     
+		
+		88837, // Accessory Amplifier Coin
+		
+		//98653, // Supreme Metal
+		//98654, // Springy Draco Limb
+		//98655, // Weight Pendulum
+        98656, // Sacred Mallet
+		
+		//88840, // Bahaar's Amplifier Coin
+		88841, // Bahaar's Handwear Amplifier
+		88842, // Bahaar's Footwear Amplifier
+		
+		//98667, // Skill Optimization Scroll I
+		//98669, // Skill Optimization Scroll II
+		
+		//89040, // yellow relic
+		//89020, // blue power relic
+		//89010, // green crit relic
+		//89000, // green power relic
+		//89030, // blue crit relic
+		
+		//89130, // blue crit halidom
+		//89110, // green crit halidom
+		//89140, // yellow halidom
+		//89120, // blue power halidom
+		//89100 // green power halidom
+		
+		98671, // Refined Lepidoptera Crystal Dust (EAR)
+		98672, // Refined Lepidoptera Crystal Powder (RING)
+		46701, // Inversion Mote
+		602172, // Argon Priest Essence (Corrupted Skynest)
+		602174, // Argon Priest Essence (Corrupted Skynest)
+		602175, // Argon Priest Essence (Corrupted Skynest)
+
+		
+    ]
 }

+ 56 - 56
index.js

@@ -1,57 +1,57 @@
-'use strict';
-const config = require('./config.js');
-
-module.exports = function AutoLootOld(mod) {
-    const cmd = mod.command || mod.require.command;
-
-    let enable = config.enable,
-        enableAuto = config.enableAuto,
-        interval = config.interval,
-        throttleMax = config.throttleMax,
-        scanInterval = config.scanInterval,
-        radius = config.radius;
-
-    let location = null,
-        items = new Map(),
-		lootTimeout = null;
-
-	cmd.add('loot', {
-		$default() {
-			enable = !enable;
-			mod.command.message(`${enable ? 'en' : 'dis'}abled`);
-		},
-		auto() {
-			enableAuto = !enableAuto;
-			mod.command.message(`auto-loot ${enableAuto ? 'en' : 'dis'}abled`);
-		}
-	});
-
-    mod.game.me.on('change_zone', () => { items.clear(); });
-	
-	mod.hook('S_RETURN_TO_LOBBY', 1, () => { items.clear(); });
-    mod.hook('C_PLAYER_LOCATION', 5, (e) => { location = e.loc; });
-    mod.hook('S_SYSTEM_MESSAGE', 1, (e) => { if (e.message === '@41') return false });
-    mod.hook('C_TRY_LOOT_DROPITEM', 4, () => { if(enable && !lootTimeout) lootTimeout = setTimeout(tryLoot, interval); });
-    mod.hook('S_DESPAWN_DROPITEM', 4, (e) => { items.delete(e.gameId); });
-
-    mod.hook('S_SPAWN_DROPITEM', 8, (e) => {
-        if(!(config.blacklist.includes(e.item)) && (e.item < 8000 || e.item > 8024) && e.owners.some(owner => owner === mod.game.me.playerId)){
-			items.set(e.gameId, Object.assign(e, {priority: 0}));
-			if(enableAuto && !lootTimeout) tryLoot();
-        }
-    });
-
-    function tryLoot() {
-		clearTimeout(lootTimeout);
-		lootTimeout = null;
-		if(!items.size || mod.game.me.mounted) return;
-		for(let item of [...items.values()].sort((a, b) => a.priority - b.priority)){
-			if(location.dist3D(item.loc) <= radius){
-				mod.send('C_TRY_LOOT_DROPITEM', 4, { gameId: item.gameId });
-				lootTimeout = setTimeout(tryLoot, Math.min(interval * ++item.priority, throttleMax));
-				return;
-			}
-		}
-		if(enableAuto) setTimeout(tryLoot, scanInterval);
-    }
+'use strict';
+const config = require('./config.js');
+
+module.exports = function AutoLootOld(mod) {
+    const cmd = mod.command || mod.require.command;
+
+    let enable = config.enable,
+        enableAuto = config.enableAuto,
+        interval = config.interval,
+        throttleMax = config.throttleMax,
+        scanInterval = config.scanInterval,
+        radius = config.radius;
+
+    let location = null,
+        items = new Map(),
+		lootTimeout = null;
+
+	cmd.add('loot', {
+		$default() {
+			enable = !enable;
+			mod.command.message(`${enable ? 'en' : 'dis'}abled`);
+		},
+		auto() {
+			enableAuto = !enableAuto;
+			mod.command.message(`auto-loot ${enableAuto ? 'en' : 'dis'}abled`);
+		}
+	});
+
+    mod.game.me.on('change_zone', () => { items.clear(); });
+	
+	mod.hook('S_RETURN_TO_LOBBY', 1, () => { items.clear(); });
+    mod.hook('C_PLAYER_LOCATION', 5, (e) => { location = e.loc; });
+    mod.hook('S_SYSTEM_MESSAGE', 1, (e) => { if (e.message === '@41') return false });
+    mod.hook('C_TRY_LOOT_DROPITEM', 4, () => { if(enable && !lootTimeout) lootTimeout = setTimeout(tryLoot, interval); });
+    mod.hook('S_DESPAWN_DROPITEM', 4, (e) => { items.delete(e.gameId); });
+
+    mod.hook('S_SPAWN_DROPITEM', 8, (e) => {
+        if(!(config.blacklist.includes(e.item)) && (e.item < 8000 || e.item > 8024) && e.owners.some(owner => owner === mod.game.me.playerId)){
+			items.set(e.gameId, Object.assign(e, {priority: 0}));
+			if(enableAuto && !lootTimeout) tryLoot();
+        }
+    });
+
+    function tryLoot() {
+		clearTimeout(lootTimeout);
+		lootTimeout = null;
+		if(!items.size || mod.game.me.mounted) return;
+		for(let item of [...items.values()].sort((a, b) => a.priority - b.priority)){
+			if(location.dist3D(item.loc) <= radius){
+				mod.send('C_TRY_LOOT_DROPITEM', 4, { gameId: item.gameId });
+				lootTimeout = setTimeout(tryLoot, Math.min(interval * ++item.priority, throttleMax));
+				return;
+			}
+		}
+		if(enableAuto) setTimeout(tryLoot, scanInterval);
+    }
 }

+ 6 - 16
manifest.json

@@ -1,18 +1,8 @@
 {
-	"files": {
-		"config.js": {
-			"overwrite": false,
-			"hash": "7ad19b8a78f5292059f2d31a9974029d3c71d73ab14d99b75701afbe88345d7b"
-		},
-		"index.js": "d24c6bfa0af08f2b65f88814ae61cc5ce6d03b0bc321aa69f86d87653a64aa4d",
-		"module.json": "4ed019900213d703cb30ad1bb47f14244abe9dadfc618869ce2c8763d59f3188"
-	},
-	"defs": {
-		"C_PLAYER_LOCATION": 5,
-		"C_TRY_LOOT_DROPITEM": 4,
-		"S_DESPAWN_DROPITEM": 4,
-		"S_RETURN_TO_LOBBY": 1,
-		"S_SPAWN_DROPITEM": 8,
-		"S_SYSTEM_MESSAGE": 1
-	}
+    "files": {
+        "README.md": "070e56caa67c73ff1661b7b8746f4dd6122886e39518d283e5828f28e8316f92",
+        "config.js": "86510f0db991599b66c83c84a222eda59bd1a250a259aa03a9b2e5e26190c9e8",
+        "index.js": "4bfdc24bffc5a2eb186d8e0bb7607659a1be16fe07f4998ec8627e32b695ccaf",
+        "module.json": "bc68c77fa5bedc8d5d544ca73231ce8c958c74351a35da0b4e81769fac84d104"
+    }
 }

+ 8 - 6
module.json

@@ -1,7 +1,9 @@
 {
-  "disableAutoUpdate": false,
-  "servers": ["https://raw.githubusercontent.com/TerableCoder/auto-loot/master/"],
-  "options": {
-    "niceName": "auto-loot"
-  }
-}
+    "disableAutoUpdate": false,
+    "servers": ["https://raw.githubusercontent.com/tera-private-mods/auto-loot/master/"],
+    "options": {
+        "niceName": "auto-loot"
+    },
+    "name": "auto-loot",
+    "description": "Description goes here."
+}