Skip to content

Commit

Permalink
Fixed the reggae... I hate how fast @Ecu got it....
Browse files Browse the repository at this point in the history
  • Loading branch information
winsock committed Feb 10, 2015
1 parent c647662 commit 5ee2850
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -298,18 +298,18 @@ public void receiveEvent(Event event) {
int skipCount = 0;
for (String s : triggerScript.getCommands()) {
//noinspection StatementWithEmptyBody
for (;skipCount > 0; skipCount--);
for (;skipCount > 0; skipCount--) { continue; }

String parsedCommand = s;
Pattern reduxPattern = Pattern.compile("\\$redux\\[[a-zA-Z]+\\]", Pattern.CASE_INSENSITIVE);
Pattern reduxPattern = Pattern.compile("\\$redux\\[\\w{1,}\\]");
Matcher reduxMatcher = reduxPattern.matcher(parsedCommand);
Pattern commandPattern = Pattern.compile("\\[[a-zA-Z]+\\]", Pattern.CASE_INSENSITIVE);
while (reduxMatcher.find() && !reduxMatcher.hitEnd()) {
Pattern commandPattern = Pattern.compile("\\[\\w{1,}\\]");
while (reduxMatcher.find()) {
MatchResult result = reduxMatcher.toMatchResult();
Matcher commandMatcher = commandPattern.matcher(result.group());
if (!commandMatcher.find())
continue;
String command = commandMatcher.toMatchResult().group().replaceAll("\\[", "").replaceAll("\\]", "");
String command = commandMatcher.toMatchResult().group().replaceFirst("\\[", "").replaceFirst("\\]", "");

if (command.equalsIgnoreCase("PEEK") || command.equalsIgnoreCase("POP")) {
if (command.equalsIgnoreCase("PEEK")) {
Expand Down

0 comments on commit 5ee2850

Please sign in to comment.