EggDrop Party Line Connection for mIRC

By FordLawnmower on Jul 18, 2010

Image
This script will allow you to connect to one or more eggdrops without the need for a telnet program or dcc chat.
Unlike most of my scripts, I'm actually interested in this one, so if you have any suggestions for improvements please post them here.

Getting Started:

  • Paste to a blank remote and save with a unique filename.
  • Right Click the channel or status and select EggDrop Connect.
  • Fill in all the boxes and click Connect.

Explanation of the input boxes:

  • IP Address = The ip address of the eggdrop
  • Port = The port the bot is listening for connections on.
  • Handle = The name the bot knows you by(not your current nick).
  • Password = The password you set with the eggdrop.
;EggDrop Connect by Ford_Lawmower irc.geekshed.net #Script-Help
;;Edit EggColor1 to change the nick color, your text and Emphesis text color.
alias -l EggColor1 return $+($chr(3),04)
;;Edit EggColor2 to change the primary response text.
alias -l EggColor2 return $+($chr(3),03)
;;Edit EggDivider to change the between the EggNick and the response text.
alias -l EggDivider return $+($chr(2),$EggColor1,»»,$chr(15))
menu channel,status,menubar,@EggDropConnect* {
  .EggDrop Connect:EggDropConnect
}
menu @EggDropConnect* {
  .$iif($EggIsConnect,$v1,Disconnected)
  .$iif($EggIsConnect,$style(2)) Connect:{
    sockopen $EggSockName $EggIP $EggPort
    EggMsg Connecting to Eggdrop.. Please Wait.....
    EggMsg Remember you must enter your username and password when prompted.
  }
  .$iif(!$EggNick,$style(2)) Disconnect:{
    EggMsg Disconnecting
    EggMsg Bye Bye :)
    sockclose $EggSockName
    EggMsg Disconnected
  }
}
alias -l EggIsConnect return $sock($EggSockName)
alias -l EggMsg echo $active $iif($EggNick,$+(<,$EggColor1,$v1,$chr(15),>),$+($EggColor1,EggConnect)) $EggDivider $+($EggColor2,$1-)
alias -l EggNick return $gettok($sock($EggSockName).mark,3,32)
alias -l EggSockName return $mid($active,2-)
alias -l EggIP return $gettok($mid($EggSockName,15-),1,58)
alias -l EggPort return $gettok($gettok($mid($EggSockName,15-),2,58),1,45)
dialog EggDropConnect {
  title "EggDrop Connect"
  size -1 -1 105 101
  option dbu
  text "IP Address:", 1, 4 10 37 8, right
  text "Port:", 2, 4 22 37 8, right
  text "Handle:", 3, 5 34 37 8, right
  text "Password:", 4, 5 47 37 8, right
  edit "", 5, 45 9 55 10, autohs
  edit "", 6, 45 21 55 10, autohs
  edit "", 7, 45 33 55 10, autohs
  edit "", 8, 45 46 55 10, pass autohs
  text "", 9, 4 62 97 13
  button "Connect", 10, 5 82 37 12
  button "Close", 11, 64 82 37 12, cancel
}
alias -l EggDropConnect dialog $iif($dialog(EggDropConnect),-v,-m) EggDropConnect EggDropConnect
On *:dialog:EggDropConnect:Sclick:10: {
  tokenize 32 $did($dname,5) $did($dname,6) $did($dname,7) $did($dname,8)
  if ($numtok($1-,32) < 4) {
    did -a $dname 9 Please fill in all the boxes and try again.
    .timereggcomment 1 4 did -a $dname 9    
  }  
  elseif (!$regex($1,(?:[\d]{1,3})\x2E(?:[\d]{1,3})\x2E(?:[\d]{1,3})\x2E(?:[\d]{1,3}))) {
    did -a $dname 9 IP Address must be in the form of xx.xx.xx.xx Check it and try again.
    .timereggcomment 1 4 did -a $dname 9
  }
  elseif ($2 !isnum) {
    did -a $dname 9 Port must be a number. Check it and try again.
    .timereggcomment 1 4 did -a $dname 9  
  }
  elseif ($numtok($1-,32) > 4) {
    did -a $dname 9 Unknown error in one of the fields. Please review them and try again.
    .timereggcomment 1 4 did -a $dname 9  
  }  
  else { eggconnect $1- }
}
alias eggconnect {
  var %sockname $+(EggDropConnect,$1,:,$2,-,TO,-,$3)
  if ($sock(%sockname)) sockclose %sockname
  sockopen %sockname $1 $2
  sockmark %sockname $3 $4
  if (!$window($+(@,%sockname))) { window -e $+(@,%sockname) }
  echo $+(@,%sockname) Connecting to your Eggdrop. Please Wait.......
}
on *:sockopen:EggDropConnect*: {
  if ($sockerr) {
    eggecho Socket Error Cannot Connect...
    eggecho No one seems to be listening on $mid($gettok($sockname,1,45),15-)
    eggecho Check your IP Address / Port Settings and Try Again.
    sockclose $sockname
  }
  elseif ($gettok($sock($sockname).mark,1,32)) { 
    sockwrite -nt $sockname $v1
    sockwrite -nt $sockname $gettok($sock($sockname).mark,2,32)
  }
}
on *:sockread:EggDropConnect*: {
  var %eggconnect | sockread %eggconnect
  if (%eggconnect) {
    eggdispformat $+(@,$sockname) $iif($gettok($sock($sockname).mark,3,32),$+(<,$EggColor1,$v1,$chr(15),>),$+($EggColor1,EggConnect)) $EggDivider %eggconnect
    if ($regex(%eggconnect,/Connected to (.*)\x2C running eggdrop/i)) sockmark $sockname 1 1 $regml(1)
    elseif (%eggconnect == You don't have access.) { 
      eggecho $+($EggColor1,EggConnect) $+($EggDivider,$EggColor2) It appears that the eggdrop doesn't know you by $&
        $+(",$iif($gettok($sock($sockname).mark,1,32),$v1,that name),")
      eggecho $+($EggColor1,EggConnect) $+($EggDivider,$EggColor2) Please Try again with the Name that the bot knows you by.
      sockclose $sockname
    }
    elseif (Negative on that isin %eggconnect) {
      eggecho $+($EggColor1,EggConnect) $+($EggDivider,$EggColor2) It appears that the password you entered is incorrect.
      eggecho $+($EggColor1,EggConnect) $+($EggDivider,$EggColor2) Please try again with the correct password.
      sockclose $sockname
    }
  }
}
alias -l eggecho echo $+(@,$sockname) $+($EggColor2,$1-)
alias -l eggsend { 
  sockwrite -nt $iif($sockname,$v1 $1-,$1-)
  echo $+(@,$iif($sockname,$v1 $me $EggDivider $+($EggColor1,$1-),$1 $+(<,$EggColor1,$me,$chr(15),>) $EggDivider $+($EggColor1,$2-)))  
}
alias -l eggdispformat { echo $1-3 $remove($+($EggColor2,$replace($4-,[1m,$+($chr(15),[,$EggColor1),[0m,$+($chr(15),],$EggColor2))),ÿû,ÿü) }
On *:input:@EggdropConnect*: { if ($left($1,1) != /) && ($EggIsConnect) eggsend $v1 $1- }
On *:close:@EggdropConnect*: { sockclose $mid($target,2-) }

Comments

Sign in to comment.
FordLawnmower   -  Apr 04, 2011

Updated to make it easier to change colors.
See the ;; comments at the top of the script.
Updated Screen:
Image

Paladinz  -  Jul 15, 2013

An amazingly useful script, but is there any way to make the window title more user friendly, e.g. use the bot name instead of the sockname?

Never mind, did it myself

Sign in to comment

Dark|   -  Nov 22, 2010

Ahhh ok

 Respond  
FordLawnmower   -  Nov 22, 2010

Nope. You can disconnect from the server and still be connected but if you close mIRC the telnet connection to the eggdrop will also be closed.

 Respond  
Dark|   -  Nov 22, 2010

i was asking if your running this and you close mIRC will this still be running?

 Respond  
FordLawnmower   -  Nov 22, 2010

@Dark| I'm not exactly sure what your are asking.
If you have a telnet connection to your eggdrop and you close the @EggdropConnect window, you will break the telnet connection with the eggdrop but this will have no effect on the bots connection status on the irc server.

 Respond  
Dark|   -  Nov 22, 2010

if you close the mirc window - will the bot dc? i know this is a silly qustion,

 Respond  
FordLawnmower   -  Sep 20, 2010

Thanks RaZ :)
I use this script to manage 100 eggdrops and all of them remain connected to my mIRC 24 hours a day with no problems.
Way better than trying to use multiple telnet windows.
This also makes it easy to script popups for the eggdrop windows so you can just click for common commands.
I've also found that it's very easy to script loops to send a single command to all the eggys at once :)

 Respond  
RaZ   -  Sep 19, 2010

Very Very Veryy Nice Scriptttttt

 Respond  
FordLawnmower   -  Aug 30, 2010

Your Welcome LostTruths :)

 Respond  
LostTruths   -  Aug 30, 2010

Works great. thx and keep up the good coding. ;p

 Respond  
sk68   -  Jul 26, 2010

@kenJi If your eggdrop is running on a shell then you should get that information from your shell provider.

I just used /dns shell.host.here

 Respond  
FordLawnmower   -  Jul 22, 2010

@kenJi If your eggdrop is running on a shell then you should get that information from your shell provider.
The port should always be listed in your eggdrop.conf in a line like this:

listen 3333 all

In this case 3333 will probably be your port.
If you are using a windrop or a eggdrop on a computer on your lan then you are going to want to connect to the bot with it's local ip. You can find the local ip of a computer by:
On windows:
Start -> Run -> Cmd [enter]
Type ipconfig in the black window.
Look for a x.x.x.x number adjacent to Ipv4.

On Linux:
Open the terminal and type ifconfig
If you get an error on this , type su, enter your admin password and then try again
Look for a inet addr x.x.x.x That is not 127.0.0.1

 Respond  
xplo   -  Jul 22, 2010

.... your eggdrop's ip and port.. not something imaginary...

 Respond  
kenJi   -  Jul 22, 2010

teach me what IP should i put? and port? where can i get IP that i gonna put.. -.-

 Respond  
FordLawnmower   -  Jul 22, 2010

Thanks }{exer :)

 Respond  
}{exer   -  Jul 22, 2010

I say Thanks too again :)

It is Flawless as usual !

 Respond  
FordLawnmower   -  Jul 22, 2010

Thanks sk68 :) I'm glad it's working well for you.
Updated
I've added a couple of connection related popups so you can disconnect without closing the bots window. This also fixes a small bug that was attempting to send to the socket without checking to see if the socket was still open. .Quit will also work with this.

 Respond  
sk68   -  Jul 22, 2010

Just used this script for my eggie, works great, even though my lazy ass had to dns my shell's host to get the right IP :P but, works without a flaw so far and even looks better than normal telnet or dcc chat sessions :D

 Respond  
SnoooP   -  Jul 19, 2010

This is a really interesting idea, i'm keen to try this out myself i'll get back to you with how it is, but yeah really nice idea (thumbs up)

 Respond  
FordLawnmower   -  Jul 18, 2010

@kenJi Is that the ip for your EggDrop?
Also have you ever connected to this eggy before. With telnet or dcc?
Any other information you could give me would help.
Windrop or eggdrop?
Home computer or shell?
The error you got is generated when there is no response from the connection. This normally means that there is no eggdrop "running" at that ip listening on that port.

 Respond  
kenJi   -  Jul 18, 2010

Connecting to your Eggdrop. Please Wait.......
Socket Error Cannot Connect...
No one seems to be listening on 112.200.153.179:3531
Check your IP Address / Port Settings and Try Again.

--- what should i do?. i put my IP add. and port but still not connecting.. -.-

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.