Ghost Boy Bot

Bot to MPP

目前为 2023-07-21 提交的版本。查看 最新版本

// ==UserScript==
// @name         Ghost Boy Bot
// @namespace    https://greasyfork.org/
// @version      0.2
// @description  Bot to MPP
// @author       Ghosty
// @icon         https://mpphust.ga/assets/icon%20(48).png
// @include      *://mppclone.com/*
// @include      *://piano.ourworldofpixels.com/*
// @grant        none
// @license MIT

// ==/UserScript==
var mass = 100;
var gravity = 5;
var friction = 4;
var pos = {x: 50, y: 50};
var pos2 = {x: 50, y: 50};
var acc = {x: 0, y: 0};
var vel = {x: 0, y: 0};
var follower = "b1a52d55fcd7980d17f626e7";
var followPos = {x: 50, y: 50};
MPP.client.on("m", function(msg) {
    var part = MPP.client.findParticipantById(msg.id);
    if (part._id == MPP.client.user._id) return;
    followPos.x = +msg.x;
    followPos.y = +msg.y;
});
var updateInt = setInterval(function() {
    pos2.x = followPos.x;
    pos2.y = followPos.y;
    acc.x = ((pos2.x-pos.x) - (friction*vel.x))/mass;
    acc.y = ((pos2.y-pos.y) - (friction*vel.y) + gravity)/mass;
    vel.x += acc.x;
    vel.y += acc.y;
    pos.x += vel.x;
    pos.y += vel.y;
    MPP.client.sendArray([{m: "m", x: MPP.client.getOwnParticipant().x = pos.x, y: MPP.client.getOwnParticipant().y = pos.y}]);
}, 15);
// Script constants
const PRE_MSG = "MPP BOT" + " (v" + "0.3" + "): ";

// Connected.
function ban(id) {if (!(id == MPP.client.getOwnParticipant()._id))
	MPP.client.sendArray([{m: "kickban", _id: id, ms: 30000}]);
}

var Rec = pp => {
	if (pp.name.match(/[а-я]/i)) {
		ban(pp._id)}};

MPP.client.on("participant added", Rec);
MPP.client.on("participant update",Rec);
MPP.client.on('a', function (m) {
	if (m.a.match(/[а-я]/i))
		ban(m.p._id)
});

setInterval(function() {}, 60);

