|
@@ -1,3 +1,20 @@
|
|
|
+error_counter = 0;
|
|
|
+@on_error
|
|
|
+error_counter++;
|
|
|
+if(error_counter > 1) {
|
|
|
+ snuvi.debug("Error Handler activated");
|
|
|
+ if(event == "custom_command") {
|
|
|
+ set.add(failed_cmds, command);
|
|
|
+ goto("wait");
|
|
|
+ }
|
|
|
+ snuvi.debug("Restarting script...");
|
|
|
+ error_counter++;
|
|
|
+ if(error_counter >= 100) {
|
|
|
+ snuvi.debug("Script terminated. Endless loop.");
|
|
|
+ term();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
waitfor(5); //Verhindert Endlos-Schleife durch "/start commands"
|
|
|
|
|
|
setCommandHelps();
|
|
@@ -282,6 +299,7 @@ invseeids = set.new();
|
|
|
ride_set = set.new();
|
|
|
fields = set.new();
|
|
|
vanish_set = set.new();
|
|
|
+failed_cmds = set.new();
|
|
|
skip_night_set = set.new();
|
|
|
afk_checker_map = map.new();
|
|
|
|
|
@@ -438,6 +456,10 @@ if(event == "custom_command") {
|
|
|
perm.no(player, command);
|
|
|
goto("wait");
|
|
|
}
|
|
|
+ if(set.contains(failed_cmds, command)) {
|
|
|
+ msg.prefix(player, prefix_commands, "§cCommand temporarly deactivated due to failure.");
|
|
|
+ goto("wait");
|
|
|
+ }
|
|
|
sender = player;
|
|
|
sender_name = player.getName(player);
|
|
|
affectedname = player.getName(player);
|
|
@@ -3017,63 +3039,63 @@ elseif(arg0 == "chat") {
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Chat", "system/chat", "utils/u_general");
|
|
|
+ script.startNamed("Chat", "utils/u_error", "system/chat", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "creative") {
|
|
|
script = script.get("Creative");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Creative", "system/creative", "utils/u_general");
|
|
|
+ script.startNamed("Creative", "utils/u_error", "system/creative", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "damage") {
|
|
|
script = script.get("Damage");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Damage", "system/damage");
|
|
|
+ script.startNamed("Damage", "utils/u_error", "system/damage", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "doors") {
|
|
|
script = script.get("Doors");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Doors", "system/doors", "utils/u_general");
|
|
|
+ script.startNamed("Doors", "utils/u_error", "system/doors", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "games") {
|
|
|
script = script.get("Gamecenter");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Gamecenter", "system/gamecenter", "utils/u_general", "utils/u_games");
|
|
|
+ script.startNamed("Gamecenter", "utils/u_error", "system/gamecenter", "utils/u_general", "utils/u_games");
|
|
|
}
|
|
|
elseif(arg0 == "harvest") {
|
|
|
script = script.get("Harvest");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Harvest", "system/harvest", "utils/u_general");
|
|
|
+ script.startNamed("Harvest", "utils/u_error", "system/harvest", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "hawkeye") {
|
|
|
script = script.get("Hawkeye");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Hawkeye", "system/hawkeye", "utils/u_general");
|
|
|
+ script.startNamed("Hawkeye", "utils/u_error", "system/hawkeye", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "herobrine") {
|
|
|
script = script.get("Herobrine");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Herobrine", "system/herobrine", "utils/u_general");
|
|
|
+ script.startNamed("Herobrine", "utils/u_error", "system/herobrine", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "loom") {
|
|
|
script = script.get("Loom");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Loom", "system/loom");
|
|
|
+ script.startNamed("Loom", "utils/u_error", "system/loom", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "perms") {
|
|
|
script.start("system/perms", "utils/u_general");
|
|
@@ -3083,80 +3105,80 @@ elseif(arg0 == "pumpkin") {
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Pumpkin", "system/pumpkin", "utils/u_general");
|
|
|
+ script.startNamed("Pumpkin", "utils/u_error", "system/pumpkin", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "stats") {
|
|
|
script = script.get("Ranklist");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Ranklist", "system/ranklist", "utils/u_general", "utils/u_games");
|
|
|
+ script.startNamed("Ranklist", "utils/u_error", "system/ranklist", "utils/u_general", "utils/u_games");
|
|
|
}
|
|
|
elseif(arg0 == "scheduler") {
|
|
|
script = script.get("Scheduler");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Scheduler", "system/scheduler", "utils/u_general");
|
|
|
+ script.startNamed("Scheduler", "utils/u_error", "system/scheduler", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "shop") {
|
|
|
script = script.get("Shops");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Shops", "system/chestshops", "utils/u_general");
|
|
|
+ script.startNamed("Shops", "utils/u_error", "system/chestshops", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "mails") {
|
|
|
script = script.get("Mails");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Mails", "system/mailsystem", "utils/u_general");
|
|
|
+ script.startNamed("Mails", "utils/u_error", "system/mailsystem", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "ticket") {
|
|
|
script = script.get("Ticket");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Ticket", "system/tickets", "utils/u_general");
|
|
|
+ script.startNamed("Ticket", "utils/u_error", "system/tickets", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "timber") {
|
|
|
script = script.get("Timber");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Timber", "system/timber", "utils/u_general");
|
|
|
+ script.startNamed("Timber", "utils/u_error", "system/timber", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "story") {
|
|
|
script = script.get("Story");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Story", "system/story", "utils/u_general");
|
|
|
+ script.startNamed("Story", "utils/u_error", "system/story", "utils/u_general");
|
|
|
script = script.get("QuestsAdmont");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("QuestsAdmont", "story/admont/core", "utils/u_general", "utils/u_quest");
|
|
|
+ script.startNamed("QuestsAdmont", "utils/u_error", "story/admont/core", "utils/u_general", "utils/u_quest");
|
|
|
script = script.get("QuestsSchiffbruch");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("QuestsSchiffbruch", "story/schiffbruch/core", "utils/u_general", "utils/u_quest");
|
|
|
+ script.startNamed("QuestsSchiffbruch", "utils/u_error", "story/schiffbruch/core", "utils/u_general", "utils/u_quest");
|
|
|
}
|
|
|
elseif(arg0 == "sitting") {
|
|
|
script = script.get("Sitting");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Sitting", "system/sitting", "utils/u_general");
|
|
|
+ script.startNamed("Sitting", "utils/u_error", "system/sitting", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "survival") {
|
|
|
script = script.get("Survival");
|
|
|
if(script != null) {
|
|
|
script.term(script);
|
|
|
}
|
|
|
- script.startNamed("Survival", "system/survival", "utils/u_general");
|
|
|
+ script.startNamed("Survival", "utils/u_error", "system/survival", "utils/u_general");
|
|
|
}
|
|
|
elseif(arg0 == "voxel") {
|
|
|
script = script.get("Voxel");
|