Valhalla Legends Archive

Programming => Battle.net Bot Development => Battle.net Bot Development References => Topic started by: blinkdude on July 11, 2003, 12:43 AM

Title: [VB]Stopping Beep
Post by: blinkdude on July 11, 2003, 12:43 AM
ok when i hit enter on my text box everything works fine but windows Dings or beeps what every it is! got nay idea's hot to stop it :)


Private Sub TextSend_KeyDown(KeyAscii As Integer, Shift As Integer)

If (KeyAscii = 13) Then
Text1.Text = Text1.Text & "<" & CleanSlateBot1.Username & "> " & TextSend.Text & vbCrLf
CleanSlateBot1.Send TextSend.Text
TextSend.Text = ""
       Else
       End If
End Sub
Title: Re:kill the Beep!!! or DIng
Post by: Soul Taker on July 11, 2003, 12:58 AM
Set KeyAscii to 0 after you're done sending or whatever.


Private Sub TextSend_KeyDown(KeyAscii As Integer, Shift As Integer)

If (KeyAscii = 13) Then
   Text1.Text = Text1.Text & "<" & CleanSlateBot1.Username & "> " &   TextSend.Text & vbCrLf
   CleanSlateBot1.Send TextSend.Text
   TextSend.Text = ""
   KeyAscii = 0
End If
End Sub
Title: Re:kill the Beep!!! or DIng
Post by: blinkdude on July 11, 2003, 01:58 AM
thx for trying to help but it still dings :/
Title: Re:kill the Beep!!! or DIng
Post by: Stealth on July 11, 2003, 02:00 AM
As long as the variable KeyAscii is 0 when the subroutine finishes, it won't ding. :\
Title: Re:kill the Beep!!! or DIng
Post by: blinkdude on July 11, 2003, 02:09 AM

Private Sub TextSend_KeyDown(KeyAscii As Integer, Shift As Integer)

If (KeyAscii = 13) Then
Text1.Text = Text1.Text & "<" & CleanSlateBot1.Username & "> " & TextSend.Text & vbCrLf
CleanSlateBot1.Send TextSend.Text
TextSend.Text = ""
KeyAscii = 0
       Else
       End If
End Sub

if this code is right it still dings for me =[
Title: Re:kill the Beep!!! or DIng
Post by: SNiFFeR on July 11, 2003, 02:11 AM
Why dont you try

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text1.Text = Text1.Text & "<" & CleanSlateBot1.Username & "> " & TextSend.Text & vbCrLf
CleanSlateBot1.Send TextSend.Text
TextSend.Text = ""
KeyAscii = 0
End If
End Sub
Title: Re:kill the Beep!!! or DIng
Post by: blinkdude on July 11, 2003, 03:40 AM
ah yes this works but you have to add

Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii = 13) Then
Text1.Text = Text1.Text & "<" & CleanSlateBot1.Username & "> " & TextSend.Text & vbCrLf
CleanSlateBot1.Send TextSend.Text
TextSend.Text = ""
KeyAscii = 0
End If
End Sub

i needed the "("")" around keyascii = 13
Title: Re:kill the Beep!!! or DIng
Post by: iago on July 11, 2003, 07:12 AM
You shouldn't in visual basic.. you only need brackets in an "if"in c++.
Title: Re:kill the Beep!!! or DIng
Post by: Camel on July 11, 2003, 04:47 PM
Quote from: iago on July 11, 2003, 07:12 AM
You shouldn't in visual basic.. you only need brackets in an "if"in c++.
some (old) c++ compilers dont even require parentheses around it if it's a single bool

[edit] err, all if statements take a single bool, but i mean just a single variable cast as bool