This repository has been archived by the owner on Jan 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aed5d07
Showing
4 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Hive Auto Queue for Latite Client | ||
|
||
## Description | ||
This project is a simple plugin that allows the user to automatically queue up for games in the Hive Minecraft server. It is designed to be used only with Latite Client. | ||
|
||
--- | ||
|
||
## How to Install | ||
|
||
1. **Download the zip from releases** | ||
2. **Extract the zip file** | ||
3. **Move the extracted folder to ```%localappdata%\Packages\Microsoft.MinecraftUWP_8wekyb3d8bbwe\RoamingState\LatiteRecode\Plugins```** | ||
4. **Launch Latite Client and enable the plugin in the mods menu** | ||
|
||
--- | ||
|
||
## How It Works | ||
The plugin works by running the /connection command on every dimension load. It then takes the game name by the "SERVER-NAME" text in the chat and then filters out the numbers in the text. | ||
It then stores the game name as the current game. It then detects for "Game" or "Victory" text in the title event, and if its shown it will then queue to the next game. | ||
|
||
Currently, the plugin only works for Victory screen and will not work for auto queue on death. This is done in favor of the upcoming party system to the plugin. | ||
|
||
--- | ||
|
||
> "The only way to do great work is to love what you do." — Steve Jobs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
//@ts-check | ||
"use strict"; | ||
|
||
// Setup | ||
let hiveAutoQueue = new Module("HiveAutoQueue", | ||
"Hive Auto Queue", "A plugin to automatically queue into the next game in Hive"); | ||
|
||
// This adds the input box for which maps to dodge | ||
let mapDodger = new hiveAutoQueue.addTextSetting("mapDodger", | ||
"Map Dodge List", "The map to dodge", ""); | ||
|
||
// Current game mode | ||
let gameMode = null; | ||
|
||
let partyMembers = new hiveAutoQueue.addTextSetting("partyMembers", | ||
"Party Members", "The members of the party, this is automatically managed", ""); | ||
|
||
let deadMembers = []; | ||
let aliveMembers = []; | ||
|
||
client.getModuleManager().registerModule(hiveAutoQueue); | ||
|
||
/** | ||
* Function to find the current game mode by using connection command | ||
* and listening to the chat message provided by the command to get the game | ||
*/ | ||
function findGamemode() { | ||
game.executeCommand("/connection"); | ||
|
||
client.on("receive-chat", chat => { | ||
let message = chat.message; | ||
if(chat.sender === "") { | ||
chat.cancel = message.includes("You are connected to public IP") || | ||
message.includes("You are connected to internal IP"); | ||
|
||
if(message.includes("You are connected to server name")) { | ||
chat.cancel = true; | ||
gameMode = message.split("You are connected to server name")[1]; | ||
gameMode = gameMode.replace(/\d+/g,"").trim(); | ||
} else { | ||
chat.cancel = false; | ||
} | ||
|
||
chat.cancel = message.includes("You are connected to server"); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Function to queue into the next game | ||
*/ | ||
function queueNextGame() { | ||
if(!gameMode) { | ||
game.executeCommand("/q " + gameMode); | ||
} | ||
} | ||
|
||
/** | ||
* Function to find the party members | ||
*/ | ||
function findPartyMembers() { | ||
game.executeCommand("/party list"); | ||
|
||
/** | ||
* TODO: Detection of party members | ||
*/ | ||
|
||
client.on("receive-chat", chat => { | ||
let message = chat.message; | ||
if(chat.sender === "") { | ||
chat.cancel = message.includes("You're issuing commands too quickly, try again later.") || | ||
message.includes("Unknown command. Sorry!"); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Listen for title content to detect if the game is over | ||
*/ | ||
client.on("title", title => { | ||
let titleText = title.text; | ||
let server = game.getFeaturedServer(); | ||
if(hiveAutoQueue.isEnabled()) { | ||
if(server.includes("hive")) { | ||
/** | ||
* TODO: Check if the player is solo and queue if the player is dead | ||
*/ | ||
if (titleText.includes("Over") || titleText.includes("Victory")) { | ||
queueNextGame(); | ||
} | ||
} | ||
} | ||
}); | ||
|
||
client.on("receive-chat", chat => { | ||
let message = chat.message; | ||
let mapDodgerArray = mapDodger.getValue().split(","); | ||
if(hiveAutoQueue.isEnabled()) { | ||
if (chat.sender === "") { | ||
|
||
/** | ||
* TODO: Do party death detection | ||
*/ | ||
if (message.includes("won with") && message.includes("votes!")) { | ||
let mapName = message.split(" ")[1]; | ||
for (let i = 0; i < mapDodgerArray.length; i++) { | ||
if (mapName === mapDodgerArray[i]) { | ||
queueNextGame(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
|
||
client.on("change-dimension", chat => { | ||
if(hiveAutoQueue.isEnabled()) { | ||
findGamemode(); | ||
client.on("receive-chat", chat => { | ||
let message = chat.message; | ||
if (chat.sender === "") { | ||
chat.cancel = message.includes("You're issuing commands too quickly, try again later.") || | ||
message.includes("Unknown command. Sorry!"); | ||
} | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "LatiteHiveAutoQueue", | ||
"version": "1.0.0", | ||
"devDependencies": { | ||
"@latitescripting/latiteapi": "^2.1.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "Hive Auto Queue", | ||
"author": "Leqends", | ||
"version": "1.0.0", | ||
"description": "Automatically queues up for games on the Hive" | ||
} |