EvalScript Plugin

monyarm

Warper
Member
Joined
Dec 26, 2015
Messages
1
Reaction score
2
First Language
Bulgarian
EvalScript 1.0
Monyarm


Introduction
This is a plugin that lets you run .js files through the Script Call Event. It also supports GZipped .js files.

Features
Exactly what it says on the tin (and in the previous segment)

How to Use
Extract and place MONY_EvalScript.js in js/plugins. Use evalScript(url), where url is the path/url to the .js file you want to run.

Script
Make sure that you place your script using the code feature, do not use quotes. Again, if spoiler tag is available in the future then use the spoiler tag together with the code tag.

Code:
// Script
function endsWith(suffix) {
    return this.indexOf(suffix, this.length - suffix.length) !== -1;
}

function evalScript(url) {
    var xhr = new XMLHttpRequest();
    if (url.endsWith(".gz")) {
        xhr.setRequestHeader("Content-Encoding", "deflate");
        //console.log(url);
    } else {
        //console.log(url);
    }
    xhr.open('GET', url);
    xhr.onload = function() {
        if (xhr.status < 400) {
            console.log(xhr.responseText);
            eval(xhr.responseText);
        }
    };
    xhr.send();
}

If you wish to support me, use the following download link:
https://userscloud.com/ntrww2ilhels (Also includes MONY_Merchant script which was used for a scrapped personal project)

FAQ
Post question and answers to common question here in the following format:

Q: The game crashes/gives an error.
A: That would be cause of the code in your .js file, my script runs the code the same way the game runs script calls.
Q: GZipped files don't work.
A: Ya, that part is a bit finnicy, it works when it wants to, sometimes it works, sometimes it doesn't.

Credit and Thanks
- Me
- Myself
- I

Author's Notes
If you want to use the script for a commercial project, go right ahead, just remember to credit me, also contact me beforehand.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,033
Messages
1,018,441
Members
137,820
Latest member
georg09byron
Top