Devilzc0de Forum Follow @devilzc0de
  • Home
  • Hacking
  • Networking
  • Programming
  • O.S
  • Server
  • Tweets
  • Search
  • Member List
  • Calendar
Current time: 06-20-2013, 01:03 PM Hello There, Guest! (Login — Register)
Devilzc0de Forum › Information Technology › Programming › Python v
« Previous 1 2 3 4

voidbot (IRC bot simple example with python)

Home General Computer Multimedia Business Lounge

Post Reply 
Tweet
Threaded Mode | Linear Mode
voidbot (IRC bot simple example with python)
11-17-2010, 08:11 AM
Post: #1
5ynL0rd Offline
DC Senior
***
Posts: 53
Joined: Oct 2010
Reputation: 14
voidbot (IRC bot simple example with python)
[Image: voidbot.png]

coded by me
Code:
import os
import IRCLib #this module is including in archive of voidbot.tar.gz
import re
import time
import string
import commands

IRCLib.DEBUG = True # for see what output detail when connecting to irc server

class voidbot(IRCLib.SimpleIRCClient):
    def __init__(self, server, port, nick, channel):
        IRCLib.SimpleIRCClient.__init__(self)
        self.connect(server, port, nick)
        self.channel = channel

    def on_welcome(self, connection, event):
        connection.join(self.channel)
        connection.privmsg(self.channel, 'I\'m a %s bot!' % nick)
        connection.privmsg(self.channel, 'AT YOUR SERVICE MASTER %s' % master)

    def on_pubmsg(self, connection, event):
        msg = event.arguments()[0].split(' ', 1)
        user = event.source().split('!')[0]
        eve = event.eventtype()
        targa = event.target()

        if user == master and msg[0] == 'hei':
            connection.privmsg(self.channel, 'FOR U MY LORD!..')
            print eve, targa
        if user == master and msg[0] == 'spamhere':
            for i in range(10):
                time.sleep(1)
                connection.privmsg(self.channel, 'SPAM TEST FOR MY LORD....')
        if user == master and msg[0] == 'getout':
            connection.privmsg(self.channel, 'YES MY LORD....')
            connection.close()
        if user == master and targa == channel and string.join(msg,' ') == 'hey bot':
            connection.privmsg(self.channel, 'AT YOUR SERVICE MY LORD....')
        if user == master and targa == channel and msg[0] == 'cmd':
            cmd = commands.getoutput(string.join(msg,' ').replace('cmd ',''))
            y = cmd.split('\n')
            for i in y:
                time.sleep(0.5)
                connection.privmsg(self.channel, '%s'%i)
        if targa == channel and user != master and msg[0] != 'cool':
            connection.privmsg(self.channel, 'hey %s! what the meanings of \'%s\'??'
                % (user, string.join(msg,' ')))
        if targa == channel and user != master and msg[0] == 'cool':
            connection.privmsg(self.channel, 'really??')
    def on_join(self, connection, event):
        if event.source().split('!')[0] != nick:
            connection.privmsg(self.channel,
                'Hi %s! I\'am a %sbot' % (user, nick)

if __name__ == '__main__':
    master = raw_input('[+] Master nick: ')
    server = raw_input('[+] IRC server hostname/IP: ')
    port = input('[+] port: ')
    nick = raw_input('[+] bot nick: ')+str(os.getpid())
    channel = raw_input('[+] channel: ')
    print 'trying to connecting...'
    vbot = voidbot(server, port, nick, channel)
    vbot.start()

download complete source here (with IRCLib):
http://voidnetwork.org/5ynL0rd/c0depy/voidbot.tar.gz
Visit this user's website Find all posts by this user
Quote this message in a reply
11-17-2010, 08:36 AM
Post: #2
chaer.newbie Offline
--------------------------
*****
Dewa
Posts: 5,350
Joined: Dec 2009
Reputation: 187
RE: voidbot (IRC bot simple example with python)
wkekekekkeke...

progremmer uler kadut, berkoar juga akhirnya

mantap bro ketawa
Find all posts by this user
Quote this message in a reply
11-17-2010, 08:41 AM
Post: #3
5ynL0rd Offline
DC Senior
***
Posts: 53
Joined: Oct 2010
Reputation: 14
RE: voidbot (IRC bot simple example with python)
bukan ular kadut, tp ular idaman wanita
Visit this user's website Find all posts by this user
Quote this message in a reply
 Reputed by :  Wayc0de(+1)
11-17-2010, 08:52 AM
Post: #4
Wayc0de Offline
-= Sifu Makan Sonice =-
**
Moderators
Posts: 2,994
Joined: Nov 2010
Reputation: 61
RE: voidbot (IRC bot simple example with python)
wah botnya lewat si ular python ea gan.,., mantap

ru denger ane, lw bot IRC bisa dibuat ri ular python.,.

sekalian ane kcie yg dingin2 empuk hmm
Visit this user's website Find all posts by this user
Quote this message in a reply
11-17-2010, 11:30 AM
Post: #5
kiddies Away
Administrator
*******
Administrators
Posts: 1,225
Joined: Dec 2009
Reputation: 40
RE: voidbot (IRC bot simple example with python)
lwlwlw... ini dia jagoan kita si luler kasur..wkwkw...pa kabar loh...udeh lama nih gak main2 ke irc lagi...sibuk ngurusin project ini itu sama task dari luh juga lum kelar2
Find all posts by this user
Quote this message in a reply
11-17-2010, 01:05 PM
Post: #6
5ynL0rd Offline
DC Senior
***
Posts: 53
Joined: Oct 2010
Reputation: 14
RE: voidbot (IRC bot simple example with python)
sante saja.. :) mdh2n akhir bulan gw byk wkt beresin portal (gw resign soalnya hehe)
Visit this user's website Find all posts by this user
Quote this message in a reply
11-17-2010, 01:07 PM
Post: #7
kiddies Away
Administrator
*******
Administrators
Posts: 1,225
Joined: Dec 2009
Reputation: 40
RE: voidbot (IRC bot simple example with python)
oohh.. ok deh..w juga mau selesain semua tugas nih..ngebut but but..hahahaha
Find all posts by this user
Quote this message in a reply
11-29-2010, 07:26 AM
Post: #8
rj-45 Offline
./Devilz 1st Cadet
Posts: 25
Joined: Jun 2010
Reputation: 0
RE: voidbot (IRC bot simple example with python)
caran makenya gmna sih??
terus bwt apa sih ni...
Find all posts by this user
Quote this message in a reply
11-29-2010, 11:01 AM (This post was last modified: 11-29-2010 11:01 AM by mariachi.)
Post: #9
mariachi Away
has been reboot
**
Moderators
Posts: 2,441
Joined: Nov 2010
Reputation: 69
RE: voidbot (IRC bot simple example with python)
buat rj-45 : ini tuch bot buat irc. cara jalaninya tinggal upload ke shell kita, di ekstrak trus dijalanin.
buat rj-45 : ini tuch bot buat irc. cara jalaninya tinggal upload ke shell kita, di ekstrak trus dijalanin.
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Topic Tools
Topic Link :
BBCode :
HTML Code :
View a Printable Version Send Thread to a Friend Subscribe to this thread
Submit Google Submit Face book Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  programming python untuk web alessandra 12 1,339 Yesterday 05:58 PM
Last Post: ghosthands
Thumbs Up Belajar Python GUI Gaya Baru candragati 20 840 05-18-2013 07:49 PM
Last Post: dewa-crot
  NGOPREK Bahasa Pemprograman (Python) Bunga.Mataharry 29 7,348 04-30-2013 06:07 PM
