mIRC Home    About    Download    Register    News    Help

Print Thread
#99138 29/09/04 04:57 AM
Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
I know it has to be in the mIRC help files , but i'm being lazy.
I want to identify what ports i may be using at any given time.
In other words, when i am chatting with a friend i want to know what port were chatting on , and any other DCC events for that matter. Not some elaborate script, just the port that is currently being used.(not the networks port)

#99139 29/09/04 05:36 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Firstly, this is NOT a 'I'm to lazy to read the helpfile, i'll post here' type of forum, but instead this is a 'if your willing to attempt to help yourself, we'll assist you' one.

Secondly, if you even botherd, which you obviously didnt, /help $chat even has an example.

So in short, grow up and read the helpfile.

Eamonn.

#99140 29/09/04 07:02 PM
Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
In Short....... who died and made you GOD...
I have been all over the HELP files for the past week and its all becoming a blurr.
I managed to teach myself some scripting with the help of several other people here..... Certainly no help from YOU!
I was Posting that here in the ATTEMPT to save myself asome time searching the vast help files for one command.
And just so you know , i did look in the mIRC help files in the index under "Port Range""$port", and all listings for "DCC" information i could find.
My comment about being too lazy to look was a simple attempt at humor...... seems your not familiar with the concept!
And for your information /help $chat returns no information whatsoever on PORTS of any kind! Perhaps you should read the help file yourself!

Last edited by JAFO; 29/09/04 07:03 PM.
#99141 29/09/04 08:12 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
nevertheless...

Unfortuately, there is no "simple" way of determinging ports, you can check if a port is open/closed using $portfree(N), where N is the port number.

If you want to gather the port a dcc is being held on, you most likely would need to "intercept" the port in a ctcp *:*:*:{ event and save it for later.

Alternatively, you can perhaps get your script to perform a 'netstats' and compair the results.

Eamonn.

#99142 30/09/04 02:53 AM
Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
Thank you ......
I added "Port: /echo is using port $dccport" to my popups to see what would happen and of course all i get is an echo of the port..... you guessed it.. 59.
Looks like i'm just gonna have to dive into this and see what i can come up with.

#99143 30/09/04 05:18 AM
Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
ctcp ^*:*:*:{
if ($1 == DCC) && ($2 == Send) /echo -a ** $nick ** $address ** is trying to send you $c(2) $3 $+ $c(1) ** on port ** $+ $c(2) $5 $c(1) $+ **
}
Was the best i could come up with..... and dont ask me .... the idea was mine a friend helped with all the identifiers.
But it only lets you know the incoming transfer request and what port its on.... nothing yet for chats.

#99144 30/09/04 08:59 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
This might help you,

The below alias will connect, via coms to a com object, and perform a 'netstats -a' which will output into a file, oports.txt, which will be in your mIRCdir if you need it, following that, a /filter will be performed to throw all the data (required), into a hash table, so you can use it via there, if you like.

alias getports {
var %f = $+(",$mircdir,oports.txt,")
if ($isfile(%f)) { .remove %f }
if ($hget(oports)) { .hfree oports }
.comopen oPorts WScript.Shell
.comclose oPorts $com(oPorts, Run, 1, bstr, $+(%,COMSPEC%) /c netstat.exe -a > %f, uint, 0, bool, true)
filter -fk %f gp.filter *:*
}

alias gp.filter { hadd -sm oports $+(conn.,$calc($hget(oports,0).item + 1)) $1- }

Just, /getports - then perhaps open oports.txt or view your hash table, to remove the echo of the /hadd simply remove the -sm

Eamonn.

#99145 01/10/04 05:14 AM
Joined: Sep 2004
Posts: 237
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
Works Great, Thanks a Lot!!
Now as for this hash table business...... I have seen many of refferences to it and cant honestly say im all that familiar with it. Guess its time to dig in and get some more studying done on "Hash Tables" now.
Thanks Again!

#99146 01/10/04 08:06 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Your welcome, you might also like to use the search feature to find some info on hash tables should the helpfile not be enough (though it should), i.e. here.


Link Copied to Clipboard