• Welcome to Valhalla Legends Archive.
 

Console Chatbot (Sending Messages)

Started by Joe[x86], May 22, 2005, 01:31 PM

Previous topic - Next topic

Joe[x86]

I've written a fairly good console chatbot over the past few days.. except.. it can't chat. Does anyone have any idea how I'd send messages from a console without the bot specifically asking for them?

EDIT -
Perhaps I should ask for a message, get on with life, and once ones finally returned, repeat?
No go. It stops all events until a message is returned. If it was simply the way I did it..

On CSB_LoggedOnAs:
Call StartChat()

My StartChat Sub
Public Sub StartChat()
    Dim S as String
    Let S = Console.ReadText()
    Call frmCSBEvents.CSB.Send(CStr(S))
    Call AddChat("<" & frmCSBEvents.CSB.Username & "> " & CStr(S))
End Sub
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Eric

QuoteDoes anyone have any idea how I'd send messages from a console without the bot specifically asking for them?

The same way you would from a non-console app.

Joe[x86]

QuoteThe same way you would from a non-console app.

Okay, lets do it your way then. Does anybody know how I can load a textbox on my console that I can type in? No? Hrm, must not be the same way.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Eric

#3
QuoteEDIT -
No go. It stops all events until a message is returned. If it was simply the way I did it..

Generally that's solved by putting ReadConsoleInput() in an infinite loop in main() and creating a seperate thread for other functions.

Eric

#4
Quote from: Joex86] link=topic=11667.msg113392#msg113392 date=1116787212]
QuoteThe same way you would from a non-console app.

Okay, lets do it your way then. Does anybody know how I can load a textbox on my console that I can type in? No? Hrm, must not be the same way.

CreateWindow().

Joe[x86]

How do I use a second thread in VisualBasic?
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Eric

#6

Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Joe[x86]

Does anybody want to help me here? All I can get out of what LoRd[nK] is telling me is that I need to use an API call.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

hismajesty


Eric

Quote from: Joex86] link=topic=11667.msg113404#msg113404 date=1116790002]
Does anybody want to help me here? All I can get out of what LoRd[nK] is telling me is that I need to use an API call.

Were you expecting this to be easy?

Warrior

well he got baby fed the console code, so I'd assume yes :p
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

UserLoser.

#12
DarkMinion supplied a simple example a long time ago.  It is here.  Yes, it's in C++, but it's no harder to translate it into VB code than it would be to read documentation somewhere else.

Don't use _beginthread() and _endthread(), use CreateThread() and ExitThread(), or don't use any at all and just find a workaround for it which shouldn't be too hard

111787


Eric

#14
Quote from: 111787 on May 22, 2005, 04:31 PM
Use WinExec()

WinExec() doesn't create a new thread.  It executes an application.