Compare commits
No commits in common. "58b57e64132b824b82657068492d1abbe2cdd259" and "45693903dce87e374d74b91f04fe27f9cb14f52d" have entirely different histories.
58b57e6413
...
45693903dc
|
@ -3,5 +3,4 @@ desiredUser:
|
||||||
color: "#1d0054"
|
color: "#1d0054"
|
||||||
agents:
|
agents:
|
||||||
wss://mppclone.com:
|
wss://mppclone.com:
|
||||||
# - id: "✧𝓓𝓔𝓥 𝓡𝓸𝓸𝓶✧"
|
- id: "✧𝓓𝓔𝓥 𝓡𝓸𝓸𝓶✧"
|
||||||
- id: "wizardposting"
|
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
import { Item, StackableItem } from "../../../economy/Item";
|
|
||||||
import { Command } from "../../Command";
|
|
||||||
import { CommandHandler } from "../../CommandHandler";
|
|
||||||
|
|
||||||
export const inventory = new Command(
|
|
||||||
"inventory",
|
|
||||||
["inventory", "inv"],
|
|
||||||
"get bozo's inventory",
|
|
||||||
"inventory",
|
|
||||||
(msg, agent) => {
|
|
||||||
const items = msg.inventory.items as unknown as Item[];
|
|
||||||
const list = items
|
|
||||||
.map(
|
|
||||||
i =>
|
|
||||||
`${i.name}${
|
|
||||||
(i as StackableItem).count
|
|
||||||
? " " + (i as StackableItem).count
|
|
||||||
: ""
|
|
||||||
}`
|
|
||||||
)
|
|
||||||
.join(" | ");
|
|
||||||
|
|
||||||
return `Items: ${list ? list : "(none)"}`;
|
|
||||||
}
|
|
||||||
);
|
|
|
@ -1,17 +0,0 @@
|
||||||
import { MPPAgent } from "../../../services/mpp";
|
|
||||||
import { Command } from "../../Command";
|
|
||||||
|
|
||||||
export const cursor = new Command(
|
|
||||||
"cursor",
|
|
||||||
["cursor"],
|
|
||||||
"set the cursor bozo",
|
|
||||||
"cursor",
|
|
||||||
(msg, agent) => {
|
|
||||||
if (!(agent as MPPAgent).client.isConnected) return;
|
|
||||||
if (!msg.argv[1]) return "Specify a mode.";
|
|
||||||
|
|
||||||
const cursor = (agent as MPPAgent).cursor;
|
|
||||||
cursor.props.currentAnimation = msg.argv[1];
|
|
||||||
},
|
|
||||||
false
|
|
||||||
);
|
|
|
@ -6,19 +6,13 @@ import { id } from "./commands/utility/id";
|
||||||
import { msg } from "./commands/utility/msg";
|
import { msg } from "./commands/utility/msg";
|
||||||
import { math } from "./commands/utility/math";
|
import { math } from "./commands/utility/math";
|
||||||
import { memory } from "./commands/utility/memory";
|
import { memory } from "./commands/utility/memory";
|
||||||
import { cursor } from "./commands/utility/cursor";
|
|
||||||
import { inventory } from "./commands/economy/inventory";
|
|
||||||
|
|
||||||
export function loadCommands() {
|
export function loadCommands() {
|
||||||
const general = new CommandGroup("general", "⭐ General");
|
const general = new CommandGroup("general", "⭐ General");
|
||||||
general.addCommands([help, about]);
|
general.addCommands([help, about]);
|
||||||
CommandHandler.addCommandGroup(general);
|
CommandHandler.addCommandGroup(general);
|
||||||
|
|
||||||
const economy = new CommandGroup("economy", "💸 Economy");
|
|
||||||
economy.addCommands([inventory]);
|
|
||||||
CommandHandler.addCommandGroup(economy);
|
|
||||||
|
|
||||||
const utility = new CommandGroup("utility", "🔨 Utility");
|
const utility = new CommandGroup("utility", "🔨 Utility");
|
||||||
utility.addCommands([math, memory, id, msg, cursor]);
|
utility.addCommands([math, memory, id, msg]);
|
||||||
CommandHandler.addCommandGroup(utility);
|
CommandHandler.addCommandGroup(utility);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
export interface Item {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StackableItem extends Item {
|
|
||||||
count: number;
|
|
||||||
}
|
|
|
@ -25,7 +25,7 @@ export class Cursor {
|
||||||
public updateInterval: NodeJS.Timeout;
|
public updateInterval: NodeJS.Timeout;
|
||||||
|
|
||||||
public props: CursorProps = {
|
public props: CursorProps = {
|
||||||
currentAnimation: "test2",
|
currentAnimation: "lemniscate",
|
||||||
position: {
|
position: {
|
||||||
x: 50,
|
x: 50,
|
||||||
y: 50
|
y: 50
|
||||||
|
@ -35,8 +35,8 @@ export class Cursor {
|
||||||
y: 0
|
y: 0
|
||||||
},
|
},
|
||||||
velocity: {
|
velocity: {
|
||||||
x: 2 / 5,
|
x: 0,
|
||||||
y: 2 / 7
|
y: 0
|
||||||
},
|
},
|
||||||
acceleration: {
|
acceleration: {
|
||||||
x: 0,
|
x: 0,
|
||||||
|
@ -112,7 +112,6 @@ export class Cursor {
|
||||||
this.props.position.x >= 105
|
this.props.position.x >= 105
|
||||||
) {
|
) {
|
||||||
this.props.position.x = 50;
|
this.props.position.x = 50;
|
||||||
this.props.velocity.x = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -120,64 +119,6 @@ export class Cursor {
|
||||||
this.props.position.y >= 105
|
this.props.position.y >= 105
|
||||||
) {
|
) {
|
||||||
this.props.position.y = 50;
|
this.props.position.y = 50;
|
||||||
this.props.velocity.y = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.props.ot = Date.now();
|
|
||||||
break;
|
|
||||||
case "bounce2":
|
|
||||||
this.props.oldPosition.x = this.props.position.x;
|
|
||||||
this.props.oldPosition.y = this.props.position.y;
|
|
||||||
this.props.t = Date.now();
|
|
||||||
this.props.dt = (this.props.t - this.props.ot) / 1000;
|
|
||||||
|
|
||||||
this.props.acceleration.x = Math.random() * 100 - 50;
|
|
||||||
|
|
||||||
if (this.props.position.y < 75) {
|
|
||||||
this.props.acceleration.y =
|
|
||||||
Math.random() * 100 - 50 - this.props.gravity;
|
|
||||||
} else {
|
|
||||||
this.props.acceleration.y = -(Math.random() * 50);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.props.velocity.x +=
|
|
||||||
this.props.acceleration.x * this.props.dt;
|
|
||||||
this.props.velocity.y +=
|
|
||||||
this.props.acceleration.y * this.props.dt;
|
|
||||||
|
|
||||||
this.props.position.x +=
|
|
||||||
this.props.velocity.x * this.props.dt;
|
|
||||||
this.props.position.y +=
|
|
||||||
this.props.velocity.y * this.props.dt;
|
|
||||||
|
|
||||||
if (
|
|
||||||
this.props.position.x >= 100 ||
|
|
||||||
this.props.position.x <= 0
|
|
||||||
) {
|
|
||||||
this.props.velocity.x = -this.props.velocity.x;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
this.props.position.y >= 100 ||
|
|
||||||
this.props.position.y <= 0
|
|
||||||
) {
|
|
||||||
this.props.velocity.y = -this.props.velocity.y;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
this.props.position.x <= -5 ||
|
|
||||||
this.props.position.x >= 105
|
|
||||||
) {
|
|
||||||
this.props.position.x = 50;
|
|
||||||
this.props.velocity.x = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
this.props.position.y <= -5 ||
|
|
||||||
this.props.position.y >= 105
|
|
||||||
) {
|
|
||||||
this.props.position.y = 50;
|
|
||||||
this.props.velocity.y = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.ot = Date.now();
|
this.props.ot = Date.now();
|
||||||
|
@ -215,7 +156,6 @@ export class Cursor {
|
||||||
this.props.position.x >= 105
|
this.props.position.x >= 105
|
||||||
) {
|
) {
|
||||||
this.props.position.x = 50;
|
this.props.position.x = 50;
|
||||||
this.props.velocity.x = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -223,7 +163,6 @@ export class Cursor {
|
||||||
this.props.position.y >= 105
|
this.props.position.y >= 105
|
||||||
) {
|
) {
|
||||||
this.props.position.y = 50;
|
this.props.position.y = 50;
|
||||||
this.props.velocity.y = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.ot = Date.now();
|
this.props.ot = Date.now();
|
||||||
|
@ -242,59 +181,6 @@ export class Cursor {
|
||||||
10 +
|
10 +
|
||||||
50;
|
50;
|
||||||
|
|
||||||
break;
|
|
||||||
case "test":
|
|
||||||
if (!this.props.angles[0]) this.props.angles[0] = 0;
|
|
||||||
|
|
||||||
this.props.angles[0] += 2;
|
|
||||||
if (this.props.angles[0] > 360) this.props.angles[0] = 0;
|
|
||||||
|
|
||||||
this.props.position.x =
|
|
||||||
Math.cos(this.props.angles[0] * (Math.PI / 180)) * 10 +
|
|
||||||
50;
|
|
||||||
this.props.position.y =
|
|
||||||
Math.sin(this.props.angles[0] * (Math.PI / 180) * 2) *
|
|
||||||
10 +
|
|
||||||
50;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case "test2":
|
|
||||||
this.props.oldPosition.x = this.props.position.x;
|
|
||||||
this.props.oldPosition.y = this.props.position.y;
|
|
||||||
this.props.t = Date.now();
|
|
||||||
this.props.dt = (this.props.t - this.props.ot) / 1000;
|
|
||||||
|
|
||||||
if (this.props.velocity.x > 10)
|
|
||||||
this.props.velocity.x = 2 / 5;
|
|
||||||
if (this.props.velocity.x < -10)
|
|
||||||
this.props.velocity.x = -(2 / 5);
|
|
||||||
if (this.props.velocity.y > 10)
|
|
||||||
this.props.velocity.y = 2 / 7;
|
|
||||||
if (this.props.velocity.y < -10)
|
|
||||||
this.props.velocity.y = -(2 / 7);
|
|
||||||
|
|
||||||
this.props.position.x +=
|
|
||||||
this.props.velocity.x * this.props.dt * 10;
|
|
||||||
this.props.position.y +=
|
|
||||||
this.props.velocity.y * this.props.dt * 10;
|
|
||||||
|
|
||||||
if (
|
|
||||||
this.props.position.x >= 100 ||
|
|
||||||
this.props.position.x <= 0
|
|
||||||
) {
|
|
||||||
this.props.velocity.x = -this.props.velocity.x;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
this.props.position.y >= 100 ||
|
|
||||||
this.props.position.y <= 0
|
|
||||||
) {
|
|
||||||
this.props.velocity.y = -this.props.velocity.y;
|
|
||||||
console.log(this.props.velocity, "setting!!!");
|
|
||||||
}
|
|
||||||
|
|
||||||
this.props.ot = Date.now();
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}, 1000 / 60);
|
}, 1000 / 60);
|
||||||
|
|
Loading…
Reference in New Issue