diff --git a/docs/404.html b/docs/404.html index 8b9c5dd..f653401 100644 --- a/docs/404.html +++ b/docs/404.html @@ -4,13 +4,13 @@ Page Not Found | MooMoo.js - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/docs/Events/Debug/index.html b/docs/Events/Debug/index.html index 345b713..ffbb2f1 100644 --- a/docs/Events/Debug/index.html +++ b/docs/Events/Debug/index.html @@ -4,13 +4,13 @@ Debug | MooMoo.js - +
Skip to main content

Debug

Debugging with MooMoo.js

The Debug event in MooMoo.js allows developers to easily debug their scripts by providing a way to log debug messages. When the client receives a debug message from the MooMoo.js API, the Debug event is triggered and the message is passed as an argument to the callback function.

To use the Debug event, simply define a callback function and pass it to the on method of the MooMoo object, like so:

MooMoo.on("debug", (message) => {
console.debug(message);
});

The message argument will contain the debug message, which you can then log to the console using the console.debug method. This is a useful tool for checking for errors or verifying that your script is functioning as intended.

- + \ No newline at end of file diff --git a/docs/Events/Packets/index.html b/docs/Events/Packets/index.html index 4ef7965..e8927ab 100644 --- a/docs/Events/Packets/index.html +++ b/docs/Events/Packets/index.html @@ -4,13 +4,13 @@ Packets | MooMoo.js - +
Skip to main content

Packets

Handling Packets with the "packet" event

The "packet" event in MooMoo.js allows you to easily handle packets sent from the server. Every time the client receives a packet, this event is triggered and the packet's data is passed to the callback function as an object with two properties: packet and data.

To use the "packet" event, define a callback function and pass it to the on method of the MooMoo object like this:

MooMoo.on("packet", (obj) => {
let packet = obj.packet;
let data = obj.data;

// do something with the packet and data
});

The packet property contains the name of the packet, and the data property contains the data associated with the packet, which will be an array. If there is no data, the data property will be an empty array. You can then use this information to perform actions based on the packet and its data.

- + \ No newline at end of file diff --git a/docs/Managers/ActivePlayers/index.html b/docs/Managers/ActivePlayers/index.html index 609e231..e3cf47d 100644 --- a/docs/Managers/ActivePlayers/index.html +++ b/docs/Managers/ActivePlayers/index.html @@ -4,13 +4,13 @@ ActivePlayers | MooMoo.js - +
Skip to main content

ActivePlayers

ActivePlayers Manager

The ActivePlayers Manager is a component of MooMoo.js that provides information about the players currently being rendered in the game. This includes details such as their session ID (sid), name, position, and other relevant information.

You can access the ActivePlayers Manager and retrieve information about the players like this:

let activePlayerManager = MooMoo.ActivePlayerManager;
let players = activePlayerManager.players;

The players property will contain an array of player objects with the following structure:

{
players: [
{
"sid": 4,
"name": "unknown",
"id": "5TapKvA56N",
"x": 5951,
"y": 8207,
"dir": -2.65
}
]
}

Note that the player objects contain much more information than what is shown here. To learn more about the available data and methods in the Player object, you can check out the Player page.

The Manager also provides you functions to search for certain players.

If you want to search for a player by SID, you can do that like this:

let player = MooMoo.ActivePlayerManager.getPlayerBySid(sid)

You can also get a player by its ID:

let player = MooMoo.ActivePlayerManager.getPlayerById(id)

You can also get a player / players by their name:

let player = MooMoo.ActivePlayerManager.getPlayerByName(name)

If there are more than one player with the same name, this method will return an array of players. Otherwise, it will return a single player object.

- + \ No newline at end of file diff --git a/docs/Managers/Commands/index.html b/docs/Managers/Commands/index.html index 8e5e9a5..8b0eebc 100644 --- a/docs/Managers/Commands/index.html +++ b/docs/Managers/Commands/index.html @@ -4,13 +4,13 @@ Commands | MooMoo.js - +
Skip to main content

Commands

Command Manager

The Command Manager is a tool, which provides help creating ingame commands, managing them and executing them.

To access the Command Manager, you can write the following code:

let CommandManager = MooMoo.CommandManager;

You can register a command like this:

CommandManager.registerCommand("test", (Command, args) => {
// reply to the Command with a chat message
Command.reply("Hello, world!");

// do stuff with the arguments
let firstArg = args[0];
console.log(firstArg);
})

By writing this code, the commandManager will register a new command called "test", and whenever the player types "{prefix}test" in chat, the command will be executed.

The Command object includes the function that executes it, and also the function that replies to the command.

The args object is an array of arguments that the player has passed to the command.

You can change the prefix for the commands by writing the following code:

CommandManager.setPrefix("!");

This will change the prefix to "!".

The commands will get executed whenever the player types in a chat message starting with the prefix.

- + \ No newline at end of file diff --git a/docs/Managers/GamePlayers/index.html b/docs/Managers/GamePlayers/index.html index cc7e5fa..3b314ef 100644 --- a/docs/Managers/GamePlayers/index.html +++ b/docs/Managers/GamePlayers/index.html @@ -4,13 +4,13 @@ GamePlayers | MooMoo.js - +
Skip to main content

