Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 860249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:47:17+00:00 2026-05-15T08:47:17+00:00

import socket, sys, string if len(sys.argv) !=4 : print Usage: ./supabot.py <host> <port> <channel>

  • 0
import socket, sys, string

if len(sys.argv) !=4 :
    print "Usage: ./supabot.py <host> <port> <channel>"
    sys.exit(1)

irc = sys.argv[1]
port = int(sys.argv[2])
chan = sys.argv[3]
sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sck.connect((irc, port))
sck.send('NICK supaBOT\r\n')
sck.send('USER supaBOT supaBOT supaBOT :supaBOT Script\r\n')
sck.send('JOIN ' + " " + chan + '\r\n')
data = ''
while True:
      data = sck.recv(1024)
      if data.find('PING') != -1:
         sck.send('PONG ' + data.split() [1] + '\r\n')
         print data
      elif data.find('!info') != -1:
           sck.send('PRIVMSG ' + chan + ' :' + ' supaBOT v1 by sourD ' + '\r\n')
           print data
      elif data.find('!commands') != -1:
           nick = data.split('!')[ 0 ].replace(':',' ') 
           if nick == "s0urd":
              sck.send('PRIVMSG ' + chan + ' :' + ' no commands have been set ' + '\r\n')
           else:
                sck.send('PRIVMSG ' + chan + ' :' + ' youre not my master ' + '\r\n')
                print data
      elif data.find('PRIVMSG') != -1: 
           message = ':'.join(data.split (':')[2:]) 
           if message.lower().find('darkunderground') == -1: 
           nick = data.split('!')[ 0 ].replace(':',' ') 
           destination = ''.join (data.split(':')[:2]).split (' ')[-2] 
           function = message.split( )[0] 
           print nick + ' : ' + function
           arg = data.split( )   

print sck.recv(1024)

my nick in IRC is s0urd but when I type !commands I get “youre not my master” but my nick is s0urd. Maybe I did the whole nick thing wrong, I don’t know, but any help would be appreciated, thanks.

line 26

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:47:18+00:00Added an answer on May 15, 2026 at 8:47 am
    nick = data.split('!')[ 0 ].replace(':',' ') 
    

    That’s going to replace the : with a space (), and thus the resulting string will be "s0urd ", not "s0urd". You probably meant this instead:

    nick = data.split('!')[ 0 ].replace(':','')
    

    Note the lack of space between the '' being passed as the replacement string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Server import socket import sys s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) host= 'VAC01.VACLab.com' port=int(2000) s.bind((host,port)) s.listen(1) conn,addr =s.accept() data=s.recv(100000)
import socket from time import strftime time = strftime(%H:%M:%S) irc = 'irc.tormented-box.net' port =
I have a script that does something like the following... import socket hostIP=sys.argv[1] if
import re , strings , os ,sys sentence = abcdefghijkl for i in range(0,len(sentence),3):
from Tkinter import * import socket, sys, os import tkMessageBox root = Tk() root.title(File
from Tkinter import * import socket, sys from PIL import Image, ImageTk root =
here is my code : import socket import sys import re import base64 import
Consider this code: import socket store = [] scount = 0 while True: scount+=1
I have the following script: import socks import socket socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, 127.0.0.1, 9050) socket.socket =
The code below binds an ip address to urllib, urllib2, etc. import socket true_socket

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.