diff --git a/bot2022.db/001296.log b/bot2022.db/001296.log deleted file mode 100644 index d7fcc22..0000000 Binary files a/bot2022.db/001296.log and /dev/null differ diff --git a/bot2022.db/001297.ldb b/bot2022.db/001297.ldb deleted file mode 100644 index d676a9e..0000000 Binary files a/bot2022.db/001297.ldb and /dev/null differ diff --git a/bot2022.db/001355.ldb b/bot2022.db/001355.ldb new file mode 100644 index 0000000..bb8683d Binary files /dev/null and b/bot2022.db/001355.ldb differ diff --git a/bot2022.db/001357.ldb b/bot2022.db/001357.ldb new file mode 100644 index 0000000..007fefe Binary files /dev/null and b/bot2022.db/001357.ldb differ diff --git a/bot2022.db/001360.ldb b/bot2022.db/001360.ldb new file mode 100644 index 0000000..cf40449 Binary files /dev/null and b/bot2022.db/001360.ldb differ diff --git a/bot2022.db/001361.log b/bot2022.db/001361.log new file mode 100644 index 0000000..b9985be Binary files /dev/null and b/bot2022.db/001361.log differ diff --git a/bot2022.db/CURRENT b/bot2022.db/CURRENT index 24eb89d..e7d6012 100644 --- a/bot2022.db/CURRENT +++ b/bot2022.db/CURRENT @@ -1 +1 @@ -MANIFEST-001294 +MANIFEST-001359 diff --git a/bot2022.db/LOG b/bot2022.db/LOG index db6041d..da47d87 100644 --- a/bot2022.db/LOG +++ b/bot2022.db/LOG @@ -1,13 +1,5 @@ -2022/04/06-22:41:18.436029 7f1868e9b700 Recovering log #1293 -2022/04/06-22:41:18.436369 7f1868e9b700 Level-0 table #1295: started -2022/04/06-22:41:18.439139 7f1868e9b700 Level-0 table #1295: 3070 bytes OK -2022/04/06-22:41:18.443935 7f1868e9b700 Delete type=0 #1293 -2022/04/06-22:41:18.443997 7f1868e9b700 Delete type=3 #1292 -2022/04/06-22:45:42.490206 7f184affd700 Compacting 3@0 + 1@1 files -2022/04/06-22:45:42.498214 7f184affd700 Generated table #1297@0: 4251 keys, 200930 bytes -2022/04/06-22:45:42.498242 7f184affd700 Compacted 3@0 + 1@1 files => 200930 bytes -2022/04/06-22:45:42.503492 7f184affd700 compacted to: files[ 0 1 0 0 0 0 0 ] -2022/04/06-22:45:42.503633 7f184affd700 Delete type=2 #1257 -2022/04/06-22:45:42.503766 7f184affd700 Delete type=2 #1260 -2022/04/06-22:45:42.503969 7f184affd700 Delete type=2 #1241 -2022/04/06-22:45:42.504133 7f184affd700 Delete type=2 #1295 +2022/04/07-02:11:18.873047 7f130ffff700 Recovering log #1358 +2022/04/07-02:11:18.873240 7f130ffff700 Level-0 table #1360: started +2022/04/07-02:11:18.876138 7f130ffff700 Level-0 table #1360: 318 bytes OK +2022/04/07-02:11:18.879394 7f130ffff700 Delete type=0 #1358 +2022/04/07-02:11:18.879436 7f130ffff700 Delete type=3 #1356 diff --git a/bot2022.db/LOG.old b/bot2022.db/LOG.old index f4a3567..def34db 100644 --- a/bot2022.db/LOG.old +++ b/bot2022.db/LOG.old @@ -1,3 +1,5 @@ -2022/04/06-22:39:28.559402 7f28d3691700 Recovering log #1291 -2022/04/06-22:39:28.563017 7f28d3691700 Delete type=3 #1290 -2022/04/06-22:39:28.563068 7f28d3691700 Delete type=0 #1291 +2022/04/07-02:10:48.753270 7f7779ffb700 Recovering log #1354 +2022/04/07-02:10:48.754642 7f7779ffb700 Level-0 table #1357: started +2022/04/07-02:10:48.756540 7f7779ffb700 Level-0 table #1357: 728 bytes OK +2022/04/07-02:10:48.758772 7f7779ffb700 Delete type=0 #1354 +2022/04/07-02:10:48.758843 7f7779ffb700 Delete type=3 #1352 diff --git a/bot2022.db/MANIFEST-001294 b/bot2022.db/MANIFEST-001294 deleted file mode 100644 index e2dfe73..0000000 Binary files a/bot2022.db/MANIFEST-001294 and /dev/null differ diff --git a/bot2022.db/MANIFEST-001359 b/bot2022.db/MANIFEST-001359 new file mode 100644 index 0000000..270bda2 Binary files /dev/null and b/bot2022.db/MANIFEST-001359 differ diff --git a/src/Commands.js b/src/Commands.js index da2eb9c..49ffb4c 100644 --- a/src/Commands.js +++ b/src/Commands.js @@ -30,7 +30,7 @@ module.exports = (bot) => { let time = 0; db.getTime((err, t) => { - if (!err) time = t; + if (!err) time = parseInt(t); }); var banned = []; @@ -45,7 +45,7 @@ module.exports = (bot) => { if (time >= 60) { time = 0; } - db.setTime(time); + db.setTime(time.toString()); db.getBanned((val, val2) => { banned = val; @@ -540,7 +540,7 @@ module.exports = (bot) => { }, false); bot.addCommand(['color', 'colour'], 0, msg => { - if (msg.args.length == 0) return; + if (msg.args.length == 0) msg.args[1] = msg.p._id; var color; if (msg.args[0].match(/^#[0-9a-f]{6}$/i)) { color = new Color(msg.args[0]); @@ -811,7 +811,7 @@ module.exports = (bot) => { } }); } else { - sendChat("You have to /go outside to "+cmd+" your device."); + sendChat("You have to /go outside to "+msg.args[0]+" your device."); } }); }, false); @@ -1655,6 +1655,10 @@ module.exports = (bot) => { db.getLocation(msg.p._id, location => { if (location === 'outside') { if(location === "outside") { + if (banned.includes(msg.p._id)) { + sendChat("Friend " + msg.p.name + ", you are not allowed to have any fruit because you steal."); + return; + } db.getFruits(function(num_fruits) { if(num_fruits > 0) { db.setFruits(num_fruits - 1); @@ -1937,5 +1941,19 @@ module.exports = (bot) => { // } // }); - + bot.addCommand('wash', 0, msg => { + db.getLocation(msg.p._id, location => { + if(location === "inside") { + let r = ["washes fish in preparation for food.","washes their fish to be eaten later on.","washes all their fish in the kitchen sink for the "+(time >= 30 ? "day" : "night" + "time.")]; + sendChat("Friend "+msg.p.name+" "+rando(r)); + } else { + sendChat("You have to /go inside to "+msg.args[0]+" your fish."); + } + }); + }, false); + + bot.addCommand('ban', 0, (msg, admin) => { + if (!admin) return; + db.appendBanned(msg.argcat); + }, false); } diff --git a/src/Database.js b/src/Database.js index 0751eda..71511cb 100644 --- a/src/Database.js +++ b/src/Database.js @@ -245,7 +245,7 @@ db.putBanned = (arr, cb) => { } db.appendBanned = (id, cb) => { - db.getBanned((val) => { + db.getBanned((arr) => { val = val.concat(arr); db.putBanned(arr, cb); });