GamePlayers

GamePlayer Manager

The GamePlayer Manager is a component of MooMoo.js that provides information about all players that are currently in the game.

Note, that this only includes players that either have been or are on the Leaderboard, players that have been rendered, or players that joined the game after you did.

The API tries as its best to keep track of all players that have been in the game, but it is not always possible to do so.

You can access the GamePlayer Manager and retrieve information about the players like this:

let gamePlayerManager = MooMoo.GamePlayerManager;

// Get all players
let players = gamePlayerManager.players;

// Get a player by their SID
let player = gamePlayerManager.getPlayerBySid(sid);

// Get a player by their ID
let player = gamePlayerManager.getPlayerById(id);

// Get a player by their name
let player = gamePlayerManager.getPlayerByName(name);

Same as for ActivePlayerManager, when using the getPlayerByName method, it will return an array of players if there are more than one player with the same name. Otherwise, it will return a single player object.

The players property will contain an array of player objects with the following structure:

{
players: [
{
"sid": 4,
"name": "unknown",
"id": "5TapKvA56N",
"x": 5951,
"y": 8207,
"dir": -2.65
}
]
}

Though, it may be possible that it looks like this:

{
players: [
{
"sid": 4,
"name": "unknown"
}
]
}

This is because the API could not view any other information that displayed on the leaderboard.

- + \ No newline at end of file diff --git a/docs/Managers/Introduction/index.html b/docs/Managers/Introduction/index.html index 1640536..3bcbedd 100644 --- a/docs/Managers/Introduction/index.html +++ b/docs/Managers/Introduction/index.html @@ -4,13 +4,13 @@ Introduction | MooMoo.js - +
Skip to main content

Introduction

Introduction to Managers

Welcome to the introduction of Managers in Moomoo.js. Managers play a crucial role in organizing and improving the structure and maintainability of code within the system.

As a developer, I have found Managers to be incredibly useful for managing various aspects of the system, such as player profiles, in-game objects, and other elements. They provide a clear and organized way to handle these complex pieces of data and functionality.

- + \ No newline at end of file diff --git a/docs/Managers/LeaderBoard/index.html b/docs/Managers/LeaderBoard/index.html index aa263c2..17095cb 100644 --- a/docs/Managers/LeaderBoard/index.html +++ b/docs/Managers/LeaderBoard/index.html @@ -4,13 +4,13 @@ LeaderBoard | MooMoo.js - +
Skip to main content

LeaderBoard

LeaderBoard Manager

The LeaderBoard Manager is a tool, which provides information about the players that are currently on the leaderboard. This includes details such as their session ID (sid), name, and position.

To access the Leaderboard, you can write the following code:

let LeaderboardManager = MooMoo.LeaderboardManager;

// get all players on the leaderboard
let leaderboard = LeaderboardManager.leaderboard;

Now, the leaderboard variable would be returning a map, where item 1 is the first place, 2 is the second place, and so on. Each item in the map is a Player object, which contains information about the player, such as name, sid, and position.

It is possible that the leaderboard returns information about a player (including position), but it is not guaranteed that the position is correct.

- + \ No newline at end of file diff --git a/docs/Managers/Objects/index.html b/docs/Managers/Objects/index.html index cdc406f..b92b4e5 100644 --- a/docs/Managers/Objects/index.html +++ b/docs/Managers/Objects/index.html @@ -4,13 +4,13 @@ Objects | MooMoo.js - +
Skip to main content

Objects

Object Manager

The Object Manager is a tool, which provides information about the objects that are currently on the map. This includes details such as their ID, position, and type.

The Object Manager may not be useful for most users, but it can be useful to gather information about items, since they include their owner's id, and other useful information.

To access the Object Manager, you can write the following code:

let ObjectManager = MooMoo.GameObjectManager;

// get a game object by its sid
let gameObject = ObjectManager.getObjectById(id);

// get all game objects placed by a player
let objects = ObjectManager.getObjectsByOwnerSid(ownerSid);

Now, the gameObject variable would be returning a GameObject object, which contains information about the object, such as its id, position, and type.

The objects variable would be returning an array of GameObject objects, which contain information about the objects, such as their id, position, and type.

- + \ No newline at end of file diff --git a/docs/Player/index.html b/docs/Player/index.html index 160fea8..e67f912 100644 --- a/docs/Player/index.html +++ b/docs/Player/index.html @@ -4,16 +4,16 @@ Player | MooMoo.js - +
-
Skip to main content

Player

Accessing Player Information with myPlayer

The MooMoo.js API provides a property called myPlayer, which represents the current player in the game. This property is only defined when the player is actually in a game, and is undefined if the player has not yet joined.

The myPlayer property contains various information about the player, such as their name, position, and more. To access the myPlayer property, simply assign it to a variable like this:

let player = MooMoo.myPlayer;

NOTE: The myPlayer property is only defined when the player is actually in a game, and is undefined if the player has not yet joined.

To check if the game has loaded or not, you can use the isLoaded property of the MooMoo API vars. For example:

function doSomething() {
let myPlayer = MooMoo.myPlayer;
// Do something with myPlayer
}

