class Trudy: def __init__(self, neo): self.neo = neo self.functions = Functions() def Trudy(self, username): self.functions.createTaskData('Trudy', username) if time.time() - float(self.functions.lastRun('Trudy', username)) >= 86400: resp = self.neo.get('trudys_surprise.phtml?delevent=yes', 'https://www.jellyneo.net/?go=dailies') if self.functions.contains(resp.text, '&slt=1'): result = self.functions.getBetween(resp.text, 'phtml?id=', '" name="') resp = self.neo.get('trudydaily/slotgame.phtml?id=%s' % result, resp.url) results = self.functions.getBetween(resp.text, '\'key\': \'', '\'};') resp = self.neo.post( 'trudydaily/ajax/claimprize.php', { 'action': 'getslotstate', 'key': results }, 'http://www.neopets.com/trudydaily/slotgame.phtml?id=%s' % result) resp = self.neo.post('trudydaily/ajax/claimprize.php', {'action': 'beginroll'}, resp.url) self.neo.post('trudydaily/ajax/claimprize.php', {'action': 'prizeclaimed'}, resp.url) self.functions.log('Trudy\'s Surprise: Done') self.functions.updateLastRun('Trudy', username) else: self.functions.log('Trudy\'s Surprise: Already done today')
class CoconutShy: def __init__(self, neo): self.neo = neo self.functions = Functions() def CoconutShy(self, username): self.functions.createTaskData('CoconutShy', username) if time.time() - float(self.functions.lastRun('CoconutShy', username)) >= 86400: resp = self.neo.get('halloween/coconutshy.phtml', 'https://thedailyneopets.com/dailies') if self.functions.contains(resp.text, 'Come back tomorrow'): self.functions.updateLastRun('CoconutShy', username) return ref = self.functions.getBetween( resp.text, 'new SWFObject(\'http://images.neopets.com/halloween/', '\',') for _ in range(20): resp = self.neo.post( 'halloween/process_cocoshy.phtml?coconut=1&r=%s' % random.randint(20000, 99999), {'onData': '[type Function]'}, ref) result = self.functions.getBetween(resp.text, '&error=', '%21') if self.functions.contains(resp.text, '%2C'): self.functions.log( 'Coconut Shy: %s' % result.replace('+', ' ').replace('%2C', '')) else: self.functions.log('Coconut Shy: %s' % result.replace('+', ' ')) self.functions.updateLastRun('CoconutShy', username)
class DiceaRoo: def __init__(self, neo): self.neo = neo self.functions = Functions() def DiceaRoo(self, username): self.functions.createTaskData('DiceaRoo', username) if time.time() - float(self.functions.lastRun('DiceaRoo', username)) >= 86400: resp = self.neo.get('games/dicearoo.phtml') gameHash = self.functions.getBetween(resp.text, 'ck\' value=\'', '\'>') resp = self.neo.post('games/play_dicearoo.phtml', { 'raah': 'init', '_ref_ck': gameHash }, resp.url) resp = self.neo.post('games/play_dicearoo.phtml', { 'type': 'start', 'raah': 'init', '_ref_ck': gameHash }, resp.url) while True: if self.functions.contains(resp.text, 'Im SO BORED of'): self.functions.log('Dice-a-Roo AP: Pet is bored') break if self.functions.contains(resp.text, 'Oh dear, that means Game Over'): resp = self.neo.post('games/dicearoo.phtml', None, resp.url) resp = self.neo.post('games/play_dicearoo.phtml', { 'raah': 'init', '_ref_ck': gameHash }, resp.url) resp = self.neo.post('games/play_dicearoo.phtml', { 'type': 'start', 'raah': 'init', '_ref_ck': gameHash }, resp.url) if not self.functions.contains( resp.text, 'Oh dear, that means Game Over'): resp = self.neo.post('games/play_dicearoo.phtml', { 'raah': 'continue', '_ref_ck': gameHash }, resp.url) if self.functions.contains(resp.text, 'Im SO BORED of'): self.functions.log('Dice-a-Roo AP: Pet is bored') break GameDice = self.functions.getBetween(resp.text, '<br><b>', ' Dice-A-Roo</b>') gameResult = self.functions.getBetween( resp.text, '</td></tr><tr><td align=center><i>', '</i>').replace('<B>', '').replace('</B>', '').replace( '<b>', '').replace('</b>', '').replace(' ', ' ').strip() self.functions.log('Dice-a-Roo AP [%s Dice]: %s' % (GameDice, gameResult)) self.functions.updateLastRun('DiceaRoo', username)
class KacheekSeek: def __init__(self, neo): self.neo = neo self.functions = Functions() def KacheekSeek(self, username): self.functions.createTaskData('Kacheek', username) if time.time() - float(self.functions.lastRun('Kacheek', username)) >= 86400: seek = True findingPlaces = [1, 2, 3, 4, 5] resp = self.neo.get('games/hidenseek.phtml', 'https://thedailyneopets.com/dailies') self.neo.get('games/hidenseek/0.phtml?xfn=', resp.url) while seek: random.shuffle(findingPlaces) for data in findingPlaces: resp = self.neo.get( 'games/process_hideandseek.phtml?p=%s&game=0' % data, 'http://www.neopets.com/games/hidenseek/0.phtml?xfn=') if self.functions.contains(resp.text, 'Oh... you found me'): gamePrize = self.functions.getBetween( resp.text, 'You win <b>', '</b> Neopoints!!!') self.functions.log('Kacheek Seek: Won %s NP!' % gamePrize) break if self.functions.contains(resp.text, 'Im SO BORED'): self.functions.log( 'Kacheek Seek: Pet is bored, stopped') self.functions.updateLastRun('Kacheek', username) seek = False break
class FruitMachine: def __init__(self, neo): self.neo = neo self.functions = Functions() def FruitMachine(self, username): self.functions.createTaskData('FruitMachine', username) if time.time() - float(self.functions.lastRun('FruitMachine', username)) >= 86400: resp = self.neo.get('desert/fruit/index.phtml', 'https://thedailyneopets.com/dailies') if not self.functions.contains( resp.text, 'Please come back tomorrow and try again'): result = self.functions.getBetween(resp.text, 'name="ck" value="', '">') resp = self.neo.post( 'desert/fruit/index.phtml', { 'spin': '1', 'ck': result }, 'http://www.neopets.com/desert/fruit/index.phtml') if self.functions.contains( resp.text, 'Sorry, this is not a winning spin'): self.functions.log('Fruit Machine: Done') else: self.functions.log('Fruit Machine: You won!') self.functions.updateLastRun('FruitMachine', username)
class BuriedTreasure: def __init__(self, neo): self.neo = neo self.functions = Functions() def BuriedTreasure(self, username): self.functions.createTaskData('BuriedTreasure', username) if time.time() - float( self.functions.lastRun('BuriedTreasure', username)) >= 86400: resp = self.neo.get('pirates/buriedtreasure/buriedtreasure.phtml?', 'https://thedailyneopets.com/dailies') if not self.functions.contains( resp.text, 'Your account must be at least <b>24</b> hours old to play' ): if not self.functions.contains(resp.text, 'you have to wait another'): x, y = random.randint(25, 450), random.randint(45, 460) resp = self.neo.get( 'pirates/buriedtreasure/buriedtreasure.phtml?%s,%s' % (x, y), 'http://www.neopets.com/pirates/buriedtreasure/buriedtreasure.phtml?' ) gamePrize = self.functions.getBetween( resp.text, '<b><center>', '</center></b>') self.functions.log('Buried Treasure: %s' % gamePrize) else: self.functions.log( 'Buried Treasure: Your account is too young to play') self.functions.updateLastRun('BuriedTreasure', username)
class Stocks: def __init__(self, neo): self.neo = neo self.functions = Functions() def Stocks(self, username): self.functions.createTaskData('Stocks', username) if time.time() - float(self.functions.lastRun('Stocks', username)) >= 86400: resp = self.neo.get( 'stockmarket.phtml?type=list&full=true', 'http://www.neopets.com/stockmarket.phtml?type=buy') data = 15 tryAgain = 15 for _ in range(3): stock = list( set( re.findall(r'<b>(\w+?) %s [-\+]\d+?<\/b>' % data, resp.text))) if not stock: tryAgain += 1 self.functions.log( 'Stock Buyer: No stocks for %s found, trying %s..' % (data, tryAgain)) data += 1 if stock: resp = self.neo.get( 'stockmarket.phtml?type=buy', 'http://www.neopets.com/stockmarket.phtml?type=list&full=true' ) stockHash = self.functions.getBetween( resp.text, '&_ref_ck=', '\';') resp = self.neo.post( 'process_stockmarket.phtml', { '_ref_ck': stockHash, 'type': 'buy', 'ticker_symbol': stock[0], 'amount_shares': '1000' }, 'http://www.neopets.com/stockmarket.phtml?type=buy') if self.functions.contains(resp.text, 'purchase limit of 1000'): self.functions.log( 'Stock Buyer: You can\'t buy more than 1000 shares per day' ) elif self.functions.contains(resp.text, 'You cannot afford'): self.functions.log( 'Stock Buyer: You don\'t have enough neopoints') elif not self.functions.contains(resp.text, 'purchase limit of 1000'): if not self.functions.contains(resp.text, 'You cannot afford'): self.functions.log( 'Stock Buyer: Purchased 1000 shares of %s for %s' % (stock[0], data)) break self.functions.updateLastRun('Stocks', username)
class PoogleRace: def __init__(self, neo): self.neo = neo self.functions = Functions() def PoogleRace(self, username): raceTimes = ['59', '14', '29', '44'] betTimes = ['11', '26', '41', '56'] now = datetime.now() current_time = now.strftime("%M") self.functions.createTaskData('PoogleRace', username) if time.time() - float(self.functions.lastRun('PoogleRace', username)) >= 3600: for data in betTimes: if current_time == data: resp = self.neo.get('faerieland/poogleracing/start.phtml') winner = resp.text[-1] resp = self.neo.post( 'faerieland/process_pooglebetting.phtml', { 'poogle': winner, 'bet': '300', 'obj_info_id': '0' }, 'http://www.neopets.com/faerieland/pooglebetting.phtml' ) if self.functions.contains(resp.url, 'thanks'): self.functions.log( 'Poogle Race: Placed a bet on poogle #%s' % winner) self.functions.updateLastRun('PoogleRace', username) self.functions.createTaskData('PoogleRaceFinish', username) if time.time() - float( self.functions.lastRun('PoogleRaceFinish', username)) >= 3600: for data in raceTimes: if current_time == data: resp = self.neo.get('faerieland/poogleracing.phtml') if self.functions.contains( resp.text, 'Please come back when the race starts!!!'): time.sleep(60) self.neo.post( 'faerieland/poogleracing.phtml?type=viewrace', {'rand': random.randint(1, 999)}, 'http://www.neopets.com/faerieland/poogleracing.phtml' ) time.sleep(random.randint(5, 10)) resp = self.neo.post( 'faerieland/poogleracing.phtml', {'type': 'collect'}, 'http://www.neopets.com/faerieland/poogleracing.phtml?type=viewrace' ) result = self.functions.getBetween( resp.text, 'You win <b>', '</b> NP back') self.functions.log('Poogle Race: You won %sNP!' % result) self.functions.updateLastRun('PoogleRaceFinish', username)
class Jelly: def __init__(self, neo): self.neo = neo self.functions = Functions() def Jelly(self, username): self.functions.createTaskData('Jelly', username) if time.time() - float(self.functions.lastRun('Jelly', username)) >= 86400: resp = self.neo.post('jelly/jelly.phtml', {'type': 'get_jelly'}, 'http://www.neopets.com/jelly/jelly.phtml') if self.functions.contains(resp.text, 'You take some <b>'): result = self.functions.getBetween(resp.text, 'some <b>', '</b>!!!') self.functions.log('Giant Jelly: Grabbed %s' % result) self.functions.updateLastRun('Jelly', username)
class Cheat: def __init__(self, neo): self.neo = neo self.functions = Functions() def Cheat(self, username): self.functions.createTaskData('Cheat', username) if time.time() - float(self.functions.lastRun('Cheat', username)) >= 86400: cardVal = 1 resp = self.neo.get('games/cheat/index.phtml') resp = self.neo.post('games/cheat/cheat.phtml', None, resp.url) while True: if self.functions.contains(resp.text, ' of cheating!'): currentPlayed = self.functions.getBetween( resp.text, ' played ', ' ') if currentPlayed == '4': cheater = self.functions.getBetween( resp.text, '"CheatYes" VALUE="', '"><BR>') resp = self.neo.post('games/cheat/cheat.phtml', {'CheatYes': cheater}, resp.url) if self.functions.contains(resp.text, 'NOT CHEATING!!!'): cheater = self.functions.getBetween( resp.text, '<BR>but ', ' was <b>NOT') self.functions.log( 'Accused %s of cheating, %s was not cheating' % (cheater, cheater)) resp = self.neo.post('games/cheat/cheat.phtml', None, resp.url) else: notCheating = self.functions.getBetween( resp.text, '"CheatNo" VALUE="', '">') resp = self.neo.post('games/cheat/cheat.phtml', {'CheatNo': notCheating}, resp.url) resp = self.neo.post('games/cheat/cheat.phtml', None, resp.url) if self.functions.contains(resp.text, 'You have won this round'): if self.functions.contains( resp.text, 'You have beaten the hardest level'): self.functions.log( 'Cheat AP: You won the hardest stage') resp = self.neo.post('games/cheat/cheat.phtml', {'x_reset': '1'}, resp.url) self.functions.updateLastRun('Cheat', username) break self.functions.log('Cheat AP: You won the round') resp = self.neo.post('games/cheat/cheat.phtml', {'x_continue': '1'}, resp.url) resp = self.neo.post('games/cheat/cheat.phtml', None, resp.url) elif self.functions.contains(resp.text, 'You will have to defeat'): resp = self.neo.post('games/cheat/cheat.phtml', {'x_continue': '1'}, resp.url) resp = self.neo.post('games/cheat/cheat.phtml', None, resp.url) if self.functions.contains(resp.text, 'Select Card Value'): ourCards = re.findall(r'games/cards/(.*?)_', resp.text) mostCommon = max(set(ourCards), key=ourCards.count) ourValues = re.findall( rf'<img src=\'http://images.neopets.com/games/cards/{mostCommon}(.*?)\' height=90 width=70', resp.text) das = self.functions.getBetween(resp.text, 'das1.value = \'', '\';') if int(mostCommon) == 14: cardData = { 'jk_pc1': '', 'jk_pc2': '', 'jk_pc3': '', 'jk_pc4': '', 'das1': das, 'x_claim': '1' } else: cardData = { 'jk_pc1': '', 'jk_pc2': '', 'jk_pc3': '', 'jk_pc4': '', 'das1': das, 'x_claim': mostCommon } for data in ourValues: cardData['jk_pc%s' % cardVal] = self.functions.getBetween( data, 'name=\'', '"') cardVal += 1 cardVal = 1 resp = self.neo.post('games/cheat/cheat.phtml', cardData, resp.url) if int(mostCommon) > 10: curCard = None if mostCommon == '11': curCard = 'Jack' elif mostCommon == '12': curCard = 'Queen' elif mostCommon == '13': curCard = 'King' elif mostCommon == '14': curCard = 'Ace' self.functions.log( 'Cheat AP: Played %s x%s' % (curCard, ourCards.count(mostCommon))) else: self.functions.log( 'Cheat AP: Played %s x%s' % (mostCommon, ourCards.count(mostCommon))) resp = self.neo.post('games/cheat/cheat.phtml', None, resp.url)
class Wheels: def __init__(self, neo): self.neo = neo self.functions = Functions() def wheelOfExcitement(self, username): self.functions.createTaskData('wheelOfExcitement', username) if time.time() - float(self.functions.lastRun('wheelOfExcitement', username)) >= 7200: resp = self.neo.get('faerieland/wheel.phtml') if self.functions.contains(resp.text, 'already spun this wheel'): self.functions.log('Wheel of Excitement: Already spun this wheel') if not self.functions.contains(resp.text, 'already spun this wheel'): ref = self.functions.getBetween(resp.text, 'http://images.neopets.com/wheels', ', \'flash_') resp = self.neo.amf('http://www.neopets.com/amfphp/gateway.php', '\x00\x03\x00\x00\x00\x01\x00\x16WheelService.spinWheel\x00\x02/1\x00\x00\x00\t\n\x00\x00\x00\x01\x02\x00\x01%s' % '2', 'http://www.neopets.com/%s' % ref.strip()) if self.functions.contains(resp.text, 'wheelofexcitement.gif'): self.functions.log('Wheel of Excitement: Done, received the avatar') else: self.functions.log('Wheel of Excitement: Done') self.functions.updateLastRun('wheelOfExcitement', username) def wheelOfMediocrity(self, username): self.functions.createTaskData('wheelOfMediocrity', username) if time.time() - float(self.functions.lastRun('wheelOfMediocrity', username)) >= 2400: resp = self.neo.get('prehistoric/mediocrity.phtml') if self.functions.contains(resp.text, 'Come back, uh, whenever'): self.functions.log('Wheel of Mediocrity: Already spun this wheel') if not self.functions.contains(resp.text, 'Come back, uh, whenever'): ref = self.functions.getBetween(resp.text, 'http://images.neopets.com/wheels', ', \'flash_') resp = self.neo.amf('http://www.neopets.com/amfphp/gateway.php', '\x00\x03\x00\x00\x00\x01\x00\x16WheelService.spinWheel\x00\x02/1\x00\x00\x00\t\n\x00\x00\x00\x01\x02\x00\x01%s' % '3', 'http://www.neopets.com/%s' % ref.strip()) if self.functions.contains(resp.text, 'mediocrity.gif'): self.functions.log('Wheel of Mediocrity: Done, received the avatar') else: self.functions.log('Wheel of Mediocrity: Done') self.functions.updateLastRun('wheelOfMediocrity', username) def wheelOfMisfortune(self, username): self.functions.createTaskData('wheelOfMisfortune', username) if time.time() - float(self.functions.lastRun('wheelOfMisfortune', username)) >= 7200: resp = self.neo.get('halloween/wheel/index.phtml') if self.functions.contains(resp.text, 'Come back later'): self.functions.log('Wheel of Misfortune: Already spun this wheel') if not self.functions.contains(resp.text, 'Come back later'): ref = self.functions.getBetween(resp.text, 'http://images.neopets.com/wheels', ', \'flash_') resp = self.neo.amf('http://www.neopets.com/amfphp/gateway.php', '\x00\x03\x00\x00\x00\x01\x00\x16WheelService.spinWheel\x00\x02/1\x00\x00\x00\t\n\x00\x00\x00\x01\x02\x00\x01%s' % '4', 'http://www.neopets.com/%s' % ref.strip()) self.functions.log('Wheel of Misfortune: Done') self.functions.updateLastRun('wheelOfMisfortune', username) def wheelOfKnowledge(self, username): self.functions.createTaskData('wheelOfKnowledge', username) if time.time() - float(self.functions.lastRun('wheelOfKnowledge', username)) >= 86400: resp = self.neo.get('medieval/knowledge.phtml') if self.functions.contains(resp.text, 'already spun this wheel'): self.functions.log('Wheel of Knowledge: Already spun this wheel') if not self.functions.contains(resp.text, 'already spun this wheel'): ref = self.functions.getBetween(resp.text, 'http://images.neopets.com/wheels', ', \'flash_') resp = self.neo.amf('http://www.neopets.com/amfphp/gateway.php', '\x00\x03\x00\x00\x00\x01\x00\x16WheelService.spinWheel\x00\x02/1\x00\x00\x00\t\n\x00\x00\x00\x01\x02\x00\x01%s' % '1', 'http://www.neopets.com/%s' % ref.strip()) if self.functions.contains(resp.text, 'brightvale.gif'): self.functions.log('Wheel of Knowledge: Done, received the avatar') else: self.functions.log('Wheel of Knowledge: Done') self.functions.updateLastRun('wheelOfKnowledge', username) def wheelOfExtravagance(self, username): self.functions.createTaskData('wheelOfExtravagance', username) if time.time() - float(self.functions.lastRun('wheelOfExtravagance', username)) >= 86400: resp = self.neo.get('desert/extravagance.phtml') if self.functions.contains(resp.text, 'already spun the wheel today'): self.functions.log('Wheel of Extravagance: Already spun this wheel') if not self.functions.contains(resp.text, 'already spun the wheel today'): ref = self.functions.getBetween(resp.text, 'http://images.neopets.com/wheels', ', \'flash_') resp = self.neo.amf('http://www.neopets.com/amfphp/gateway.php', '\x00\x03\x00\x00\x00\x01\x00\x16WheelService.spinWheel\x00\x02/1\x00\x00\x00\t\n\x00\x00\x00\x01\x02\x00\x01%s' % '6', 'http://www.neopets.com/%s' % ref.strip()) if self.functions.contains(resp.text, 'extravagance.gif'): self.functions.log('Wheel of Extravagance: Done, received the avatar') else: self.functions.log('Wheel of Extravagance: Done') self.functions.updateLastRun('wheelOfExtravagance', username) def wheelOfMonotony(self, username): self.functions.createTaskData('monotonystart', username) if time.time() - float(self.functions.lastRun('monotonystart', username)) >= 86400: self.functions.createTaskData('monotony1', username) if time.time() - float(self.functions.lastRun('monotony1', username)) >= 86400: resp = self.neo.get('prehistoric/monotony/monotony.phtml') if self.functions.contains(resp.text, 'already spun'): self.functions.log('Wheel of Monotony: Already spun this wheel') if not self.functions.contains(resp.text, 'already spun'): ref = self.functions.getBetween(resp.text, 'http://images.neopets.com/wheels', ', \'flash_') resp = self.neo.amf('http://www.neopets.com/amfphp/gateway.php', '\x00\x03\x00\x00\x00\x01\x00\x1aWheelService.startMonotony\x00\x02/1\x00\x00\x00\x05\x0a\x00\x00\x00\x00', 'http://www.neopets.com/%s' % ref.strip()) self.functions.log('Wheel of Monotony: Started spinning the wheel, checking back in 2 hours') self.functions.updateLastRun('monotony1', username) self.functions.createTaskData('monotonycollect', username) self.functions.updateLastRun('monotonycollect', username) if time.time() - float(self.functions.lastRun('monotonycollect', username)) >= 7200: ref = self.functions.getBetween(resp.text, 'http://images.neopets.com/wheels', ', \'flash_') resp = self.neo.amf('http://www.neopets.com/amfphp/gateway.php', '\x00\x03\x00\x00\x00\x01\x00\x16WheelService.spinWheel\x00\x02/1\x00\x00\x00\t\n\x00\x00\x00\x01\x02\x00\x01%s' % '5', 'http://www.neopets.com/%s' % ref.strip()) if self.functions.contains(resp.text, 'monotony.gif'): self.functions.log('Wheel of Monotony: Done, received the avatar') else: self.functions.log('Wheel of Monotony: Done') self.functions.updateLastRun('monotonystart', username) self.functions.updateLastRun('monotonycollect', username)
class BankManager: def __init__(self, neo): self.neo = neo self.functions = Functions() def createBank(self): resp = self.neo.get('bank.phtml') currentNp = self.functions.getNp(resp.text) accountType = { 0: 0, 1000: 1, 2500: 2, 5000: 3, 10000: 4, 25000: 5, 50000: 6, 75000: 7, 100000: 8, 250000: 9, 500000: 10, 1000000: 11, 2000000: 12, 5000000: 13, 7500000: 14, 10000000: 15 } available = {} for key, value in accountType.items(): if currentNp > key: available[key] = value bankType = list(available.keys())[-1] resp = self.neo.post( 'process_bank.phtml', { 'type': 'new_account', 'name': 'x', 'add1': 'n', 'employment': 'Chia Custodian', 'salary': '10,000 NP and below', 'account_type': str(available[bankType]), 'initial_deposit': str(bankType) }, resp.url) if self.functions.contains(resp.text, 'Activation Code'): self.functions.log( 'Bank Manager: Your account isn\'t activated, unable to create a bank account' ) else: self.functions.log('Bank Manager: Created a bank account') def depositNp(self, np): resp = self.neo.get('bank.phtml') if self.functions.contains( resp.text, 'I see you don\'t currently have an account with us.'): self.createBank() self.neo.post('process_bank.phtml', { 'type': 'deposit', 'amount': str(np) }, 'http://www.neopets.com/bank.phtml') self.functions.log('Bank Manager: Deposited %s NP!' % np) def withdrawNp(self, np, pin): resp = self.neo.get('bank.phtml') if self.functions.contains( resp.text, 'I see you don\'t currently have an account with us.'): self.createBank() if self.functions.contains(resp.text, 'Enter your'): self.neo.post('process_bank.phtml', { 'type': 'withdraw', 'amount': str(np), 'pin': str(pin) }, 'http://www.neopets.com/bank.phtml') else: self.neo.post('process_bank.phtml', { 'type': 'withdraw', 'amount': str(np) }, 'http://www.neopets.com/bank.phtml') self.functions.log('Bank Manager: Withdrew %s NP!' % np) def BankManager(self, username): self.functions.createTaskData('BankManager', username) if time.time() - float(self.functions.lastRun('BankManager', username)) >= 86400: resp = self.neo.get('bank.phtml') if self.functions.contains( resp.text, 'I see you don\'t currently have an account with us.'): self.createBank() if self.functions.contains( resp.text, 'You have already collected your interest today'): self.functions.log( 'Bank Manager: You already collected your interest today') elif self.functions.contains(resp.text, 'Collect Interest ('): interest = self.functions.getBetween(resp.text, 'allow you to gain <b>', ' NP</b> per ') resp = self.neo.post('process_bank.phtml', {'type': 'interest'}, resp.url) self.functions.log('Bank Manager: Collected %s NP interest' % interest) self.functions.updateLastRun('BankManager', username)
class Gormball: def __init__(self, neo): self.neo = neo self.functions = Functions() def Gormball(self, username): self.functions.createTaskData('Gormball', username) if time.time() - float(self.functions.lastRun('Gormball', username)) >= 86400: resp = self.neo.get('space/gormball.phtml') gameHash = self.functions.getBetween(resp.text, '\'xcn\' value=\'', '\'>') resp = self.neo.post('space/gormball2.phtml', { 'xcn': gameHash, 'player_backed': random.randint(1, 8) }, resp.url) while True: if self.functions.contains(resp.text, 'Im SO BORED of'): self.functions.log('Gormball AP: Pet is bored') break lastCharacter = self.functions.getBetween( resp.text, '_character\' value=\'', '\'>') pageCount = self.functions.getBetween(resp.text, '_count\' value=', '><') if lastCharacter == 'You': resp = self.neo.post( 'space/gormball2.phtml', { 'type': 'moveon', 'page_count': pageCount, 'xcn': gameHash, 'turns_waited': '1', 'last_character': lastCharacter }, resp.url) if self.functions.contains( resp.text, '<b>You are the last remaining character!!! You have won!!!</b>' ): self.functions.log('Gormball AP: You Won!') resp = self.neo.get('space/gormball.phtml', resp.url) resp = self.neo.post( 'space/gormball2.phtml', { 'xcn': gameHash, 'player_backed': random.randint(1, 8) }, resp.url) elif lastCharacter != 'You': resp = self.neo.post( 'space/gormball2.phtml', { 'type': 'moveon', 'page_count': pageCount, 'xcn': gameHash, 'last_character': lastCharacter }, resp.url) if self.functions.contains( resp.text, '<b>You are the last remaining character!!! You have won!!!</b>' ): self.functions.log('Gormball AP: You Won!') resp = self.neo.get('space/gormball.phtml', resp.url) resp = self.neo.post( 'space/gormball2.phtml', { 'xcn': gameHash, 'player_backed': random.randint(1, 8) }, resp.url) if self.functions.contains(resp.text, 'Oh dear, you are out of the game'): scoredPoints = self.functions.getBetween( resp.text, 'You scored <b>', '</b> points!') self.functions.log( 'Gormball AP: Game Over - You scored %s points' % scoredPoints) resp = self.neo.get('space/gormball.phtml', resp.url) resp = self.neo.post('space/gormball2.phtml', { 'xcn': gameHash, 'player_backed': random.randint(1, 8) }, resp.url) if self.functions.contains(resp.text, 'The Gormball explodes on '): gormballExplodes = self.functions.getBetween( resp.text, 'The Gormball explodes on ', '!!!</b>') self.functions.log( 'Gormball AP: The Gormball explodes on %s' % gormballExplodes) pageCount = self.functions.getBetween( resp.text, '_count\' value=', '><') resp = self.neo.post('space/gormball2.phtml', { 'xcn': gameHash, 'type': 'moveon', 'page_count': pageCount }, resp.url) if self.functions.contains(resp.text, 'Im SO BORED of'): self.functions.log('Gormball AP: Pet is bored') break self.functions.updateLastRun('Gormball', username)