Valhalla Legends Forums Archive | Battle.net Bot Development | Help with code plz

AuthorMessageTime
TeEhEiMaN
[code]
For I = 0 To banned.ListCount
If Username = banned.List(I) Then
If Left((LCase(Message)), 5) = (Form2.txttrigger.Text & "say ") Then
Dim saymessage As String
saymessage = Right(Message, (Len(Message) - 5))
CleanSlateBot1.Send saymessage
AddChat "<" & Form2.txtUsername.Text & "> ", vbCyan, saymessage & vbNewLine, vbWhite
End If
End If
Next I
[/code]

i add'd the names to the list and I try to Get it to do the @say command but just doesnt work.
July 11, 2003, 6:03 AM
Lobo.id
[quote author=TeEhEiMaN link=board=17;threadid=1873;start=0#msg14504 date=1057903412]
[code]
For I = 0 To banned.ListCount
If Username = banned.List(I) Then
If Left((LCase(Message)), 5) = (Form2.txttrigger.Text & "say ") Then
Dim saymessage As String
saymessage = Right(Message, (Len(Message) - 5))
CleanSlateBot1.Send saymessage
AddChat "<" & Form2.txtUsername.Text & "> ", vbCyan, saymessage & vbNewLine, vbWhite
End If
End If
Next I
[/code]

i add'd the names to the list and I try to Get it to do the @say command but just doesnt work.
[/quote]

You might wanna do
[code]If LCase(left(message,5)) = (Form2.txttrigger.text & "say ") Then[/code]
July 11, 2003, 6:28 AM
TeEhEiMaN
nope that dont work
July 11, 2003, 9:05 AM
Ithien
You should make it support more than one characters trigger, and should support different capatilization, It could of not workes before because of wrong caps :)

Try this
[code]
For I = 0 To banned.ListCount
If LCase(Username) = LCase(banned.List(I)) Then
If LCase(Left(Right(Message, (Len(Message) - Len(Form2.txttrigger.Text))), 4)) = "say " Then
Dim Cut As String
Cut = Right(Message, (Len(Message) - Len(Form2.txttrigger.Text)) - 4)
CleanSlateBot1.Send Cut
AddChat "<" & Form2.txtUsername.Text & "> ", vbCyan, saymessage & vbNewLine, vbWhite
end if
End If
Next I[/code]
July 11, 2003, 9:52 PM
TeEhEiMaN
I made sure its right characters, so that cant be the problem
July 11, 2003, 9:57 PM

Search