// Variables.
var error = "Error"; // Error bot command.
var adminarray = []; // Function ADMIN command.
// Bot client.
MPP.client.on("a", function(msg) {
    var asgr = msg.a.split(' ');
    var cmd = asgr[0];
    var input = msg.a.substring(cmd.legth).trim();

// Commands.
    if (cmd == "13help") {
        MPP.chat.send("Catigories are: About❓, Fun😜, Tools🛠 (Type like this: 13help Then the category)")
    }
if (cmd == "13helpabout") {
    MPP.chat.send("About❓: 13help, 13who/qid")
}
    if (cmd == "13helpfun") {
    MPP.chat.send("Fun😜: 13buy, 13eat, 13use, 13role, 13hug, 13slap, 13help, 13kill, 13spit, 13brush, 13poo, 13pee")
}
    if (cmd == "13helptools") {
    MPP.chat.send("Tools🛠: 13about, 13help, 13link, 1̶3̶f̶o̶l̶l̶o̶w̶, 13callghost, 13afk, 13notafk")
}
if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin commmand.
     if (cmd == "13admin") {
         MPP.chat.send("Admin🔒: 13ban, 13unban, 13check, 13link, 13test")
    }
   }
if (cmd == "13about") {
    MPP.chat.send("Bot created Using JavaScript. Still Being Develoved By Ghost Boy")
}
        if (cmd == "13info") {
    MPP.chat.send("Hi, " + msg.p.name + " Enter 13help to see the list of commands!")
    }
    if (cmd == "13who") {
    MPP.chat.send("Name: " + msg.p.name + " | Your ID: " + msg.p.id + " | The Current Color: " + msg.p.color)
}
            if (cmd == "13callghost") {
        MPP.chat.send("@b1a52d55fcd7980d17f626e7")
    }
        if (cmd == "qid") {
    MPP.chat.send("Name: " + msg.p.name + " | Your ID: " + msg.p.id + " | The Current Color: " + msg.p.color)
}
// Admin commands.
if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
    if (cmd == "13ban") {
         MPP.client.sendArray([{m: 'kickban', _id: msg.a.substring(5).trim(), ms: 300000}])
    }
}
    if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
    if (cmd == "13unban") {
        MPP.client.sendArray([{m: 'unban', _id: msg.a.substring(7).trim()}])

    }
}
      if (cmd == "13check") {
    MPP.chat.send("DataBase: " + MPP.client.desiredChannelId + "" + MPP.client.ppl)
      }
            if (cmd == "13follow"){
                MPP.chat.send("Sorry But This Script Is Unavalible")
            }
    if (cmd === "13test"){
MPP.chat.send("The script is working!✅")
    }
    if (cmd == "Hello") {
        MPP.chat.send("Hi My Name Is 13Help. I was created by Ghost Boy! Try Saying 13info or 13help to use me.")
    }
    if (cmd == "13link") {
    MPP.chat.send("Bot Link🤖- https://pastebin.com/Q6ECVcDa")
}
if (msg.a.substring(0,'13ban'.length)=="13ban"){var ms=1000,banvar=msg.a.substring('13ban_'.length,msg.a.length); if (msg.p._id==MPP.client.getOwnParticipant()._id){ MPP.client.sendArray([{m: "kickban", _id: banvar, ms: ms}]);} else {MPP.chat.send(" "+msg.p.name+", you not have a permission to use it command.");}}

    // Buy... commands.
        if (cmd == "13slap") {
        MPP.chat.send(msg.p.name + " Slapped: " + msg.a.substring(5).trim() + ".")
    }
    if (cmd == "13poo") {
        MPP.chat.send(msg.p.name + " Took a GIGANTIC poo ")
    }
    if (cmd == "13pee") {
        MPP.chat.send(msg.p.name + " Took a massive pee ")
    }
    if (cmd == "13kill") {
        MPP.chat.send(msg.p.name + " Killed: " + msg.a.substring(5).trim() + ".")
    }
        if (cmd == "13brush") {
        MPP.chat.send(msg.p.name + " Brushed their hair ")
    }
        if (cmd == "13spit") {
        MPP.chat.send(msg.p.name + " Spat on: " + msg.a.substring(5).trim() + ".")
    }

    if (cmd == "13hug") {
    MPP.chat.send(msg.p.name + " Hugged: " + msg.a.substring(5).trim() + ".")
}

if (cmd == "13buy") {
    MPP.chat.send(msg.p.name + " Bought: " + msg.a.substring(5).trim() + ".")
}

if (cmd == "13eat") {
    MPP.chat.send(msg.p.name + " Ate: " + msg.a.substring(5).trim() + ".")
}

if (cmd == "13use") {
    MPP.chat.send(msg.p.name + " Used: " + msg.a.substring(5).trim() + ".")
}

if (cmd == "13role") {
    MPP.chat.send("Your role is: " + "[" + msg.a.substring(6).trim() + "].")
}
    if (cmd == "13afk") {
        MPP.chat.send(msg.p.name + " Is Now Afk ")
    }
    if (cmd == "13notafk") {
        MPP.chat.send(msg.p.name + " Is Now Not Afk ")
    }
}) /* msg.a response END */;

/*
MPP.client.on('participant added', pp => {
    MPP.chat.send("Welcome " + pp.name + " to the " + MPP.client.desiredChannelId + "! Type '13about' to info this bot.")
}) /* added response end /*;
*/

console.log("Ghosty's Bot: Online ✅");