Last Post: pr4bu_51l1w4n61
  how to create login auth with django framework (python) 5ynL0rd 6 1,803 04-25-2013 08:06 AM
Last Post: dophponh
Star [Tutor] Materi DIC "Basic Programming Python" root31 20 498 04-23-2013 07:56 AM
Last Post: orochimadit
  [PYTHON] Install Python di Windows sang.sakaya 12 3,956 04-19-2013 03:40 PM
Last Post: fata
  [cloning] nembak cewek dengan python test 13 460 03-31-2013 11:58 AM
Last Post: 2easy4me
  Belajar bahasa pemrograman Python whitehat 17 5,444 03-03-2013 08:01 PM
Last Post: eM.eL
  [Tutor] [Share]Program Pencacah Pecahan dengan Python hitheir 5 372 02-24-2013 02:21 PM
Last Post: ghosthands
  [Tutor] Slideshare Disabled Python Looping Slide Download hitheir 9 227 01-27-2013 05:53 PM
Last Post: sotbot

Users Browsing
1 Guest(s)

  • Contact Us
  • devilzc0de
  • Return to Top
  • Mobile Version
  • RSS Syndication
  • Help
Current time: 06-20-2013, 01:03 PM Powered By MyBB, © 2002-2013 MyBB Group. Theme created by Justin S. | Mixed By Chaer.Newbie | Fixed By Aditya

USING THIS SITE INDICATES THAT YOU HAVE READ AND ACCEPT OUR TERMS. IF YOU DO NOT ACCEPT THESE TERMS, YOU ARE NOT AUTHORIZED TO USE THIS SITE