|
@@ -8,7 +8,7 @@ module.exports = function boxOpener(dispatch){
|
|
|
enabled = false,
|
|
enabled = false,
|
|
|
location = null,
|
|
location = null,
|
|
|
timer = null,
|
|
timer = null,
|
|
|
- delay = 200,
|
|
|
|
|
|
|
+ delay = 1000,
|
|
|
statOpened = 0,
|
|
statOpened = 0,
|
|
|
statStarted = null,
|
|
statStarted = null,
|
|
|
scanning = false;
|
|
scanning = false;
|
|
@@ -48,10 +48,10 @@ module.exports = function boxOpener(dispatch){
|
|
|
|
|
|
|
|
dispatch.hook('S_LOGIN', 1, event =>{cid = event.cid});
|
|
dispatch.hook('S_LOGIN', 1, event =>{cid = event.cid});
|
|
|
|
|
|
|
|
|
|
+ dispatch.hook('C_PLAYER_LOCATION', 1, event =>{location = event});
|
|
|
|
|
+
|
|
|
function load()
|
|
function load()
|
|
|
{
|
|
{
|
|
|
- hook('C_PLAYER_LOCATION', 1, event =>{location = event});
|
|
|
|
|
-
|
|
|
|
|
hook('S_INVEN', 5, event =>{
|
|
hook('S_INVEN', 5, event =>{
|
|
|
if(!enabled) return
|
|
if(!enabled) return
|
|
|
|
|
|
|
@@ -155,7 +155,7 @@ module.exports = function boxOpener(dispatch){
|
|
|
let m = addZero(d.getMinutes());
|
|
let m = addZero(d.getMinutes());
|
|
|
let s = addZero(d.getSeconds());
|
|
let s = addZero(d.getSeconds());
|
|
|
x.innerHTML = h + ":" + m + ":" + s;
|
|
x.innerHTML = h + ":" + m + ":" + s;
|
|
|
- command.message('Box opener stopped. Opened: ' + statOpened + ' boxes. Time elapsed: ' + (h + ":" + m + ":" + s) + " per box: " ((timeElapsedMSec / statOpened) / 1000) + " sec");
|
|
|
|
|
|
|
+ command.message('Box opener stopped. Opened: ' + statOpened + ' boxes. Time elapsed: ' + (h + ":" + m + ":" + s) + ". Per box: " + ((timeElapsedMSec / statOpened) / 1000).toPrecision(2) + " sec");
|
|
|
statOpened = 0;
|
|
statOpened = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -168,6 +168,6 @@ module.exports = function boxOpener(dispatch){
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function hook() {
|
|
function hook() {
|
|
|
- hooks.push(hook(...arguments))
|
|
|
|
|
|
|
+ hooks.push(dispatch.hook(...arguments))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|