Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: FLiPPY_ on August 03, 2003, 09:58 PM

Title: Sending Text
Post by: FLiPPY_ on August 03, 2003, 09:58 PM
Ok.. I have everything worked out.. I can view text.. see whispers.. connect.. and everything.. But I can't Send Msg's.. here's my code

Private Sub txtSend_KeyPress(keyascii As Integer)
If CleanSlateBot1.Connected = True Then
  mUsername = GetStuff("Configuration", "Username")
       strSend = txtSend.Text
       txtSend.Text = ""
       If keyascii = 13 And txtSend.Text <> "" Then
       AddSpeech vbWhite, " [" & Format$(Time, "Hh:Nn:Ss") & "] ", vbCyan, "<", vbBlue, mUsername, vbCyan, "> ", vbWhite, strSend
       
   End If
End If
End Sub

When I Hit Enter.. it makes a *dun* noise. :-\
Title: Re:Sending Text
Post by: DarkMinion on August 03, 2003, 10:28 PM
Ok...all you do is print it to screen, you don't even try to send anything...

And try keyascii = 0 to get rid of the beep
Title: Re:Sending Text
Post by: FLiPPY_ on August 03, 2003, 10:31 PM
Quote from: DarkMinion on August 03, 2003, 10:28 PM
Ok...all you do is print it to screen, you don't even try to send anything...

Like the Print Screen Button? I'm confused.. can u be more specific?
Title: Re:Sending Text
Post by: FuZe on August 03, 2003, 10:36 PM
What hes saying is you dont have any code to send the data to BNET, all your doing is showing what you typed up on the screen.. rofl.. that sounded exactly like what he sed...
Title: Re:Sending Text
Post by: FuZe on August 03, 2003, 10:38 PM
Try This

Private Sub txtSend_KeyPress(keyascii As Integer)
If CleanSlateBot1.Connected = True Then
 mUsername = GetStuff("Configuration", "Username")
       strSend = txtSend.Text
       txtSend.Text = ""
       If keyascii = 13 And txtSend.Text <> "" Then
       AddSpeech vbWhite, " [" & Format$(Time, "Hh:Nn:Ss") & "] ", vbCyan, "<", vbBlue, mUsername, vbCyan, "> ", vbWhite, strSend
       CleanSlateBot1.Send strSend

       
   End If
End If
End Sub
Title: Re:Sending Text
Post by: FLiPPY_ on August 03, 2003, 10:49 PM
Lol.. now it only allows me to type in 1 char. If you type another it just over wrights the last one. It still doesn't send..
Title: Re:Sending Text
Post by: FuZe on August 03, 2003, 11:06 PM
Quote from: FLiPPY_ on August 03, 2003, 10:49 PM
Lol.. now it only allows me to type in 1 char. If you type another it just over wrights the last one. It still doesn't send..
whoops thats cuz ur code initially was wrong let me rewrite this.. u have
txtSend.Text = "" before If keyascii = 13 And txtSend.Text <> "" Then

try this........


Private Sub txtSend_KeyPress(keyascii As Integer)
If CleanSlateBot1.Connected = True Then
 mUsername = GetStuff("Configuration", "Username")              
       If keyascii = 13 And txtSend.Text <> "" Then
       AddSpeech vbWhite, " [" & Format$(Time, "Hh:Nn:Ss") & "] ", vbCyan, "<", vbBlue, mUsername, vbCyan, "> ", vbWhite, strSend
       CleanSlateBot1.Send text1.text
       txtSend.Text = ""      

       
   End If
End If
End Sub
Title: Re:Sending Text
Post by: FLiPPY_ on August 03, 2003, 11:12 PM
Wow.. Thanks.. it does work! Yes!
Title: Re:Sending Text
Post by: DarkMinion on August 04, 2003, 12:30 AM
Read my signature for explanation.