Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Scripted by iMagic
- /*
- ==============================================================================
- This is the Gani Staff Companion Tool V.3 Meant to make the job of the gani
- team a little bit easier.
- In this version you can:
- - Replace your Idle and Walk animations.
- - Play sound files as well as search for soundfiles stored on the server.
- - Store notes.
- - Find .png, .mng and .gif images on the server with or without the file's folder path.
- - Spawn temp.npcs that mimic a speficic image.
- ==============================================================================
- */
- function onCreated() {
- // Folder in which you want the note files to be stored (they are .txt files).
- this.notes_path = "levels/users/Graal2007722/logs/";
- setShape(1, 32, 32);
- }
- // Send the respective note file to the respective client on request.
- function onActionLoadNote(owner) {
- temp.lines = {};
- temp.notepath = getNotePath(temp.owner);
- // Check if they had a note file. If not. create one.
- if (!(fileExists(temp.notepath))) {
- temp.newfile = {
- "I noticed you didnt have a note file",
- "So I created one for you :D",
- "Welcome to your notes!",
- "",
- "Dont forget to save your notes before",
- "closing the Tool!",
- };
- temp.newfile.savelines(temp.notepath, 0);
- }
- temp.lines.loadlines(temp.notepath);
- // Send them the note file.
- triggerAction(this.x, this.y, "RecieveNote", temp.owner, {temp.lines});
- }
- // Save the note server-side to the proper owner's txt file.
- function onActionSaveNote(owner, note) {
- temp.notepath = getNotePath(temp.owner);
- temp.lines = temp.note;
- temp.newlines = {};
- for (temp.i = 0; temp.i < temp.lines.size(); temp.i++) {
- temp.newlines.add(temp.lines[temp.i]);
- }
- // Doesnt overwrite the previus note. Deletes whatever there was before and add what's currently on the note.
- temp.newlines.savelines(temp.notepath, 0);
- }
- // Send an array of found files.
- function onActionGetFiles(query, format, playerID, filepath) {
- switch (temp.format) {
- case "*.wav":
- temp.files = findfiles("*" @ temp.query @ temp.format, 1);
- break;
- case "images":
- temp.files = {};
- temp.files_to_find = {"*.mng", "*.gif", "*.png"};
- // Create a new array for each file extension and add it to the main array.
- for (temp.i = 0; temp.i < temp.files_to_find.size(); temp.i++) {
- temp.array_holder = findfiles("*" @ temp.query @ temp.files_to_find[temp.i], 1);
- // Only add arrays that contain items.
- if (temp.array_holder.size() >= 1) {
- temp.files.addarray(temp.array_holder);
- }
- }
- break;
- }
- triggerAction(this.x, this.y, "RecieveFiles", temp.format, {temp.files}, temp.playerID, temp.filepath);
- }
- // Generates a notepath given the user. Each user has their own note .txt file.
- function getNotePath(playerID) {
- temp.suffix = format("%s_companionnote.txt", temp.playerID);
- // Appends the custom filename to the custom folder in which to store the note.
- temp.path = this.notes_path @ temp.suffix;
- return temp.path;
- }
- // Place the NPC server-side for other staff to see.
- function onActionPlaceNPC(image, x, y) {
- if (fileExists(temp.image)) {
- temp.obj = putnpc2(temp.x, temp.y, NULL);
- temp.obj.image = temp.obj.chat = temp.image;
- temp.obj.drawunderplayer();
- temp.obj.dontblock();
- }
- }
- // Destroys the NPCs on the level which arent hooked up to a class.
- function onActionDestroyNPCS() {
- for (temp.npc : this.level.npcs) {
- if (temp.npc.joinedclasses == NULL) {
- temp.npc.destroy();
- }
- }
- }
- //#CLIENTSIDE
- function onCreated() {
- setShape(1, 32, 32);
- this.chat = "Gani Staff Companion";
- this.image = "block.png";
- // Commands with which you can launch the tool.
- this.aliases = {
- ":companion", ":GSC"
- };
- // The server's default walk and idle.
- // This is what the reset button sets the walk and idle back to.
- this.default_walk = "ol_walk";
- this.default_idle = "ol_idle";
- this.allowed_image_extensions = {".png", ".gif", ".mng"};
- }
- /*
- Using onMouseDown("left") here instead of onActionLeftMouse() because Carlito said
- that for the latter, the NPC has to actually be clicked, so if anything else is on top
- of the NPC it wont trigger it.
- */
- function onMouseDown(mouse) {
- switch (temp.mouse) {
- case "left":
- if (mousex in |this.x, this.x + 2| && mousey in |this.y, this.y + 2|) {
- if (player.chat in this.aliases) {
- if (isObject("Win1_Companion")) {
- onDestroyGui();
- }
- onDrawGui();
- }
- }
- break;
- }
- }
- function onDrawGui() {
- new GuiWindowCtrl("Win1_Companion") {
- profile = GuiBlueWindowProfile;
- width = 230;
- height = 170;
- useownprofile = true;
- x = (screenwidth / 2) * 0.8;
- y = ((screenheight / 2) - height) * 0.37;
- canminimize = canmaximize = canresize = false;
- canclose = canmove = closequery = true;
- text = "Gani Staff Companion V.3";
- new GuiMLTextCtrl("Text_ReplaceAni") {
- x = 10;
- y = 27;
- height = 135;
- width = 150;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiMLTextCtrl("Text_Walk") {
- x = Text_ReplaceAni.x;
- y = Text_ReplaceAni.y + 20;
- height = 135;
- width = 380;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiMLTextCtrl("Text_Idle") {
- x = Text_ReplaceAni.x;
- y = Text_ReplaceAni.y + 65;
- height = 135;
- width = 380;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiTextEditCtrl("Input_Walk") {
- profile = GuiBlueTextEditProfile;
- x = Text_Walk.x;
- y = Text_Walk.y + 20;
- width = 180;
- height = 20;
- text = "";
- hint = "Replaces your walk animation with another gani.";
- }
- new GuiTextEditCtrl("Input_Idle") {
- profile = GuiBlueTextEditProfile;
- x = Text_Idle.x;
- y = Text_Idle.y + 20;
- width = Input_Walk.width;
- height = Input_Walk.height;
- text = "";
- hint = "Replaces your idle animation with another gani.";
- }
- new GuiButtonCtrl("Button_ReplaceAniApply") {
- profile = GuiBlueButtonProfile;
- width = 60;
- height = 20;
- x = 10;
- y = Win1_Companion.height - height - 10;
- text = "Apply";
- }
- new GuiButtonCtrl("Button_ReplaceAniReset") {
- profile = GuiBlueButtonProfile;
- width = 60;
- height = 20;
- x = Button_ReplaceAniApply.x + Button_ReplaceAniApply.width + 5;
- y = Win1_Companion.height - height - 10;
- text = "Reset";
- hint = "Set your animations back to the server's default walk and idle";
- }
- }
- // Sounds Window.
- new GuiWindowCtrl("Win2_Companion") {
- profile = GuiBlueWindowProfile;
- x = Win1_Companion.x + Win1_Companion.width;
- y = Win1_Companion.y;
- width = 300;
- height = 250;
- useownprofile = true;
- canminimize = canmaximize = canresize = canmove = canclose = false;
- new GuiMLTextCtrl("Text_Sounds") {
- x = 10;
- y = 27;
- height = 135;
- width = 380;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiMLTextCtrl("Text_PlaySound") {
- x = Text_Sounds.x;
- y = Text_Sounds.y + 20;
- height = 135;
- width = 380;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiTextEditCtrl("Input_PlaySound") {
- profile = GuiBlueTextEditProfile;
- x = Text_PlaySound.x;
- y = Text_PlaySound.y + 20;
- width = 175;
- height = 20;
- text = "";
- hint = "Plays a sound file.";
- }
- new GuiButtonCtrl("Button_PlaySound") {
- profile = GuiBlueButtonProfile;
- width = 40;
- height = 20;
- x = Input_PlaySound.x + Input_PlaySound.width + 5;
- y = Input_PlaySound.y;
- text = "Play";
- }
- new GuiButtonCtrl("Button_ClearSound") {
- profile = GuiBlueButtonProfile;
- width = 40;
- height = 20;
- x = Button_PlaySound.x + Button_PlaySound.width + 5;
- y = Button_PlaySound.y;
- text = "Clear";
- }
- new GuiMLTextCtrl("Text_FindSound") {
- x = Input_PlaySound.x;
- y = Input_PlaySound.y + 25;
- height = 135;
- width = 380;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiTextEditCtrl("Input_FindSound") {
- profile = GuiBlueTextEditProfile;
- x = Text_FindSound.x;
- y = Text_FindSound.y + 20;
- width = Input_PlaySound.width;
- height = 20;
- text = "";
- hint = "Finds .wav files on the server";
- }
- new GuiButtonCtrl("Button_FindSound") {
- profile = GuiBlueButtonProfile;
- width = 40;
- height = 20;
- x = Input_FindSound.x + Input_FindSound.width + 5;
- y = Input_FindSound.y;
- text = "Find";
- }
- new GuiScrollCtrl("Scroll_FoundSounds") {
- profile = GuiBlueScrollProfile;
- x = Input_FindSound.x;
- y = Input_FindSound.y + Input_FindSound.height + 10;
- width = Win2_Companion.width - 30;
- height = 100;
- hScrollBar = "dynamic";
- vScrollBar = "dynamic";
- new GuiTextListCtrl("List_FoundSounds") {
- profile = GuiBlueTextListProfile;
- x = y = 0;
- width = Scroll_FoundSounds.width;
- fitparentwidth = false;
- }
- }
- }
- // Notes window.
- new GuiWindowCtrl("Win3_Companion") {
- profile = GuiBlueWindowProfile;
- x = Win2_Companion.x + Win2_Companion.width;
- y = Win2_Companion.y;
- width = 280;
- height = 525;
- useownprofile = true;
- canminimize = canmaximize = canresize = canmove = canclose = false;
- new GuiMLTextCtrl("Text_Notes") {
- x = 10;
- y = 27;
- height = 135;
- width = 380;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiScrollCtrl("Scroll_NotesWindow") {
- profile = GuiBlueScrollProfile;
- scrollprofile = GuiBlueScrollProfile;
- x = Text_Notes.x;
- y = Text_Notes.y + 20;
- width = Win3_Companion.width - 20;
- height = Win3_Companion.height - 80;
- useownprofile = true;
- profile.fillColor = "51 93 176";
- profile.opaque = true;
- profile.border = 1;
- profile.bitmap = "guiblue_scroll_noback.png";
- horizsizing = "width";
- vertsizing = "height";
- new GuiMLTextEditCtrl("Text_NotesWindow") {
- profile = SyntaxHighlightProfile;
- x = 0;
- y = 0;
- width = Scroll_NotesWindow.width;
- height = Scroll_Notes.height;
- useownprofile = true;
- profile.fillcolorhl = "51 107 176"; // Background color
- profile.fontcolor = "255 255 255";
- profile.fontsize = 13.5;
- horizsizing = "width";
- wordwrap = false;
- }
- }
- new GuiButtonCtrl("Button_SaveNote") {
- profile = GuiBlueButtonProfile;
- width = 80;
- height = 20;
- x = Scroll_NotesWindow.x + Scroll_NotesWindow.width - width;
- y = Scroll_NotesWindow.y + Scroll_NotesWindow.height + 5;
- text = "Save Note";
- }
- }
- // Img NPC spawner Window
- new GuiWindowCtrl("Win4_Companion") {
- profile = GuiBlueWindowProfile;
- x = Win2_Companion.x;
- y = Win2_Companion.y + Win2_Companion.height;
- width = Win2_Companion.width;
- height = 275;
- useownprofile = true;
- canminimize = canmaximize = canresize = canmove = canclose = false;
- new GuiMLTextCtrl("Text_Images") {
- x = 10;
- y = 27;
- height = 135;
- width = 380;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiMLTextCtrl("Text_ImageFile") {
- x = Text_Sounds.x;
- y = Text_Sounds.y + 20;
- height = 135;
- width = 380;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiTextEditCtrl("Input_ImageFile") {
- profile = GuiBlueTextEditProfile;
- x = Text_ImageFile.x;
- y = Text_ImageFile.y + 20;
- width = 210;
- height = 20;
- text = "";
- hint = "Places an image file on the level at the given coordinates.";
- }
- new GuiMLTextCtrl("Text_ImageFileX") {
- x = Input_ImageFile.x;
- y = Input_ImageFile.y + 25;
- height = 135;
- width = 380;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiTextEditCtrl("Input_ImageFileX") {
- profile = GuiBlueTextEditProfile;
- x = Text_ImageFileX.x + 15;
- y = Text_ImageFileX.y - 3;
- width = 45;
- height = 20;
- text = "";
- hint = "X coordinate to spawn the image file at.";
- }
- new GuiMLTextCtrl("Text_ImageFileY") {
- x = Input_ImageFileX.x + Input_ImageFileX.width + 5;
- y = Input_ImageFile.y + 25;
- height = 135;
- width = 380;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiTextEditCtrl("Input_ImageFileY") {
- profile = GuiBlueTextEditProfile;
- x = Text_ImageFileY.x + 15;
- y = Text_ImageFileY.y - 3;
- width = 45;
- height = 20;
- text = "";
- hint = "Y coordinate to spawn the image file at.";
- }
- new GuiCheckBoxCtrl("Check_AutoCoord") {
- profile = GuiBlueCheckBoxProfile;
- x = Input_ImageFileY.x + Input_ImageFileY.width + 10;
- y = Input_ImageFileY.y + 3;
- width = height = 15;
- hint = "Autogenerate coordinates depending on your coordinates.";
- }
- new GuiMLTextCtrl("Text_AutoCoord") {
- x = Check_AutoCoord.x + Check_AutoCoord.width + 5;
- y = Check_AutoCoord.y;
- height = 135;
- width = 380;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiButtonCtrl("Button_Place") {
- profile = GuiBlueButtonProfile;
- width = 50;
- height = 20;
- x = Input_ImageFile.x + Input_ImageFile.width + 15;
- y = Input_ImageFile.y;
- text = "Place";
- }
- new GuiButtonCtrl("Button_Destroy") {
- profile = GuiBlueButtonProfile;
- width = 50;
- height = 40;
- x = Button_Place.x;
- y = Button_Place.y + Button_Place.height + 5;
- text = "Destroy";
- hint = "Destroy all image files in this level that were placed with this tool.";
- }
- new GuiMLTextCtrl("Text_FindImage") {
- x = Input_ImageFile.x;
- y = Input_ImageFile.y + 50;
- width = 120;
- height = 135;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiTextEditCtrl("Input_FindImage") {
- profile = GuiBlueTextEditProfile;
- x = Text_FindImage.x;
- y = Text_FindImage.y + 20;
- width = Input_ImageFile.width;
- height = 20;
- text = "";
- hint = "Type a keyword (e.g. 'west'). Get a list of image files that contain that keyword.";
- }
- new GuiButtonCtrl("Button_FindImage") {
- profile = GuiBlueButtonProfile;
- width = 40;
- height = 20;
- x = Button_Place.x;
- y = Input_FindImage.y;
- text = "Find";
- }
- new GuiCheckBoxCtrl("Check_Filepath") {
- profile = GuiBlueCheckBoxProfile;
- x = Check_AutoCoord.x;
- y = Text_FindImage.y + 3;
- width = height = 15;
- hint = "Whether or not to show the filepath of each file";
- }
- new GuiMLTextCtrl("Text_Filepath") {
- x = Check_Filepath.x + Check_Filepath.width + 5;
- y = Check_Filepath.y;
- height = 135;
- width = 380;
- useownprofile = true;
- profile.modal = false;
- }
- new GuiScrollCtrl("Scroll_FoundImages") {
- profile = GuiBlueScrollProfile;
- x = Input_FindImage.x;
- y = Input_FindImage.y + Input_FindImage.height + 10;
- width = Win4_Companion.width - 30;
- height = 100;
- hScrollBar = "dynamic";
- vScrollBar = "dynamic";
- new GuiTextListCtrl("List_FoundImages") {
- profile = GuiBlueTextListProfile;
- x = y = 0;
- width = 140;
- fitparentwidth = true;
- }
- }
- }
- onRequestNote();
- onUpdateText();
- }
- // Request to get the user's notes as soon as the Gui is launched.
- function onRequestNote() {
- triggerAction(this.x, this.y, "LoadNote", player.account);
- }
- // Load the user's notes.
- function onActionRecieveNote(player, note) {
- if (temp.player == player.account) {
- Text_NotesWindow.setlines(temp.note[0]);
- }
- }
- function Button_SaveNote.onAction() {
- triggerAction(this.x, this.y, "SaveNote", player.account, Text_NotesWindow.getlines());
- shared.adminmessage("Note saved!");
- }
- function onUpdateText() {
- // Some prefixes for the text.
- temp.prefix_big = "<font color=white size=16 face=arial>";
- temp.prefix_small = "<font color=white size=15 face=arial>";
- Text_ReplaceAni.text = temp.prefix_big @ "<b>Replace Animations";
- Text_Sounds.text = temp.prefix_big @ "<b>Sounds";
- Text_Images.text = temp.prefix_big @ "<b>Images";
- Text_Notes.text = temp.prefix_big @ "<b>Notepad";
- Text_Walk.text = temp.prefix_small @ "Walk:";
- Text_Idle.text = temp.prefix_small @ "Idle:";
- Text_ImageFile.text = temp.prefix_small @ "Spawn an image file:";
- Text_FindImage.text = temp.prefix_small @ "Find an image file:";
- Text_Filepath.text = temp.prefix_small @ "Filepath";
- Text_ImageFileX.text = temp.prefix_small @ "X:";
- Text_ImageFileY.text = temp.prefix_small @ "Y:";
- Text_AutoCoord.text = temp.prefix_small @ "Auto";
- Text_PlaySound.text = temp.prefix_small @ "Play a sound file:";
- Text_FindSound.text = temp.prefix_small @ "Find a sound file:";
- onTimeout();
- }
- // The main window has been closed, close the others as well.
- function Win1_Companion.onCloseQuery() {
- onDestroyGui();
- }
- // Replace the walk and idle animations.
- function Button_ReplaceAniApply.onAction() {
- if (Input_Walk.text == NULL && Input_Idle.text == NULL) {
- shared.adminmessage("Both fields are empty!");
- return;
- }
- // This is made in such a way so that you can either just replace the walk or just replace the idle.
- if (Input_Idle.text != NULL) {
- // Ignore the '.gani' if there is any.
- temp.input_idle = extractFileBase(Input_Idle.text);
- player.ani = temp.input_idle;
- replaceani("idle", temp.input_idle);
- }
- if (Input_Walk.text != NULL) {
- temp.input_walk = extractFileBase(Input_Walk.text);
- replaceani("walk", temp.input_walk);
- }
- player.chat = "Ganis replaced!";
- }
- // Reset the walk and idle back to the server's default.
- function Button_ReplaceAniReset.onAction() {
- player.ani = this.default_idle;
- replaceani("walk", this.default_walk);
- replaceani("idle", this.default_idle);
- player.chat = "Walk and Idle have been reset!";
- }
- // Play a sound file if one isnt playing already.
- function Button_PlaySound.onAction() {
- if (!(isSoundPlaying(this.previous_file))) {
- // Check for empty input.
- if (Input_PlaySound.text == NULL) {
- shared.adminmessage("You must put in a filename!");
- return;
- }
- // Check if their volume is too low. If so, increase it and let them know it's been increased.
- if ($pref::audio::sfxvolume <= 15) {
- $pref::audio::sfxvolume = 40;
- shared.adminmessage("Your game volume was too low. I've set it to 40. Press play again");
- return;
- }
- // Ensure the file always ends with .wav
- temp.sound_file = (extractFileExt(Input_PlaySound.text) == ".wav" ? Input_PlaySound.text : Input_PlaySound.text @ ".wav");
- // If the soundfile exists, play it. If not, let them know it doesnt exist.
- if (fileExists(temp.sound_file)) {
- play(temp.sound_file);
- this.previous_file = temp.sound_file;
- } else {
- shared.adminmessage("That file doesnt exist!");
- }
- } else {
- shared.adminmessage("The previous file is still playing!");
- }
- }
- // Clear the sound input.
- function Button_ClearSound.onAction() {
- if (Input_PlaySound.text == NULL) {
- shared.adminmessage("Nothing to clear.");
- return;
- }
- Input_PlaySound.text = "";
- }
- // Search for sound files on the server
- function Button_FindSound.onAction() {
- // Check for NULL input.
- if (Input_FindSound.text == NULL) {
- shared.adminmessage("Search field is empty!");
- return;
- }
- // Request a list of all the sound files with the matching query.
- triggerAction(this.x, this.y, "GetFiles", Input_FindSound.text, "*.wav", player.account, this.show_path);
- }
- // Gets the array of found files and turns it into a list..
- function onActionRecieveFiles(format, fileArray, player, filepath) {
- // Avoid the client of the wrong player being updated.
- if (temp.player != player.account) { return; }
- // Catch the list for sounds.
- temp.list = temp.fileArray;
- switch (temp.format) {
- case "*.wav":
- with (List_FoundSounds) {
- clearrows();
- for (temp.i = 0; temp.i < temp.fileArray[0].size(); i++) {
- temp.file = extractFileName(temp.fileArray[0][temp.i]);
- addrow(temp.i, temp.file);
- }
- }
- break;
- case "images":
- with (List_FoundImages) {
- clearrows();
- for (temp.i = 0; temp.i < temp.fileArray[0].size(); i++) {
- if (temp.filepath) {
- addrow(temp.i, temp.fileArray[0][temp.i]);
- } else {
- temp.file = extractFileName(temp.fileArray[0][temp.i]);
- addrow(temp.i, temp.file);
- }
- }
- }
- break;
- }
- }
- // Replaces the text of the input when you click on one of the found files.
- function List_FoundSounds.onSelect() {
- Input_FindSound.text = params[1];
- }
- function List_FoundImages.onSelect() {
- Input_FindImage.text = params[1];
- }
- // Search for image files on the server
- function Button_FindImage.onAction() {
- // Check for NULL input.
- if (Input_FindImage.text == NULL) {
- shared.adminmessage("Search field is empty!");
- return;
- }
- // Remove the extension off of the input if there is any.
- temp.input = (extractFileExt(Input_FindImage.text) == NULL ? Input_FindImage.text : extractFileBase(Input_FindImage.text));
- // Request a list of all the sound files with the matching query.
- triggerAction(this.x, this.y, "GetFiles", temp.input, "images", player.account, this.show_path);
- }
- function Button_Place.onAction() {
- if (Input_ImageFile.text == NULL) {
- shared.adminmessage("You must type in a filename!");
- return;
- }
- if (Input_ImageFileX.text == NULL || Input_ImageFileY.text == NULL) {
- shared.adminmessage("Erroneous coordinates. Please check the given X and Y positions");
- return;
- }
- temp.image = scanImageForErrors(Input_ImageFile.text);
- if (temp.image != NULL) {
- // Place an NPC on the given coordinates.
- triggerAction(this.x, this.y, "PlaceNPC", temp.image[0] @ temp.image[1], Input_ImageFileX.text, Input_ImageFileY.text);
- }
- }
- function scanImageForErrors(image) {
- // Split the image into the base and the extension.
- temp.file_extension = extractFileExt(temp.image);
- temp.file_base = extractFileBase(temp.image);
- // Confirm there is a valid extension.
- if (temp.file_extension != NULL) {
- // Ensure the extension is one of the allowed ones.
- if (temp.file_extension in this.allowed_image_extensions) {
- // If there was no issues, send back the file.
- return {temp.file_base, temp.file_extension};
- } else {
- sendError();
- }
- } else {
- sendError();
- return NULL;
- }
- }
- function sendError() {
- // Send an error saying what went wrong.
- temp.error = format("That doesnt seem like a valid file extension. Currently allowed formats: %s", this.allowed_image_extensions);
- shared.adminmessage(temp.error);
- }
- // Destroy all of the NPCs created by the tool.
- function Button_Destroy.onAction() {
- triggerAction(this.x, this.y, "DestroyNPCS", "");
- }
- // Toggle generating coordinates based on the player's x and y.
- function Check_AutoCoord.onAction() {
- this.auto_coord = ! this.auto_coord;
- }
- // Toggle between showing the filepath on file searches.
- function Check_Filepath.onAction() {
- this.show_path = ! this.show_path;
- }
- // Destroys all the windows
- function onDestroyGui() {
- setTimer(0);
- Win1_Companion.destroy();
- Win2_Companion.destroy();
- Win3_Companion.destroy();
- Win4_Companion.destroy();
- }
- // Keep the windows next to each other.
- function onTimeout() {
- if (this.auto_coord) {
- Input_ImageFileX.text = player.x;
- Input_ImageFileY.text = player.y;
- }
- Win2_Companion.x = Win1_Companion.x + Win1_Companion.width;
- Win2_Companion.y = Win1_Companion.y;
- Win3_Companion.x = Win2_Companion.x + Win2_Companion.width;
- Win3_Companion.y = Win2_Companion.y;
- Win4_Companion.x = Win2_Companion.x;
- Win4_Companion.y = Win2_Companion.y + Win2_Companion.height;
- setTimer(.05);
- }
Add Comment
Please, Sign In to add comment