3 Commits

Author SHA1 Message Date
TheTrouper
9ddf4e5478 Gonna make a test at some point 2024-04-16 19:58:44 -05:00
obvWolf
89276b1f8c Did some optimizations 2024-04-15 13:41:55 -05:00
TheTrouper
e6cae61b7d Floor and cieling have been added to all 3 of the major bots, so division is now possible 2024-04-12 18:36:39 -05:00
8 changed files with 66 additions and 142 deletions

View File

@@ -3,7 +3,7 @@ plugins {
} }
group 'me.trouper' group 'me.trouper'
version '0.0.5' version '0.0.6'
repositories { repositories {
mavenCentral() mavenCentral()

BIN
libs/gson-2.10.1.jar Normal file

Binary file not shown.

View File

@@ -6,6 +6,7 @@ import com.google.gson.JsonIOException;
import com.google.gson.JsonSyntaxException; import com.google.gson.JsonSyntaxException;
import me.trouper.Countroll; import me.trouper.Countroll;
import me.trouper.Functions.Complexers; import me.trouper.Functions.Complexers;
import me.trouper.Functions.Obf;
import me.trouper.Utils.Verbose; import me.trouper.Utils.Verbose;
import java.io.*; import java.io.*;
@@ -38,7 +39,9 @@ public class ConfigManager {
defaultConfig.put("usePower", true); defaultConfig.put("usePower", true);
defaultConfig.put("useRoot", true); defaultConfig.put("useRoot", true);
defaultConfig.put("useModDividend", true); defaultConfig.put("useModDividend", true);
defaultConfig.put("useSquareFinder", true);
defaultConfig.put("doCopy", false); defaultConfig.put("doCopy", false);
defaultConfig.put("doSafeSubtract", true);
defaultConfig.put("deep", false); defaultConfig.put("deep", false);
defaultConfig.put("color", true); defaultConfig.put("color", true);
defaultConfig.put("printHelp", false); defaultConfig.put("printHelp", false);

View File

@@ -0,0 +1,7 @@
package me.trouper.Functions;
public class Decreasers {
public static String divide() {
return null;
}
}

View File

@@ -13,7 +13,7 @@ public class Eval {
return exp.evaluate(); return exp.evaluate();
} }
public static boolean isPerfectSquare(int num) { public static boolean isPerfectSquare(int num) {
if (num == 0) return false; if (num == 0 || num == 1) return false;
final double sq = Math.sqrt(num); final double sq = Math.sqrt(num);
return sq == Math.floor(sq); return sq == Math.floor(sq);
} }

View File

@@ -38,158 +38,65 @@ public class Obf {
} }
String comp = Complexers.complex(ri,Countroll.deep); String comp = Complexers.complex(ri,Countroll.deep);
String incr = Increasers.increase(current,target,ri,Countroll.deep);
String rounder = rand.nextBoolean() ? "floor(" : "ceil(";
boolean front = rand.nextBoolean();
// Case for if its below // Case for if its below
if (isPerfectSquare(current)) {
expression.insert(0,"<&eh><&b>sqrt(<&r>");
expression.append("<&eh><&b>)<&r>");
continue;
}
if (current < target) { if (current < target) {
Countroll.addCount++; Countroll.addCount++;
expression.append("<&b>+<&r><&e>").append(comp).append("<&r>"); //expression.insert(0,"<&b>+<&r><&e>").insert(0,comp);
String toAdd = comp;
if (target - current > 128) { if (target - current > 128) {
expression.append("<&b>*<&r><&e>").append(Increasers.increase(current,target,ri,Countroll.deep)).append("<&r>"); toAdd = incr;
} }
if (front) {
if (toAdd.equals(comp)) {
toAdd = toAdd + "<&b>+<&r><&e>";
expression.insert(0,toAdd);
continue;
}
toAdd = toAdd + "<&b>*<&r><&e>";
expression.insert(0,toAdd);
continue;
}
if (toAdd.equals(comp)) {
toAdd = "<&b>+<&r><&e>" + toAdd;
expression.append(toAdd);
continue;
}
toAdd = "<&b>*<&r><&e>" + toAdd;
expression.append(toAdd);
continue;
} }
// Case for if its above // Case for if its above
if (current > target) { if (current > target) {
Countroll.subCount++; Countroll.subCount++;
expression.append("<&b>-<&r><&e>").append(comp).append("<&r>"); String toAdd = comp;
if (current - target > 128) { if (current - target > 128) {
expression.append("<&b>-<&r><&e>").append(Increasers.increase(target,current,ri,Countroll.deep)).append("<&r>"); toAdd = incr;
} }
if (toAdd.equals(comp)) {
toAdd = "<&b>-<&r><&e>" + toAdd;
expression.append(toAdd);
continue;
}
toAdd = "<&b>/<&r><&e>" + toAdd;
expression.insert(0,rounder);
expression.append(toAdd).append(")");
continue;
} }
} }
Verbose.send("PROC", "Broke out of loop."); Verbose.send("PROC", "Broke out of loop.");
return expression.toString(); return expression.toString();
} }
/**
* ObfIntN will work for Numselli's counting bot
* @param target Integer to reach
* @param deep When True, doubles the use of Complexers and Increasers
* @return A colored string
*/
public static String obfIntN(int target, boolean deep) {
if (deep) System.out.println("Deep Obfuscation is coming soon!");
StringBuilder expression = new StringBuilder();
Random random = new Random();
int initializer = random.nextInt(9)+1;
Verbose.send("PROC","Initializing Expression: " + initializer);
expression.append("<&dh><&f>").append(initializer).append("<&r>");
while (eval(expression.toString()) != target) {
Countroll.total++;
int eval = (int) eval(expression.toString());
int ri = random.nextInt(9)+1;
int op = random.nextInt(2);
boolean mult = false;
if (!isInt(eval(expression.toString()))) {
System.out.println("Something went horribly wrong, Here is the relevant info." +
"\nEvaluation: " + eval(expression.toString()) +
"\nRandom Pick: " + ri +
"\nOperation: " + op +
"\nCaught at: \n" + removeColors(expression.toString()));
break;
}
Verbose.send("LOOP","Random: " + ri);
Verbose.send("LOOP","Current: " + eval(expression.toString()));
if (isPerfectSquare(eval) && eval != 1) {
Countroll.perfectCount++;
Verbose.send("LOOP","PERFECT SQUARE TIME! (" + Countroll.perfectCount+ ")");
expression.insert(0,"<&eh><&b>sqrt(<&r>").append("<&eh><&b>)<&r>");
eval = (int) eval(expression.toString());
}
final String toAdd = Complexers.complex(ri,deep);
if (eval < target) {
if (target - eval > 4069) {
Countroll.expCount++;
Verbose.send("LOOP","Large than (" + Countroll.expCount + ")");
expression.append("<&b>*<&r><&a>").append(Increasers.power(ri,3,deep)).append("<&r>");
} else if (target - eval > 1048) {
Countroll.expCount++;
Verbose.send("LOOP","Large than (" + Countroll.expCount + ")");
expression.append("<&b>*<&r><&a>").append(Increasers.power(ri,2,deep)).append("<&r>");
} else if (target - eval > 128) {
Countroll.factorCount++;
Verbose.send("LOOP","Big than (" + Countroll.factorCount + ")");
expression.append("<&b>*<&r><&a>").append(Increasers.multiply(ri,9,deep)).append("<&r>");
}
Countroll.addCount++;
expression.append("<&b>+<&r><&e>").append(toAdd).append("<&r>");
Verbose.send("LOOP","Less than (" + Countroll.addCount + ")");
}
if (eval > target) {
Countroll.subCount++;
expression.insert(0,"<&c>(<&r>").append("<&c>)<&r>");
expression.append("<&b>-<&r><&e>").append(toAdd).append("<&r>");
Verbose.send("LOOP","Greater than (" + Countroll.subCount + ")");
}
}
Verbose.send("PROC","Broke out of loop. Value: " + eval(expression.toString()));
Verbose.send("EVAL","Expression: " + expression);
Verbose.send("EVAL","Expression (Cleaned): " + removeColors(expression.toString()));
return expression.toString();
}
/**
* ObfIntD will work with DuckGroups's Counting bot
* @param target Integer to reach
* @param deep When True, doubles the use of Complexers and Increasers
* @return A colored string
*/
public static String obfIntD(int target, boolean deep) {
if (deep) System.out.println("Deep Obfuscation is coming soon!");
StringBuilder expression = new StringBuilder();
Random random = new Random();
int initializer = random.nextInt(9)+1;
expression.append("<&dh><&f>").append(initializer).append("<&r>");
while (eval(expression.toString()) != target) {
Countroll.total++;
int eval = (int) eval(expression.toString());
int ri = random.nextInt(9)+1;
final String toAdd = Complexers.complex(ri,deep);
if (eval < target) {
if (target - eval > 4096) {
Countroll.expCount++;
expression.append("<&b>*<&r>").append(Increasers.power(ri,4,deep));
} else if (target - eval > 1048) {
Countroll.expCount++;
expression.append("<&b>*<&r>").append(Increasers.power(ri,2,deep));
} else if (target - eval > 128) {
Countroll.factorCount++;
expression.append("<&b>*<&r>").append(Increasers.multiply(ri,2,deep));
}
Countroll.addCount++;
expression.append("<&b>+<&r>").append(toAdd);
}
if (eval > target) {
if (eval - target > 4096) {
Countroll.expCount++;
expression.append("<&b>-<&r>").append(Increasers.power(ri,5,deep));
} else if (eval - target> 1048) {
Countroll.expCount++;
expression.append("<&b>-<&r>").append(Increasers.power(ri,3,deep));
} else if (eval - target > 128) {
Countroll.factorCount++;
expression.append("<&b>-<&r>").append(Increasers.multiply(ri,2,deep));
}
Countroll.subCount++;
expression.insert(0,"<&c>(<&r>").append("<&c>)<&r>");
expression.append("<&b>-<&r>").append(toAdd);
}
}
return expression.toString();
}
} }

