master
Raw Download raw file
 1// ________                                                _________
 2// \________\--------___       ___         ____----------/_________/
 3//     \_______\----\\\\\\   //_ _ \\    //////-------/________/
 4//         \______\----\\|| (( ~|~ )))  ||//------/________/
 5//             \_____\---\\ ((\ = / ))) //----/_____/
 6//                  \____\--\_)))  \ _)))---/____/
 7//                        \__/  (((     (((_/
 8// ヾღ彡                   |  -)))  -  ))
 9// =================================================================
10// con_spec_scriptor_free.js
11// -----------------------------------------------------------------
12// author:  @archangel
13// SEC LVL: 4
14// Chars:   157
15// Descr:   Simple CON_SPEC scriptor for anyone to use.
16// Syntax:  #s.archangel.con_spec_scriptor_free  // while you try to crack
17// Syntax:  con_spec_scriptor_free {s:"string", d:_int_}  // to test the script
18// =================================================================
19
20function (context, args)
21{   
22    // we'll wrap the analytics in a try-catch, so that a failure during recording doesn't break the rest of the script
23    try
24    {
25        // Those calls are for logging purposes. Check dtr.man{page:"soron.arch_data"} and dtr.man{page:"ada.haxfax"} in-game for more info.
26        #s.soron.arch_data({log:{c:context}});
27        #s.ada.haxfax({log:{c:context}});
28    }
29    catch (e)
30    {
31        // oh well, we can live with this. Congrats, user-who-is-not-tracked!
32    }
33
34    // CON_SPEC scriptor lock demands a script that take 2 arguments, 's' as a string and 'd' as an integer, and returns the how many times
35    // the 'd' apears in the 's'.
36    return args.s.split(args.d.toString()).length - 1;
37}