mIRC Home    About    Download    Register    News    Help

Topic Options
#126553 - 01/08/05 02:04 PM Get proxy list
Abuser__ Offline
Babel fish

Registered: 21/04/05
Posts: 53
I am a little new with socks. Let's start with the script i want:

When someone writes !proxylist the bot gets the list of proxys from http://www.proxycn.net/proxy_irc/page1.htm and msgs it into the channel. I think that it would be great, if there would be a 1500 delay between lines, so the bot wouldn't flood of the server...

Can someone help me? smile

Top
#126554 - 01/08/05 03:09 PM Re: Get proxy list
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
Here's a small example.

Note that it will write the proxies to a .txt file called proxylist.txt which is located in your main mIRC folder. Note that once you've retrieved the list, you shouldn't use the sockets all the time to message the proxies to a person, just read it from the file, and update the file with the code every once in a while.

Code:
alias getproxies {
  var %e = echo -ac info * /getproxies:
  if ($fopen(proxylist)) .fclose proxylist
 .fopen -o proxylist proxylist.txt
  if ($ferr) { %e error opening proxylist.txt | return }
  sockclose gprox
  sockopen gprox proxycn.net 80
  %e retrieving proxy list
}
 [color:red]  [/color] 
on *:sockopen:gprox:{
  if ($sockerr) { echo -ac info * /getproxies: error opening socket | return }
  var %s = sockwrite -n gprox
  %s GET /proxy_irc/page1.htm HTTP/1.1
  %s Host: www.proxycn.net $str($crlf,2)
}
 [color:red]  [/color] 
on *:sockread:gprox:{
  if ($sockerr) return
  var %a, %token
  sockread %a
  while ($sockbr) {
    %token = $remove($gettok(%a,1,32),</td>)
    if (*.*.*.* iswm %token) sockmark gprox %token
    elseif (%token isnum) && ($sock(gprox).mark) {
      sockmark gprox $ifmatch %token
    }
    elseif (%token isalpha) && ($isupper(%token)) {
      .fwrite -n proxylist $sock(gprox).mark %token
      sockmark gprox
    }
    sockread %a
  }
}
 [color:red]  [/color] 
on *:sockclose:gprox:{
  .fclose proxylist
  echo -ac info * /getproxies: finished retrieving proxies
}


After doing /getproxies, you will be notified when the process is finished. From this point on, you can use the /play command to message the contents of a file to a person/channel with a specified interval.

In its simplest form, this would look something like: /play <channel> proxylist.txt 1500
For more information about /play, type /help /play in mIRC and take a look at the flags and such.

Mod note: Code edited as per author's request


Edited by Mentality (05/10/05 11:39 AM)
_________________________
Gone.

Top
#126555 - 11/10/05 09:10 PM Re: Get proxy list
yah Offline
Nutrimatic drinks dispenser

Registered: 08/10/05
Posts: 8
when i type /getproxies, i get this msg:
FOPEN Unknown command
-
FWRITE Unknown command
-
FWRITE Unknown command
-
FWRITE Unknown command
-
FCLOSE Unknown command
-
i use mirc client

Top
#126556 - 11/10/05 09:14 PM Re: Get proxy list
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
Then you must be using a really old mIRC version, where these commands don't exist yet.

The file handling commands were introduced in mIRC v6.1.

Any version beneath that won't work.

You can find out your version by typing this in mIRC: //echo -a $version

You'll need to update your client in order for the script to work, or I could modify it to use another approach instead of the file handling commands.
_________________________
Gone.

Top
#126557 - 12/10/05 03:08 AM Re: Get proxy list
yah Offline
Nutrimatic drinks dispenser

Registered: 08/10/05
Posts: 8
sorry! i am using version 6.03. can you modify it to use another approach instead of the file handling commands?

Top
#126558 - 12/10/05 03:15 AM Re: Get proxy list
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
Code:
alias getproxies {
  window -h @gprox
  clear @gprox
  sockclose gprox
  sockopen gprox proxycn.net 80
  echo $color(info) -a * Retrieving proxy list...
}
 [color:red]  [/color] 
on *:sockopen:gprox:{
  if ($sockerr) { 
    echo $color(info) -a * /getproxies: error opening socket 
    window -c @gprox
    return 
  }
  var %s = sockwrite -n gprox
  %s GET /proxy_irc/page1.htm HTTP/1.1
  %s Host: www.proxycn.net $str($crlf,2)
}
 [color:red]  [/color] 
on *:sockread:gprox:{
  if ($sockerr) return
  var %a, %token
  sockread %a
  while ($sockbr) {
    %token = $remove($gettok(%a,1,32),&lt;/td&gt;)
    if (*.*.*.* iswm %token) sockmark gprox %token
    elseif (%token isnum) &amp;&amp; ($sock(gprox).mark) {
      sockmark gprox $ifmatch %token
    }
    elseif (%token isalpha) &amp;&amp; ($isupper(%token)) {
      aline @gprox $sock(gprox).mark %token
      sockmark gprox
    }
    sockread %a
  }
}
 [color:red]  [/color] 
on *:sockclose:gprox:{
  savebuf @gprox proxylist.txt
  window -c @gprox
  echo $color(info) -a * /getproxies: finished retrieving proxies
}
_________________________
Gone.

Top