Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: TeEhEiMaN on July 11, 2003, 01:03 AM

Title: Help with code plz
Post by: TeEhEiMaN on July 11, 2003, 01:03 AM

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


i add'd the names to the list and I try to Get it to do the @say command but just doesnt work.
Title: Re:Help with code plz
Post by: Lobo on July 11, 2003, 01:28 AM
Quote from: TeEhEiMaN on July 11, 2003, 01:03 AM

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


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

You might wanna do
If LCase(left(message,5)) = (Form2.txttrigger.text & "say ") Then
Title: Re:Help with code plz
Post by: TeEhEiMaN on July 11, 2003, 04:05 AM
nope that dont work
Title: Re:Help with code plz
Post by: Ithien on July 11, 2003, 04:52 PM
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

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
Title: Re:Help with code plz
Post by: TeEhEiMaN on July 11, 2003, 04:57 PM
I made sure its right characters, so that cant be the problem