i´m new to this, hope i can get help anyway? sorry for my english!
i want this to work, but maybe its all wrong.
Ex: i want it to write random, Hello or Hi or Hey! How are you or How is it with you? What are you doing or Tell me what you are doing now?
Is it possible to do so?
Code: Select all
F1::
string = {Hello | Hi |Hey }! {How is it | How are you | How is it with you}? {What are you doing | Tell me what you are doing now}?
clipboard:=spintax(string)
;send, ^v
spintax(string) {
Pos := 1
while (Pos := RegExMatch(string, "{([^}]*)}" M, Pos + StrLen (R)))
string := StrReplace(string, M, R := getRandomElement(StrSplit(M1, "|")))
return string
}
getRandomElement(Arr) {
Random rand, 1, % Arr.Count()
return Arr.RemoveAt(rand)
}
Best reguard Tony
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]