Snow_Flake

Omegle Bot.py

Oct 10th, 2014
755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.00 KB | None | 0 0
  1.  
  2. import urllib2 as url
  3. import urllib
  4. import httplib as http
  5. import random
  6.  
  7.  
  8. def fmtId( string ):
  9.     return string[1:len( string ) - 1]
  10.  
  11. def omegleConnect():
  12.    
  13.     while True:
  14.         site = url.urlopen('http://omegle.com/start','')
  15.         id = fmtId( site.read() )
  16.         print("#"+id)    
  17.  
  18.         while True:
  19.             site = url.urlopen(req)
  20.             rec = site.read()
  21.             if 'aptcha' in rec:
  22.                 print("#CAPTCHA Problem Found please fix it to be able to continue")
  23.             elif 'identDigests' in rec or 'connected' in rec:
  24.                 print('#A Stranger Have Connected')
  25.                 beginGame(id,req)
  26.                 break
  27.             elif 'waiting' in rec:
  28.                 print("#Waiting...")
  29.  
  30.            
  31.  
  32. def player_input(id,req):
  33.     while True:
  34.         site = url.urlopen(req)
  35.         rec = site.read()
  36.         if 'strangerDisconnected' in rec:
  37.             print('#The Stranger Disconnected')
  38.             running = False
  39.             return '',False
  40.             omegleConnect()
  41.                        
  42.         elif 'gotMessage' in rec:
  43.             message = eval(rec)
  44.             try:
  45.                 print ">> "+message[0][1]
  46.                 message = message[0][1]
  47.             except:
  48.                 print'>>ERROR GETTING MESSAGE'
  49.                 message = 'error'
  50.             return message,True
  51.        
  52. def display(id,req,message):
  53.     typing = url.urlopen('http://omegle.com/typing', '&id='+id)
  54.     typing.close()
  55.  
  56.     msgReq = url.urlopen('http://omegle.com/send', '&msg='+message+'&id='+id)
  57.     print(message)
  58.     msgReq.close()
  59.  
  60. def beginGame(id,req):
  61.     running = True
  62.     display(id,req,'Heyyy')
  63.     display(id,req,'Sub4Sub http://www.youtube.com/user/SnowFlakegoingdeeper ')
  64.     display(id,req,"You Also want a ADs Bot?PM [email protected]")
  65.     name,running = player_input(id,req)
  66.     if not running:
  67.         omegleConnect()
  68.  
  69.     display(id,req,"You Also want a bot? send me a PM [email protected]")
Advertisement
Add Comment
Please, Sign In to add comment