• Welcome to Valhalla Legends Archive.
 

Sending a key (i.e. Enter)

Started by shadowz, May 04, 2003, 03:46 AM

Previous topic - Next topic

tA-Kane

#15
I beleive the Enter key (bottom right of number pad) has a different character code than the Return key (to the right of all the letters, just up and left of the arrow keys).

IIRC, on my Mac, the Enter key creates a keydown event with Chr(3) as the value, instead of Chr(13).
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

shadowz

Quote from: tA-Kane on May 06, 2003, 06:03 PM
I beleive the Enter key (bottom right of number pad) has a different character code than the Return key (to the right of all the letters, just up and left of the arrow keys).

IIRC, on my Mac, the Enter key creates a keydown event with Chr(3) as the value, instead of Chr(13).

Still doesn't work  :-\

Tazo

#17
Quote from: kamakazie on May 06, 2003, 04:14 PM
Don't listen to laurion he doesn't know what he is talking about.

Anyways,  I believe your problem is that there is no vbCrLf in the offending line:

ws.SendData "/w Masterzs" & strUsername & "" & "is logged in"

So modify it as below:

ws.SendData "/w Masterzs " & strUsername & "" & "is logged in" & vbCrLf

Edit: Also you might want to add a space after Masterzs so it whispers Masterzs and not MasterszBlah, Blah being the value assigned to strUsername.  Unless of course, that was your intention.
ah, nevermind, I forgot that on chat you use senddata, props to UserLoser for correcting me :-p

MrRaza

Quote from: laurion on May 06, 2003, 01:59 PM
you dont send text or whisper people by using sendata, you use packet packet 0x0E (&HE)


(STRING) Text

http://www.valhallalegends.com/arta/bnetdocs/content.php?id=0E&Sender=C


He's talking about a chat bot, not a binary bot. Also, please edit your post to fix your grammar errors please.

Stealth

#19
Quote from: tA-Kane on May 06, 2003, 06:03 PM
I beleive the Enter key (bottom right of number pad) has a different character code than the Return key (to the right of all the letters, just up and left of the arrow keys).

IIRC, on my Mac, the Enter key creates a keydown event with Chr(3) as the value, instead of Chr(13).

In Windows, the standard ENTER key and the numpad ENTER key both generate chr(13) in the KeyPress event.


Private Sub txtSend_KeyPress(KeyAscii as Integer)
     if keyascii =13 then 'if enter is pressed
         if sckbnet.state = 7 then 'if the socket is connected
              keyascii = 0 'removes that cursed DING noise you would otherwise hear
              sckbnet.senddata txtsend.text & vbcrlf
              txtsend.text = ""
         endif
     endif
End Sub


Untested, but should work.
- Stealth
Author of StealthBot

Camel

Quote from: Stealth on May 06, 2003, 08:13 PM
     if keyascii =13 then 'if enter is pressed

that'll work, but you should use the vbKeyReturn constant instead of just 13

dxoigmn

Quote from: laurion on May 06, 2003, 07:28 PM
ah, nevermind, I forgot that on chat you use senddata, props to UserLoser for correcting me :-p

I still use SendData() for a binary connection.

Socket.SendData sData    ' sData == BNCS packet