iirc there's no built in function to get the ASCII values of characters, but you can do something similar instead.
ways i can think of are:
1) Creating a string array of characters and getting a random index for a random range, here's a function which returns the result of this:
-----------------------------------------------------------
using Console;
using System;
using Array;
using Math;
using String;
string[] chars = new Array[65]; // i cba to write out all values, this represents the length of all lowercase, uppercase, numbers, space, dash and underscore
function<string> getRandomString(number len, string[] charList)
{
string pass; // creates a variable to store the password
while(String.Length(pass) <= len)
{
pass = pass .. charList[Math.RandomRange(1, Array.Length(charList)]; // Concatenates a new character onto the string while it's less than the desired length
}
return pass; // Returns the variable 'pass'
}
string randomPass = getRandomString(Math.RandomRange(10,15), chars);
-----------------------------------------------------------
2) Creating a single string with each character and using String.CharAt() instead
-----------------------------------------------------------
using Console;
using System;
using Math;
using String;
string chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 -_";
function<string> getRandomString(number len, string charList)
{
string pass;
while(String.Length(pass) <= len)
{
pass = pass .. String.CharAt(charList, Math.RandomRange(1, String.Length(charList)));
}
return pass;
}
string randomPass = getRandomString(Math.RandomRange(10,15), chars);
-----------------------------------------------------------
Then just do something like
System.RunCommand("router settings admin_password " .. getRandomString(Math.RandomRange(10,15), chars));
tbh there's probably a far easier way, but this is all off the top of my head. Hope these helped