Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Loader = {
- scriptList: [],
- init : function () {
- this.getScripts();
- this.loadScripts();
- },
- getScripts: function () {
- var i,
- fileList = dopen("libs/bots/").getFiles();
- for (i = 0; i < fileList.length; i += 1) {
- if (fileList[i].indexOf(".js") > -1) {
- this.scriptList.push(fileList[i].substring(0, fileList[i].indexOf(".js")));
- }
- }
- },
- loadScripts: function () {
- if (!this.scriptList.length) {
- print("ΓΏc1You don't have any scripts in bots folder.");
- return false;
- }
- for (var i in Scripts) {
- if (this.scriptList.indexOf(i) > -1) {
- if (!eval("Scripts." + i)) {
- continue;
- }
- include("bots/" + i + ".js");
- try {
- eval(i + "()");
- } catch (e) {
- print("ΓΏc1Script " + i + " " + e);
- }
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement