mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Nov 2003
Posts: 32
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Nov 2003
Posts: 32
Hi! I just wonder if there is a method to implement the ICMP INTERNET PING into mIRC, maybe in mIRCscript, using the dll Icmp.dll located by default in the directory C:\Windows\System32\ in my windows xp.
I know pretty well mirc script but that's is the first time to me, with dlls stuff, and I don't know where to move my steps..
I've tried something like
//echo -a * $dll(C:\Windows\System32\Icmp.dll,ICMPSendEcho,www.google.com)
and mIRC crashes laugh ... i was just trying...
I've already searched in google but without finding somtin' good :\

So.. can you help me? :tongue:

Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
You cannot use icmp.dll directly from mIRC; I have written a mIRC DLL that can use it, but I haven't gotten around to writing all of the documentation for it yet. If I remember, I'll post a message here when it's done. smile


Saturn, QuakeNet staff
Joined: Nov 2003
Posts: 32
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Nov 2003
Posts: 32
Quote:
You cannot use icmp.dll directly from mIRC; I have written a mIRC DLL that can use it, but I haven't gotten around to writing all of the documentation for it yet. If I remember, I'll post a message here when it's done. smile


OMG u'r great!! smile)
But, I think that "just" the dll would be fine, I don't mind to read all the documentation smirk smile can you send me the dll if it works? :P
I really appreciate that ^_^ :*

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
What's wrong with using ping.exe or tracert.exe etc?


Gone.
Joined: Nov 2003
Posts: 32
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Nov 2003
Posts: 32
Quote:
What's wrong with using ping.exe or tracert.exe etc?


Uhmm.. if u can trig the results, nothing! cool

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Trig the results? You mean you want to be able to return the results to mIRC? Yes that can be done, just export it to a file when you call it with /run.


Gone.
Joined: Nov 2003
Posts: 32
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Nov 2003
Posts: 32
Quote:
Trig the results? You mean you want to be able to return the results to mIRC? Yes that can be done, just export it to a file when you call it with /run.

oh gosh.. I don't ever know this feature..

And, would not be a little bit slow to run the ping.exe, write down the results, make a $read and manipulate them?

Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Okay then, you can get a copy of the DLL and partial documentation (which you are going to need, even though it's not complete) here.


Saturn, QuakeNet staff
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Examples:

//cmdoutput ping localhost >ping.txt | run ping.txt
//cmdoutput netstat -n >netstat.txt
...

Syntax for ping.exe:
  • ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
    [-r count] [-s count] [[-j host-list] | [-k host-list]]
    [-w timeout] destination-list

    Options:

    -t
    Pings the specified host until stopped.
    To see statistics and continue - type Control-Break;
    To stop - type Control-C.

    -a Resolve addresses to hostnames.
    -n count Number of echo requests to send.
    -l size Send buffer size.
    -f Set Don't Fragment flag in packet.
    -i TTL Time To Live.
    -v TOS Type Of Service.
    -r count Record route for count hops.
    -s count Timestamp for count hops.
    -j host-list Loose source route along host-list.
    -k host-list Strict source route along host-list.
    -w timeout Timeout in milliseconds to wait for each reply.


I put the signal there, that will notify you when the command has finished processing. It runs a synchrounous call, which means the cmdoutput alias waits with processing until the com call returns.

As you can see you can export the results to a text file, which you can then manipulate, read, etc.

Example:

//window -n @netstat | cmdoutput netstat -n >netstat.txt | loadbuf @netstat netstat.txt | .remove netstat.txt

Code:
alias cmdoutput {
  var %wsh = wsh $+ $ticks
  .comopen %wsh wscript.shell
  .comclose %wsh $com(%wsh,run,1,bstr*,% $+ comspec% /c $1-,uint,0,bool,true)
  .signal cmdoutput $1-
}
 [color:red]  [/color] 
on *:signal:cmdoutput:{
  echo -ac info * /cmdoutput: finished processing command: $1-
}

Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Sure you can run ping.exe and tracert.exe, but good luck with parsing the results properly and reliably, in all translations of all (including future) versions of Windows...


Saturn, QuakeNet staff
Joined: Nov 2003
Posts: 32
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Nov 2003
Posts: 32
Quote:
Okay then, you can get a copy of the DLL and partial documentation (which you are going to need, even though it's not complete) here.


Ok, 16:08:51 * Dns resolved www.google.it to 216.239.59.99
then i launch the dll with
//echo -a $dll(ping.dll, ping, 216.239.59.99)
but the result is:
1
No response from 216.239.59.99

what's wrong here? frown

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Quote:
Sure you can run ping.exe and tracert.exe, but good luck with parsing the results properly and reliably, in all translations of all (including future) versions of Windows...


Who cares about that? If his OS is English, then he's all set. ping.exe's output will be the same on all English Windows OS'es, so I don't see the problem really. It's a solution for him without requiring a DLL, it's not meant to be a universal solution for all languages.


Gone.
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Quote:
No response from 216.239.59.99

what's wrong here? frown

Pinging that IP even crashes in iphlpapi.dll here. That's the result of me not having had enough time to test the DLL thoroughly.. I'll look into it.


Saturn, QuakeNet staff
Joined: Nov 2003
Posts: 32
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Nov 2003
Posts: 32
Quote:
Examples:

//cmdoutput ping localhost >ping.txt | run ping.txt
//cmdoutput netstat -n >netstat.txt
(...)


shocked great.. but.. it is not a bit slow all that? I mean, shure it works, but.. I dunno.. I have to make a ping every tot seconds..to control if a server is up obviously.. and i won't to see (neither minimized to tray) the window pop-upping every tot seconds °_° it would make me crazy :PPPPPPPPPPPPP

Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Quote:
Who cares about that?

Pretty much everyone who ever intends to distribute the scripts they make. Binding a solution to e.g. a specific language of an OS is not very neat IMO.


Saturn, QuakeNet staff
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
What are you talking about? No window pops up with that code... it's all done hidden. It's speed is the same as the speed of using ping.exe in your command prompt. If you are talking about my example with the window @netstat, that is obviously an example, no one says you have to loadbuf them to a window...


Gone.
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
This is a forum to help people with specific problems, it's not like he's going to release an addon, it looks like a clear case of a user specific problem, which doesn't need universal solutions. Not saying universal solutions aren't good, in fact they are preferable, but I wouldn't know why I shouldn't be able to post workarounds that don't require a DLL.

When posting code, there might always be compatibility issues, whether due to mIRC itsself, or the OS. That doesn't mean solutions may not be posted. If so I should have never released any code using COM, because it either relies on having a certain version of IE installed, WMI installed, mIRC 6.16 (due to $comval) etc.

Your DLL has more compatibility issues than my COM solution, as people actually need to download your DLL, whilst ping.exe is already on everyone's Windows OS.

I think it's great you made that DLL, but don't give me comments like "good luck parsing..." when I give other solutions.


Gone.
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Strawman. I never said you should not post your solution, I merely pointed out that it has certain downsides.


Saturn, QuakeNet staff
Joined: Nov 2003
Posts: 32
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Nov 2003
Posts: 32
Quote:
This is a forum to help people with specific problems, (...).


yeah it works!!! Thanxs ^______________^ :***********

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
You didn't "merely point it out", you downplayed it. The strawman principle doesn't apply, as I knew exactly what you meant with your "sure.. good luck" line.


Gone.
Page 1 of 2 1 2

Link Copied to Clipboard