setInterval(() => {
if (MooMoo.vars.isLoaded) { // Check if the game has loaded
doSomething();
}
}, 1000);

or, you can use the onload event:

MooMoo.onload = () => {
let myPlayer = MooMoo.myPlayer;
// Do something with myPlayer
}

This is just an example to prevent errors.

Accessing Player Data and Information

Once you have access to the myPlayer property, you can access various data and information about the player, such as:

  • x: the player's x-coordinate on the map
  • y: the player's y-coordinate on the map
  • name: the player's name
  • dir: the direction the player is facing
  • health: the player's current health
  • buildIndex: the index of the player's current building
  • weaponIndex: the index of the player's current weapon
  • weaponVariant: the variant of the player's current weapon
  • team: the player's current team
  • isLeader: a boolean indicating whether the player is the leader of their team
  • skinIndex: the index of the player's current skin
  • tailIndex: the index of the player's current tail
  • iconIndex: the index of the player's current icon state
  • zIndex: the player's z-index
  • isVisible: a boolean indicating whether the player is currently visible

You can use this data and information to create scripts or perform other actions.

Player Inventory and Items

The myPlayer property also includes the player's inventory, which contains the player's items such as:

  • primary: the player's primary weapon
  • secondary: the player's secondary weapon +

    Player

    Accessing Player Information with myPlayer

    The MooMoo.js API provides a property called myPlayer, which represents the current player in the game. This property is only defined when the player is actually in a game, and is undefined if the player has not yet joined.

    The myPlayer property contains various information about the player, such as their name, position, and more. To access the myPlayer property, simply assign it to a variable like this:

    let player = MooMoo.myPlayer;

    NOTE: The myPlayer property is only defined when the player is actually in a game, and is undefined if the player has not yet joined.

    To check if the game has loaded or not, you can use the isLoaded property of the MooMoo API vars. For example:

    function doSomething() {
    let myPlayer = MooMoo.myPlayer;
    // Do something with myPlayer
    }

    setInterval(() => {
    if (MooMoo.vars.isLoaded) { // Check if the game has loaded
    doSomething();
    }
    }, 1000);

    or, you can use the onload event:

    MooMoo.onGameLoad = () => {
    let myPlayer = MooMoo.myPlayer;
    // Do something with myPlayer
    }

    This is just an example to prevent errors.

    Accessing Player Data and Information

    Once you have access to the myPlayer property, you can access various data and information about the player, such as:

    • x: the player's x-coordinate on the map
    • y: the player's y-coordinate on the map
    • name: the player's name
    • dir: the direction the player is facing
    • health: the player's current health
    • buildIndex: the index of the player's current building
    • weaponIndex: the index of the player's current weapon
    • weaponVariant: the variant of the player's current weapon
    • team: the player's current team
    • isLeader: a boolean indicating whether the player is the leader of their team
    • skinIndex: the index of the player's current skin
    • tailIndex: the index of the player's current tail
    • iconIndex: the index of the player's current icon state
    • zIndex: the player's z-index
    • isVisible: a boolean indicating whether the player is currently visible

    You can use this data and information to create scripts or perform other actions.

    Player Inventory and Items

    The myPlayer property also includes the player's inventory, which contains the player's items such as:

    • primary: the player's primary weapon
    • secondary: the player's secondary weapon food: the player's food
    • wall: the player's wall
    • spike: the player's spike
    • mill: the player's mill
    • mine: the player's mine
    • boostPad: the player's boost pad
    • trap: the player's trap -turret: the player's turret
    • spawnPad: the player's spawn pad You can use these items to create macros or place items on the map.

    Player Methods

    The myPlayer property also includes several methods that you can use to work with the player.

    Placing Items

    You can use the place method to place items on the map. For example:

    let spike = MooMoo.myPlayer.inventory.spike;
    let place = MooMoo.myPlayer.place;
    place(spike);

    The place method can take an optional second argument, which represents the angle in radians relative to the player at which the item will be placed.

    Resources

    You can get your current points(gold), wood, food, stone, and kills with the resources property. For example:

    let resources = MooMoo.myPlayer.resources;
    console.log(resources.points);
    console.log(resources.wood);

    Working with Hats and Accessories

    You can use the following methods to work with hats and accessories:

    • equipHat: equips a hat. This method can take either a number representing the hat ID or the name of the hat as an argument.
    • equipAccessory: equips an accessory. This method can take either a number representing the accessory ID or the name of the accessory as an argument.
    • unequipHat: removes a hat.
    • unequipAccessory: removes an accessory.
    • buyHat: buys a hat. This method can take either a number representing the hat ID or the name of the hat as an argument.
    • buyAccessory: buys an accessory. This method can take either a number representing the accessory ID or the name of the accessory as an argument.

    To buy a hat or accessory using the API, you can use the buyHat and buyAccessory methods. These methods work in the same way as the equipHat and equipAccessory methods, and can take either a number representing the item ID or the name of the item as an argument.

    Chatting

    You can use the chat method to send a message to the chat. For example:

    let chat = MooMoo.myPlayer.chat;
    chat("Hello world!");
