MEWBIES@: Facebook Twitter G+ YouTube DeviantArt Forum Wall
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ██
█▌ - HOW TO HAVE 1 BOT / EGGDROP ON MULTIPLE NETWORKS - █▌
█▌ █▌
█ ▐▌
█ If you have been told it's not possible to have one bot on more than one ▐▌
█ network at a time, it's not true. This tutorial will use psyBNC to do this.▐▌
█ You could use other types of IRC bouncer soft as well following the same ▐▌
█ principles below such as ZNC HERE. ▐▌
█ ▐▌
█ PREREQUISITES: ▐▌
█ `````````````` ▐▌
█ 1. Eggdrop with SSL patch- if you don't know how to install it see my ▐▌
█ tutorial HERE. ▐▌
█ ▐▌
█ 2. psyBNC with SSL support and admin rights. A fresh install that hasn't ▐▌
█ been logged into is best but not required- tho this tutorial will be for a ▐▌
█ fresh install. ▐▌
█ (The difference would be only that you will need to give your bot admin ▐▌
█ rights to be on multiple servers for a psyBNC that is already in use.) ▐▌
█ ▐▌
█ To install psyBNC follow my tutorial, HERE, until this part 'SETUP BNC ON ▐▌
█ mIRC'. Do not do any of the steps from 'SETUP BNC ON mIRC' down, return to ▐▌
█ this tutorial. ▐▌
█ ▐▌
█ 3. List of SSL servers on each network that you are going to use: ▐▌
█ Efnet's SSL port is 9999. Server list is HERE. ▐▌
█ e.g. on efnet's list: # irc.choopa.ca - ipv6 - ssl - 729 users ▐▌
█ To use this it would be: irc.choopa.ca:9999 ▐▌
█ Linknet's SSL port is 7000. Server list is HERE, use same servers but ▐▌
█ port 6667 for non SSL. ▐▌
█ Freenode's SSL port is 7000 or 7070. Server list is HERE. ▐▌
█ ▐▌
█ 4. If you are going to use a vhost for your bot, have one selected. ▐▌
█ ▐▌
█ BOT'S CONFIGURATION SETTINGS: ▐▌
█ ````````````````````````````` ▐▌
█ 1. You'll need to edit yourbots.conf in a few places: ▐▌
█ pico /home/user/YourBot/yourbots.conf ▐▌
█ ▐▌
█ A. This should be on the 2nd line, if it's not add it: ▐▌
█ set use-ssl 1 ▐▌
█ ▐▌
█ B. This needs to be the login name for the shell account you have the ▐▌
█ psyBNC installed on: ▐▌
█ set username "MyLogin" ▐▌
█ ▐▌
█ C. Set networks to Others: ▐▌
█ set net-type 5 ▐▌
█ ▐▌
█ D. The port you have psyBNC running on: ▐▌
█ set default-port 45678 ▐▌
█ ▐▌
█ E. The IP or domain name, port and password (same as your shell password) ▐▌
█ the psyBNC is running on for the bot to login into: ▐▌
█ set servers { ▐▌
█ myshell.com:45678:PaSSword ▐▌
█ ▐▌
█ } ▐▌
█ ▐▌
█ If you are running the bot on the same box as your psyBNC you can enter ▐▌
█ for the 'set servers': ▐▌
█ 127.0.0.1:45678:PaSSword ▐▌
█ ▐▌
█ F. Change flood settings so that you can view replies from psyBNC and not ▐▌
█ get this: ▐▌
█ 'Flood from @lam3rz.de! Placing on ignore!' ▐▌
█ Change: ▐▌
█ set flood-msg 5:60 ▐▌
█ ▐▌
█ Change to: ▐▌
█ set flood-msg 0:0 ▐▌
█ ▐▌
█ After you have your bot on multiple networks running smooth, you can ▐▌
█ change that setting back. ▐▌
█ Tip: If the bot did put someone on ignore and you want to view it and or ▐▌
█ remove it, telnet into the bot and enter the cmds bold: ▐▌
█ This shows the ignores: .ignores ▐▌
█ This will remove the first in the list of ignores: .-ignore 1 ▐▌
█ ▐▌
█ G. Keep in mind that just like yourself when using psyBNC on multiple ▐▌
█ networks there are prefixes e.g. l' for linknet, etc. So any events taking ▐▌
█ place with your bot must also have this prefix. For example in my ▐▌
█ bots.conf I have the prefixes l' and z': ▐▌
█ proc evnt:init_server {type} { ▐▌
█ global botnick ▐▌
█ putquick "MODE l'$botnick +ih-ws" ▐▌
█ trueputserv "PRIVMSG z'nickserv :identify MyPassWord" ▐▌
█ ▐▌
█ H. Comment these two lines out to be this: ▐▌
█ #unbind dcc n tcl *dcc:tcl ▐▌
█ #unbind dcc n set *dcc:set ▐▌
█ ▐▌
█ 2. Telnet into your bot then issue the cmd: ▐▌
█ .restart ▐▌
█ ▐▌
█ Once the bot restarts it will login to your psyBNC account if all went ▐▌
█ well :). ▐▌
█ If your bot can't login to the psyBNC, the first places to check are that ▐▌
█ the bot is SSL, psyBNC is SSL, username is your login name, port, IP are ▐▌
█ the same your psyBNC is running on and that your psyBNC is running :D . ▐▌
█ ▐▌
█ METHODS TO SETUP MULTIPLE NETWORKS FOR EGGDROP: ▐▌
█ ``````````````````````````````````````````````` ▐▌
█ I have done this using two different methods, that I'll cover here: ▐▌
█ 1. Telnet to your bot, giving all the commands (cleaner way). ▐▌
█ 2. Using your own IRC client to set it up (easy for cmd line shy peeps). ▐▌
█ ▐▌
█ METHOD 1: SETUP THROUGH TELNET TO YOUR BOT: ▐▌
█ 1. It's very similar to setting up multiple networks for your self, only ▐▌
█ the cmds are different. ▐▌
█ You should still be in telnet with your bot, if not telnet to bot. ▐▌
█ First set the bots nick and its vhost: ▐▌
█ .tcl putserv "setusername BotsName" ▐▌
█ .tcl putserv "setawaynick _BotsName" ▐▌
█ .tcl putserv "bvhost my.vhost.com" ▐▌
█ ▐▌
█ 2. First we have to do a little change so that it adds the servers ▐▌
█ correctly, enter this cmd: ▐▌
█ .tcl proc putnow { a } { append a "\n"; putdccraw 0 [string length $a] $a }▐▌
█ .rehash ▐▌
█ ▐▌
█ 3. Add the servers for your main network only first. For this example I'll ▐▌
█ use Efnet. ▐▌
█ For example: ▐▌
█ .tcl putnow "addserver S=irc.choopa.ca:9999"; ▐▌
█ .tcl putnow "addserver S=irc.umich.edu:9999"; ▐▌
█ ▐▌
█ etc... You can add up to 9 servers. As soon as you add those your bot will ▐▌
█ start trying to connect to them. ▐▌
█ ▐▌
█ To view the servers that you have entered: ▐▌
█ .tcl putserv "listservers" ▐▌
█ To remove a server from the list, use the server number: ▐▌
█ .tcl putserv "delserver 9" ▐▌
█ To stop the connect to the servers: ▐▌
█ .tcl putserv "bquit" ▐▌
█ To connect back to the servers: ▐▌
█ .tcl putserv "bconnect" ▐▌
█ To switch (jump) servers: ▐▌
█ .tcl putserv "jump" ▐▌
█ ▐▌
█ At this point your bot is using psyBNC to connect to IRC on one network. ▐▌
█ ▐▌
█ 4. Add another network and its servers. For this example I'll use Linknet. ▐▌
█ Below the prefix I'll use for Linknet is l ("addnetwork l") you can give ▐▌
█ it any prefix/name you like, it does not need to be l: ▐▌
█ .tcl putserv "addnetwork l" ▐▌
█ .tcl putnow "addserver l'S=irc.link-net.org:7000"; ▐▌
█ .tcl putnow "addserver l'S=irc.config.no:7000"; ▐▌
█ ▐▌
█ etc... You can add up to 9 servers. As soon as you add those your bot will ▐▌
█ start trying to connect to them. ▐▌
█ ▐▌
█ If the server you are adding requires a password the format would be: ▐▌
█ .tcl putnow "addserver z'S=irc.whatever.xy:1234 PasswordHere"; ▐▌
█ ▐▌
█ When accessing information from a multiple network you need to have its ▐▌
█ prefix and ' in the cmds: ▐▌
█ To view the servers that you have entered for network l: ▐▌
█ .tcl putserv "listservers l'" ▐▌
█ To remove a server from the l network, use the server number: ▐▌
█ .tcl putserv "delserver l'9" ▐▌
█ To stop the connect to the l servers: ▐▌
█ .tcl putserv "bquit l'" ▐▌
█ To connect back to the l servers: ▐▌
█ .tcl putserv "bconnect l'" ▐▌
█ To switch (jump) l servers: ▐▌
█ .tcl putserv "jump l'" ▐▌
█ If problem with bot not mangling host: ▐▌
█ .tcl putserv "mode l'MyBotsName +h" ▐▌
█ ▐▌
█ 5. Repeat step 4 for other networks and its servers you want to add, ▐▌
█ giving each network a unique prefix and using that prefix in the cmds. ▐▌
█ ▐▌
█ 6. Skip the Method 2 section if you used this method, to continue with the ▐▌
█ tutorial. ▐▌
█ ▐▌
█ METHOD 2: SETUP USING YOUR LOCAL IRC CLIENT: ▐▌
█ ```````````````````````````````````````````` ▐▌
█ It's the same method as setting up multiple networks for your self, except ▐▌
█ you will use your bot's login settings. Below is how I did it using mIRC. ▐▌
█ You will need an SSL capable IRC client to do this. If you are using mIRC ▐▌
█ and yours isn't SSL capable or you aren't sure see my SSL MIRC tutorial ▐▌
█ HERE. To do the same with IRC programs like IRSSI, WeeChat, etc. precede ▐▌
█ all /cmds listed below with 'quote', ex: /quote setusername MyBotsName ▐▌
█ ▐▌
█ 1. Close mIRC if it's running. ▐▌
█ ▐▌
█ 2. Copy over your entire mIRC directory to a new location. Launch the copy ▐▌
█ of your mirc and change the Connection Settings: ▐▌
█ Tools/Options/Connect/ fill in the information: ▐▌
█ Full Name: the bot's 'username', that is in its .conf file (set username ▐▌
█ "MyLogin") ▐▌
█ Email: MyLogin@whatever.com ▐▌
█ Nickname: Bot's name ▐▌
█ Alternative: Bot's alternative nick ▐▌
█ ▐▌
█ Tools/Options/Connect/Servers/Add button. Fill in the correct information: ▐▌
█ IRC Server: Would be the IP or domain of the shell your psyBNC is running ▐▌
█ on. ▐▌
█ Ports: Would be the port psyBNC is running on ▐▌
█ Password: Would be the password for the shell. ▐▌
█ Press OK ▐▌
█ ▐▌
█ Tools/Options/Connect/Identd fill in the information: ▐▌
█ Check 'Enable Identd server' if it isn't. ▐▌
█ User ID: the bot's 'username', that is in its .conf file (set username ▐▌
█ "MyLogin"), this will be used for its ident. ▐▌
█ Check 'Show Identd request' to trouble shoot if you have problems ▐▌
█ connecting because of your ident. ▐▌
█ Press OK ▐▌
█ ▐▌
█ 3. Now press Connect. You'll be prompted with psyBNC window if all went ▐▌
█ well :D. ▐▌
█ ▐▌
█ 4. Now you just add all the settings in the same manner that you would for ▐▌
█ yourself using a psyBNC multiple network: ▐▌
█ Enter all the cmds below into an IRC window. To set the bots nick and its ▐▌
█ vhost: ▐▌
█ /setusername MyBotsName ▐▌
█ /setawaynick _MyBotsName ▐▌
█ /vhost my.vhost.com ▐▌
█ ▐▌
█ 5. Add the servers for your main network only first. For this example I'll ▐▌
█ use Efnet. ▐▌
█ For example: ▐▌
█ /addserver S=irc.choopa.ca:9999 ▐▌
█ /addserver S=irc.umich.edu:9999 ▐▌
█ ▐▌
█ etc... You can add up to 9 servers. As soon as you add those your bot will ▐▌
█ start trying to connect to them. ▐▌
█ ▐▌
█ To view the servers that you have entered: ▐▌
█ /listservers ▐▌
█ To remove a server from the list, use the server number: ▐▌
█ /delserver 9 ▐▌
█ To stop the connect to the servers: ▐▌
█ /bquit ▐▌
█ To connect back to the servers: ▐▌
█ /bconnect ▐▌
█ To switch (jump) servers: ▐▌
█ /jump ▐▌
█ ▐▌
█ At this point your have set up psyBNC to connect to IRC on one network. ▐▌
█ ▐▌
█ 6. Add another network and its servers. For this example I'll use Linknet. ▐▌
█ Below the prefix I'll use for Linknet is l (/addnetwork l) you can give it ▐▌
█ any prefix/name you like: ▐▌
█ /addnetwork l ▐▌
█ /addserver l'S=irc.link-net.org:7000 ▐▌
█ /addserver l'S=irc.config.no:7000 ▐▌
█ ▐▌
█ etc... You can add up to 9 servers. As soon as you add those your bot will ▐▌
█ start trying to connect to them. ▐▌
█ ▐▌
█ If the server you are adding requires a password the format would be: ▐▌
█ /addserver z'S=irc.whatever.xy:1234 PasswordHere ▐▌
█ ▐▌
█ When accessing information from a multiple network you need to have its ▐▌
█ prefix and ' in the cmds: ▐▌
█ To view the servers that you have entered for network l: ▐▌
█ /listservers l' ▐▌
█ To remove a server from the l network, use the server number: ▐▌
█ /delserver l'9 ▐▌
█ To stop the connect to the l servers: ▐▌
█ /bquit l' ▐▌
█ To connect back to the l servers: ▐▌
█ /bconnect l' ▐▌
█ To switch (jump) l servers: ▐▌
█ /jump l' ▐▌
█ To mangle your host (not all networks support this): ▐▌
█ /mode l'MyBotsName +h ▐▌
█ ▐▌
█ 7. Repeat step 6 for other networks and its servers you want to add, ▐▌
█ giving each network a different prefix and using that prefix in the cmds. ▐▌
█ ▐▌
█ TIPS: ▐▌
█ ````` ▐▌
█ 1. Remember that you'll need to update the bots IP with the other bots: ▐▌
█ .+host MyBotsName *!mewb@my.vhost.com ▐▌
█ ▐▌
█ 2. To have your bot join channels follow the same steps on my Eggdrop ▐▌
█ tutorial HERE. Scroll down to 'CHANNEL SETTINGS' ▐▌
█ Just remember that if it is joining a channel other than its main network ▐▌
█ (first one added to psyBNC) you must use the network's prefix that you ▐▌
█ used while adding the networks earlier. ▐▌
█ Examples of cmds on a multiple network in the bot's telnet: ▐▌
█ .msg z'nickserv register MyBotsName mewbie@whatever.com ▐▌
█ .+chan #l'#mychannel ▐▌
█ .chanset #l'#mychannel chanmode +npsp ▐▌
█ .chanset #l'#mychannel chanmode +k mykey ▐▌
█ .chanset #x'#myotherchannel -statuslog ▐▌
█ ▐▌
█ 3. Other scripts you have installed will need these same prefixes if the ▐▌
█ channel and or nick names are used in the script. ▐▌
█ Example using the encryption script McEggDrop: ▐▌
█ set mcpskey(#l'#mychannel) "VFJZRQt0CdE4oDL6SdmtZ7xv1xmiFyzDqewforuhCCqS" ▐▌
█ ▐▌
█ TROUBLE SHOOTING: ▐▌
█ ````````````````` ▐▌
█ 1. You can see your bot in channel but the bot states it's not in the ▐▌
█ channel (.status) or the opposite; your bot states it's in a channel but ▐▌
█ indeed it isn't - the only way I have found to fix this so far is to ▐▌
█ .restart the bot and if it still has a problem, kill the psybnc then ▐▌
█ restart it on the shell, or in bot's telnet enter: ▐▌
█ .tcl putserv "brehash" ▐▌
█ ▐▌
█ AUTOSTART PSYBNC: ▐▌
█ ````````````````` ▐▌
█ If you want your psyBNC to run automatically even after a reboot it's ▐▌
█ simple- just a few steps are involved. We will make a 'bash script' and ▐▌
█ 'crontab' it. This will check every 10 minutes if it is running, if not ▐▌
█ it will start it for you. I have listed 2 methods how to do this: ▐▌
█ Method 1: Write your own bash script (easy, fun) ▐▌
█ Method 2: Use a pre-made script (quicker, easier) ▐▌
█ ▐▌
█ METHOD 1: WRITE A BASH SCRIPT FOR CRONTAB: ▐▌
█ Login to your shell, issue the cmds in bold below. ▐▌
█ 1. FIND THE LOCATION OF BASH: ▐▌
█ which bash ▐▌
█ My reply is: /bin/bash ▐▌
█ So that will be the path in the top line of the the bash script. Your ▐▌
█ reply might be different. Make a note of the reply/path that it gave you. ▐▌
█ ▐▌
█ 2. UNIQUE PROCESS NAME: ▐▌
█ Then to find something unique in psybnc's process name - something that ▐▌
█ isn't in your other processes. This will show your current running ▐▌
█ processes: ▐▌
█ ps x ▐▌
█ For example reply might be: ▐▌
█ PID TTY STAT TIME COMMAND ▐▌
█ 2052 ? Sl 17:41 ./eggdrop Bot1.conf ▐▌
█ 18526 ? Sl 0:14 ./eggdrop Bot2.conf ▐▌
█ 2239 ? S 0:21 ./psybnc ▐▌
█ 24395 ? R 0:00 sshd: user@pts/3 ▐▌
█ 24396 pts/3 Rs 0:00 -bash ▐▌
█ 24419 pts/3 R+ 0:00 ps x ▐▌
█ ▐▌
█ I'll choose the word 'psybnc', doh :p ▐▌
█ ▐▌
█ 3. CREATE BASH SCRIPT: ▐▌
█ OK lets create a bash script for it, using our unique word for 'SERVICE': ▐▌
█ cd ~ ▐▌
█ pico psybnc.sh (this file doesn't exist yet, name it anything.sh you ▐▌
█ like) ▐▌
█ paste in - changing bash & psybnc to your own correct paths: ▐▌
#!/bin/bash
SERVICE="psybnc"
RUNIT="/home/user/psybnc/./psybnc"
if /bin/ps ax | /bin/grep -v /bin/grep | /bin/grep $SERVICE > /dev/null
then
echo "$SERVICE service running, everything is fine"
else
$RUNIT
fi
exit
█ ▐▌
█ Now set the perms on your new file: ▐▌
█ chmod 744 psybnc.sh ▐▌
█ ▐▌
█ Kill psybnc if it's running: ▐▌
█ kill -15 [its pid number] ▐▌
█ Test the bash script it works correctly: ▐▌
█ ./psybnc.sh ▐▌
█ ▐▌
█ CRONTAB BASH SCRIPT: ▐▌
█ If all went well kill it again so we can test crontab: ▐▌
█ kill -15 [its pid number] ▐▌
█ This will make crontab run the *psybnc.sh every 10 minutes. Where ever ▐▌
█ you pico/created your bash script is its path- you need to have the ▐▌
█ correct full path. Create a crontab: ▐▌
█ crontab -e ▐▌
█ Paste in, below the other crontab jobs if there are any: ▐▌
█ 0,10,20,30,40,50 * * * * /home/user/psybnc.sh >/dev/null 2>&1 ▐▌
█ ▐▌
█ It will reply: crontab: installing new crontab ▐▌
█ Wait 10 minutes and then see if it's running: ▐▌
█ ps x ▐▌
█ ▐▌
█ To list all your crontab jobs: crontab -l ▐▌
█ To remove 'all' your crontab jobs: crontab -r ▐▌
█ To remove only certain jobs of course do: crontab -e ▐▌
█ then remove them. ▐▌
█ ▐▌
█ METHOD 2: USE AN EXISTING SCRIPT TO CRONTAB: ▐▌
█ ```````````````````````````````````````````` ▐▌
█ There is an existing script to do this for you, but be warned it removes ▐▌
█ all your other existing crontabs. So to remedy this problem: ▐▌
█ 1. View your existing crontabs: ▐▌
█ crontab -l ▐▌
█ If anything is on it, copy and paste everything to a note somewhere so ▐▌
█ that you can add them back in after. ▐▌
█ ▐▌
█ 2. cd to your psybnc directory: cd /home/user/psybnc ▐▌
█ then: wget http://www.sjacob.dk/createcrontab ▐▌
█ then: chmod +x createcrontab ▐▌
█ then run the script: ./createcrontab ▐▌
█ To view its entry, enter: crontab -l ▐▌
█ If all is good it will reply: 0,10,20,30,40,50 * * * * /home/user/psybnc/psybncchk >/dev/null
█ ▐▌
█ 3. To add back the removed crontabs, if any, (step 1): ▐▌
█ crontab -e ▐▌
█ Paste those back in on a new line. Ctrl X to save, hit enter to confirm. ▐▌
█ ▐▌
█ //---------------------------------------------------------------------- ▐▌
█ ▐▌
█ If you find mistakes, have suggestions, and or questions please post at ▐▌
█ mewbies forum HERE - thank you. ▐▌
█ ▐▌
█ Last update on 14 Jul '10 ▐▌
█ ▐▌
█▌ █▌
█▌ - mewbies.com - █▌
█▌ █▌
██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██