master
1//This script just demonstrates how a cracker would work.
2//Executing this code in-game WOULD NOT WORK!!!
3function (context,args) {
4 var std = #s.scripts.lib(); //For logging messages
5 var c_1 = ["x","y","z"]; //Possibilities for lock 1
6 var c_2 = ["a","b","c"]; //Possibilities for lock 2
7 var c_3 = [1,2,3]; //Possibilities for lock 3
8 var ret = ""; //To store the result message of a cracking attempt
9 var comb = {}; //To use when target is called
10
11 ret = args.target.call({}); //Initial call of target to determine first lock
12
13 while (/*LOCK_ERROR present in ret*/) {
14 if (/*ret contains lock 1*/) { //Example of "simple" lock
15 for (/*Length of possibilities for lock 1*/) {
16 //Set neccessary args of comb for cracking attempt
17 //Call target with comb (set ret to output)
18
19 if (/*ret DOES NOT contain any hint on the result (lock is cracked)*/) {
20 break; //Break loop (since further attempts are not neccessary)
21 }
22 }
23 if (/*ret contains lock 2*/) { //Example of lock with 2 arguments
24 for (/*Length of possibilites for lock 2, argument 1*/) {
25 for (/*Length of possibilities for lock 2, argument 2*/) {
26 //Set neccessary args of comb for cracking attempt
27 //Call target with comb (set ret to output)
28
29 if (/*ret DOES NOT contain any hint on any of the arguments (lock is cracked)*/) {
30 break; //Break loop (since further attempts are not neccessary)
31 }
32 }
33 }
34 //Depending on the amount of possible locks, further statements must be added
35 }
36 }
37 }
38
39 std.log(comb); //Log final version of comb (version that fully cracked the target)
40 return {ok:true,msg:std.get_log()}; //Return ok and logs
41}