mIRC Home    About    Download    Register    News    Help

Print Thread
#177161 20/05/07 09:20 PM
Joined: May 2007
Posts: 3
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: May 2007
Posts: 3
I am wanting to establish a DDE link between mIRC and a VB6 program. I have found the list of DDE Topics in the mIRC help file but do not see a topic for reading text from the actual channel itself or sending text to a channel. There is a DDE topic called command. This should enable most functions I am looking for such as logging onto a server, joining a channel and even sending text to a channel or a specific user. Reading the channel is still a problem.

Any help or information regarding reading text from a channel would be greatly appreciated.

Thanks
sneakers

sneakers #177170 21/05/07 12:03 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
//echo -ag $dde($ddename,evaluate,Last line in $!chan(1) : $!line($chan(1),$line($chan(1),0)))

From this you should be able to infer the appropriate syntax in VB. Note that the exclamation marks I used in the above mirc command should not be in the VB string that contains the identifiers to be evaluated.

Last edited by qwerty; 21/05/07 12:06 AM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
qwerty #177177 21/05/07 02:49 AM
Joined: May 2007
Posts: 3
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: May 2007
Posts: 3
Quote:
//echo -ag $dde($ddename,evaluate,Last line in $!chan(1) : $!line($chan(1),$line($chan(1),0)))

Pasting that command into a DDE Link seems to be doing exactly what it is saying to do. It reads the last line of text and echoes it back into the room. Surprisingly it worked unchanged, even in the link with a VB6 program but the problem still remains. I need to be able to read this data from the VB6 program through the DDE Link and use the VB6 program to analyze it. I think the problem might be the Echo command.

Something else that has to be considered is that I need to read this text automatically each time it is entered. If there is no way for this to be done automatically, I can put the code in the VB6 program into a timer to test the channel regularly. This is a last choice option. Ideally Mirc initiating the DDE Link is preferable. The main thing at this point is actually reading the last line from my VB6 program.

Thanks
sneakers

sneakers #177189 21/05/07 08:57 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
The idea is to use the EVALUATE topic, not the COMMAND one (type /help /dde and read the entire page, if you haven't already done so).

However, to have mirc automatically notify your program of new channel text, you need to set up an on TEXT event in mirc, something like:
Code:
on *:text:*:#yourchannel: dde <name> <topic> "" $1-

where <name> and <topic> as defined in your app.



/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
qwerty #177221 21/05/07 07:44 PM
Joined: May 2007
Posts: 3
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: May 2007
Posts: 3
Actually setting the LinkItem to "$dde($ddename,evaluate,$!line($chan(1),$line($chan(1),0)))" returns the exact data I am looking for. I didn't try leaving out the exclamation marks and it appears to work fine.

In case you didn't notice, I am new to DDE and to programming mIRC. I first used mIRC about 10 years ago and am probably more aquainted with it than most users but never did any actual scripting.

Thanks a lot for your help. It not only helped me get closer to accomplishing my task but has helped me to understand more about mIRC and DDE usage with VB6. I am currently trying to figure out exactly how to accomplish the on text event and exactly how to communicate that back to my program. I fully understand that I can not and do not expect anyone to try and teach me how to accomplish scripting for mIRC or actual DDE linking in this forum but with what I do know, most times I can figure it out with bits of information. I would have never found the $chan(1) for the channel name but was able to figure out how to apply it once I had the information.

Any further help or information concerning the on text event is sure appreciated.

Thanks,
sneakers


Link Copied to Clipboard