Download the script for free by clicking here, or view it online below.


;There are free public IRC Bnc proxies on undernet courtesy of the self-proclaimed
;"Greatest Skript Kiddie Ever" Fyle. lol! :-)
;Here is an example script that demonstrates how to find and use them.
;This script is fully working and can be used as an add-on in your mIRC.
;To use it, copy this file (bncGetter.mrc) to your mIRC folder and in any
;active mIRC window type: /load -rs bncGetter.mrc
;Then type /server irc.undernet.org and when connected type /bg
;A self-explanatory dialog will open and you can grab the bnc addresses and double-click
;to connect. Everything in this script is fully commented so that even if you are a beginner
;at mIRC scripting you should be able to figure out what is going on!

;Enjoy free bnc :-)

alias bg {

  ;if mIRC is not connected to Undernet, do nothing and explain why

  if ($network != undernet) {
    echo -a 4Must be connected to undernet to get the BnC's
    return
  }

  ;if the dialog is not active at all, open it

  if ($dialog(fbb).active == $null) { dialog -movd fbb fbb }

  ;if the dialog is open but focus is on another window, put focus on the Bnc dialog

  if ($dialog(fbb).active == $false) { dialog -e fbb }
}
raw 321:*: {

  ;raw 321 means the channel list has begun sending
  ;if we're on undernet and the dialog is open, reset the counting hashes

  if ($network == undernet) && ($dialog(fbb).active != $null) {

    ;index 1 of bgVar counts the total number of channels recieved

    hadd -m bgVar 1 0

    ;index 2 of bgVar counts the total number of possible Bnc's found

    hadd -m bgVar 2 0

    ;if the bgBots hash has something in it, destroy it

    if ($hget(bgBots,0).item > 0) { hfree bgBots }

    ;halting it means that the text won't appear in the mIRC status window,
    ;filling it with needless clutter

    halt
  }
}
raw 322:*: {

  ;raw 322 means a channel has been recieved from the channel list, time to parse out the Bnc's
  ;so if we're on undernet and the dialog is open...

  if ($network == undernet) && ($dialog(fbb).active != $null) {

    ;add 1 to total number of channels recieved...

    hinc bgVar 1

    if ($gettok($1-,4-8,32) == Free BnC Courtesy of Fyle:) {

      ;when we find a channel that contains a Bnc, increment the other hash incrementor,
      ;and add the address of the (possible) bnc to our bgBots hash

      if ($chr(46) isin $gettok($gettok($1-,2,58),3,32)) && ($gettok($gettok($1-,2,58),4,32) isnum 1024-5000) {
        hinc bgVar 2
        hadd -m bgBots $calc($hget(bgBots,0).item + 1) $gettok($gettok($1-,2,58),3-4,32)
      }
    }

    ;display the progress in our dialog

    fbi Channels Fetched: $hget(bgVar,1) Bots Found: $hget(bgVar,2)
  }
}
raw 323:*: {

  ;raw 323 means the channel list has stopped

  if ($network == undernet) && ($dialog(fbb).active != $null) {
    if ($hget(bgVar,2) > 0) {

      ;update the dialog progress bar one last time and then begin testing for active
      ;and available bnc servers

      fbi Channels Fetched: $hget(bgVar,1) Bots Found: $hget(bgVar,2) $+ . Testing BnC's...
      fbbTest
      return
    }

    ;if there were no bnc servers found at all, display that fact and do nothing further

    if ($hget(bgVar,2) == 0) {
      fbi No Bots Found.
    }
    halt
  }
}
alias fbbTest {

  ;clear the main dialog window

  did -r fbb 1

  ;if there are some bnc servers in our hash from a previous search, destroy the hash

  if ($hget(bgGood,0).item > 0) { hfree bgGood }

  ;start a timer that will call an event when we've finished testing all possible bnc servers

  .timerfbbTest 0 1 fbbTestDone

  ;if there were no bnc servers found at all, explain that fact and do nothing

  if ($hget(bgVar,2) == 0) { 
    fbi No bots found. 
    return
  }

  ;otherwise, iterate through our hash list of all possible available bnc servers
  ;and open a unique socket for testing each one ourselves

  %inc = 0
  while (%inc < $hget(bgBots,0).item) {
    inc %inc
    sockopen fbbTest_ $+ %inc $hget(bgBots,%inc)
  }
}

;reading data from the bnc testing sockets

on *:sockread:fbbTest_*: {
  sockread %fbbTest

  ;if a bnc test socket finds that the bnc is available, add it to a new hash bgGood

  if ($strip($gettok(%fbbTest,-1,58),burc) == Welcome to Backdoor BnC by Fyle) {
    if ($sock($sockname).status == active) {
      hadd -m bgGood $calc($hget(bgGood,0).item + 1) $hget(bgBots,$gettok($sockname,2,95))

      ;display progress in the dialog and close the socket immediately, as there is no
      ;further need for it

      fbl $hget(bgBots,$gettok($sockname,2,95))
      sockclose $sockname

      ;and cleanup temporary variables

      unset %fbbTest
    }
  }
  unset %fbbTest
}

;the parameters for the main dialog

dialog fbb {
  title "Free BnC Courtesy of Fyle"
  size -1 -1 200 121
  option dbu
  list 1,1 1 199 100,extsel
  button "Refresh BnC List",2,50 100 50 10,center
  button "Stop Listing",3,99 100 50 10,center
  edit "",4,1 110 199 10,read
}

;when the "Refresh BnC List" button is clicked in the dialog, make sure we're connected
;to undernet, and then request the channel list
;sending the command LIST >0,<2 specifies that we're only interested in channels containing
;one bot, conserving bandwidth

on *:dialog:fbb:sclick:2: {
  if ($network == undernet) && ($status == connected) {
    fbi Getting channel list...
    .raw LIST >0,<2
  }
}

;when an address is double-clicked in the main dialog window we make a connection
;to it in a new mIRC window

on *:dialog:fbb:dclick:1: {
  if ($chr(46) isin $gettok($did(fbb,1).seltext,1,32)) && ($gettok($did(fbb,1).seltext,2,32) isnum 1024-5000) {   
    server -m $did(fbb,1).seltext
  }
}

;fbi and fbl aliases handle sending text to the progress bar of the main dialog

alias fbi {
  if ($dialog(fbb).active != $null) {
    did -r fbb 4
    did -a fbb 4 $1-
  }
}
alias fbl {
  if ($dialog(fbb).active != $null) {
    did -a fbb 1 $1-
  }
}

;if for some reason we want to stop the channel list mid-stream, we single-click the
;button "Stop Listing" and it sends the command LIST STOP

on *:dialog:fbb:sclick:3: {
  if ($network == undernet) && ($status == connected) {
    .raw LIST STOP
  }
}

;when the main dialog is first opened, init the main window with instructions if there are
;no bnc servers currently in the bgGood hash, otherwise display the bnc servers that
;tested successfully

on *:dialog:fbb:init:0: {
  did -f fbb 2
  if ($hget(bgGood,0).item == 0) {
    fbl Click "Refresh BnC List" to fetch a fresh channel list.
    fbl When the channel list has stopped, BnC's will be tested
    fbl automatically and listed in this window.
    return
  }
  %inc = 0
  while (%inc < $hget(bgGood,0).item) {
    inc %inc
    did -a fbb 1 $hget(bgGood,%inc)
  }
  unset %inc
}

;raw 002 is an extra raw numeric used by the server to send miscellaneous messages to
;the client. In the case of the Fyle bnc servers, we can tell that we've connected to
;one of his servers when we see "Welcome to Backdoor BnC by Fyle". When we recieve that
;line we open the other dialog that handles our favorite server list and allows us to
;double-click our way there using the bnc servers after just entering them one time in
;the dialog itself.

raw 002:*: {
  if ($strip(Welcome to Backdoor BnC by Fyle,burc) isin $1-) {
    if ($dialog(fbb).active != $null) { dialog -x fbb }
    echo -a 12Type ddd to re-open the server manager.
    bgFav
  }
}

;this alias was called from the timer above.
;the status of all test sockets are checked every 1 second.
;when there are no more test sockets active, we sum up our findings in the dialog.

alias fbbTestDone {
  if ($sock(fbbTest_*,0) == 0) {
    if ($hget(bgGood,0).item == 0) { 
      fbi No BnC's found. Refresh BnC list to search again.
      .timerfbbTest off
      return
    }
    fbi $hget(bgGood,0).item good BnC's found. Double click an address above to connect.
    .timerfbbTest off
  }
}

;defines the parameters of our server manager dialog

dialog bgFav {
  title "Server Manager"
  size -1 -1 200 121
  option dbu
  list 1,1 1 199 100,extsel
  text "New Server:",2,1 101 30 9,center
  edit "",3,31 100 168 10,multi return autovs autohs
  button "Remove Server",4,75 110 50 10,center
}

;handles our favorite servers input and displays them in the server manager
;dialog accordingly. favorite servers are saved and reloaded even after your
;mIRC has closed.

on *:dialog:bgFav:edit:3: {
  %bfe = $did(bgFav,3).text
  if ($did(bgFav,3).lines > 1) {
    if ($gettok(%bfe,2,32) !isnum) {
      hadd -m bgFav $calc($hget(bgFav,0).item + 1) $gettok(%bfe,1,32) 6667
      did -a bgFav 1 $gettok(%bfe,1,32) 6667
      unset %bfe
      did -r bgFav 3
      return
    }
    if ($gettok(%bfe,2,32) isnum) {
      hadd -m bgFav $calc($hget(bgFav,0).item + 1) %bfe
      did -a bgFav 1 %bfe
      unset %bfe
      did -r bgFav 3
      return
    }
  }
}

;sends the command to connect to the specified server through the bnc from the server
;manager dialog window

on *:dialog:bgFav:dclick:1: {
  .raw CON $did(bgFav,1).seltext
  dialog -x bgFav
}

;displays our currently specified and saved favorite servers in the server manager dialog

on *:dialog:bgFav:init:0: {
  %inc = 0
  while (%inc < $hget(bgFav,0).item) {
    inc %inc
    if ($dialog(bgFav).active != $null) {
      if ($hget(bgFav,%inc) != $null) {
        did -a bgFav 1 $hget(bgFav,%inc)
      }
    }
  }
}

;opens or refocuses the server manager dialog according to its current state

alias bgFav {
  if ($dialog(bgFav).active == $null) { dialog -movd bgFav bgFav }
  if ($dialog(bgFav).active == $false) { dialog -e bgFav }
}

;if we want to remove a server from the server manager favorites list, we click
;the "Remove" button. It is deleted from the hash and the dialog window is refreshed.

on *:dialog:bgFav:sclick:4: {
  if ($did(bgFav,1).sel isnum) {
    hdel bgFav $hfind(bgFav,$did(bgFav,1).seltext,1).data
    did -d bgFav 1 $did(bgFav,1).sel
  }
}

;when mIRC is terminated, save the specified server configuration to a file
;so that it can be reloaded the next time mIRC starts

on *:exit: {
  if ($hget(bgFav,0).item == 0) && ($exists(bgFav.hsh) == $true) {
    .remove bgFav.hsh
  }
  if ($hget(bgFav,0).item > 0) {
    hsave bgFav bgFav.hsh
  }
}

;when mIRC starts, if we have something in our favorite servers list, load them into
;the bgFav hash

on *:start: {
  if ($exists(bgFav.hsh) == $true) {
    hmake bgFav 50
    hload bgFav bgFav.hsh
  }
}

;works like an alias but without needing to type / in front of it for slightly more convenience
;and speed. reopens the server manager dialog as needed by typing 'ddd' in any window.

on *:input:*: {
  if ($1 == ddd) {
    bgFav
    halt
  }
}

Questions and comments regarding this page or script may be directed to fyle_bnc_script@yahoo.com
Counter
Page Last Modified: Feb. 11 2004
free-counters.net @ free hit counter