- + \ No newline at end of file diff --git a/docs/Teams/index.html b/docs/Teams/index.html index 42a26cf..4c2b982 100644 --- a/docs/Teams/index.html +++ b/docs/Teams/index.html @@ -4,13 +4,13 @@ Teams | MooMoo.js - +

Teams

Accessing Team Information with the teams Property

The teams property of the MooMoo.js API provides an array of all the teams in the game. Each element of the array is an Alliance object, which includes the team leader and the team's name.

Unfortunately, the API does not provide any information about the team members or more detailed information about the team leader. The only information available about the leader is their sid (session ID).

To access the teams property, you can simply assign it to a variable like this:

let teams = MooMoo.teams;

Then, you can access the name and leader of a specific team using array notation, like so:

// Getting the name of the first team
let teamName = teams[0].name;
let teamLeader = teams[0].leader;

An example of an Alliance Object might look like this:

{
"Leader": Player {
"sid": 7
},
"Name": "Base"
}

Note that the information about the team may be updated, such as when you join a team or when the leader of a clan is rendered. When the leader is rendered, you will be able to access more information about them, such as their name, position, and other details.

- + \ No newline at end of file diff --git a/docs/WebSocket/index.html b/docs/WebSocket/index.html index 29a6524..2e213be 100644 --- a/docs/WebSocket/index.html +++ b/docs/WebSocket/index.html @@ -4,13 +4,13 @@ WebSocket | MooMoo.js - +

WebSocket

Accessing the WebSocket Object

The WebSocket object can be accessed through the MooMoo.ws property in your code. This property represents the WebSocket connection currently established with the server. You can use this property to perform various actions, such as sending raw packets, adding event listeners, and getting information.

Examples of the WebSocket Object

Here's an example of how you can access the WebSocket object:

let ws = MooMoo.ws

// Adding an event listener

ws.addEventListener("message", (e) => {
console.log(e.data);
})

// Sending a raw packet
ws.send(new Uint8Array([0, 0]));

// getting information

let socketurl = ws.url
let socketstate = ws.readyState

Sending Packets

To send packets which will be encoded automatically, you can use the sendPacket method to send raw packets, which will be automatically encoded by the API.

For example, if you want to send a chat message, you can use the sendPacket method like this:

MooMoo.sendPacket("ch", "Hello, world!");
- + \ No newline at end of file diff --git a/docs/assets/js/d1443f99.6a87dff0.js b/docs/assets/js/d1443f99.6a87dff0.js deleted file mode 100644 index faad23a..0000000 --- a/docs/assets/js/d1443f99.6a87dff0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunknotes=self.webpackChunknotes||[]).push([[316],{3905:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>y});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),p=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},h=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),m=p(a),h=r,y=m["".concat(s,".").concat(h)]||m[h]||u[h]||l;return a?n.createElement(y,o(o({ref:t},c),{},{components:a})):n.createElement(y,o({ref:t},c))}));function y(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,o=new Array(l);o[0]=h;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[m]="string"==typeof e?e:r,o[1]=i;for(var p=2;p{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>m,frontMatter:()=>l,metadata:()=>i,toc:()=>p});var n=a(7462),r=(a(7294),a(3905));const l={sidebar_position:3},o=void 0,i={unversionedId:"Player",id:"Player",title:"Player",description:"Accessing Player Information with myPlayer",source:"@site/docs/Player.md",sourceDirName:".",slug:"/Player",permalink:"/MooMoo.js/Player",draft:!1,tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"WebSocket",permalink:"/MooMoo.js/WebSocket"},next:{title:"Teams",permalink:"/MooMoo.js/Teams"}},s={},p=[{value:"Accessing Player Information with myPlayer",id:"accessing-player-information-with-myplayer",level:2},{value:"Accessing Player Data and Information",id:"accessing-player-data-and-information",level:3},{value:"Player Inventory and Items",id:"player-inventory-and-items",level:3},{value:"Player Methods",id:"player-methods",level:2},{value:"Placing Items",id:"placing-items",level:3},{value:"Resources",id:"resources",level:3},{value:"Working with Hats and Accessories",id:"working-with-hats-and-accessories",level:3},{value:"Chatting",id:"chatting",level:3}],c={toc:p};function m(e){let{components:t,...a}=e;return(0,r.kt)("wrapper",(0,n.Z)({},c,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"accessing-player-information-with-myplayer"},"Accessing Player Information with myPlayer"),(0,r.kt)("p",null,"The MooMoo.js API provides a property called ",(0,r.kt)("inlineCode",{parentName:"p"},"myPlayer"),", which represents the current player in the game. This property is only defined when the player is actually in a game, and is undefined if the player has not yet joined."),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"myPlayer")," property contains various information about the player, such as their name, position, and more. To access the myPlayer property, simply assign it to a variable like this:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"},"let player = MooMoo.myPlayer;\n")),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"NOTE"),": The myPlayer property is only defined when the player is actually in a game, and is undefined if the player has not yet joined."),(0,r.kt)("p",null,"To check if the game has loaded or not, you can use the ",(0,r.kt)("inlineCode",{parentName:"p"},"isLoaded")," property of the MooMoo API vars. For example:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"},"function doSomething() {\n let myPlayer = MooMoo.myPlayer;\n // Do something with myPlayer\n}\n\nsetInterval(() => {\n if (MooMoo.vars.isLoaded) { // Check if the game has loaded\n doSomething();\n }\n}, 1000);\n")),(0,r.kt)("p",null,"or, you can use the ",(0,r.kt)("inlineCode",{parentName:"p"},"onload")," event:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"},"MooMoo.onload = () => {\n let myPlayer = MooMoo.myPlayer;\n // Do something with myPlayer\n}\n")),(0,r.kt)("p",null,"This is just an example to prevent errors."),(0,r.kt)("h3",{id:"accessing-player-data-and-information"},"Accessing Player Data and Information"),(0,r.kt)("p",null,"Once you have access to the myPlayer property, you can access various data and information about the player, such as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"x"),": the player's x-coordinate on the map"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"y"),": the player's y-coordinate on the map"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"name"),": the player's name"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"dir"),": the direction the player is facing"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"health"),": the player's current health"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"buildIndex"),": the index of the player's current building"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"weaponIndex"),": the index of the player's current weapon"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"weaponVariant"),": the variant of the player's current weapon"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"team"),": the player's current team"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"isLeader"),": a boolean indicating whether the player is the leader of their team"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"skinIndex"),": the index of the player's current skin"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"tailIndex"),": the index of the player's current tail"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"iconIndex"),": the index of the player's current icon state"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"zIndex"),": the player's z-index"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"isVisible"),": a boolean indicating whether the player is currently visible")),(0,r.kt)("p",null,"You can use this data and information to create scripts or perform other actions."),(0,r.kt)("h3",{id:"player-inventory-and-items"},"Player Inventory and Items"),(0,r.kt)("p",null,"The myPlayer property also includes the player's inventory, which contains the player's items such as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"primary"),": the player's primary weapon"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"secondary"),": the player's secondary weapon\n",(0,r.kt)("inlineCode",{parentName:"li"}," food"),": the player's food "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"wall"),": the player's wall "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"spike"),": the player's spike "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"mill"),": the player's mill "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"mine"),": the player's mine "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"boostPad"),": the player's boost pad "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"trap"),": the player's trap\n-",(0,r.kt)("inlineCode",{parentName:"li"},"turret"),": the player's turret "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"spawnPad"),": the player's spawn pad\nYou can use these items to create macros or place items on the map.")),(0,r.kt)("h2",{id:"player-methods"},"Player Methods"),(0,r.kt)("p",null,"The myPlayer property also includes several methods that you can use to work with the player."),(0,r.kt)("h3",{id:"placing-items"},"Placing Items"),(0,r.kt)("p",null,"You can use the place method to place items on the map. For example:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"},"let spike = MooMoo.myPlayer.inventory.spike;\nlet place = MooMoo.myPlayer.place;\nplace(spike);\n")),(0,r.kt)("p",null,"The place method can take an optional second argument, which represents the angle in radians relative to the player at which the item will be placed."),(0,r.kt)("h3",{id:"resources"},"Resources"),(0,r.kt)("p",null,"You can get your current points(gold), wood, food, stone, and kills with the ",(0,r.kt)("inlineCode",{parentName:"p"},"resources")," property. For example:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"},"let resources = MooMoo.myPlayer.resources;\nconsole.log(resources.points);\nconsole.log(resources.wood);\n")),(0,r.kt)("h3",{id:"working-with-hats-and-accessories"},"Working with Hats and Accessories"),(0,r.kt)("p",null,"You can use the following methods to work with hats and accessories:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"equipHat"),": equips a hat. This method can take either a number representing the hat ID or the name of the hat as an argument."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"equipAccessory"),": equips an accessory. This method can take either a number representing the accessory ID or the name of the accessory as an argument."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"unequipHat"),": removes a hat."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"unequipAccessory"),": removes an accessory."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"buyHat"),": buys a hat. This method can take either a number representing the hat ID or the name of the hat as an argument."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"buyAccessory"),": buys an accessory. This method can take either a number representing the accessory ID or the name of the accessory as an argument.")),(0,r.kt)("p",null,"To buy a hat or accessory using the API, you can use the buyHat and buyAccessory methods. These methods work in the same way as the equipHat and equipAccessory methods, and can take either a number representing the item ID or the name of the item as an argument."),(0,r.kt)("h3",{id:"chatting"},"Chatting"),(0,r.kt)("p",null,"You can use the chat method to send a message to the chat. For example:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"},'let chat = MooMoo.myPlayer.chat;\nchat("Hello world!");\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/assets/js/d1443f99.f17bb087.js b/docs/assets/js/d1443f99.f17bb087.js new file mode 100644 index 0000000..0c0c7f3 --- /dev/null +++ b/docs/assets/js/d1443f99.f17bb087.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunknotes=self.webpackChunknotes||[]).push([[316],{3905:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>y});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),p=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},h=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),m=p(a),h=r,y=m["".concat(s,".").concat(h)]||m[h]||u[h]||l;return a?n.createElement(y,o(o({ref:t},c),{},{components:a})):n.createElement(y,o({ref:t},c))}));function y(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,o=new Array(l);o[0]=h;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[m]="string"==typeof e?e:r,o[1]=i;for(var p=2;p{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>m,frontMatter:()=>l,metadata:()=>i,toc:()=>p});var n=a(7462),r=(a(7294),a(3905));const l={sidebar_position:3},o=void 0,i={unversionedId:"Player",id:"Player",title:"Player",description:"Accessing Player Information with myPlayer",source:"@site/docs/Player.md",sourceDirName:".",slug:"/Player",permalink:"/MooMoo.js/Player",draft:!1,tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"WebSocket",permalink:"/MooMoo.js/WebSocket"},next:{title:"Teams",permalink:"/MooMoo.js/Teams"}},s={},p=[{value:"Accessing Player Information with myPlayer",id:"accessing-player-information-with-myplayer",level:2},{value:"Accessing Player Data and Information",id:"accessing-player-data-and-information",level:3},{value:"Player Inventory and Items",id:"player-inventory-and-items",level:3},{value:"Player Methods",id:"player-methods",level:2},{value:"Placing Items",id:"placing-items",level:3},{value:"Resources",id:"resources",level:3},{value:"Working with Hats and Accessories",id:"working-with-hats-and-accessories",level:3},{value:"Chatting",id:"chatting",level:3}],c={toc:p};function m(e){let{components:t,...a}=e;return(0,r.kt)("wrapper",(0,n.Z)({},c,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"accessing-player-information-with-myplayer"},"Accessing Player Information with myPlayer"),(0,r.kt)("p",null,"The MooMoo.js API provides a property called ",(0,r.kt)("inlineCode",{parentName:"p"},"myPlayer"),", which represents the current player in the game. This property is only defined when the player is actually in a game, and is undefined if the player has not yet joined."),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"myPlayer")," property contains various information about the player, such as their name, position, and more. To access the myPlayer property, simply assign it to a variable like this:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"},"let player = MooMoo.myPlayer;\n")),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"NOTE"),": The myPlayer property is only defined when the player is actually in a game, and is undefined if the player has not yet joined."),(0,r.kt)("p",null,"To check if the game has loaded or not, you can use the ",(0,r.kt)("inlineCode",{parentName:"p"},"isLoaded")," property of the MooMoo API vars. For example:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"},"function doSomething() {\n let myPlayer = MooMoo.myPlayer;\n // Do something with myPlayer\n}\n\nsetInterval(() => {\n if (MooMoo.vars.isLoaded) { // Check if the game has loaded\n doSomething();\n }\n}, 1000);\n")),(0,r.kt)("p",null,"or, you can use the ",(0,r.kt)("inlineCode",{parentName:"p"},"onload")," event:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"},"MooMoo.onGameLoad = () => {\n let myPlayer = MooMoo.myPlayer;\n // Do something with myPlayer\n}\n")),(0,r.kt)("p",null,"This is just an example to prevent errors."),(0,r.kt)("h3",{id:"accessing-player-data-and-information"},"Accessing Player Data and Information"),(0,r.kt)("p",null,"Once you have access to the myPlayer property, you can access various data and information about the player, such as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"x"),": the player's x-coordinate on the map"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"y"),": the player's y-coordinate on the map"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"name"),": the player's name"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"dir"),": the direction the player is facing"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"health"),": the player's current health"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"buildIndex"),": the index of the player's current building"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"weaponIndex"),": the index of the player's current weapon"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"weaponVariant"),": the variant of the player's current weapon"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"team"),": the player's current team"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"isLeader"),": a boolean indicating whether the player is the leader of their team"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"skinIndex"),": the index of the player's current skin"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"tailIndex"),": the index of the player's current tail"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"iconIndex"),": the index of the player's current icon state"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"zIndex"),": the player's z-index"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"isVisible"),": a boolean indicating whether the player is currently visible")),(0,r.kt)("p",null,"You can use this data and information to create scripts or perform other actions."),(0,r.kt)("h3",{id:"player-inventory-and-items"},"Player Inventory and Items"),(0,r.kt)("p",null,"The myPlayer property also includes the player's inventory, which contains the player's items such as:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"primary"),": the player's primary weapon"),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"secondary"),": the player's secondary weapon\n",(0,r.kt)("inlineCode",{parentName:"li"}," food"),": the player's food "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"wall"),": the player's wall "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"spike"),": the player's spike "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"mill"),": the player's mill "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"mine"),": the player's mine "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"boostPad"),": the player's boost pad "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"trap"),": the player's trap\n-",(0,r.kt)("inlineCode",{parentName:"li"},"turret"),": the player's turret "),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"spawnPad"),": the player's spawn pad\nYou can use these items to create macros or place items on the map.")),(0,r.kt)("h2",{id:"player-methods"},"Player Methods"),(0,r.kt)("p",null,"The myPlayer property also includes several methods that you can use to work with the player."),(0,r.kt)("h3",{id:"placing-items"},"Placing Items"),(0,r.kt)("p",null,"You can use the place method to place items on the map. For example:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"},"let spike = MooMoo.myPlayer.inventory.spike;\nlet place = MooMoo.myPlayer.place;\nplace(spike);\n")),(0,r.kt)("p",null,"The place method can take an optional second argument, which represents the angle in radians relative to the player at which the item will be placed."),(0,r.kt)("h3",{id:"resources"},"Resources"),(0,r.kt)("p",null,"You can get your current points(gold), wood, food, stone, and kills with the ",(0,r.kt)("inlineCode",{parentName:"p"},"resources")," property. For example:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"},"let resources = MooMoo.myPlayer.resources;\nconsole.log(resources.points);\nconsole.log(resources.wood);\n")),(0,r.kt)("h3",{id:"working-with-hats-and-accessories"},"Working with Hats and Accessories"),(0,r.kt)("p",null,"You can use the following methods to work with hats and accessories:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"equipHat"),": equips a hat. This method can take either a number representing the hat ID or the name of the hat as an argument."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"equipAccessory"),": equips an accessory. This method can take either a number representing the accessory ID or the name of the accessory as an argument."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"unequipHat"),": removes a hat."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"unequipAccessory"),": removes an accessory."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"buyHat"),": buys a hat. This method can take either a number representing the hat ID or the name of the hat as an argument."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"buyAccessory"),": buys an accessory. This method can take either a number representing the accessory ID or the name of the accessory as an argument.")),(0,r.kt)("p",null,"To buy a hat or accessory using the API, you can use the buyHat and buyAccessory methods. These methods work in the same way as the equipHat and equipAccessory methods, and can take either a number representing the item ID or the name of the item as an argument."),(0,r.kt)("h3",{id:"chatting"},"Chatting"),(0,r.kt)("p",null,"You can use the chat method to send a message to the chat. For example:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-js"},'let chat = MooMoo.myPlayer.chat;\nchat("Hello world!");\n')))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/assets/js/runtime~main.3b4df72d.js b/docs/assets/js/runtime~main.2c0bebdc.js similarity index 98% rename from docs/assets/js/runtime~main.3b4df72d.js rename to docs/assets/js/runtime~main.2c0bebdc.js index 61ddea2..aa12c61 100644 --- a/docs/assets/js/runtime~main.3b4df72d.js +++ b/docs/assets/js/runtime~main.2c0bebdc.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r,o,a,n={},f={};function i(e){var t=f[e];if(void 0!==t)return t.exports;var r=f[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,i),r.loaded=!0,r.exports}i.m=n,i.c=f,e=[],i.O=(t,r,o,a)=>{if(!r){var n=1/0;for(u=0;u=a)&&Object.keys(i.O).every((e=>i.O[e](r[c])))?r.splice(c--,1):(f=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[r,o,a]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var a=Object.create(null);i.r(a);var n={};t=t||[null,r({}),r([]),r(r)];for(var f=2&o&&e;"object"==typeof f&&!~t.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,i.d(a,n),a},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>"assets/js/"+({53:"935f2afb",85:"1f391b9e",226:"33b79d8e",229:"bea35a28",242:"4f4497bf",274:"0c9f3499",316:"d1443f99",330:"8914568a",398:"697e267b",414:"393be207",480:"f1add1e2",481:"5d892720",514:"1be78505",576:"aa0f21ac",587:"95756ce9",671:"0e384e19",858:"334b7089",918:"17896441",942:"990a4b7c"}[e]||e)+"."+{53:"83317e03",85:"3d212cd8",210:"8d9348b1",226:"797684dc",229:"94274917",242:"67a49411",274:"653546eb",316:"6a87dff0",330:"e35e05cd",398:"581b695c",414:"f8be0ca3",480:"b4b2c4d4",481:"134282b6",514:"a118b43d",576:"b950636a",587:"35823e55",671:"bd0cb3e1",858:"a63882c0",918:"27dd8d0a",942:"b6542ccd",972:"c537b33b"}[e]+".js",i.miniCssF=e=>{},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},a="notes:",i.l=(e,t,r,n)=>{if(o[e])o[e].push(t);else{var f,c;if(void 0!==r)for(var d=document.getElementsByTagName("script"),u=0;u{f.onerror=f.onload=null,clearTimeout(s);var a=o[e];if(delete o[e],f.parentNode&&f.parentNode.removeChild(f),a&&a.forEach((e=>e(r))),t)return t(r)},s=setTimeout(b.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=b.bind(null,f.onerror),f.onload=b.bind(null,f.onload),c&&document.head.appendChild(f)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="/MooMoo.js/",i.gca=function(e){return e={17896441:"918","935f2afb":"53","1f391b9e":"85","33b79d8e":"226",bea35a28:"229","4f4497bf":"242","0c9f3499":"274",d1443f99:"316","8914568a":"330","697e267b":"398","393be207":"414",f1add1e2:"480","5d892720":"481","1be78505":"514",aa0f21ac:"576","95756ce9":"587","0e384e19":"671","334b7089":"858","990a4b7c":"942"}[e]||e,i.p+i.u(e)},(()=>{var e={303:0,532:0};i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var a=new Promise(((r,a)=>o=e[t]=[r,a]));r.push(o[2]=a);var n=i.p+i.u(t),f=new Error;i.l(n,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;f.message="Loading chunk "+t+" failed.\n("+a+": "+n+")",f.name="ChunkLoadError",f.type=a,f.request=n,o[1](f)}}),"chunk-"+t,t)}},i.O.j=t=>0===e[t];var t=(t,r)=>{var o,a,n=r[0],f=r[1],c=r[2],d=0;if(n.some((t=>0!==e[t]))){for(o in f)i.o(f,o)&&(i.m[o]=f[o]);if(c)var u=c(i)}for(t&&t(r);d{"use strict";var e,t,r,o,a,n={},f={};function i(e){var t=f[e];if(void 0!==t)return t.exports;var r=f[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,i),r.loaded=!0,r.exports}i.m=n,i.c=f,e=[],i.O=(t,r,o,a)=>{if(!r){var n=1/0;for(u=0;u=a)&&Object.keys(i.O).every((e=>i.O[e](r[c])))?r.splice(c--,1):(f=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[r,o,a]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var a=Object.create(null);i.r(a);var n={};t=t||[null,r({}),r([]),r(r)];for(var f=2&o&&e;"object"==typeof f&&!~t.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,i.d(a,n),a},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>"assets/js/"+({53:"935f2afb",85:"1f391b9e",226:"33b79d8e",229:"bea35a28",242:"4f4497bf",274:"0c9f3499",316:"d1443f99",330:"8914568a",398:"697e267b",414:"393be207",480:"f1add1e2",481:"5d892720",514:"1be78505",576:"aa0f21ac",587:"95756ce9",671:"0e384e19",858:"334b7089",918:"17896441",942:"990a4b7c"}[e]||e)+"."+{53:"83317e03",85:"3d212cd8",210:"8d9348b1",226:"797684dc",229:"94274917",242:"67a49411",274:"653546eb",316:"f17bb087",330:"e35e05cd",398:"581b695c",414:"f8be0ca3",480:"b4b2c4d4",481:"134282b6",514:"a118b43d",576:"b950636a",587:"35823e55",671:"bd0cb3e1",858:"a63882c0",918:"27dd8d0a",942:"b6542ccd",972:"c537b33b"}[e]+".js",i.miniCssF=e=>{},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},a="notes:",i.l=(e,t,r,n)=>{if(o[e])o[e].push(t);else{var f,c;if(void 0!==r)for(var d=document.getElementsByTagName("script"),u=0;u{f.onerror=f.onload=null,clearTimeout(s);var a=o[e];if(delete o[e],f.parentNode&&f.parentNode.removeChild(f),a&&a.forEach((e=>e(r))),t)return t(r)},s=setTimeout(b.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=b.bind(null,f.onerror),f.onload=b.bind(null,f.onload),c&&document.head.appendChild(f)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="/MooMoo.js/",i.gca=function(e){return e={17896441:"918","935f2afb":"53","1f391b9e":"85","33b79d8e":"226",bea35a28:"229","4f4497bf":"242","0c9f3499":"274",d1443f99:"316","8914568a":"330","697e267b":"398","393be207":"414",f1add1e2:"480","5d892720":"481","1be78505":"514",aa0f21ac:"576","95756ce9":"587","0e384e19":"671","334b7089":"858","990a4b7c":"942"}[e]||e,i.p+i.u(e)},(()=>{var e={303:0,532:0};i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var a=new Promise(((r,a)=>o=e[t]=[r,a]));r.push(o[2]=a);var n=i.p+i.u(t),f=new Error;i.l(n,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;f.message="Loading chunk "+t+" failed.\n("+a+": "+n+")",f.name="ChunkLoadError",f.type=a,f.request=n,o[1](f)}}),"chunk-"+t,t)}},i.O.j=t=>0===e[t];var t=(t,r)=>{var o,a,n=r[0],f=r[1],c=r[2],d=0;if(n.some((t=>0!==e[t]))){for(o in f)i.o(f,o)&&(i.m[o]=f[o]);if(c)var u=c(i)}for(t&&t(r);d Introduction | MooMoo.js - +

Introduction

Introduction to MooMoo.js

MooMoo.js is a powerful and easy-to-use API for the popular game, MooMoo.io. It provides a wide range of tools and features that can be used to enhance your gameplay experience and create custom scripts.

There are two ways to use MooMoo.js: as a userscript on Greasyfork or as an external userscript downloaded from the official GitHub repository.

Installing and Getting Started

To install and get started with MooMoo.js, you can simply add the following code snippet to your script:

const MooMoo = (function MooMooJS_beta() {})[69]

This will set the MooMoo variable to the MooMoo API, which you can then use to access all of the tools and features provided by the API.

IMPORTANT: Make sure to run this code before your script is loaded, as it will not work if run after the script has already been loaded.

Once you have the MooMoo API set up, you can start exploring all of the possibilities it offers and have fun creating custom scripts for MooMoo.io!

That's all for now. If you feel like there's something missing, please let me know in the Discord server.

- + \ No newline at end of file diff --git a/docs/markdown-page/index.html b/docs/markdown-page/index.html index 9564845..66bce31 100644 --- a/docs/markdown-page/index.html +++ b/docs/markdown-page/index.html @@ -4,13 +4,13 @@ Markdown page example | MooMoo.js - +

Markdown page example

You don't need React to write simple standalone pages.

- + \ No newline at end of file