would it be possible for a script to take a variable and scramble that word with *'s or what id want, and change that into a 2nd variable.
The answer is: yes it is possible. The problem is you haven't really explained "what [you]'d want". It's easy to replace all letters, or even certain letters, with *, for example:
//echo -a $replace(foo, f, *, o, *)
But that's probably not what you want. I'm guessing you may want some randomness involved? If so, you could do something like:
//echo -a $remove($($regsubex(example, /(.)/g, $!iif($rand(1,2) == 1,\1,*) $chr(32)),2),$chr(32))
The problem is these results are extremely unpredictable and probably not what you really want either. Here are a couple of runs:
*xamp**
exa*pl*
e**mpl*
exa*pl*
**am**e
A lot of those are way too much of a hint. You could control how many *'s you add, but even then, you probably want to manually control the way you slowly expose the word via hints. In other words, you probably don't want to automate this.
Now for part 2, is there a way to make a command like !rank and it would tell the person what place he is
You can use /filter -a to sort the file into a hidden @window and then use the line numbers to represent the rank. This is an expensive call, so you should not do it on request, but you should perform this /filter at the end of each round (or whenever points are assigned) and keep the @window active throughout your game. Basically:
alias trivia.endround { | ; when the round ends
assignPoints
filter -fwca ranks.txt @trivia.rank trivia.ranksorter *
}
Then when someone wants their rank you can use $fline to find the line, and the index represents their rank.