mIRC Home    About    Download    Register    News    Help

Print Thread
Multi-Sock #27583 02/06/03 03:50 AM
Joined: Mar 2003
Posts: 36
bugx Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Mar 2003
Posts: 36
I trying to do a check web pages than users (bots) puts in
a channel (eg. xxx pages)

I can check 1 or 2 pages but with diferents names for the
sockets (eg. Sock1 Sock2) and is limitated for 2 or more
but one code for Sock (for 5 socks use like 600 lines of code)

I read in the help than can use the wildcard * and i try to
use for a re-estructured mi source, but i have a problem
reading the name of the socket than is in sockopen

Can any do me a code ? I need :

var %last = last_connection
sockopen sock.%last %web.%last 80

Must check the last conection for sock.* and use it for
new connection

In the "on sockopen" need the number or sintaxis for read
correctly all then i can send than i need

I can send the vars but need how can returme the
name of the connection

Sorry but i'm from Mexico and my english isn't good


Re: Multi-Sock #27584 02/06/03 06:50 AM
Joined: May 2003
Posts: 22
aarrgghh Offline
Ameglian cow
Ameglian cow
Joined: May 2003
Posts: 22
Use $ticks .... (it's the number of milliseconds since your computer restarted) ....

var %socket $+(sock.,$ticks)
/sockopen %socket IP PORT
/sockmark %socket /filename.exe

as you can see this will make a socket with the name sock.NUMBER .... I used %variables cause $ticks is milliseconds and might change between the /sockopen and /sockmark ...

ok now the on sockopen
on *:sockopen:sock.*: {
     sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
     sockwrite $sockname $crlf

$sockname is the socket that just connected ...

I hope you understand some of this....

(note: this sample doesn't really work, HTTP usually needs more parameters then just GET/POST)

I really don't know anything.... I just fake it