View File

@@ -60,8 +60,8 @@ public class Utils {
--deep, -d Enable deep obfuscation (under development) --deep, -d Enable deep obfuscation (under development)
--color, -rgb Enable colored output --color, -rgb Enable colored output
--help, --h, -h Show this help message --help, --h, -h Show this help message
--mode, -m Toggle the mode Values (Long): [duckgroup, numselli] Values (Brief): [d, n] --mode, -m Toggle the mode Values (Long): [duckgroup, numselli, universal, testing] Values (Brief): [d, n, u, t]
--toggle, -t Toggle off Complexer Values: [divide, power, root, mrDividend, mrDivisor] --toggle, -t Toggle off Complexer Values: [divide, power, root, mrDividend, mrDivisor, perfect]
Note: When using multiple options, separate them with spaces."""); Note: When using multiple options, separate them with spaces.""");
System.exit(0); System.exit(0);
} }
@@ -71,7 +71,9 @@ public class Utils {
"\n<&b><&eh>Blue/Yellow:<&r> Perfect Square" + "\n<&b><&eh>Blue/Yellow:<&r> Perfect Square" +
"\n<&a>Green:<&r> Increaser" + "\n<&a>Green:<&r> Increaser" +
"\n<&9>Blue:<&r> Operation" + "\n<&9>Blue:<&r> Operation" +
"\n<&e>Yellow:<&r> Complexer"; "\n<&e>Yellow:<&r> Complexer" +
"\n<&b><&d&h>Blue/Purple:<&r> Safe Subtract" +
"\n<&3>Cyan:<&r> Deep Complexer";
System.out.println(activateColors(colorKey)); System.out.println(activateColors(colorKey));
} }

5
src/test/java/Main.java Normal file
View File

@@ -0,0 +1,5 @@
public class Main {
public static void main(String[] args) {
}
}