Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: ObsidianWolf on November 25, 2003, 08:16 PM

Title: Beep On Keyascii13
Post by: ObsidianWolf on November 25, 2003, 08:16 PM
when i press enter to send the text on my bot the computer does that annoying ding sound.  how can I stop this from happening?  Im using VB6
Title: Re:Beep On Keyascii13
Post by: Spht on November 25, 2003, 08:18 PM
Returning zero (0) to KeyAscii parameter will let it know you got the message and not beep.
Title: Re:Beep On Keyascii13
Post by: ObsidianWolf on November 25, 2003, 08:26 PM
That worked great, thanks
Code for those that might run into same deal.

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    AddChat vbWhite, "<" & varAccount & "> ", vbCyan, Text1.text


With Packet
   .InsertNTString Text1.text
   .SendPacket &HE
   Text1.text = ""
End With
End If
KeyAscii=0
End Sub



Title: Re:Beep On Keyascii13
Post by: iago on November 25, 2003, 08:27 PM
Just a comment:

instead of 13, you should have vbKeyEnter or vbEnter or something like that.

Not a big deal, just thought I'd mention it :)
Title: Re:Beep On Keyascii13
Post by: Spht on November 25, 2003, 08:28 PM
vbKeyReturn -- Yes it's better to use constants. Makes reading your code much easier.
Title: Re:Beep On Keyascii13
Post by: Dyndrilliac on November 25, 2003, 08:29 PM
Quote from: iago on November 25, 2003, 08:27 PM
Just a comment:

instead of 13, you should have vbKeyEnter or vbEnter or something like that.

Not a big deal, just thought I'd mention it :)
.

Learn something new everyday - I was not aware that would work; So which is it? vbEnter or vbKeyEnter? :P
Title: Re:Beep On Keyascii13
Post by: ObsidianWolf on November 25, 2003, 08:32 PM
vbenter
Title: Re:Beep On Keyascii13
Post by: Spht on November 25, 2003, 08:35 PM
Quote from: ObsidianWolf on November 25, 2003, 08:32 PM
vbenter


No, vbEnter = 0. He's looking for vbKeyReturn, which = 13.
Title: Re:Beep On Keyascii13
Post by: ObsidianWolf on November 25, 2003, 08:40 PM
whoops my bad, thanks for the correction.
Title: Re:Beep On Keyascii13
Post by: Dyndrilliac on November 25, 2003, 08:41 PM
Could I do the same thing with Alt? Like, vbKeyAlt? Or is it something different?
Title: Re:Beep On Keyascii13
Post by: TriCk on November 26, 2003, 06:34 AM
Dyndrilliac, you sure could, it would just make Alt send instead of Enter
Title: Re:Beep On Keyascii13
Post by: Skywing on November 26, 2003, 08:26 AM
Quote from: TriCk on November 26, 2003, 06:34 AM
Dyndrilliac, you sure could, it would just make Alt send instead of Enter
Note that alt is a modifier and doesn't have an (ASCII/Unicode) keycode of it's own.