- 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.
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.
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.
