Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib2
- import cookielib
- import thread
- import re
- import os
- import webbrowser
- import sys
- import time
- import datetime
- import socket
- import threading
- import urllib
- import threadingPool
- import getpass
- #--------------------SETTINGS-----------
- #note: I(YG) did not create this aa, I only curate it. I got it from GateCrasher and that's as far down the chain as my awareness goes.
- #another note: I'm not responsible for any spelling errors. I've been doing my best to correct all of those, but there are tons
- SERVER = ""
- USER = ""
- TOTALA = 0
- WON = 0
- TOTALG = 0
- TOTALS = 0
- Header = """
- #------------------------------------------------------------------------------#
- #### # # # # # # ' ### # #
- # # # # # # # # # # # # # #
- # ## # # ### # # ### ### ### ###
- # # # # # # # # # # # # # # #
- #### ### # # # # # ### # # # #
- #------------------------------------------------------------------------------#
- """
- #print HEADER
- def header():
- os.system("cls")
- #print Header
- info = "SERVER: ["+SERVER+"] | ACCOUNT: ["+USER+"] \nATTACKS WON ["+str(WON)+"/"+str(TOTALA)+"] | STRIPPED ["+str(TOTALS)+"] | GAINED ["+str(TOTALG)+"] \n"
- print info
- #------------------Cookie-Jar----------
- socket.setdefaulttimeout(30.0)
- cj = cookielib.CookieJar()
- opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
- opener.addheaders = [('User-agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1 ID:20120614114901')]
- #------------------anti-lag-opener---------
- def alo(url):
- lagsafe = 1
- while lagsafe == 1:
- try:
- site = opener.open(url)
- lagsafe = 0
- except IOError:
- pass
- except Exception:
- pass
- return site
- def alo2(url, pData):
- lagsafe = 1
- while lagsafe == 1:
- try:
- site = opener.open(url, pData)
- lagsafe = 0
- except IOError:
- pass
- except Exception:
- pass
- return site
- def url_opener(url, p_data=None):
- while True:
- try:
- if not p_data:
- site = opener.open(url)
- else:
- site = opener.open(url, p_data)
- break
- except IOError:
- a=1
- except Exception:
- a=1
- return site
- def iB(src, start, end):
- try:
- return src.split(start)[1].split(end)[0]
- except IndexError:
- msg("Could not retrieve the inbetween value.")
- return
- def msg(out):
- thetime = time.strftime("[%H:%M:%S]", time.localtime(time.time()))
- message = thetime + " " + out
- print message
- return message
- def setServerID():
- global SERVER_ID
- if SERVER.lower() == "sigil":
- SERVER_ID = 1
- else:
- SERVER_ID = 2
- def get_char_name(char_id):
- checkname = url_opener("http://"+SERVER+".outwar.com/profile.php?id="+str(char_id) + "&serverid="+str(SERVER_ID)).read()
- char_name = checkname.split('send_ow_message.php?name=')[1].split('">')[0]
- #char_name = char_name.split('">View Treasury Items</a></font><Br />')[0]
- return char_name
- def configure():
- header()
- print 'Login with session ID?: \n'
- sess = raw_input("yes/no: ")
- header()
- global SERVER
- if sess.lower() == "yes":
- global RG_SESS_ID
- print 'Enter the session_id:\n'
- RG_SESS_ID = raw_input('Sess_ID: ')
- header()
- print 'Please select your server sigil or torax:\n'
- SERVER = raw_input('Server: ')
- header()
- setServerID()
- loginRGSessionID()
- else:
- global USERNAME, PASSWORD
- print 'Enter your username:\n'
- USERNAME = raw_input('Username: ')
- header()
- print 'Password will not show even when typing:\n'
- PASSWORD = getpass.getpass()
- header()
- print 'Please select your server sigil or torax:\n'
- SERVER = raw_input('Server: ')
- header()
- setServerID()
- login()
- def loginRGSessionID():
- msg('Trying to log in\n')
- loginRGA = alo("http://"+SERVER+".outwar.com/accounts.php?ac_serverid="+str(SERVER_ID)+"&rg_sess_id="+RG_SESS_ID).read()
- header()
- msg('Logged in\n')
- msg('Loading Accounts please wait...\n')
- AccountSelector()
- #AccountSelector(SERVER, SERVER_ID)
- def login():
- msg('Trying to log in\n')
- loginRGA = alo2("http://"+SERVER+".outwar.com/myaccount.php", "login_username="+USERNAME+"&login_password="+PASSWORD).read()
- header()
- msg('Logged in\n')
- msg('Loading Accounts please wait...\n')
- AccountSelector()
- #AccountSelector(SERVER, SERVER_ID)
- #def AccountSelector(server, serverid):
- def AccountSelector():
- x = 1
- c = 0
- global acctName, acctID
- acctName = []
- acctID = []
- totalName = 0
- name = alo("http://" + SERVER + ".outwar.com/accounts.php?ac_serverid=" + str(SERVER_ID)).read()
- nameReader = name
- nameReader = nameReader.split("\n")
- while x == 1:
- nameCode = nameReader[c].strip()
- if nameCode.find('star.jpg') != -1:
- c = c + 3
- nameCode = nameReader[c].split('</b>')
- nameCode = nameCode[0].split('<b>')
- nameCode = nameCode[1]
- acctName.append(nameCode)
- totalName = totalName + 1
- if nameCode == "</body>" or nameCode.find('Trustee Access') != -1:
- x = 0
- else:
- c = c + 1
- x = 1
- c = 0
- while x == 1:
- nameCode = nameReader[c].strip()
- if nameCode.find('world.php?suid=') != -1:
- nameCode = nameReader[c].split('"><font color=')[0].split('href="')[1]
- acctID.append(nameCode)
- if nameCode == '</body>':
- x = 0
- else:
- c = c + 1
- c = 0
- c2 = 1
- print ''
- while totalName > c:
- temp = acctName[c]
- print str(c2) + ' - ' + temp
- c = c + 1
- c2 = c2 + 1
- x = 1
- while x == 1:
- print ''
- print 'Select Account to attack with'
- num = raw_input('Enter #: ')
- number = int(num)
- if number > totalName or number <= 0:
- print 'Invalid Selection'
- else:
- global NUM_CHARS
- NUM_CHARS = totalName
- x = 0
- global USER, attackerID
- attackerID = iB(acctID[number-1], "suid=", "&")
- USER = acctName[number-1]
- header()
- print 'Loading ' +USER
- changechar = url_opener("http://"+SERVER+".outwar.com/home.php?suid="+attackerID).read()
- msg('You selected ' +USER)
- def castbrut():
- print 'Casting brut on ' + USER
- profile = url_opener("http://"+SERVER+".outwar.com/profile.php?="+attackerID).read()
- if "/images/skills/skill_40.gif" in profile:
- print USER +" Already has a brut cast"
- return
- backpack = url_opener("http://"+SERVER+".outwar.com/backpack.php?potion=1").read()
- if "images/potion1.jpg" in backpack:
- brut = backpack.split("images/potion1.jpg")
- brut = brut[1].split("itempopup(event,'")
- brut = brut[1].split("')")
- brut = brut[0]
- cast = url_opener("http://"+SERVER+".outwar.com/home.php?itemaction="+brut).read()
- while 'Level 1 Brutality Potion' not in cast:
- print "Error casting Brut, retrying on" + USER
- backpack = url_opener("http://"+SERVER+".outwar.com/backpack.php?potion=1").read()
- if "images/potion1.jpg" in backpack:
- brut = backpack.split("images/potion1.jpg")
- brut = brut[1].split("itempopup(event,'")
- brut = brut[1].split("')")
- brut = brut[0]
- cast = url_opener("http://"+SERVER+".outwar.com/home.php?itemaction="+brut).read()
- print "Casted Brut on " + USER
- else:
- print "Casted Brut on " + USER
- else:
- window.geometry("1x1+"+str(window.winfo_screenwidth()/2)+"+"+str(window.winfo_screenheight()/2))
- tkMessageBox.showinfo(title="ERROR", message="Out of bruts!" % USER)
- print "out of Bruts"
- def actlistcrew():
- global actstohit
- actstohit = ''
- print "Enter the crew ids you would like to load\n"
- crewids = raw_input("crew id: ")
- header()
- print 'Please wait a few seconds to load the crew.\n'
- if ',' != crewids:
- crewids = crewids + ','
- crewids = crewids.split(',')
- for crew in crewids:
- if crew != '':
- changechar = url_opener("http://"+SERVER+".outwar.com/crew_profile.php?id="+crew).read()
- actids = changechar.split('<td style="padding-left:25px;" align="left">')
- count = 1
- for actid in actids:
- if count > 1:
- actid = actid.split('</td>')
- actlvl = actid[2].split('<td align="center">')
- actlvl = actlvl[1]
- actid = actid[1].split('profile.php?id=')
- actid = actid[1].split('">')
- actid = actid[0]
- if int(actlvl) >= 65:
- if actstohit == '':
- actstohit = actid
- else:
- actstohit = actstohit + ',' + actid
- count = count +1
- actstohit = actstohit.split(',')
- return actstohit
- msg('Accounts loaded\n')
- def actlisthl():
- header()
- global actstohit
- actstohit = ''
- print 'Please wait a few seconds to load the hitlist.\n'
- page = url_opener("http://"+SERVER+".outwar.com/crew_hitlist.php").read()
- page = page.split("Crew Hit List")[1]
- atckids = page.split("attackWindow('")[1:]
- ids = ''
- for hlids in atckids:
- hlid = hlids.split("','")[1]
- ids = ids + ',' + hlid
- actstohit = ids[1:].split(',')
- msg('Accounts loaded\n')
- return actstohit
- time.sleep(5)
- def attack(actid):
- attackaccount = get_char_name(actid)
- #msg('Attacking ' + attackaccount)
- global WON,TOTALS,TOTALG,TOTALA
- while True:
- profile = url_opener("http://"+SERVER+".outwar.com/profile.php?serverid=2&id="+actid).read()
- if "attackWindow" in profile:
- hash = profile.split("attackWindow('")
- hash = hash[1].split(')">')
- hash = hash[0].split("','")
- name = hash[0]
- hash = hash[3].replace("'",'')
- attack = url_opener("http://"+SERVER+".outwar.com/somethingelse.php?serverid=2&attackid="+actid+"&r=undefined", "message="+myMessage+"&hash="+hash+"&rage=500").read()
- #print attack
- if "You have won the battle" in attack:
- strip = 0
- gain = 0
- if 'stripped' in attack:
- stripped = attack.split('stripped')[1]
- strip = stripped.split('xp')[0].split("'>")[1]
- gain = stripped.split('xp')[1].split("'>")[1]
- WON = WON + 1
- TOTALA = 1 + TOTALA
- TOTALS = TOTALS + int(strip)
- TOTALG = TOTALG + int(gain)
- msg('Attack won on ' + attackaccount)
- msg('You stripped ' +str(strip) + 'xp and gained '+str(gain)+'xp')
- time.sleep(1)
- header()
- break
- elif "is your ally" in attack.lower():
- msg('' + attackaccount + ' is your ally')
- header()
- break
- elif "This player is a member of an Allied crew" in attack:
- msg('' +attackaccount + ' is a member of an Allied crew')
- header()
- break
- elif "You can not attack this player at this time as they are" in attack:
- msg('' + attackaccount + ' is a puss and is under the effects of PVP Immunity.')
- header()
- break
- elif "You have been defeated!" in attack:
- msg('You have been defeated by ' + attackaccount)
- TOTALA = TOTALA + 1
- header()
- break
- else:
- msg('Error Attacking... Retrying')
- header()
- else:
- msg(USER + ' you are trying to attack '+attackaccount +' too soon')
- header()
- break
- def attackPool(actstohit):
- pool = threadingPool.ThreadPool(5)
- for act in actstohit:
- pool.add_task(attack, act)
- attack(act)
- pool.wait_completion()
- ##if SERVER.lower() == "sigil":
- ## SERVER_ID = 1
- ##else:
- ## SERVER_ID = 2
- #MAIN
- #print get_char_name('225857')
- print Header
- header()
- configure()
- ans=True
- while ans:
- header()
- print("""
- 1. Change RGA: 5. Cast brute:
- 2. Change Account: 6. Attack:
- 3. Load a crew: 7. Exit:
- 4. Load Hitlist:
- """)
- ans=raw_input("What would you like to do? ")
- if ans=="1":
- configure()
- elif ans=="2":
- header()
- AccountSelector()
- elif ans=="3":
- header()
- actstohit = actlistcrew()
- elif ans=="4":
- header()
- actstohit = actlisthl()
- elif ans=="6":
- header()
- toMessage = raw_input("Would you like to send messages with your attacks? yes/no ")
- if 'y' in toMessage.lower():
- myMessage = raw_input("What would you like to message them? ")
- elif 'n' in toMessage.lower():
- myMessage = ''
- attackPool(actstohit)
- elif ans=="5":
- header()
- castbrut()
- elif ans=="7":
- print("\n Goodbye")
- ans = None
- else:
- print("\n Not Valid Choice Try again")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement