Closed andrewhodel closed 2 years ago
/system/script/run base64EncodeFunctions
expected command name (line 11 column 753)
Same problem that was an already created issue with Mikrotik, array declaration syntax.
https://github.com/andrewhodel/ispapp-routeros-client/blob/master/ispapp.rsc#L1470
{:local a [:toarray ""]; :set ($a->"asdf") 67; :put $a;}
var import_type = true;
var p = document.createElement('pre');
document.body.appendChild(p);
var c = 32;
var skips = [34, 92];
var escapes = [36]
while (c <= 126) {
var s = '';
var ch = String.fromCharCode(c);
if (skips.includes(c)) {
// skip it
c++;
continue;
} else if (escapes.includes(c)) {
ch = "\\" + ch;
}
if (import_type) {
// print for pasting to routeros import script
s = s + '\\n:set (\\$charToDec->\\"' + ch + '\\") ' + c + ';\\r\\\n';
} else {
// print for testing in shell
s = s + ':set ($charToDec->"' + ch + '") ' + c + ';\n';
}
p.innerHTML += s;
c++;
}
// base64 characters
var b64index = [];
c = 65;
while (c <= 90) {
b64index.push(String.fromCharCode(c));
c++
}
c = 97;
while (c <= 122) {
b64index.push(String.fromCharCode(c));
c++;
}
c = 48;
while (c <= 57) {
b64index.push(String.fromCharCode(c));
c++;
}
c = 62;
b64index.push("+");
b64index.push("/");
c = 0
while (c < b64index.length) {
var s = '';
var ch = b64index[c];
if (import_type) {
// print for pasting to routeros import script
s = s + '\\n:set (\\$base64Chars->' + c + ') \\"' + ch + '\\";\\r\\\n';
} else {
// print for testing in shell
s = s = s + ':set ($base64Chars->' + c + ') "' + ch + '";\n';
}
p.innerHTML += s;
c++;
}
Rewrite cmd execution, more junk from Emrah designed to create problems while people die.
no response