Hello,
I've got two question I hope to get answers to:
1. I'm trying to match a pattern in strings that can come in two ways:
a. "Bases: 3 Points: 150/1600 ..."
b. "Points/Flags: 2 ..."
I want to get the 150 in case it's a string type 'a' (with ####/####). And in case there is no such pattern (type 'b'), I want to get the number - 2 in the example.
I've tried to use:
Code:
string.match(origString, "(%d+)/*")
But it didn't work - I got 3 for string type 'a'. If I use:
Code:
string.match(origString, "(%d+)/")
then I get the 150, but it obviously fails on string type 'b'.
Is there a matching pattern that will catch both cases? Note that the string before the number can alter, it's not always 'Points' for example.
2. When trying to whisper to an offline player, I get error "No player named XXX is currently playing". Is there a way to know that prior to the whisper? Like an API telling me that? I looked but couldn't find one.
Thanks