Ow guides n tricks

Macros ow guides etc

Most active topics

Latest topics

» Badlands macro
Sun Jan 10, 2016 4:58 pm by Admin

» Trading wow stuff for ow stuff
Tue Dec 08, 2015 11:26 pm by Admin

» Gold pot buyer
Tue Dec 08, 2015 10:28 pm by Admin

» Underling buffer
Tue Dec 08, 2015 10:25 pm by Admin

» Woz transfer python made by c0d3r
Wed May 07, 2014 11:59 am by Admin

» Edcaa mob lists
Mon Apr 07, 2014 5:33 pm by Admin

» Bookmark login
Sun Jan 12, 2014 5:08 pm by Admin

» Py Kix Potion quest items transfer
Mon Sep 09, 2013 7:17 pm by Admin

» py edited version God arj
Thu Mar 21, 2013 3:28 pm by Admin

Poll


    Gold pot buyer

    Share

    Admin
    Admin

    Posts : 39
    Join date : 2011-11-18

    Gold pot buyer

    Post  Admin on Tue Dec 08, 2015 10:28 pm

    Code:
    import urllib2,cookielib,thread,re,os,webbrowser,sys,time,socket,threading,numbers,datetime,Queue,getpass,ast,itertools
    import subprocess,datetime,urllib,math,ttk
     
    cj = cookielib.CookieJar()
    user_agent = ('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) ' +
        'Gecko/20100101 Firefox/13.0.1 ID:20120614114901')
    opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
    opener.addheaders = [('User-agent', user_agent)]
     
    usernames = ["RGA",
                 "RGA",
                 "RGA",
                 "RGA",]
     
    passwords = ["pass",
                 "pass",
                 "pass", ]
     
    secs = ["sec",
            "sec",
            "sec",]
     
    server = 'sigil'
    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:
              print 'URLError: Site not loading...'
            except Exception:
              print 'Unknown error...'
          return site
     
    def sub_string(source, start, end, nick='1'):
          try:
            return source.split(start)[1].split(end)[0]
          except IndexError:
            #print start
            #print end
            msg('Could not retrieve the inbetween value')
      
    def serverid(serv):
        global server,server_id,prefix
        server = serv
        if server.lower() == "sigil":
            server_id = 1
            print 'Server set to Sigil'
        else:
            server_id = 2
            print 'Server set to Torax'
        server_id = str(server_id)
        prefix = 'http://%s.outwar.com/' % server
        return {'server_id': server_id,'prefix': prefix}
     
    def login(user,passw):
        loginrpg = url_opener("%smyaccount.php" % prefix, "serverid=%s&login_username=%s&login_password=%s" % (server_id,user,passw)).read()
        if 'Please wait 15 minutes' in loginrpg:
          ret = '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Locked Out'
        elif 'Invalid ' in loginrpg:
          ret = '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Invalid Login'
        else:
          ret = 'Logged into %s' % user
        print ret
        return ret
     
    def load_All():
        mpage = url_opener("http://%s.outwar.com/accounts.php?ac_serverid=%s" %(server,server_id)).read()
        mpage = mpage.split('Trustee Access')[0]
        xp = re.compile('suid=(\d+)&')
        ids = re.findall(xp, mpage)
        suids = ids
        nam = mpage.split('<font color="#FFFF00" face="Verdana, Arial, Helvetica, sans-serif" size="1">')[1:]
        nam = [i.split('</b>')[0] for i in nam]
        names = [i.split('<b>')[1] for i in nam]
        lev = mpage.split('<font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" size="1">')[1:]
        lev = [i.split('</b>')[0] for i in lev]
        levels = [i.split('<b>')[1] for i in lev]
        crew = mpage.split('<font color="#999999" face="Verdana, Arial, Helvetica, sans-serif" size="1">')[1:]
        crew = [i.split('</b>')[0] for i in crew]
        crews = [i.split('<b>')[1] for i in crew]
        return {'suids':suids,'names':names,'levels':levels,'crews':crews}
     
    def sec_enter(secw):
      security = 'none'
      while True:
        if (secw != '') and (secw != 'Blank') and (secw != '"Blank"'):
          security = url_opener("%ssecurity_prompt.php" % (prefix), "prompt_number=1&answer=%s&security_submitted=Continue" % secw).read()
          if 'Incorrect answer to security question' in security:
            print 'Incorrect answer to security question\nYou entered '+secw
            secw = raw_input('Please Reenter: ')
          elif 'Security Prompt' in security:
            print 'Secword not Entered'
            continue
          else:
            break
        else:
          break
      return security
    def change_act(char):
        return url_opener('%sprofile.php?suid=%s' % (prefix,char)).read()
                
    def get_formnonce(source):
      formnonce = sub_string(source,'form-nonce" value="','" />')
      return formnonce
          
    q = raw_input("Enter Quantitiy:")
    serverid(server)
    remnant = {'20':'2243','30':'2244','40':'2245','50':'2246','60':'2247','65':'2248','75':'4626','80':'4628'}
    for x in range(len(usernames)):
        login(usernames[x],passwords[x])
        info = load_All()
        suids = info['suids']
        names = info['names']
        levels = info['levels']
        sec_enter(secs[x])
        for y in range(len(suids)):
              change_act(suids[y])
              form = url_opener(prefix+'treasury.php?search_for=remn').read()
              form_nonce = get_formnonce(form)
              lastr = 0
              rem = ['80','75','65','60','50','40','30','20']
              for r in rem:
                  if int(levels[y]) >= int(r):
                      formn = form.split('form-nonce" value="')[1].split('"')[0]
                      h = form.split('%s' % remnant[r])[4].split('&h=')[-1].split('"')[0]
                      buy = url_opener('http://%s.outwar.com/treasury.php?type=206&h=%s' % (server, h), 'buy_qty=%s&buy=%s&price=&isData=1&form-nonce=%s&x=28&y=15' % (q,remnant[r], formn)).read()
                      if 'must not bring you' in buy:
                          print 'Not enough experience to buy enhancement ON %s' % names[y]
                      elif 'Sorry, you do not have enough free space ' in buy:
                          print 'BACKPACK FULL ON %s' % names[y]
                      elif 'You must be level' in buy:
                          print "Not high enough level ON %s" % names[y]
                      elif 'not have enough gold' in buy:
                          print "Not enough gold ON %s" % names[y]
                      else:
                          bought = buy.split('purchased!')[0].split('" />')[-1]
                          print bought + "purchased ON %s" % names[y]
                      break
                  lastr = r

      Current date/time is Wed Jul 26, 2017 4:42 am