mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2003
Posts: 6
L
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Oct 2003
Posts: 6
Please help me, I cannot find a suitable Win32 API messages to send to the chat window 'mIRC_Query', I have developed an application to take control of the new people that want to chat but sometimes (even if input is recorded by the editbox in that window) nothing is written to the chat window!

Please, expert programmers HELP ME!!!

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You just want your mirc to automaticly answer on a query sent to you?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
If you're writing an external application that is placing text into a window's editbox, I'm guessing you're experiencing problems when the user has Multi-line editbox enabled... allowing the presence of CRLF characters in the editbox (rather than sending the text to its target).

The best way to write an external application that ties with mIRC, is either via DLL or COM Object which can communicate with mIRC via /DLL & $DLL or /COM & $COM calls in mIRC Script. If you're writing an external application that forces itself on mIRC, you'll want to use SendMessage call instead and instruct mIRC to /msg Nickname Message instead of sending direct to the editbox.

Type: /help SendMessage

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Oct 2003
Posts: 6
L
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Oct 2003
Posts: 6
Thx for replying.
I am not using any DLL/COM internal mIRC support, since I simply overtake the HWND of each mIRC_Query window with my external program and I send the appropriate messages (thro' SendMessage) to the editbox. It works! My problem is that sometimes text is not sent (and not written to the main chat box, but the editbox behaves like if it was containg that text (WM_GETTEXTLENGTH returns the correct length). It is an orrible bug, REALLY, I cannot find a reason, I have tried EVERYTHING, also debugging while online...in step-by-step debug the problem simply doesn't happen!!!
I have not tried the multi-line editbox..perhaps I should enable it in the mIRC client, but do you think that input will be sent correctly???

Joined: Oct 2003
Posts: 6
L
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Oct 2003
Posts: 6
I am not going to use a single answer to each query...I need something more flexible...at least 3 answers, for example. I don't know if there are suitable scripts around...

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
mIRC Script is surely capable of doing whatever it is you're trying to do. Perhaps if you told us what that was, we could assist you better.

Eg: If you are auto-responding with various messages to various questions or commands, it is esceedingly easy to store these responses in a file and have mIRC reply with them. mIRC is capable of Regular Expression pattern matches which allows for sophisticated grammar interpretation that can borderline artificial intelligence. grin

Whatever the situation, I'm sure mIRC can accomodate it. Of course, you're more familiar with whichever language you currently use, but we're a fairly helpful bunch.

As far as your SendMessage issue, you should again research what mIRC's /help file has to say about it (/help SendMessage). If you create a mapped file named mIRC using CreateFileMapping(), you would store your /msg in that mapped file instead of sending it directly to the query's editbox.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Oct 2003
Posts: 6
L
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Oct 2003
Posts: 6
Thanx for the advice. Now I will use the WM_MCOMMAND interfacing to communicate with mIRC (using the mapped file).
I didn't know about it, it's incredible how much we can use a program without yet knowing it in all of its parts!

I think this will solve my problem, because messages cannot be mis-interpretated through a mapped file, they are not simulation of key presses but a real request of data broadcast.

Again, thanks a lot. If I should help you in the future, I would be pleased to do.

Joined: Oct 2003
Posts: 38
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Oct 2003
Posts: 38
just remember the data you place in the mapped file is limited to 900 chars


-TheXenocide
ParseMPopup
Joined: Oct 2003
Posts: 6
L
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Oct 2003
Posts: 6
Yes, but mIRC requires the file to be at least 1024bytes (1K)...why? And why do I get -1 (nothing is written) ?

Perhaps expert scripters will tell me how to solve this?

To tell the truth, I have never used mapped files (and sincerely, mIRC should better use shared memory buffers in my opinion... wink


Link Copied to Clipboard