aaaahhhhh!
This commit is contained in:
parent
8e1d366b38
commit
82112658b3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
MANIFEST-000386
|
||||
MANIFEST-000080
|
||||
|
|
|
@ -1,47 +1,13 @@
|
|||
2022/01/13-21:24:02.528757 7f68c0c86700 Recovering log #384
|
||||
2022/01/13-21:24:02.541876 7f68c0c86700 Level-0 table #387: started
|
||||
2022/01/13-21:24:02.582419 7f68c0c86700 Level-0 table #387: 29147 bytes OK
|
||||
2022/01/13-21:24:02.592320 7f68c0c86700 Delete type=0 #384
|
||||
2022/01/13-21:24:02.593583 7f68c0c86700 Delete type=3 #382
|
||||
2022/01/13-22:59:42.183462 7f68a37fe700 Compacting 1@0 + 1@1 files
|
||||
2022/01/13-22:59:42.201472 7f68a37fe700 Generated table #389@0: 113 keys, 7871 bytes
|
||||
2022/01/13-22:59:42.201511 7f68a37fe700 Compacted 1@0 + 1@1 files => 7871 bytes
|
||||
2022/01/13-22:59:42.204516 7f68a37fe700 compacted to: files[ 0 1 0 0 0 0 0 ]
|
||||
2022/01/13-22:59:42.204748 7f68a37fe700 Delete type=2 #385
|
||||
2022/01/13-22:59:42.204914 7f68a37fe700 Delete type=2 #387
|
||||
2022/01/14-10:58:56.588572 7f68a37fe700 Level-0 table #391: started
|
||||
2022/01/14-10:58:56.779373 7f68a37fe700 Level-0 table #391: 421500 bytes OK
|
||||
2022/01/14-10:58:56.806257 7f68a37fe700 Delete type=0 #388
|
||||
2022/01/14-14:10:03.261091 7f68a37fe700 Compacting 1@0 + 1@1 files
|
||||
2022/01/14-14:10:03.302932 7f68a37fe700 Generated table #392@0: 135 keys, 9948 bytes
|
||||
2022/01/14-14:10:03.302953 7f68a37fe700 Compacted 1@0 + 1@1 files => 9948 bytes
|
||||
2022/01/14-14:10:03.306403 7f68a37fe700 compacted to: files[ 0 1 0 0 0 0 0 ]
|
||||
2022/01/14-14:10:03.306839 7f68a37fe700 Delete type=2 #391
|
||||
2022/01/14-14:10:03.308757 7f68a37fe700 Delete type=2 #389
|
||||
2022/01/15-00:33:21.126357 7f68a37fe700 Level-0 table #394: started
|
||||
2022/01/15-00:33:21.230438 7f68a37fe700 Level-0 table #394: 415933 bytes OK
|
||||
2022/01/15-00:33:21.238870 7f68a37fe700 Delete type=0 #390
|
||||
2022/01/15-03:04:03.667912 7f68a37fe700 Compacting 1@0 + 1@1 files
|
||||
2022/01/15-03:04:03.756490 7f68a37fe700 Generated table #395@0: 147 keys, 11442 bytes
|
||||
2022/01/15-03:04:03.756517 7f68a37fe700 Compacted 1@0 + 1@1 files => 11442 bytes
|
||||
2022/01/15-03:04:03.783080 7f68a37fe700 compacted to: files[ 0 1 0 0 0 0 0 ]
|
||||
2022/01/15-03:04:03.783421 7f68a37fe700 Delete type=2 #394
|
||||
2022/01/15-03:04:03.784455 7f68a37fe700 Delete type=2 #392
|
||||
2022/01/15-14:23:03.305012 7f68a37fe700 Level-0 table #397: started
|
||||
2022/01/15-14:23:03.429225 7f68a37fe700 Level-0 table #397: 415900 bytes OK
|
||||
2022/01/15-14:23:03.435599 7f68a37fe700 Delete type=0 #393
|
||||
2022/01/15-18:10:04.413621 7f68a37fe700 Compacting 1@0 + 1@1 files
|
||||
2022/01/15-18:10:04.430980 7f68a37fe700 Generated table #398@0: 163 keys, 13251 bytes
|
||||
2022/01/15-18:10:04.431011 7f68a37fe700 Compacted 1@0 + 1@1 files => 13251 bytes
|
||||
2022/01/15-18:10:04.476243 7f68a37fe700 compacted to: files[ 0 1 0 0 0 0 0 ]
|
||||
2022/01/15-18:10:04.476482 7f68a37fe700 Delete type=2 #395
|
||||
2022/01/15-18:10:04.476944 7f68a37fe700 Delete type=2 #397
|
||||
2022/01/16-04:14:07.311026 7f68a37fe700 Level-0 table #400: started
|
||||
2022/01/16-04:14:07.361543 7f68a37fe700 Level-0 table #400: 416810 bytes OK
|
||||
2022/01/16-04:14:07.365780 7f68a37fe700 Delete type=0 #396
|
||||
2022/01/16-06:54:43.512802 7f68a37fe700 Compacting 1@0 + 1@1 files
|
||||
2022/01/16-06:54:43.595202 7f68a37fe700 Generated table #401@0: 177 keys, 14527 bytes
|
||||
2022/01/16-06:54:43.595227 7f68a37fe700 Compacted 1@0 + 1@1 files => 14527 bytes
|
||||
2022/01/16-06:54:43.614608 7f68a37fe700 compacted to: files[ 0 1 0 0 0 0 0 ]
|
||||
2022/01/16-06:54:43.615190 7f68a37fe700 Delete type=2 #400
|
||||
2022/01/16-06:54:43.615725 7f68a37fe700 Delete type=2 #398
|
||||
2022/01/16-13:05:00.304 5390 Recovering log #79
|
||||
2022/01/16-13:05:00.305 5390 Level-0 table #81: started
|
||||
2022/01/16-13:05:00.306 5390 Level-0 table #81: 5033 bytes OK
|
||||
2022/01/16-13:05:00.311 5390 Delete type=0 #79
|
||||
2022/01/16-13:05:00.311 5390 Delete type=3 #77
|
||||
2022/01/16-14:50:51.373 3240 Compacting 3@0 + 1@1 files
|
||||
2022/01/16-14:50:51.382 3240 Generated table #83@0: 540 keys, 15703 bytes
|
||||
2022/01/16-14:50:51.382 3240 Compacted 3@0 + 1@1 files => 15703 bytes
|
||||
2022/01/16-14:50:51.384 3240 compacted to: files[ 0 1 0 0 0 0 0 ]
|
||||
2022/01/16-14:50:51.385 3240 Delete type=2 #69
|
||||
2022/01/16-14:50:51.385 3240 Delete type=2 #71
|
||||
2022/01/16-14:50:51.386 3240 Delete type=2 #78
|
||||
2022/01/16-14:50:51.388 3240 Delete type=2 #81
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
2022/01/13-20:28:19.599602 7fce8bfff700 Recovering log #380
|
||||
2022/01/13-20:28:19.619863 7fce8bfff700 Level-0 table #383: started
|
||||
2022/01/13-20:28:19.644721 7fce8bfff700 Level-0 table #383: 34245 bytes OK
|
||||
2022/01/13-20:28:19.659675 7fce8bfff700 Delete type=3 #376
|
||||
2022/01/13-20:28:19.659731 7fce8bfff700 Delete type=0 #380
|
||||
2022/01/13-21:23:01.795818 7fce8a7fc700 Compacting 2@0 + 1@1 files
|
||||
2022/01/13-21:23:01.855301 7fce8a7fc700 Generated table #385@0: 106 keys, 7830 bytes
|
||||
2022/01/13-21:23:01.855331 7fce8a7fc700 Compacted 2@0 + 1@1 files => 7830 bytes
|
||||
2022/01/13-21:23:01.866354 7fce8a7fc700 compacted to: files[ 0 1 0 0 0 0 0 ]
|
||||
2022/01/13-21:23:01.866927 7fce8a7fc700 Delete type=2 #381
|
||||
2022/01/13-21:23:01.867414 7fce8a7fc700 Delete type=2 #379
|
||||
2022/01/13-21:23:01.871859 7fce8a7fc700 Delete type=2 #383
|
||||
2022/01/16-12:54:34.247 8028 Recovering log #76
|
||||
2022/01/16-12:54:34.247 8028 Level-0 table #78: started
|
||||
2022/01/16-12:54:34.249 8028 Level-0 table #78: 1215 bytes OK
|
||||
2022/01/16-12:54:34.254 8028 Delete type=0 #76
|
||||
2022/01/16-12:54:34.255 8028 Delete type=3 #75
|
||||
|
|
Binary file not shown.
Binary file not shown.
127
src/Commands.js
127
src/Commands.js
|
@ -171,6 +171,17 @@ module.exports = (bot) => {
|
|||
|
||||
rainstorm();
|
||||
|
||||
function checkDayJoin(part) {
|
||||
db.get('join~'+part._id, function(err, lastjoin) {
|
||||
// check if it's been more than a day
|
||||
if(lastjoin && (Date.now() - lastjoin) < 864e5) return false;
|
||||
db.put('join~'+part._id, Date.now());
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
MPPClient.checkDayJoin = checkDayJoin;
|
||||
|
||||
function catchSomething(part) {
|
||||
db.getFish(part._id, function(myfish) {
|
||||
if(myfish.length > 10 && Math.random() < 0.1) {
|
||||
|
@ -199,6 +210,22 @@ module.exports = (bot) => {
|
|||
console.log(type);
|
||||
// client.sendArray([{m: "admin message", password: new String(data).trim(),
|
||||
// msg: {"m": "notification", "id":"Fish-caught","targetUser": "room", "target": "#piano", "duration": "7000", "class":"short","html": "<img src=\"https://multiplayerpiano.com/fishing-bot/"+type+".png\"/><br>"+sanitize(text)}}]);
|
||||
MPPClient.client.sendArray([{
|
||||
m: 'custom',
|
||||
data: {
|
||||
m: 'notification',
|
||||
id: 'Fish-caught',
|
||||
targetUser: 'room',
|
||||
target: '#piano',
|
||||
duration: '7000',
|
||||
class: 'short',
|
||||
html: '<img src="https://multiplayerpiano.com/fishing-bot/'+type+'.png"/><br>'+sanitize(text)
|
||||
},
|
||||
target: {
|
||||
mode: 'subscribed',
|
||||
global: false
|
||||
}
|
||||
}]);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
@ -277,6 +304,8 @@ module.exports = (bot) => {
|
|||
});
|
||||
};
|
||||
|
||||
MPPClient.catchPokemon = catchPokemon;
|
||||
|
||||
function findParticipantByName(name) {
|
||||
if(!name || name.trim() == "") return undefined;
|
||||
for(var id in MPPClient.client.ppl) {
|
||||
|
@ -497,6 +526,16 @@ module.exports = (bot) => {
|
|||
}
|
||||
}, false);
|
||||
|
||||
bot.addCommand(['pokemon', 'pkmn'], 0, msg => {
|
||||
var part = findParticipantByNameFuzzy(msg.argcat()) || msg.p;
|
||||
|
||||
db.getPokemon(part._id, function(mypkmn) {
|
||||
var message = "";
|
||||
message = "Friend "+part.name+"'s pokemon: "+listOff(mypkmn) + message;
|
||||
sendChat(message);
|
||||
});
|
||||
}, false);
|
||||
|
||||
bot.addCommand('fishing_count', 0, msg => {
|
||||
var count = 0;
|
||||
db.createReadStream({
|
||||
|
@ -781,6 +820,7 @@ module.exports = (bot) => {
|
|||
|
||||
bot.addCommand(['eat', 'oot'], 0, msg => {
|
||||
db.getFish(msg.p._id, function(myfish) {
|
||||
db.getPokemon(msg.p._id, function (mypkmn) {
|
||||
if(myfish.length < 1) {
|
||||
sendChat("Friend " + msg.p.name+": You have no food. /fish to get some.");
|
||||
return;
|
||||
|
@ -793,6 +833,14 @@ module.exports = (bot) => {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (msg.args[0] && !idx) {
|
||||
for(var i = 0; i < mypkmn.length; i++) {
|
||||
if(mypkmn[i].toLowerCase().indexOf(arg) !== -1) {
|
||||
sendChat("My dude, " + msg.p.name+", Pokémon are not food. You can't just eat something that cute!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(idx == -1) {
|
||||
sendChat("Friend " +msg.p.name+": You don't have a "+arg+" that's edible.");
|
||||
return;
|
||||
|
@ -863,6 +911,7 @@ module.exports = (bot) => {
|
|||
sendChat("Our friend " + msg.p.name+" ate his/her "+food+" and it made him/her turn "+(new Color(color).getName().toLowerCase())+".");
|
||||
}
|
||||
});
|
||||
});
|
||||
}, false);
|
||||
|
||||
bot.addCommand(['caught', 'sack'], 0, msg => {
|
||||
|
@ -1165,12 +1214,11 @@ module.exports = (bot) => {
|
|||
|
||||
setInterval(function() {
|
||||
db.put("look.outside.◍Sand", "We don't talk about that.");
|
||||
db.put("look.outside.◍Lawn Mower", "It's a bird! It's a plane! It's a... lawn mower!");
|
||||
|
||||
db.put("look.sleep.◍Bed", "*snuggles*");
|
||||
|
||||
db.put("look.inside.◍Couch", "Let's sit down and have a talk.");
|
||||
db.put("look.inside.◍Grand Piano", "Sounds very multiplayer.");
|
||||
db.put("look.inside.◍Grand Piano", "Maybe you could play a song or two for us.");
|
||||
}, 6000);
|
||||
|
||||
var FISHING_CHANCE = 0.02;
|
||||
|
@ -1217,6 +1265,7 @@ module.exports = (bot) => {
|
|||
|
||||
setInterval(function() {
|
||||
// return; // stop auto-fishing
|
||||
if (new Date().getDay() !== 2) return;
|
||||
|
||||
var client = MPPClient.client;
|
||||
|
||||
|
@ -1295,15 +1344,11 @@ module.exports = (bot) => {
|
|||
} else if(this.part.y > 100) {
|
||||
this.vy = -this.vy;
|
||||
}
|
||||
//this.vx += Math.random() * 0.5 - 0.25;
|
||||
//this.vy += Math.random() * 0.5 - 0.25;
|
||||
// this.client.sendArray([{m: "m", x: this.part.x, y: this.part.y}]);
|
||||
this.vx += Math.random() * 0.5 - 0.25;
|
||||
this.vy += Math.random() * 0.5 - 0.25;
|
||||
this.client.sendArray([{m: "m", x: this.part.x, y: this.part.y}]);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var Exchange = function(db) {
|
||||
this.db = db;
|
||||
};
|
||||
|
@ -1633,56 +1678,6 @@ module.exports = (bot) => {
|
|||
}
|
||||
});
|
||||
|
||||
// bot.addCommand(['give'], 0, msg => {
|
||||
// var thief = msg.p;
|
||||
// var victim = findParticipantByNameFuzzy(msg.args[0]);
|
||||
// if (!victim) {
|
||||
// sendChat("Friend " + thief.name + " missed");
|
||||
// return;
|
||||
// }
|
||||
// if (victim._id == thief._id) {
|
||||
// sendChat("Friendly friend " + thief.name + " fudged");
|
||||
// return;
|
||||
// }
|
||||
// var target_fish = msg.argcat(1);
|
||||
// db.getFish(thief._id, function (thief_fish) {
|
||||
// db.getFish(victim._id, function (victim_fish) {
|
||||
// if (victim_fish.length >= TOO_MANY_FISH) {
|
||||
// sendChat("Friend " + victim.name + " is carrying too much.");
|
||||
// return;
|
||||
// }
|
||||
// if (thief_fish.length > 0) {
|
||||
// var idx = -1;
|
||||
// var arg = target_fish.trim().toLowerCase();
|
||||
// for (var i = 0; i < thief_fish.length; i++) {
|
||||
// if (arg == "" || thief_fish[i].toLowerCase().indexOf(arg) !== -1) {
|
||||
// idx = i;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if (idx == -1) {
|
||||
// sendChat("Friend " + thief.name + ": You don't have a " + arg + "that you can /give like that.");
|
||||
// return;
|
||||
// }
|
||||
// var thefish = thief_fish[idx];
|
||||
// thief_fish.splice(idx, 1);
|
||||
// victim_fish.push(thefish);
|
||||
|
||||
// sendChat("Our friend" + thief.name + " gave " + victim.name + " his/her " + thefish);
|
||||
// db.putFish(thief._id, thief_fish);
|
||||
// db.putFish(victim._id, victim_fish);
|
||||
// } else {
|
||||
// sendChat("Friend " + thief.name + ": You don't have the fish to give.");
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// return;
|
||||
// }, false);
|
||||
|
||||
// bot.addCommand(['/give_'], 0, msg => {
|
||||
|
||||
// }, true);
|
||||
|
||||
bot.addCommand(['bestow'], 0, msg => {
|
||||
var thief = msg.p;
|
||||
var victim = findParticipantByNameFuzzy(msg.args[0]);
|
||||
|
@ -1729,9 +1724,13 @@ module.exports = (bot) => {
|
|||
return;
|
||||
});
|
||||
|
||||
// bot.addCommand(['/bestow_'], 0, msg => {
|
||||
|
||||
// }, true);
|
||||
|
||||
|
||||
bot.addCommand(['setcolor'], 0, (msg, admin) => {
|
||||
if (!admin) return;
|
||||
MPPClient.client.sendArray([{
|
||||
m: 'userset',
|
||||
set: {
|
||||
color: msg.args[0]
|
||||
}
|
||||
}])
|
||||
});
|
||||
}
|
||||
|
|
|
@ -47,6 +47,14 @@ module.exports = class MPPClient {
|
|||
|
||||
// if (role) guildMember.roles.add(role);
|
||||
// });
|
||||
|
||||
this.client.on('participant added', p => {
|
||||
let day = true;
|
||||
if (this.checkDayJoin) {
|
||||
day = this.checkDayJoin(p);
|
||||
}
|
||||
if (this.catchPokemon && day) this.catchPokemon(p, true);
|
||||
});
|
||||
}
|
||||
|
||||
static handleMessage(msg) {
|
||||
|
|
Loading…
Reference in New Issue