Post by naskootbg on Mar 9, 2016 16:02:43 GMT
Such plugin will help improving unibot a lot and all other bot creators have nested spintax support.
Nested spintax config is possible, but it will require at leas 2 indexes and inplementing it will be pain, becasie it require work with array and in case in the code we want to create have other array, than the task goes impossible (because possible bugs).
It will be very easy for someone that know VB6 AND VB.net, becasue there already have such vb.net script
Nested spintax config is possible, but it will require at leas 2 indexes and inplementing it will be pain, becasie it require work with array and in case in the code we want to create have other array, than the task goes impossible (because possible bugs).
It will be very easy for someone that know VB6 AND VB.net, becasue there already have such vb.net script
'http://www.experts-exchange.com/questions/28198689/vb-net-spin-nested-spintax.html
Private rand As New Random()
Sub Main()
Dim source As String = "She said, '{hello there my {friend|dude|buddy|pal}, how are you!|hello there!}'."
Dim pattern As String = "\{[^{}]*\}" ' Any set of braces that do not contain other braces
Dim m As Match = Regex.Match(source, pattern)
Dim result As String = source
While m.Success
result = Regex.Replace(result, pattern, AddressOf RandomReplacement)
m = Regex.Match(result, pattern)
End While
Console.WriteLine(result)
End Sub
Function RandomReplacement(ByVal m As Match) As String
Dim matchedText As String = m.Value.Substring(1, m.Value.Length - 2) ' Skip { and }
Dim delimiter() As Char = {"|"c}
Dim choices() As String = matchedText.Split(delimiter)
Dim randomIndex As Integer = rand.Next(choices.Length)
Return choices(randomIndex)
End Function
End Module
It just require to be modified from vb.net to vb6 and if somebody help me at least with this, I will do the rest.