mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2004
Posts: 111
Z
Zeusbwr Offline OP
Vogon poet
OP Offline
Vogon poet
Z
Joined: Mar 2004
Posts: 111
Can anyone enlighten me to the syntax to catch an echo event?


Also, how can i parse text in a variable? I am sending strings fron another application to mIRC. It see's commands such as .msg, /msg, msg, etc. But if i add an identifier in there, such as $me, i cannot get mirc to parse it.


What i want to do, is any identifier info i need i can echo it and ping it back to the controller program. However, as said, i have problems with both of that. I cant find an On Echo event, and i cannot get mIRC to parse identifiers from a string.

Any help?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You can't find an ON ECHO event, because there isn't one.

The echo command sends the information to your screen and your screen only. The information never goes to the network.

/help /echo for more assistance with the echo command

As to the rest of your query, I can't help you, as I don't understand what it is you're attempting to do.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
There's no 'on echo' event and no scriptable way to catch that kind of thing properly. You'd have to specify precisely how you're sending data to mIRC in order for anyone to really tell you the best way to capture it.

As for evaluation, it's simply a case of using $eval(%variablename, 2), however be aware that this is potentially very dangerous unless you're certain the data being evaluated is always 100% trustworthy.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Mar 2004
Posts: 111
Z
Zeusbwr Offline OP
Vogon poet
OP Offline
Vogon poet
Z
Joined: Mar 2004
Posts: 111
The Data is coming in through a simple socket connection.

Hmm.. maybe i can notice myself and use that as a way to capture it.. Though thats a security hole seeing as others could do the same.. hmm.

But ya, i need to have some type of event that only my local mirc knows of, so it can catch it, and send it back out to my program.

Like if i could catch echo's, i'd do the following steps.

1.) Prog sends to mIRC "echo -s RETURN_INFO $me"
2.) mIRC Recievs the command, executes it, and displays in the server window "RETURN_INFO BotsName"
3.) the On Echo event (example only) catches the echo, and immedietly sends back to the program the string mIRC echo'd. Which is "RETURN_INFO BotsName".
4.) The program parses the tag RETURN_INFO, and knows what it last requested, so the 2nd word must be the return of $me.

Thats an example, as if there WAS an echo event. Since there isnt i dunno...

I just happend to think maybe i'll return an error, if i remember right mIRC catches error events in the Raw Event setup. For example if you typed /GOGOBUTTERBEAN, ofcourse, mirc has no command, and chances are you didnt script one. So a raw event could capture whatever was in the string.. possibly.


Anyway, any ideas?

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
look at /help DDE
see if that will work for you

Joined: Mar 2004
Posts: 111
Z
Zeusbwr Offline OP
Vogon poet
OP Offline
Vogon poet
Z
Joined: Mar 2004
Posts: 111
Quote:
look at /help DDE
see if that will work for you


Im not asking about the communication, im asking about an event thats solo.. similar to an On Echo event would be.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I dont really understand what your upto here, seems like your making things hard for yourself.

If your PROG can send "echo -s RETURN_INFO $me" and you were hopping for a ON ECHO event that you could have trapped to get that info, Well why not just have you PROG send "RETURN_INFO $me" and in the mirc you have an alias called RETURN_INFO
alias RETURN_INFO { ... however you return info to your prog send it $1- ... }

Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
I assume that you have some code that 'catches' the info when it is sent to mirc (sockread etc). Then somewhere in this event you have a /echo -s <data> line. Just simply send the info straight back in this same event.

for example. (taken from 2 thread down!)
Code:
on 1:sockread:testing:{
  if ($sockerr) return
  :nextread
  sockread %temp
  if ($sockbr == 0) return
  if (%temp == $null) %temp = -
  ; echo the string recieved
  echo -s $eval(%temp,2)
  ; send the evaluated string back
  sockwrite testing $eval(%temp,2)
  goto nextread
}


Note, because this is not triggered by an action inside of mirc, not all identifiers can be evaluated ($chan $nick etc). You may use all socket related identifiers, global identifiers (non event specific and such) and global variables. If you wish to restrieve other information not in these catagories you will need to create your own identifiers (aliases) to return the information. eg.

Alias getfirstcid { scid 1 return $network }

Control could then send a request for $getfirstcid


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Joined: Mar 2004
Posts: 111
Z
Zeusbwr Offline OP
Vogon poet
OP Offline
Vogon poet
Z
Joined: Mar 2004
Posts: 111
Quote:
I dont really understand what your upto here, seems like your making things hard for yourself.

If your PROG can send "echo -s RETURN_INFO $me" and you were hopping for a ON ECHO event that you could have trapped to get that info, Well why not just have you PROG send "RETURN_INFO $me" and in the mirc you have an alias called RETURN_INFO
alias RETURN_INFO { ... however you return info to your prog send it $1- ... }


LMFAO, sorry everyone. I've been away from mirc for 2 years so everything is really rusty.

Making a custom function is exactly what i need! I can just have it send back whatever i request.

Thanks a ton. Sorry i forgot blush ( Obvious answers usually are the best lol, thanks again! )

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Actually i liked Om3n's better!


Link Copied to Clipboard