Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.01 KB | None | 0 0
  1. import urllib2
  2. import cookielib
  3. import thread
  4. import re
  5. import os
  6. import webbrowser
  7. import sys
  8. import time
  9. import datetime
  10. import socket
  11. import threading
  12. import urllib
  13. import getpass
  14. #--------------------SETTINGS-----------
  15. #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.
  16. #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
  17. SERVER = "sigil"
  18. USER = "voodoo"
  19. TOTALA = 0
  20. WON = 0
  21. TOTALG = 0
  22. TOTALS = 0
  23. Header = """
  24. #------------------------------------------------------------------------------#
  25. #### # # # # # # ' ### # #
  26. # # # # # # # # # # # # # #
  27. # ## # # ### # # ### ### ### ###
  28. # # # # # # # # # # # # # # #
  29. #### ### # # # # # ### # # # #
  30.  
  31. #------------------------------------------------------------------------------#
  32. """
  33. #print HEADER
  34. def header():
  35. os.system("cls")
  36. #print Header
  37. info = "SERVER: ["+SERVER+"] | ACCOUNT: ["+USER+"] \nATTACKS WON ["+str(WON)+"/"+str(TOTALA)+"] | STRIPPED ["+str(TOTALS)+"] | GAINED ["+str(TOTALG)+"] \n"
  38. print info
  39. #------------------Cookie-Jar----------
  40. socket.setdefaulttimeout(30.0)
  41.  
  42. cj = cookielib.CookieJar()
  43. opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
  44. opener.addheaders = [('User-agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1 ID:20120614114901')]
  45.  
  46. #------------------anti-lag-opener---------
  47. def alo(url):
  48. lagsafe = 1
  49. while lagsafe == 1:
  50. try:
  51. site = opener.open(url)
  52. lagsafe = 0
  53. except IOError:
  54. pass
  55. except Exception:
  56. pass
  57. return site
  58.  
  59. def alo2(url, pData):
  60. lagsafe = 1
  61. while lagsafe == 1:
  62. try:
  63. site = opener.open(url, pData)
  64. lagsafe = 0
  65. except IOError:
  66. pass
  67. except Exception:
  68. pass
  69. return site
  70.  
  71. def url_opener(url, p_data=None):
  72. while True:
  73. try:
  74. if not p_data:
  75. site = opener.open(url)
  76. else:
  77. site = opener.open(url, p_data)
  78. break
  79. except IOError:
  80. a=1
  81. except Exception:
  82. a=1
  83. return site
  84.  
  85. def iB(src, start, end):
  86. try:
  87. return src.split(start)[1].split(end)[0]
  88. except IndexError:
  89. msg("Could not retrieve the inbetween value.")
  90. return
  91.  
  92. def msg(out):
  93. thetime = time.strftime("[%H:%M:%S]", time.localtime(time.time()))
  94. message = thetime + " " + out
  95. print message
  96. return message
  97.  
  98. def setServerID():
  99. global SERVER_ID
  100. if SERVER.lower() == "sigil":
  101. SERVER_ID = 1
  102. else:
  103. SERVER_ID = 2
  104.  
  105. def get_char_name(char_id):
  106. checkname = url_opener("http://"+SERVER+".outwar.com/profile.php?id="+str(char_id) + "&serverid="+str(SERVER_ID)).read()
  107. char_name = checkname.split('send_ow_message.php?name=')[1].split('">')[0]
  108. #char_name = char_name.split('">View Treasury Items</a></font><Br />')[0]
  109. return char_name
  110.  
  111. def configure():
  112. header()
  113. print 'Login with session ID?: \n'
  114. sess = raw_input("yes/no: ")
  115. header()
  116. global SERVER
  117. if sess.lower() == "yes":
  118. global RG_SESS_ID
  119. print 'Enter the session_id:\n'
  120. RG_SESS_ID = raw_input('Sess_ID: ')
  121. header()
  122. print 'Please select your server sigil or torax:\n'
  123. SERVER = raw_input('Server: ')
  124. header()
  125. setServerID()
  126. loginRGSessionID()
  127. else:
  128. global USERNAME, PASSWORD
  129. print 'Enter your username:\n'
  130. USERNAME = raw_input('Username: ')
  131. header()
  132. print 'Password will not show even when typing:\n'
  133. PASSWORD = getpass.getpass()
  134. header()
  135. print 'Please select your server sigil or torax:\n'
  136. SERVER = raw_input('Server: ')
  137. header()
  138. setServerID()
  139. login()
  140.  
  141. def loginRGSessionID():
  142. msg('Trying to log in\n')
  143. loginRGA = alo("http://"+SERVER+".outwar.com/accounts.php?ac_serverid="+str(SERVER_ID)+"&rg_sess_id="+RG_SESS_ID).read()
  144. header()
  145. msg('Logged in\n')
  146. msg('Loading Accounts please wait...\n')
  147. AccountSelector()
  148. #AccountSelector(SERVER, SERVER_ID)
  149.  
  150. def login():
  151. msg('Trying to log in\n')
  152. loginRGA = alo2("http://"+SERVER+".outwar.com/myaccount.php", "login_username="+USERNAME+"&login_password="+PASSWORD).read()
  153. header()
  154. msg('Logged in\n')
  155. msg('Loading Accounts please wait...\n')
  156. AccountSelector()
  157. #AccountSelector(SERVER, SERVER_ID)
  158.  
  159. #def AccountSelector(server, serverid):
  160. def AccountSelector():
  161. x = 1
  162. c = 0
  163. global acctName, acctID
  164. acctName = []
  165. acctID = []
  166. totalName = 0
  167. name = alo("http://" + SERVER + ".outwar.com/accounts.php?ac_serverid=" + str(SERVER_ID)).read()
  168. nameReader = name
  169. nameReader = nameReader.split("\n")
  170. while x == 1:
  171. nameCode = nameReader[c].strip()
  172. if nameCode.find('star.jpg') != -1:
  173. c = c + 3
  174. nameCode = nameReader[c].split('</b>')
  175. nameCode = nameCode[0].split('<b>')
  176. nameCode = nameCode[1]
  177. acctName.append(nameCode)
  178. totalName = totalName + 1
  179. if nameCode == "</body>" or nameCode.find('Trustee Access') != -1:
  180. x = 0
  181. else:
  182. c = c + 1
  183. x = 1
  184. c = 0
  185. while x == 1:
  186. nameCode = nameReader[c].strip()
  187. if nameCode.find('world.php?suid=') != -1:
  188. nameCode = nameReader[c].split('"><font color=')[0].split('href="')[1]
  189. acctID.append(nameCode)
  190. if nameCode == '</body>':
  191. x = 0
  192. else:
  193. c = c + 1
  194. c = 0
  195. c2 = 1
  196. print ''
  197. while totalName > c:
  198. temp = acctName[c]
  199. print str(c2) + ' - ' + temp
  200. c = c + 1
  201. c2 = c2 + 1
  202. x = 1
  203. while x == 1:
  204. print ''
  205. print 'Select Account to attack with'
  206. num = raw_input('Enter #: ')
  207. number = int(num)
  208. if number > totalName or number <= 0:
  209. print 'Invalid Selection'
  210. else:
  211. global NUM_CHARS
  212. NUM_CHARS = totalName
  213. x = 0
  214. global USER, attackerID
  215. attackerID = iB(acctID[number-1], "suid=", "&")
  216. USER = acctName[number-1]
  217. header()
  218. print 'Loading ' +USER
  219. changechar = url_opener("http://"+SERVER+".outwar.com/home.php?suid="+attackerID).read()
  220. msg('You selected ' +USER)
  221.  
  222. def castbrut():
  223. print 'Casting brut on ' + USER
  224. profile = url_opener("http://"+SERVER+".outwar.com/profile.php?="+attackerID).read()
  225. if "/images/skills/skill_40.gif" in profile:
  226. print USER +" Already has a brut cast"
  227. return
  228. backpack = url_opener("http://"+SERVER+".outwar.com/backpack.php?potion=1").read()
  229. if "images/potion1.jpg" in backpack:
  230. brut = backpack.split("images/potion1.jpg")
  231. brut = brut[1].split("itempopup(event,'")
  232. brut = brut[1].split("')")
  233. brut = brut[0]
  234. cast = url_opener("http://"+SERVER+".outwar.com/home.php?itemaction="+brut).read()
  235. while 'Level 1 Brutality Potion' not in cast:
  236. print "Error casting Brut, retrying on" + USER
  237. backpack = url_opener("http://"+SERVER+".outwar.com/backpack.php?potion=1").read()
  238. if "images/potion1.jpg" in backpack:
  239. brut = backpack.split("images/potion1.jpg")
  240. brut = brut[1].split("itempopup(event,'")
  241. brut = brut[1].split("')")
  242. brut = brut[0]
  243. cast = url_opener("http://"+SERVER+".outwar.com/home.php?itemaction="+brut).read()
  244. print "Casted Brut on " + USER
  245. else:
  246. print "Casted Brut on " + USER
  247. else:
  248. window.geometry("1x1+"+str(window.winfo_screenwidth()/2)+"+"+str(window.winfo_screenheight()/2))
  249. tkMessageBox.showinfo(title="ERROR", message="Out of bruts!" % USER)
  250. print "out of Bruts"
  251.  
  252. def actlistcrew():
  253. global actstohit
  254. actstohit = ''
  255. print "Enter the crew ids you would like to load\n"
  256. crewids = raw_input("crew id: ")
  257. header()
  258. print 'Please wait a few seconds to load the crew.\n'
  259. if ',' != crewids:
  260. crewids = crewids + ','
  261. crewids = crewids.split(',')
  262. for crew in crewids:
  263. if crew != '':
  264. changechar = url_opener("http://"+SERVER+".outwar.com/crew_profile.php?id="+crew).read()
  265. actids = changechar.split('<td style="padding-left:25px;" align="left">')
  266. count = 1
  267. for actid in actids:
  268. if count > 1:
  269. actid = actid.split('</td>')
  270. actlvl = actid[2].split('<td align="center">')
  271. actlvl = actlvl[1]
  272. actid = actid[1].split('profile.php?id=')
  273. actid = actid[1].split('">')
  274. actid = actid[0]
  275. if int(actlvl) >= 65:
  276. if actstohit == '':
  277. actstohit = actid
  278. else:
  279. actstohit = actstohit + ',' + actid
  280. count = count +1
  281. actstohit = actstohit.split(',')
  282. return actstohit
  283. msg('Accounts loaded\n')
  284.  
  285. def actlisthl():
  286. header()
  287. global actstohit
  288. actstohit = ''
  289. print 'Please wait a few seconds to load the hitlist.\n'
  290. page = url_opener("http://"+SERVER+".outwar.com/crew_hitlist.php").read()
  291. page = page.split("Crew Hit List")[1]
  292. atckids = page.split("attackWindow('")[1:]
  293. ids = ''
  294. for hlids in atckids:
  295. hlid = hlids.split("','")[1]
  296. ids = ids + ',' + hlid
  297. actstohit = ids[1:].split(',')
  298. msg('Accounts loaded\n')
  299. return actstohit
  300. time.sleep(5)
  301.  
  302. def attack(actid):
  303. attackaccount = get_char_name(actid)
  304. #msg('Attacking ' + attackaccount)
  305. global WON,TOTALS,TOTALG,TOTALA
  306. while True:
  307. profile = url_opener("http://"+SERVER+".outwar.com/profile.php?serverid=2&id="+actid).read()
  308. if "attackWindow" in profile:
  309. hash = profile.split("attackWindow('")
  310. hash = hash[1].split(')">')
  311. hash = hash[0].split("','")
  312. name = hash[0]
  313. hash = hash[3].replace("'",'')
  314. attack = url_opener("http://"+SERVER+".outwar.com/somethingelse.php?serverid=2&attackid="+actid+"&r=undefined", "message="+myMessage+"&hash="+hash+"&rage=500").read()
  315. #print attack
  316. if "You have won the battle" in attack:
  317. strip = 0
  318. gain = 0
  319. if 'stripped' in attack:
  320. stripped = attack.split('stripped')[1]
  321. strip = stripped.split('xp')[0].split("'>")[1]
  322. gain = stripped.split('xp')[1].split("'>")[1]
  323. WON = WON + 1
  324. TOTALA = 1 + TOTALA
  325. TOTALS = TOTALS + int(strip)
  326. TOTALG = TOTALG + int(gain)
  327. msg('Attack won on ' + attackaccount)
  328. msg('You stripped ' +str(strip) + 'xp and gained '+str(gain)+'xp')
  329. time.sleep(1)
  330. header()
  331. break
  332. elif "is your ally" in attack.lower():
  333. msg('' + attackaccount + ' is your ally')
  334. header()
  335. break
  336. elif "This player is a member of an Allied crew" in attack:
  337. msg('' +attackaccount + ' is a member of an Allied crew')
  338. header()
  339. break
  340. elif "You can not attack this player at this time as they are" in attack:
  341. msg('' + attackaccount + ' is a puss and is under the effects of PVP Immunity.')
  342. header()
  343. break
  344. elif "You have been defeated!" in attack:
  345. msg('You have been defeated by ' + attackaccount)
  346. TOTALA = TOTALA + 1
  347. header()
  348. break
  349. else:
  350. msg('Error Attacking... Retrying')
  351. header()
  352. else:
  353. msg(USER + ' you are trying to attack '+attackaccount +' too soon')
  354. header()
  355. break
  356.  
  357. def attackPool(actstohit):
  358. pool = threadingPool.ThreadPool(5)
  359. for act in actstohit:
  360. pool.add_task(attack, act)
  361. attack(act)
  362. pool.wait_completion()
  363. ##if SERVER.lower() == "sigil":
  364. ## SERVER_ID = 1
  365. ##else:
  366. ## SERVER_ID = 2
  367. #MAIN
  368. #print get_char_name('225857')
  369. print Header
  370. header()
  371. configure()
  372. ans=True
  373. while ans:
  374. header()
  375. print("""
  376. 1. Change RGA: 5. Cast brute:
  377. 2. Change Account: 6. Attack:
  378. 3. Load a crew: 7. Exit:
  379. 4. Load Hitlist:
  380. """)
  381. ans=raw_input("What would you like to do? ")
  382. if ans=="1":
  383. configure()
  384. elif ans=="2":
  385. header()
  386. AccountSelector()
  387. elif ans=="3":
  388. header()
  389. actstohit = actlistcrew()
  390. elif ans=="4":
  391. header()
  392. actstohit = actlisthl()
  393. elif ans=="6":
  394. header()
  395. toMessage = raw_input("Would you like to send messages with your attacks? yes/no ")
  396. if 'y' in toMessage.lower():
  397. myMessage = raw_input("What would you like to message them? ")
  398. elif 'n' in toMessage.lower():
  399. myMessage = ''
  400. attackPool(actstohit)
  401. elif ans=="5":
  402. header()
  403. castbrut()
  404. elif ans=="7":
  405. print("\n Goodbye")
  406. ans = None
  407. else:
  408. print("\n Not Valid Choice Try again")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement