General mIRC scripts

Here you will find posts that were of interest and have been placed into this forum for information purposes...
Post Reply
User avatar
pizzahut
Extraordinary Gentleman
Posts: 1210
Joined: Fri Sep 17, 2004 1:25 am

General mIRC scripts

Post by pizzahut »

Coloured nicks

I made a script which assigns nick colours, so it's easier to track what a particular person said.

If you don't like a nick / colour combination, it can be edited by pressing Alt+B (mIRC address book, nick colours). Also available via the Tools menu.

Code: Select all

; coloured nicks
on ^*:text:*:#:{
  if (($cnick($nick).color == $color(Normal)) || ($cnick($nick).color == $color(Background))) {
    var %colour $rand(0,15)
    while ((%colour == $color(Normal)) || (%colour == $color(Background)))  {
      var %colour $rand(0,15)
    }
    cnick $nick %colour
  }
}
If you want the whole line to be coloured:

Code: Select all

; coloured lines
on ^*:text:*:#:{
  if (($cnick($nick).color == $color(Normal)) || ($cnick($nick).color == $color(Background))) {
    var %colour $rand(0,15)
    while ((%colour == $color(Normal)) || (%colour == $color(Background)))  {
      var %colour $rand(0,15)
    }
    cnick $nick %colour
  }
  echo $cnick($nick).color # $timestamp < $+ $nick $+ > $1-
  haltdef
}
on ^*:action:*:#:{
  if (($cnick($nick).color == $color(Normal)) || ($cnick($nick).color == $color(Background))) {
    var %colour $rand(0,15)
    while ((%colour == $color(Normal)) || (%colour == $color(Background)))  {
      var %colour $rand(0,15)
    }
    cnick $nick %colour
  }
  echo $cnick($nick).color # $timestamp * $nick $1-
  haltdef
}
User avatar
pizzahut
Extraordinary Gentleman
Posts: 1210
Joined: Fri Sep 17, 2004 1:25 am

Re: General mIRC scripts

Post by pizzahut »

Removing duplicate lines

Code: Select all

; no duplicate lines
on ^*:text:*:#:{
  if ((%spam_nick == $nick) && (%spam_msg == $1-)) {
    ;If you want to see the duplicate lines, uncomment this:
    ;echo 14 # $timestamp $nick $strip($1-)
    halt
  }
  else {
    set %spam_nick $nick
    set %spam_msg $1-
  }
}
on ^*:action:*:#:{
  if ((%spam_nick == $nick) && (%spam_msg == $1-)) {
    ;If you want to see the duplicate lines, uncomment this:
    ;echo 14 # $timestamp $nick $strip($1-)
    halt
  }
  else {
    set %spam_nick $nick
    set %spam_msg $1-
  }
}
It seems that there can be only one event with a ^ prefix per script, at least this was my experience. When I had more, only the 1st one was executed. So you either have to merge scripts which use this prefix, or put them into separate files.

Example for merged scripts:

Code: Select all

on ^*:text:*:#:{
  ; Coloured nicks
  if (($cnick($nick).color == $color(Normal)) || ($cnick($nick).color == $color(Background))) {
    var %colour $rand(0,15)
    while ((%colour == $color(Normal)) || (%colour == $color(Background)))  {
      var %colour $rand(0,15)
    }
    cnick $nick %colour
  }
  ; Remove duplicate lines
  if ((%spam_nick == $nick) && (%spam_msg == $1-)) {
    ;If you want to see the duplicate lines, uncomment this:
    ;echo 14 # $timestamp $nick $strip($1-)
    halt
  }
  else {
    set %spam_nick $nick
    set %spam_msg $1-
  }
}
on ^*:action:*:#:{
  ; Remove duplicate lines
  if ((%spam_nick == $nick) && (%spam_msg == $1-)) {
    ;If you want to see the duplicate lines, uncomment this:
    ;echo 14 # $timestamp $nick $strip($1-)
    halt
  }
  else {
    set %spam_nick $nick
    set %spam_msg $1-
  }
}
User avatar
pizzahut
Extraordinary Gentleman
Posts: 1210
Joined: Fri Sep 17, 2004 1:25 am

Re: General mIRC scripts

Post by pizzahut »

Joined hints for trivia

Added an anti-spam variable so it should be possible for several people to run the script at the same time.

Code: Select all

%joined_hints_enabled = yes

on *:text:Joined hints*:#:set -u10 %joined_hints_quiet yes
on *:text:Not printing joined hints*:#:set -u10 %joined_hints_quiet yes

alias check_status {
  if (%joined_hints_quiet != yes) {
    if (%joined_hints_enabled == yes) {
      msg # Joined hints are enabled, say !sjoined to stop joined hints from appearing.
    }
    else msg # Joined hints are disabled, say !joined to enable them.
  }
}

on *:text:!joined:#:{
  %joined_hints_enabled = yes
  check_status
}

on *:text:!sjoined:#:{
  %joined_hints_enabled = no
  check_status
}

on *:input:#:{
  if ($1- == !joined) {
    %joined_hints_enabled = yes
    check_status
  }
  if ($1- == !sjoined) {
    %joined_hints_enabled = no
    check_status
  }
}

on *:text:*Starting the trivia*:#:check_status

on *:text:*Here's your 1st hint*:#:%trivia1 = $mid($strip($1-),39)

on *:text:*Here's your 2nd hint*:#:{
  %trivia2 = $mid($strip($1-),23)
  var %i = 1
  while (%i <= $len(%trivia1)) {
    if (($mid(%trivia1,%i,1) == _) && ($mid(%trivia2,%i,1) != _)) {
      %trivia1 = $left(%trivia1,$calc(%i - 1)) $+ $mid(%trivia2,%i,1) $+ $mid(%trivia1,$calc(%i + 1))
    }
    inc %i
  }
  if ((%joined_hints_enabled == yes) && (%joined_hints_quiet != yes)) {
    if (_ isin %trivia1) msg # Joined hints: %trivia1
    else msg # Not printing joined hints because it's the full solution.
  }
}
User avatar
pizzahut
Extraordinary Gentleman
Posts: 1210
Joined: Fri Sep 17, 2004 1:25 am

Re: General mIRC scripts

Post by pizzahut »

Fixed a seen script I found on Google, might still contain bugs though.

Last update: 15.02.2014 03:29

Old, bugged script: http://www.hawkee.com/snippet/7191/

Fixed version:

Code: Select all

;; Knoeki's seen script. (C) 2010, All rights and/or wrongs reserved.
;; Use it, enjoy it, modify it, but don't pretend you did all the work.

on *:TEXT:*:#: {
  seen add $$address($nick, 5) $ctime talk $chan $network $1-
  if ($1 == !seen) msg $chan $seen(get, $2-)
}

on *:INPUT:#: {
  seen add $$address($me, 5) $ctime talk $chan $network $1-
  if ($1 == !seen) msg $chan $seen(get, $2-)
}

on *:ACTION:*:#: {
  seen add $$address($nick, 5) $ctime talk $chan $network $1-
}

on *:JOIN:#: {
  seen add $$address($nick, 5) $ctime join $chan $network
}

on *:PART:#: {
  seen add $+($nick,!,$address) $ctime part $chan $network $1-
}

on  *:QUIT: {
  seen add $+($nick,!,$address) $ctime quit irc $network $1-
}

on *:NICK: {
  seen add $+($nick,!,$address) $ctime nick irc $network $newnick
}

on *:KICK:#: {
  ; Can't use $address here because it refers to $nick (the kicker).
  seen add $$address($knick, 5) $ctime kick $chan $network $nick $1-
}

on *:TOPIC:#: {
  seen add $$address($nick, 5) $ctime topic $chan $network $2-
}

on *:START: {
  hmake -s seen 5000
  if ($file($scriptdirseen.txt) != $null) {
    hload seen $qt($scriptdirseen.txt)
  }
  timerseen.dump 0 60 hsave seen $qt($scriptdirseen.txt)
}

alias seen {
  if ($1 == add) {
    hadd -m seen $2-
  }
  if ($1 == get) {
    var %query $2
    if (%query == $null) {
      return Error: Insufficent parameters.
    }
    elseif ($len($remove(%query, $chr(42), $chr(63))) < 2) {
      return Error: Please use 2 or more non-wildcard characters in your query.
    }
    else {
      if ((! !isin %query) && (@ !isin %query)) {
        if (. isin %query) var %query $+(*!*@*,%query)
        else var %query $+(*,%query,*!*)
      }
      elseif ((! !isin %query) && (@ isin %query)) var %query $+(*!,%query)
      elseif ((! isin %query) && (@ !isin %query)) var %query $+(%query,@*)
      var %total $hfind(seen, %query, 0, w)
      if (%total == 0) {
        return No results for your query. $iif($chr(42) !isin %query, Try using wildcards.)
      }
      else {
        if (%total > 1) {
          window -aslh @seen.sort
          var %count 1
          while (%count <= %total) {
            var %current $hfind(seen, %query, %count, w)
            aline @seen.sort $gettok($hget(seen, %current), 1, 32) %current
            inc %count
          }
          var %query $gettok($line(@seen.sort, %total), 2, 32)
          window -c @seen.sort
        }
        tokenize 32 $hfind(seen, %query, 1, w) $hget(seen, $hfind(seen, %query, 1, w))
        if ($3 isin talk,part,quit,join) {
          return $1 was last seen $+($3,$iif($3 == quit,ting,ing)) $iif($3 == talk, on) $&
            $4 @ $+($5,$chr(44)) $duration($calc($ctime - $2)) ago. $iif($6- != $null, The $3 message was: $6-)
        }
        if ($3 == kick) {
          return $1 was last seen getting kicked from $4 @ $5 by $+($6,$chr(44)) $&
            $duration($calc($ctime - $2)) ago. The kick message was: $7-
        }
        if ($3 == nick) {
          return $1 was last seen changing their nick to $6 @ $+($5,$chr(44)) $&
            $duration($calc($ctime - $2)) ago.
        }
        if ($3 == topic) {
          return $1 was last seen changing the topic for $4 @ $+($5,$chr(44)) $&
            $duration($calc($ctime - $2)) ago. The new topic was: $6-
        }
        else {
          return Error: This isn't supposed to happen.
        }
      }
    }
  }
  else {
    return Invalid request.
  }
}
User avatar
pizzahut
Extraordinary Gentleman
Posts: 1210
Joined: Fri Sep 17, 2004 1:25 am

Re: General mIRC scripts

Post by pizzahut »

Anti-spam script - mute for repetition spam. There's one major difference from the script above which removes duplicate lines: The script for repetition spam stores the last chat line *for each nick*, while the duplicate lines script just stores one line in total.

Last updated 15.02.2014 03:21 CET

Code: Select all

; Based on BlueThen's Anti-Repeat http://www.hawkee.com/snippet/4150/
alias anti_repeat {
  if ((bot !isin $nick) && ($nick !isop #) && ($me isop #) && ($nick isvoice #) && (m isin $chan(#).mode)) {
    var %warns
    if ($readini(logs.ini,$nick,last) == $1-) {
      %warns = $readini(logs.ini,$nick,warns)
      inc %warns
      if (%warns >= 2) {
        mode # -v $nick
        notice $nick Your voice has been temporarily removed because of repetition spam.
        timer 1 30 mode # +v $nick
        %warns = 0
      } 
    }
    else %warns = 0
    writeini -n logs.ini $nick last $1-
    writeini -n logs.ini $nick warns %warns
  }
}
on ^*:action:*:#:anti_repeat $1-
on ^*:text:*:#:anti_repeat $1-
User avatar
pizzahut
Extraordinary Gentleman
Posts: 1210
Joined: Fri Sep 17, 2004 1:25 am

Re: General mIRC scripts

Post by pizzahut »

- Changed the seen script so it only gives one result when several match.

- Also made it a bit more convenient by automatically adding * around the nick. So instead of

!seen ^lycosbot^

you can type

!seen lycosbot

- And as previously noted, chat/quit messages will now be shown.

EDIT:

- Optimised the code of the anti-repeat, added credits.

- Made domain search for the seen script more comfortable. You can now do e.g. !seen example.com instead of !seen *!*@*example.com .
Spanky
innocent choirboy
Posts: 230
Joined: Mon Aug 01, 2011 1:12 am

Re: General mIRC scripts

Post by Spanky »

Wow, you've been a busy boy! Thank you Mr. Pizza. DONE
User avatar
pizzahut
Extraordinary Gentleman
Posts: 1210
Joined: Fri Sep 17, 2004 1:25 am

Re: General mIRC scripts

Post by pizzahut »

Alternative script for coloured nicks

Monitors only one channel, not sure how well it would work if you apply it to several channels.

Action and nick change events are halted in order to colour the nicks for these events. This may interfere with other scripts. If your nick is used in an action (e.g. you're slapped) then the event isn't halted though.

Colours are adjusted when two people with the same nick colour chat at the same time.

Colours aren't assigned randomly but in order. When all colours are used up it starts with the first colour again.

Colour list is cleared when mIRC starts.

Edit 2014-03-30: Added a check in action event so it doesn't echo to channel if another script already halted this event. It's best to load this script last!

Code: Select all

; Coloured nicks

; To do:
; - On colour change, use a colour which hasn't been used recently.

on *:start:{
  set %last_nick xxx
  set %next_colour 0
  var %i $cnick(0)
  while (%i) {
    cnick -r $cnick(%i)
    dec %i
  }
}

on ^*:action:*:#roystonvasey,#TheLegionEffect:{
  if ((bot !isin $nick) && ($ial($nick) != $null)) {
    change_colour
    if (!$halted) {
      echo # $timestamp * $+ $cnick($nick).color $nick $+  $1-
      halt
    }
  }
}

on ^*:text:*:#roystonvasey,#TheLegionEffect:if ((bot !isin $nick) && ($ial($nick) != $null)) change_colour

alias change_colour {
  if ($ial($nick) == $null) halt
  var %colour $cnick($nick).color
  var %time $ctime
  while ((%colour == $color(Normal)) || (%colour == $color(Background)) $&
    || (($nick != %last_nick) && (%colour == $cnick(%last_nick).color) && (%last_nick ison $chan)))  {
    var %colour %next_colour
    set %next_colour $calc((%next_colour + 1) % 16)
    if ($calc($ctime - %time) > 1) {
      echo -a Script halted in alias change_colour!
      echo -d Script halted in alias change_colour!
      echo -s Script halted in alias change_colour!
      halt
    }
  }
  if (%colour != $cnick($nick).color) {
    echo -s cnick $mask($ial($nick),0) %colour
    cnick $mask($ial($nick),0) %colour
  }
  set %last_nick $nick
}
User avatar
pizzahut
Extraordinary Gentleman
Posts: 1210
Joined: Fri Sep 17, 2004 1:25 am

Re: General mIRC scripts

Post by pizzahut »

Spam filter and other action/text related manipulation

Code: Select all

on ^*:action:*:#:spam $1-
on ^*:text:*:#:spam $1-

alias -l myreplace {
  ; Replace all characters with stars.
  ;var %temp = $str(*,$len($1))
  ;%words = $replace(%words,$1,%temp)

  ; Spoiler v1 (background colour := text colour, partial matches)
  ;var %i = 1
  ;var %temp
  ;while (%i <= $len($1)) {
  ;  %temp = %temp $+ 01,01 $+ $mid($1,%i,1) $+ 
  ;  inc %i
  ;}
  ;%words = $replace(%words,$1,%temp)

  ; Spoiler v2 (background colour := text colour, word matches)
  var %temp1 = \b $+ $1 $+ \b
  var %temp2 = 1,1 $+ $1 $+ 
  %words = $regsubex(%words,%temp1,%temp2)
}

alias -l spam {
  if (!$halted) {
    if (rv-bot isin $nick) {

      ; IRC style join and quit colouring for rv-bot
      if ($1 == Join:) {
        echo # $timestamp < $+ $nick $+ >  $+ $color(Join) $+ $1-
        halt
      }
      if ($1 == Quit:) {
        echo # $timestamp < $+ $nick $+ >  $+ $color(Quit) $+ $1-
        halt
      }
    }
    else {

      ; Delete mp3 spam
      if (is listening to isin $1-) { halt }

      ; Censor dirty language
      var -g %words = $1-
      myreplace asshole
      myreplace arshloch
      myreplace cock
      myreplace cumming
      myreplace cum
      myreplace ejaculation
      myreplace fuck
      myreplace jerking
      myreplace masterbate
      myreplace masturbate
      myreplace masturbation
      myreplace masterbating
      myreplace rape
      myreplace raping
      myreplace rapist
      myreplace retard
      myreplace wanker
      myreplace wank
      if (%words != $1-) {
        echo $chan $timestamp  $+ $cnick($nick).color $+ $nick $+ : %words
        halt
      }

      ; Shorten Youtube info
      if ($1 == 1,0You0,4Tube) {
        echo $chan $timestamp  $+ $cnick($nick).color $+ $nick $+ : $left($1-,$calc($pos($1-,10Views:4,1) - 1))
        halt
      }
      if (4Views: isin $1-) {
        echo $chan $timestamp  $+ $cnick($nick).color $+ $nick $+ : $left($1-,$calc($pos($1-,4Views:) - 3))
        halt
      }

      ; Silence away info
      if (is now away isin $1-) {
        echo $chan $timestamp  $+ $cnick($nick).color $+ $nick $+ : $1-
        halt
      }

      ; Shorten Fleur's spam
      if (($count($1-,a,e,i,o,u) < 10) && ($calc($len($nick) + $len($1-)) > 67)) {
        echo $chan $timestamp  $+ $cnick($nick).color $+ $nick $+ : $left($1-,$calc(67 - $len($nick)))
        halt
      }
    }
  }
}
User avatar
pizzahut
Extraordinary Gentleman
Posts: 1210
Joined: Fri Sep 17, 2004 1:25 am

Re: General mIRC scripts

Post by pizzahut »

"hi" script - to say hi and nn when you aren't there.

Replace "pizza" with your own nick's abbreviation.

Code: Select all

on *:NICK:{
  if ((%hi_quiet == 1) || ($nick(#roystonvasey,$newnick) == $null)) halt
  var %lo = $len($nick)
  var %ln = $len($newnick)
  if ((%ln > %lo) && ($pos($newnick,$nick,1) == 1)) {
    var %diff = $right($newnick,$calc(%ln - %lo))
    if ((%diff == sleep) || ($pos(%diff,z,0) == $len(%diff))) {
      msg #roystonvasey good night $newnick
      set -u60 %hi_quiet 1
      .timer 1 0 echo #roystonvasey $timestamp The hi script is now quiet for 1m.
    }
  }
}

on *:TEXT:*:#:{
  if (%hi_quiet == 1) halt
  if (($1 == hi) && (($2 == $me) || ($2 == pizza))) {
    msg # hello $nick
    set -u1 %hi_quiet 1
  }
  if (($1 == hello) && (($2 == $me) || ($2 == pizza))) {
    msg # hi $nick
    set -u1 %hi_quiet 1
  }
  if (($1 == hiya) && (($2 == $me) || ($2 == pizza))) {
    msg # heyo $nick
    set -u1 %hi_quiet 1
  }
  if (($1 == heyo) && (($2 == $me) || ($2 == pizza))) {
    msg # hiya $nick
    set -u1 %hi_quiet 1
  }
  if (($1 == hihi) && (($2 == $me) || ($2 == pizza))) {
    msg # howdy $nick
    set -u1 %hi_quiet 1
  }
  if (($1 == howdy) && (($2 == $me) || ($2 == pizza))) {
    msg # hihi $nick
    set -u1 %hi_quiet 1
  }
  if (($1 == good) && (($2 == morning) || ($2 == afternoon) $&
    || ($2 == evening) || ($2 == day)) && (($3 == $me) || ($3 == pizza))) {
    var %h = $asctime(H)
    if (kat !isin $nick) {
      if ((%h >= 6) && (%h <= 11)) msg # good morning $nick
      if ((%h >= 12) && (%h <= 17)) msg # good afternoon $nick
      if ((%h >= 18) && (%h <= 23)) msg # good evening $nick
      if ((%h >= 0) && (%h <= 5)) msg # good evening $nick
    }
    if (kat isin $nick) {
      if ((%h >= 6) && (%h <= 11)) msg # good evening $nick
      if ((%h >= 12) && (%h <= 17)) msg # good evening $nick
      if ((%h >= 18) && (%h <= 23)) msg # good morning $nick
      if ((%h >= 0) && (%h <= 5)) msg # good afternoon $nick
    }
    set -u1 %hi_quiet 1
  }
  if ($0 < 2) {
    var %count = 0
  }
  else {
    var %count = $count($2,a,b,e,i,o,u)
  }
  if (($1- == nn) || (nn all isin $1-) || (nite nite all isin $1-) || (($1 == nn) && (%count == 0))) {
    msg # good night $nick
    set -u60 %hi_quiet 1
    .timer 1 0 echo # $timestamp The hi script is now quiet for 1m.
  }
  if (($1 == hi) && (%count == 0)) {
    msg # hello $nick
    set -u60 %hi_quiet 1
    .timer 1 0 echo # $timestamp The hi script is now quiet for 1m.
  }
  if (($1 == hello) && (%count == 0)) {
    msg # hi $nick
    set -u60 %hi_quiet 1
    .timer 1 0 echo # $timestamp The hi script is now quiet for 1m.
  }
  if (($1 == hiya) && (%count == 0)) {
    msg # heyo $nick
    set -u60 %hi_quiet 1
    .timer 1 0 echo # $timestamp The hi script is now quiet for 1m.
  }
  if (($1 == heyo) && (%count == 0)) {
    msg # hiya $nick
    set -u60 %hi_quiet 1
    .timer 1 0 echo # $timestamp The hi script is now quiet for 1m.
  }
  if (($1 == hihi) && (%count == 0)) {
    msg # howdy $nick
    set -u60 %hi_quiet 1
    .timer 1 0 echo # $timestamp The hi script is now quiet for 1m.
  }
  if (($1 == howdy) && (%count == 0)) {
    msg # hihi $nick
    set -u60 %hi_quiet 1
    .timer 1 0 echo # $timestamp The hi script is now quiet for 1m.
  }
}

on *:INPUT:#:{
  if (($1 == hi) || ($1 == hello) || ($1 == hiya) || ($1 == heyo) || ($1 == hihi) || ($1 == howdy) || ($1 == good)) {
    set -u60 %hi_quiet 1
    .timer 1 0 echo # $timestamp The hi script is now quiet for 1m.
  }
}
Last edited by pizzahut on Mon Feb 29, 2016 10:23 pm, edited 2 times in total.
User avatar
pizzahut
Extraordinary Gentleman
Posts: 1210
Joined: Fri Sep 17, 2004 1:25 am

Re: General mIRC scripts

Post by pizzahut »

URL info

Butchered the original script, so if you're a scripter you may want to have a look at the original, too.
Developer: Spoofing / Voglea
Date Added: Jun 03, 2010
Download mirror for the original script: http://rv.apg-clan.org/dlds/mirc_scripts/urlinf.zip

Modified script:

Code: Select all

alias -l simulate_text {
  var %id = $ticks, %scheme, %user, %pass, %ssl = $false, %address = $1, %request = /
  if ($pos(%address,://)) {
    var %address = $mid(%address,$calc($v1 + 3))
    if ($v1 > 1) {
      var %scheme = $mid($1,1,$calc($v1 - 1))
      if (*s iswm %scheme) var %ssl = $true, %scheme = $left(%scheme,-1)
    }
  }
  if ($pos(%address,/)) var %request = $gettok($mid(%address,$v1),1,35)
  var %address = $gettok(%address,1,47)
  if (*?:?*@* iswm %address) {
    var %user = $gettok(%address,1,58)
    var %pass = $gettok($gettok(%address,2,58),1,64)
  }
  if ($pos(%address,@)) var %address = $mid(%address,$calc($v1 + 1))
  var %host = $gettok(%address,1,58)
  if (www.* iswm %host) var %scheme = http
  elseif (ftp.* iswm %host) var %scheme = ftp
  elseif (irc.* iswm %host) var %scheme = irc
  var %port = $gettok(%address,2,58)
  if (%scheme == http) {
    if ($sock($+(urlinf.,%scheme,.,%id))) {
      echo 4 -a sc01
      sockclose $v1
      halt
    }
    sockopen $iif(%ssl,-e) $+(urlinf.,%scheme,.,%id) $urlinf.idna(%host) $iif(%port isnum,$v1,$iif(%ssl,443,80))
    sockmark $+(urlinf.,%scheme,.,%id) $ticks $ctime $2 $3 $4 $gettok($ial($4),2,$asc(!)) $+(%user,:,%pass) $urlinf.urlencode($utfencode(%request))
  }
}

alias urlinf.depositfiles {
  if ($sock($1).addr == depositfiles.com) {
    if ($prop == sockopen) {
      if (*/files/?* iswm $gettok($sock($1).mark,8,32)) {
        if (/?*/files/?* iswm $v2) sockwrite -n $1 POST $+(/ru/,$gettok($v2,2-,47)) HTTP/1.0
        else sockwrite -n $1 POST $+(/ru,$gettok($sock($1).mark,8,32)) HTTP/1.0
        sockwrite -n $1 Content-Type: application/x-www-form-urlencoded
        sockwrite -n $1 Content-Length: 16
        sockwrite -n $1 Host: $sock($1).addr
        sockwrite -n $1
        sockwrite -n $1 gateway_result=1
        return $sock($1).sent
      }
    }
    if ($hget(urlinf.sockets,$1,$+(&,$1)) = 0) return
    var %offset = $bfind($+(&,$1),1,13 10 13 10), %name, %size, %link
    if ($prop == name) {
      if ($bfind($+(&,$1),%offset,<b title=")) {
        var %> = $bfind($+(&,$1),$v1,>) + 1, %name = $bvar($+(&,$1),%>,$calc($bfind($+(&,$1),%>,<) - %>)).text
        if ($isutf(%name)) var %name = $utfdecode(%name)
      }
      return %name
    }
    if ($prop == size) {
      if ($bfind($+(&,$1),%offset,<span class="nowrap">)) var %> = $bfind($+(&,$1),$v1,<b>) + 3, %size = $replace($bvar($+(&,$1),%>,$calc($bfind($+(&,$1),%>,<) - %>)).text,&nbsp;,$chr(32))
      return %size
    }
    if ($prop == link) {
      if ($bfind($+(&,$1),%offset,id="download_url")) {
        if ($bfind($+(&,$1),$v1,<form action=")) var %" = $bfind($+(&,$1),$v1,") + 1, %link = $bvar($+(&,$1),%",$calc($bfind($+(&,$1),%",") - %")).text
      }
      return %link
    }
    if ($bfind($+(&,$1),%offset,class="no_download_msg">)) return no_download_msg
    if (*/files/?* iswm $gettok($sock($1).mark,8,32)) return $bvar($+(&,$1),0)
  }
}
alias urlinf.bashorg {
  if ($sock($1).addr == www.bash.org.ru) || ($sock($1).addr == bash.org.ru) {
    if ($hget(urlinf.sockets,$1,$+(&,$1)) = 0) return
    var %offset = $bfind($+(&,$1),1,13 10 13 10), %quote
    if ($prop == quote) {
      if ($bfind($+(&,$1),%offset,<div>)) {
        var %div = $v1 + 5
        if ($bfind($+(&,$1),%div,</div>)) return $bvar($+(&,$1),%div,$calc($v1 - %div)).text
      }
      return
    }
    return %offset
  }
}
alias urlinf.youtube {
  return
  if ($sock($1).addr == www.youtube.com) || ($sock($1).addr == youtube.com) {
    if ($hget(urlinf.sockets,$1,$+(&,$1)) = 0) return
    var %offset = $bfind($+(&,$1),1,13 10 13 10), %request = $gettok($sock($1).mark,8,32)
    if (/watch?v=?* iswm %request) {
      var %title, %author, %date, %duration = 0, %view = 0, %rate = 0, %rates = 0, %download
      if ($prop == title) {
        if ($bfind($+(&,$1),%offset,'VIDEO_TITLE':)) {
          var %' = $bfind($+(&,$1),$calc($v1 + 14),') + 1, %title = $bvar($+(&,$1),%',$calc($bfind($+(&,$1),%',') - %')).text
          if ($isutf(%title)) var %title = $utfdecode(%title)
        }
        return %title
      }
      if ($prop == author) {
        if ($bfind($+(&,$1),%offset,href="/user/)) var %/ = $bfind($+(&,$1),$calc($v1 + 10),/) + 1, %author = $bvar($+(&,$1),%/,$calc($bfind($+(&,$1),%/,") - %/)).text
        return %author
      }
      if ($prop == date) {
        if ($bfind($+(&,$1),%offset,post-date">)) var %> = $bfind($+(&,$1),$v1,>) + 1, %date = $bvar($+(&,$1),%>,$calc($bfind($+(&,$1),%>,<) - %>)).text
        return %date
      }
      if ($prop == duration) {
        if ($bfind($+(&,$1),%offset,"length_seconds":)) var %" = $bfind($+(&,$1),$calc($v1 + 18),") + 1, %duration = $bvar($+(&,$1),%",$calc($bfind($+(&,$1),%",") - %")).text
        return %duration
      }
      if ($prop == view) {
        if ($bfind($+(&,$1),%offset,watch-view-count">)) var %> = $bfind($+(&,$1),$v1,>) + 1, %view = $bvar($+(&,$1),%>,$calc($bfind($+(&,$1),%>,<) - %>)).text
        return %view
      }
      if ($prop == rate) {
        if ($bfind($+(&,$1),%offset,ratingL-)) var %- = $bfind($+(&,$1),$v1,-) + 1, %rate = $bvar($+(&,$1),%-,$calc($bfind($+(&,$1),%-,") - %-)).text
        return %rate
      }
      if ($prop == rates) {
        if ($bfind($+(&,$1),%offset,ratingL-)) var %- = $bfind($+(&,$1),$v1,-) + 1, %: = $bfind($+(&,$1),%-,:) + 2, %rates = $bvar($+(&,$1),%:,$calc($bfind($+(&,$1),%:,<) - %:)).text
        return %rates
      }
      if ($prop == download) {
        if ($bfind($+(&,$1),%offset,"fmt_url_map":)) {
          var %" = $bfind($+(&,$1),$calc($v1 + 15),") + 1, %i = 255, %download = $bvar($+(&,$1),%",$calc($bfind($+(&,$1),%",") - %")).text
          while (%i) var %download = $replace(%download,$+(%,$base(%i,10,16,2)),$chr(%i)), %i = %i - 1
        }
        return $gettok($gettok(%download,2,124),1,44)
      }
      return $bvar($+(&,$1),0)
    }
  }
}
alias urlinf.tinyurl {
  if ($sock($1).addr == tinyurl.com) || ($sock($1).addr == www.tinyurl.com) {
    if ($hget(urlinf.sockets,$1,$+(&,$1)) = 0) return
    var %offset = $bfind($+(&,$1),1,13 10 13 10), %request = $gettok($sock($1).mark,8,32)
    if ($prop == redirect) {
      if ($bfind($+(&,$1),1,Location:)) && ($v1 < %offset) return $bvar($+(&,$1),$calc($v1 + 10),$calc($bfind($+(&,$1),$v1,13 10) - $v1 - 10)).text
      return
    }
    if ($prop == error) {
      if ($bfind($+(&,$1),%offset,<br />)) {
        var %offset = $v1
        if ($bfind($+(&,$1),%offset,</h1)) {
          var %h1 = $bfind($+(&,$1),%offset,<h1) + 4
          return $bvar($+(&,$1),%h1,$calc($v1 - %h1)).text
        }
      }
      return
    }
    if (/#* iswm %request) || (. isin %request) return
    return $bvar($+(&,$1),0)
  }
}
alias urlinf.txt {
  if ($hget(urlinf.sockets,$1,$+(&,$1)) = 0) return
  if ($bfind($+(&,$1),1,13 10 13 10 239 187 191)) return UTF-8
  if ($bfind($+(&,$1),1,13 10 13 10 255 254)) return UTF-16 Little Endian
  if ($bfind($+(&,$1),1,13 10 13 10 254 255)) return UTF-16 Big Endian
  if ($bfind($+(&,$1),1,13 10 13 10 255 254 0 0)) return UTF-32 Little Endian
  if ($bfind($+(&,$1),1,13 10 13 10 0 0 254 255)) return UTF-32 Big Endian
}
alias urlinf.jpeg {
  if ($hget(urlinf.sockets,$1,$+(&,$1)) = 0) return
  var %offset = $bfind($+(&,$1),1,13 10 13 10) + 4, %dimensions, %i = 1, %exif
  if ($prop == dimensions) {
    if ($sock($1).rcvd > $calc(32 * 1024)) || ($bvar($+(&,$1),$calc($sock($1).rcvd - 1),2) == 255 217) {
      while ($bfind($+(&,$1),%offset,255)) {
        var %offset = $v1 + 1
        if ($bvar($+(&,$1),%offset,1) isnum 192-195) var %dimensions = %offset
      }
    }
    return %dimensions
  }
  if ($prop == width) return $base($+($base($bvar($+(&,$1),$calc($2 + 6),1),10,16,2),$base($bvar($+(&,$1),$calc($2 + 7),1),10,16,2)),16,10)
  if ($prop == height) return $base($+($base($bvar($+(&,$1),$calc($2 + 4),1),10,16,2),$base($bvar($+(&,$1),$calc($2 + 5),1),10,16,2)),16,10)
  if ($prop == exif) {
    return
    while ($bfind($+(&,$1),%i,0)) {
      var %i = $v1 + 1, %data = $bvar($+(&,$1),%i,$calc($bfind($+(&,$1),%i,0) - %i)).text
      while ($left(%data,1)) && ($v1 !isalnum) var %data = $right(%data,-1)
      while ($right(%data,1)) && ($v1 !isalnum) var %data = $left(%data,-1)
      if (%data == Ducky) || (%data == Adobe) || (%data == JFIF) || (%data == Exif) continue
      if ($len(%data) > 3) {
        var %data = $urlinf.char(%data)
        if ($remove(%data,:,.,-,$chr(32),$chr(44)) isalnum) var %exif = %exif $+ ; %data
        if ($numtok(%data,59) > 3) || (*:*:* iswm %data) return $mid(%exif,2)
      }
    }
  }
  return $bfind($+(&,$1),1,13 10 13 10 255 216 255)
}
alias urlinf.gif {
  if ($hget(urlinf.sockets,$1,$+(&,$1)) = 0) return
  var %offset = $bfind($+(&,$1),1,13 10 13 10) + 4
  if ($prop == dimensions) {
    if ($bfind($+(&,$1),1,13 10 13 10 71 73 70 56 57 97)) return $v1
    if ($bfind($+(&,$1),1,13 10 13 10 71 73 70 56 55 97)) return $v1
  }
  if ($prop == width) return $base($+($base($bvar($+(&,$1),$calc(%offset + 7),1),10,16,2),$base($bvar($+(&,$1),$calc(%offset + 6),1),10,16,2)),16,10)
  if ($prop == height) return $base($+($base($bvar($+(&,$1),$calc(%offset + 9),1),10,16,2),$base($bvar($+(&,$1),$calc(%offset + 8),1),10,16,2)),16,10)
  return $bfind($+(&,$1),1,13 10 13 10 71 73 70)
}
alias urlinf.png {
  if ($hget(urlinf.sockets,$1,$+(&,$1)) = 0) return
  var %offset = $bfind($+(&,$1),1,13 10 13 10) + 4
  if ($prop == dimensions) {
    if ($bfind($+(&,$1),%offset,73 72 68 82)) return $v1
  }
  if ($prop == width) return $base($+($base($bvar($+(&,$1),$calc($2 + 4),1),10,16,2),$base($bvar($+(&,$1),$calc($2 + 5),1),10,16,2),$base($bvar($+(&,$1),$calc($2 + 6),1),10,16,2),$base($bvar($+(&,$1),$calc($2 + 7),1),10,16,2)),16,10)
  if ($prop == height) return $base($+($base($bvar($+(&,$1),$calc($2 + 8),1),10,16,2),$base($bvar($+(&,$1),$calc($2 + 9),1),10,16,2),$base($bvar($+(&,$1),$calc($2 + 10),1),10,16,2),$base($bvar($+(&,$1),$calc($2 + 11),1),10,16,2)),16,10)
  return $bfind($+(&,$1),1,13 10 13 10 137 80 78 71 13 10 26 10)
}
alias doublelong {
  tokenize 32 $1
  var %doublelong = $base($+($base($1,10,16,2),$base($2,10,16,2),$base($3,10,16,2),$base($4,10,16,2),$base($5,10,16,2),$base($6,10,16,2),$base($7,10,16,2),$base($8,10,16,2)),16,2,64)
  return $+($iif($left(%doublelong,1),-),$calc($base($+(1.,$right(%doublelong,52)),2,10) * 2 ^ ($base($mid(%doublelong,2,11),2,10) - 1023)))
}
alias urlinf.flv {
  if ($hget(urlinf.sockets,$1,$+(&,$1)) = 0) return
  var %offset = $bfind($+(&,$1),1,13 10 13 10) + 4
  if ($prop) return $doublelong($bvar($+(&,$1),$calc($bfind($+(&,$1),%offset,$prop) + $len($prop) + 1),8))
  return $bfind($+(&,$1),1,13 10 13 10 70 76 86)
}
alias urlinf.char {
  var %i = 32, %str = $1
  while (%i) var %str = $replace(%str,$chr(%i),$chr(32)), %i = %i - 1
  return %str
}
alias urlinf.unicode {
  if ($1 < 128) return $chr($1)
  if ($1 < 2048) return $+($chr($calc(192 + $int($calc($1 / 64)))),$chr($calc(128 + ($1 % 64))))
  if ($1 < 65536) return $+($chr($calc(224 + $int($calc($1 / 4096)))),$chr($calc(128 + ($int($calc($1 / 64)) % 64))),$chr($calc(128 + ($1 % 64))))
  if ($1 < 2097152) return $+($chr($calc(240 + $int($calc($1 / 262144)))),$chr($calc(128 + ($int($calc($1 / 4096)) % 64))),$chr($calc(128 + ($int($calc($1 / 64)) % 64))),$chr($calc(128 + ($1 % 64))))
  return ?
}
alias urlinf.win2koi return $replacex($1,à,Þ,á,À,â,Á,ã,Ö,ä,Ä,å,Å,¸,Å,æ,Ô,ç,Ã,è,Õ,é,È,ê,É,ë,Ê,ì,Ë,í,Ì,î,Í,ï,Î,ð,Ï,ñ,ß,ò,Ð,ó,Ñ,ô,Ò,õ,Ó,ö,Æ,÷,Â,ø,Ü,ù,Û,ý,Ù,û,Ø,þ,×,ÿ,Ú,ú,Ç,ü,Ý)
alias urlinf.koi2win return $replacex($1,Þ,à,À,á,Á,â,Ö,ã,Ä,ä,Å,å,Ô,æ,Ã,ç,Õ,è,È,é,É,ê,Ê,ë,Ë,ì,Ì,í,Í,î,Î,ï,Ï,ð,ß,ñ,Ð,ò,Ñ,ó,Ò,ô,Ó,õ,Æ,ö,Â,÷,Ü,ø,Û,ù,Ù,ý,Ø,û,×,þ,Ú,ÿ,Ç,ú,Ý,ü)
alias urlinf.html {
  var %str = $remove($1,><,> <)
  while (<![*[*]]> iswm %str) var %str = $mid(%str,$calc($pos(%str,[,2) + 1),-3)
  while ($pos(%str,<)) var %str = $remove(%str,$mid(%str,$v1,$calc($pos(%str,>) - $v1 + 1)))
  if (*&#*;* iswm %str) var %str = $regsubex(%str,/&#(\d+?);/g,$urlinf.unicode(\1))
  return $replacex(%str,&,&,&mdash;,-,",",<,<,>,>,&laquo;,<<,&raquo;,>>,&bull;,*,&nbsp;,$chr(32))
}
alias urlinf.idna {
  if ($lof(dlls/idna.dll)) return $dll(dlls/idna.dll,encode,$1)
  return $1
}
alias urlinf.space {
  tokenize 32 $1
  return $1-
}
alias urlinf.urlencode {
  var %i = 128, %str = $1
  while (%i <= 255) var %str = $replace(%str,$chr(%i),$+(%,$base(%i,10,16,2))), %i = %i + 1
  return %str
}
alias urlinf.urldecode {
  var %i = 255, %str = $1
  while (%i) var %str = $replace(%str,$+(%,$base(%i,10,16,2)),$chr(%i)), %i = %i - 1
  return %str
}
alias urlinf.size {
  return $bytes($1).suf
}
alias urlinf.database {
  if ($1 == load) {
    if ($lof(channels/urlinf.txt)) {
      if ($fopen(urlinf)) .fclose $v1
      .fopen urlinf channels/urlinf.txt
      while (!$feof) {
        var %read = $fread(urlinf)
        if (* iswm %read) {
          var %database = $mid($v2,2,-1)
          if ($hget(%database)) hdel -w %database *
          else hmake %database
        }
        else if ((%database != $null) && (%read != $null)) hadd %database %read
      }
      .fclose urlinf
    }
  }
  elseif ($1 == save) {
    if ($fopen(urlinf)) .fclose $v1
    .fopen -no urlinf channels/urlinf.txt
    var %i = 1
    while ($hget(%i)) {
      var %database = $v1, %o = 1, %i = %i + 1
      if (urlinf* iswm %database) {
        .fwrite -n urlinf $+(,%database,)
        while ($hget(%database,%o).item) {
          .fwrite -n urlinf $v1 $hget(%database,$v1)
          inc %o
        }
      }
    }
    .fclose urlinf
  }
}
on *:START: {
  urlinf.database load
  if ($hget(urlinf,created)) return
  hmake urlinf
  hmake urlinf.sockets
  hadd urlinf created $ctime
  urlinf.database save
}
on *:input:#APG-BattleFortress,#roystonvasey,#roystonvasey-breakfastclub,#tfm.priv,#pizza.test: {
  var %temp = $1-
  if (i.imgur.com isin %temp) {
    %temp = $replace(%temp,i.imgur.com,imgur.com)
    %temp = $remove(%temp,.jpg,.gif,.png)
  }
  ;if (https isin %temp) {
  ;  %temp = $replace(%temp,https,http)
  ;}
  tokenize 32 $strip(%temp)
  while ($0) {
    var %id = $ticks, %scheme, %user, %pass, %ssl = $false, %address = $1, %request = /
    if ($pos(%address,://)) {
      var %address = $mid(%address,$calc($v1 + 3))
      if ($v1 > 1) {
        var %scheme = $mid($1,1,$calc($v1 - 1))
        if (*s iswm %scheme) var %ssl = $true, %scheme = $left(%scheme,-1)
      }
    }
    if ($pos(%address,/)) var %request = $gettok($mid(%address,$v1),1,35)
    var %address = $gettok(%address,1,47)
    if (*?:?*@* iswm %address) {
      var %user = $gettok(%address,1,58)
      var %pass = $gettok($gettok(%address,2,58),1,64)
    }
    if ($pos(%address,@)) var %address = $mid(%address,$calc($v1 + 1))
    var %host = $gettok(%address,1,58)
    if (www.* iswm %host) var %scheme = http
    elseif (ftp.* iswm %host) var %scheme = ftp
    elseif (irc.* iswm %host) var %scheme = irc
    var %port = $gettok(%address,2,58)
    if (%scheme == http) {
      if ($sock($+(urlinf.,%scheme,.,%id))) {
        echo 4 -a sc02
        sockclose $v1
        halt
      }
      sockopen $iif(%ssl,-e) $+(urlinf.,%scheme,.,%id) $urlinf.idna(%host) $iif(%port isnum,$v1,$iif(%ssl,443,80))
      sockmark $+(urlinf.,%scheme,.,%id) $ticks $ctime $network # $me $gettok($ial($me),2,$asc(!)) $+(%user,:,%pass) $urlinf.urlencode($utfencode(%request))
    }
    tokenize 32 $2-
  }
}
on *:TEXT:*:#APG-BattleFortress,#roystonvasey,#roystonvasey-breakfastclub,#tfm.priv,#pizza.test: {
  if (bot isin $nick) halt
  if (b0t isin $nick) halt
  ;if ((/192.168. isin $1-) || (/localhost isin $1-) || (/127. isin $1-) || $&
  ;  (@192.168. isin $1-) || (@localhost isin $1-) || (@127. isin $1-) || $&
  ;  (.box isin $1-)) {
  ;  msg # nope.avi
  ;  halt
  ;}
  var %temp = $1-
  if (i.imgur.com isin %temp) {
    %temp = $replace(%temp,i.imgur.com,imgur.com)
    %temp = $remove(%temp,.jpg,.gif,.png)
  }
  ;if (https isin %temp) {
  ;  %temp = $replace(%temp,https,http)
  ;}
  tokenize 32 $strip(%temp)
  while ($0) {
    var %id = $ticks, %scheme, %user, %pass, %ssl = $false, %address = $1, %request = /
    if ($pos(%address,://)) {
      var %address = $mid(%address,$calc($v1 + 3))
      if ($v1 > 1) {
        var %scheme = $mid($1,1,$calc($v1 - 1))
        if (*s iswm %scheme) var %ssl = $true, %scheme = $left(%scheme,-1)
      }
    }
    if ($pos(%address,/)) var %request = $gettok($mid(%address,$v1),1,35)
    var %address = $gettok(%address,1,47)
    if (*?:?*@* iswm %address) {
      var %user = $gettok(%address,1,58)
      var %pass = $gettok($gettok(%address,2,58),1,64)
    }
    if ($pos(%address,@)) var %address = $mid(%address,$calc($v1 + 1))
    var %host = $gettok(%address,1,58)

    ; IPv6 isn't parsed properly, otherwise add " || (*::* iswm %host)".
    if ((192.168.* iswm %host) || (localhost == %host) || (127.* iswm %host) || (*.box iswm %host)) {
      msg # nope.avi
      halt
    }
    ;else echo # host: %host

    if (www.* iswm %host) var %scheme = http
    elseif (ftp.* iswm %host) var %scheme = ftp
    elseif (irc.* iswm %host) var %scheme = irc
    var %port = $gettok(%address,2,58)
    if (%scheme == http) {
      if ($sock($+(urlinf.,%scheme,.,%id))) {
        echo 4 -a sc03
        sockclose $v1
        halt
      }
      sockopen $iif(%ssl,-e) $+(urlinf.,%scheme,.,%id) $urlinf.idna(%host) $iif(%port isnum,$v1,$iif(%ssl,443,80))
      sockmark $+(urlinf.,%scheme,.,%id) $ticks $ctime $network # $nick $address $+(%user,:,%pass) $urlinf.urlencode($utfencode(%request))
    }
    tokenize 32 $2-
  }
}
on *:SOCKOPEN:urlinf.*: {
  tokenize 32 $sock($sockname).mark
  if ($sockerr) msg $4 $+([,$sock($sockname).addr,:,$sock($sockname).port,]) $sock($sockname).wsmsg
  elseif (urlinf.http.* iswm $sockname) {
    if ($urlinf.depositfiles($sockname).sockopen) return
    sockwrite -n $sockname GET $8 HTTP/1.0
    sockwrite -n $sockname User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
    sockwrite -n $sockname Host: $+($sock($sockname).addr,$iif($sock($sockname).port != 80,$+(:,$v1)))
    sockwrite -n $sockname Accept: */*
    if ($sock($sockname).addr == vkontakte.ru) sockwrite -n $sockname Cookie: remixsid=be06679f9f3c9a4c95a91a37d398a77f69d9cb94c9e36f6279b5198c
    if (*?:?* iswm $7) sockwrite -n $sockname Authorization: Basic $encode($7,m)
    sockwrite -n $sockname
  }
}
on *:SOCKREAD:urlinf.*: {
  ;echo 4 -a SOCKREAD
  timer 1 5 hdel urlinf.sockets $sockname
  ;timer 1 5 echo 4 -a (closing connection, 5s timer is up)
  timer 1 5 sockclose $sockname
  timer 1 5 halt
  if (%url-antiflood == 1) halt
  tokenize 32 $sock($sockname).mark
  if ($sockerr) {
    REM msg $3 $+([,$sock($sockname).addr,:,$sock($sockname).port,]) $sock($sockname).wsmsg
    hdel urlinf.sockets $sockname
  }
  elseif (urlinf.http.* iswm $sockname) {

    var %data
    sockread %temp
    ;echo 4 $4 addr = $sock($sockname).addr
    ;echo 4 $4 wsmsg = $sock($sockname).wsmsg
    ;echo 4 $4 temp (1st read) = %temp
    while ($sockbr != 0) {
      ;echo 4 $4 sockbr != 0
      if (%temp != $null) {
        ;echo 4 $4 temp != null
        ;echo 4 -s data: $+ $crlf $+ %data

        ;echo 4 -s temp =
        ;var %i = 1
        ;while $mid(%temp,%i,80) {
        ;  echo -s $ifmatch
        ;  inc %i 80
        ;}

        ;echo 4 -s old len: $len(%data) new len: $calc($len(%data) + $len(%temp))
        if ($calc($len(%data) + $len(%temp)) < 4094) {
          %data = $+(%data,%temp,$crlf)
        }
      }
      sockread %temp
      ;echo 4 $4 temp = %temp
    }
    ;echo 4 $4 data= $+ %data

    if (%data == $null) {
      echo 4 -s *** no data ***
      return
    }
    echo 4 -s *** finished reading data ***
    bset -t $+(&packet.,$sockname) 1 %data
    ; echo 5 -a $bvar($+(&packet.,$sockname),1,4096).text
    bcopy $+(&,$sockname) $calc($hget(urlinf.sockets,$sockname,$+(&,$sockname)) + 1) $+(&packet.,$sockname) 1 -1
    ; echo 6 -a $bvar($+(&,$sockname),1,4096).text
    bunset $+(&packet.,$sockname)
    hadd -b urlinf.sockets $sockname $+(&,$sockname)

    ;if ($bfind($+(&,$sockname),1,13 10 13 10)) {
    if (0 == 0) {
      ; var %offset = $v1 + 4
      var %offset = 1
      var %filename = $mkfn($urlinf.urldecode($nopath($8)))
      ; echo 4 -a bfind(loc) = $bfind($+(&,$sockname),1,Location:)) v1 = $v1 < offset = %offset
      if ($bfind($+(&,$sockname),1,Location:)) { ; && ($v1 < %offset) {
          var %location = $urlinf.char($urlinf.space($bvar($+(&,$sockname),$calc($v1 + 10),$calc($bfind($+(&,$sockname),$v1,13 10) - $v1 - 10)).text))
          if (%location = %last_loc) {
            echo 4 $4 Same location twice in a row, closing connection.
            hdel urlinf.sockets $sockname
            sockclose $sockname
            return
          }          
          set %last_loc %location
          ; echo 4 $4 New location: %location (closing connection)
          timer 1 0 simulate_text %location $network $4 $nick
          hdel urlinf.sockets $sockname
          sockclose $sockname
          return
        }
        if ($bfind($+(&,$sockname),1,Content-Type:)) { ; && ($v1 < %offset) {
            var %type = $urlinf.char($urlinf.space($bvar($+(&,$sockname),$calc($v1 + 14),$calc($bfind($+(&,$sockname),$v1,13 10) - $v1 - 14)).text))
            if ($pos(%type,;)) var %type = $mid(%type,1,$calc($v1 - 1))
          }
          if ($bfind($+(&,$sockname),1,Content-Length:)) { ; && ($v1 < %offset) {
              var %length = $urlinf.char($urlinf.space($bvar($+(&,$sockname),$calc($v1 + 16),$calc($bfind($+(&,$sockname),$v1,13 10) - $v1 - 16)).text))
            }
          }
          elseif ($sock($sockname).rcvd > $calc(16 * 1024)) {
            hdel urlinf.sockets $sockname
            echo 4 -a sc04
            sockclose $sockname
            return
          }
          else {
            return
          }
        }
        if ($bvar($+(&,$sockname),0) = 0) return
        if ($urlinf.youtube($sockname)) {
          if ($urlinf.youtube($sockname).view) {
            if ($3 == Jabber::) {
            }
            else {
              msg $4 [01,00You00,04Tube]: Title: $+(,$urlinf.youtube($sockname).title,) $(|) By: $+(,$urlinf.youtube($sockname).author,) (uploaded on $urlinf.youtube($sockname).date $+ ) $(|) Duration: $+(,$duration($urlinf.youtube($sockname).duration,3),) $(|) Views: $+(,$urlinf.youtube($sockname).view,) $(|) Rating: $+(,$urlinf.youtube($sockname).rate,) ( $+ $+(,$urlinf.youtube($sockname).rates,) ratings)
              msg $4 Downloading the video... $+(14,$urlinf.youtube($sockname).download,)
            }
            hdel urlinf.sockets $sockname
            echo 4 -a sc05
            sockclose $sockname
          }
        }
        elseif ($urlinf.tinyurl($sockname)) {
          if ($urlinf.tinyurl($sockname).redirect) {
            if ($3 == Jabber::) {
              REM jabber $4 TinyURL ( $+ $+(http://tinyurl.com,$8) $+ ) redirects to: $urlinf.char($urlinf.tinyurl($sockname).redirect)
            }
            else {
              msg $4 00,02TinyURL ( $+ $+(http://tinyurl.com,$8) $+ ) redirects to: $+(,$urlinf.char($urlinf.tinyurl($sockname).redirect),)
            }
            hdel urlinf.sockets $sockname
            echo 4 -a sc06
            sockclose $sockname
          }
          elseif ($urlinf.tinyurl($sockname).error) {
            if ($3 == Jabber::) {
              REM jabber $4 TinyURL $urlinf.tinyurl($sockname).error
            }
            else {
              msg $4 00,02TinyURL $urlinf.tinyurl($sockname).error
            }
            hdel urlinf.sockets $sockname
            echo 4 -a sc07
            sockclose $sockname
          }
        }
        elseif ($urlinf.depositfiles($sockname)) {
          if ($v1 == no_download_msg) {
            if ($3 == Jabber::) {
              REM jabber $4 [depositfiles]: $utfencode(Òàêîãî ôàéëà íå ñóùåñòâóåò èëè îí áûë óäàëåí èç-çà íàðóøåíèÿ àâòîðñêèõ ïðàâ.)
            }
            else {
              msg $4 [01,00de05,00p04,00o01,00sit14,00files]: Òàêîãî ôàéëà íå ñóùåñòâóåò èëè îí áûë óäàëåí èç-çà íàðóøåíèÿ àâòîðñêèõ ïðàâ.
            }
            hdel urlinf.sockets $sockname
            echo 4 -a sc08
            sockclose $sockname
          }
          elseif ($urlinf.depositfiles($sockname).link) {
            if ($3 == Jabber::) {
              REM jabber $4 [depositfiles]: $urlinf.depositfiles($sockname).name ( $+ $urlinf.depositfiles($sockname).size $+ ) @ $urlinf.depositfiles($sockname).link
            }
            else {
              msg $4 [01,00de05,00p04,00o01,00sit14,00files]: $+(,$urlinf.depositfiles($sockname).name,) ( $+ $urlinf.depositfiles($sockname).size $+ ) @ $+(14,$urlinf.depositfiles($sockname).link,)
            }
            hdel urlinf.sockets $sockname
            echo 4 -a sc09
            sockclose $sockname
          }
        }
        elseif ($urlinf.bashorg($sockname)) {
          if ($urlinf.bashorg($sockname).quote) {
            var %i = 1, %quote = $urlinf.html($replace($v1,<br>,$chr(1)))
            while ($gettok(%quote,%i,1)) {
              msg $4 14> $v1
              inc %i
            }
            hdel urlinf.sockets $sockname
            echo 4 -a sc10
            sockclose $sockname
          }
        }
        elseif ($urlinf.jpeg($sockname)) {
          if ($urlinf.jpeg($sockname,%length).dimensions) {
            var %dimensions = $v1, %exif
            if ($urlinf.jpeg($sockname).exif) var %exif = (Exif: $v1 $+ )
            if ($3 == Jabber::) {
              REM jabber $4 PIC: $+(JPEG[,%type,]) $+(w:,$urlinf.jpeg($sockname,%dimensions).width) $+(h:,$urlinf.jpeg($sockname,%dimensions).height) %exif @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
            }
            else {
              ;msg $4 PIC: $+(JPEG[,%type,]) $+(w:,$urlinf.jpeg($sockname,%dimensions).width) $+(h:,$urlinf.jpeg($sockname,%dimensions).height) %exif @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
              ;msg $4 Image: Format: $+(JPEG[,%type,]) :: Dimensions: $+($urlinf.jpeg($sockname,%dimensions).width,x,$urlinf.jpeg($sockname,%dimensions).height) px. @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
            }
            hdel urlinf.sockets $sockname
            echo 4 -a sc11
            sockclose $sockname
          }
          elseif ($sock($sockname).rcvd > $calc(64 * 1024)) {
            hdel urlinf.sockets $sockname
            echo 4 -a sc12
            sockclose $sockname
          }
        }
        elseif ($urlinf.gif($sockname)) {
          if ($urlinf.gif($sockname).dimensions) {
            if ($3 == Jabber::) {
              REM jabber $4 PIC: $+(GIF[,%type,]) $+(w:,$urlinf.gif($sockname,%dimensions).width) $+(h:,$urlinf.gif($sockname,%dimensions).height) @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
            }
            else {
              ;msg $4 PIC: $+(GIF[,%type,]) $+(w:,$urlinf.gif($sockname).width) $+(h:,$urlinf.gif($sockname).height) @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
              ;msg $4 Image: Format: $+(GIF[,%type,]) :: Dimensions: $+($urlinf.gif($sockname,%dimensions).width,x,$urlinf.gif($sockname,%dimensions).height) px. @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
            }
            hdel urlinf.sockets $sockname
            echo 4 -a sc13
            sockclose $sockname
          }
          elseif ($sock($sockname).rcvd > $calc(4 * 1024)) {
            hdel urlinf.sockets $sockname
            echo 4 -a sc14
            sockclose $sockname
          }
        }
        elseif ($urlinf.png($sockname)) {
          if ($urlinf.png($sockname).dimensions) {
            var %dimensions = $v1
            if ($3 == Jabber::) {
              REM jabber $4 PIC: $+(PNG[,%type,]) $+(w:,$urlinf.png($sockname,%dimensions).width) $+(h:,$urlinf.png($sockname,%dimensions).height) @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
            }
            else {
              ;msg $4 PIC: $+(PNG[,%type,]) $+(w:,$urlinf.png($sockname,%dimensions).width) $+(h:,$urlinf.png($sockname,%dimensions).height) @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
              ;msg $4 Image: Format: $+(PNG[,%type,]) :: Dimensions: $+($urlinf.png($sockname,%dimensions).width,x,$urlinf.png($sockname,%dimensions).height) px. @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
            }
            hdel urlinf.sockets $sockname
            echo 4 -a sc15
            sockclose $sockname
          }
          elseif ($sock($sockname).rcvd > $calc(16 * 1024)) {
            hdel urlinf.sockets $sockname
            echo 4 -a sc16
            sockclose $sockname
          }
        }
        elseif ($urlinf.txt($sockname)) {
          if ($urlinf.txt($sockname).codepage) {
            if ($3 == Jabber::) {
              REM jabber $4 TEXT: $+([,%type,]) $urlinf.txt($sockname).codepage @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
            }
            else {
              msg $4 TEXT: $+([,%type,]) $urlinf.txt($sockname).codepage @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
            }
            hdel urlinf.sockets $sockname
            echo 4 -a sc17
            sockclose $sockname
          }
          elseif ($sock($sockname).rcvd > $calc(2 * 1024)) {
            hdel urlinf.sockets $sockname
            echo 4 -a sc18
            sockclose $sockname
          }
        }
        elseif ($urlinf.flv($sockname)) {
          if ($bvar($+(&,$sockname),0) < 8192) return
          if ($3 == Jabber::) {
            REM jabber $4 VIDEO: $+(FLV[,%type,]) $+(w:,$urlinf.flv($sockname).width) $+(h:,$urlinf.flv($sockname).height) @ $int($urlinf.flv($sockname).framerate) FPS, $duration($urlinf.flv($sockname).duration,3) (Videocodec: $replacex($urlinf.flv($sockname).videocodecid,0,H.264,2,Sorenson H.263,3,Macromedia Screen Video,4,VP6-E,5,VP6-S,6,Macromedia Screen Video 2) $+ , $int($urlinf.flv($sockname).videodatarate) $+(kbit/s,;) Audiocodec: $replacex($urlinf.flv($sockname).audiocodecid,0,RAW (PCM),1,ADPCM,2,MP3,6,Nellymoser,11,Speex) $+ , $int($urlinf.flv($sockname).audiodatarate) kbit/s) @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
          }
          else {
            msg $4 VIDEO: $+(FLV[,%type,]) $+(w:,$urlinf.flv($sockname).width) $+(h:,$urlinf.flv($sockname).height) @ $int($urlinf.flv($sockname).framerate) FPS, $duration($urlinf.flv($sockname).duration,3) (Videocodec: $replacex($urlinf.flv($sockname).videocodecid,0,H.264,2,Sorenson H.263,3,Macromedia Screen Video,4,VP6-E,5,VP6-S,6,Macromedia Screen Video 2) $+ , $int($urlinf.flv($sockname).videodatarate) $+(kbit/s,;) Audiocodec: $replacex($urlinf.flv($sockname).audiocodecid,0,RAW (PCM),1,ADPCM,2,MP3,6,Nellymoser,11,Speex) $+ , $int($urlinf.flv($sockname).audiodatarate) kbit/s) @ $iif(%length,$urlinf.size($v1),[rcvd] $urlinf.size($sock($sockname).rcvd))
          }
          hdel urlinf $sockname
          echo 4 -a sc19
          sockclose $sockname
        }
        elseif (0 == 0) {
          ;elseif ($bfind($+(&,$sockname),%offset,<html)) {
          ; echo 4 $4 searching "<title", text starts with: $bvar($+(&,$sockname),%offset,40).text
          if ($bfind($+(&,$sockname),%offset,<title)) {
            var %> = $bfind($+(&,$sockname),$v1,>) + 1, %</ = 4096, %lost = ... (packet lost)
            var %searchterm = </
            ; echo 4 $4 (1) title tag at $v1 , content at %> , title size %</
            if ($bfind($+(&,$sockname),%>,%searchterm)) {
              var %</ = $v1 - %>, %lost
              if (%</ > 4096) var %</ = $v2
              ; echo 4 $4 (2) title tag at $v1 , content at %> , title size %</
            }
            if ($bvar($+(&,$sockname),%>,%</).text) {
              ; echo 4 $4 (found title) title tag at $v1 , content at %> , title size %</
              var %title = $urlinf.html($urlinf.char($v1)), %rutracker
              if ($isutf(%title)) var %title = $utfdecode(%title)
              if ($len(%title) > 256) var %title = $left(%title,128) ... (over 256 byte, truncated to 128)
              if (*rutracker.org iswm $sock($sockname).addr) {
                if (/forum/viewtopic.php?t=* iswm $8) var %rutracker = @ $+(12,http://dl.rutracker.org/forum/dl.php?t=,$gettok($gettok($8,2,61),1,38),)
              }
              if ($3 == Jabber::) {
                REM jabber $4 URL: %title %lost %rutracker
              }
              else {
                set -u10 %url-antiflood 1
                msg $4 URL: %title %lost %rutracker
              }
            }
            else {
              if ($3 == Jabber::) {
                REM jabber $4 URL: (title is empty)
              }
              else {
                msg $4 URL: (title is empty)
              }
            }
            hdel urlinf.sockets $sockname
            ;echo 4 -a sc20 (normal?)
            sockclose $sockname
          }
          elseif ($sock($sockname).rcvd > $calc(16 * 1024)) || (%length == $calc($v1 - %offset + 1)) || ($bfind($+(&,$sockname),%offset,</html)) {
            if ($3 == Jabber::) {
              REM jabber $4 URL: (no title found in this page)
            }
            else {
              ; msg $4 URL: (no title found in this page)
            }
            hdel urlinf.sockets $sockname
            echo 4 $4 No title found.
            sockclose $sockname
          }
        }
        elseif ($sock($sockname).rcvd > %offset) {
          hdel urlinf.sockets $sockname
          echo 4 -a sc22
          sockclose $sockname
        }
      }
    }
  }
}
on *:SOCKCLOSE:urlinf.*: {
  echo 4 -a SOCKCLOSE $sockname
  hdel urlinf.sockets $sockname
}
Last edited by pizzahut on Wed Aug 31, 2016 12:06 am, edited 2 times in total.
Big Dave
Extraordinary Gentleman
Posts: 1991
Joined: Fri Sep 17, 2004 3:42 pm
Contact:

Re: General mIRC scripts

Post by Big Dave »

Hahaha... You name your socks??? LOL :bounce:
A.K.A. BIG*N*BAD
A.K.A. THE_WORST_EVER>>>>>SNIPER
User avatar
Tempted
crooked doctor
Posts: 688
Joined: Wed May 13, 2009 6:25 pm

Re: General mIRC scripts

Post by Tempted »

lol
bunnyhop is NOT a hack!!
also, i like kitties ^_^
further more, if you look up, you cant see your feet.
User avatar
pizzahut
Extraordinary Gentleman
Posts: 1210
Joined: Fri Sep 17, 2004 1:25 am

Re: General mIRC scripts

Post by pizzahut »

No, the original author did. :P

http://web.archive.org/web/201006201733 ... /12828336/

Developer: Spoofing / Voglea
Date Added: Jun 03, 2010
Big Dave
Extraordinary Gentleman
Posts: 1991
Joined: Fri Sep 17, 2004 3:42 pm
Contact:

Re: General mIRC scripts

Post by Big Dave »

Sometimes I wish I could write code.
A.K.A. BIG*N*BAD
A.K.A. THE_WORST_EVER>>>>>SNIPER
Post Reply