Advertisement
Guest User

Untitled

a guest
May 8th, 2017
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.32 KB | None | 0 0
  1. import getpass
  2. import sys
  3. import time
  4. import hashlib
  5. import json
  6. import random
  7. import requests
  8. import os
  9. from requests.packages.urllib3.exceptions import InsecureRequestWarning
  10. requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
  11. # starting parameters (GameID & Key from .swf)
  12.  
  13. GameList = [[86,'kl8ut5fr43','http://www.tremorgames.com/playgame/5708/tu-unleashed.html','http://www.tremorgames.com/games/files/LaunchInTheSky%20AD.swf'],[227,'DFBGHRTyt645t3765ft','http://www.tremorgames.com/playgame/7568/ragdoll-achievement-2.html','http://www.tremorgames.com/games/files/1382443391_7568_RA2.swf'],[23,'3r5tyk','http://www.tremorgames.com/playgame/3721/zombie-madness.html','http://www.tremorgames.com/games/files/zombie-madness.swf'],[63,'sf5tghy7uj','http://www.tremorgames.com/playgame/5087/death-call.html','http://www.tremorgames.com/games/files/DeathCall_withAds.swf'],[228,'DFRtgbngh567hF@','http://www.tremorgames.com/playgame/7680/potato-rebellion.html','http://www.tremorgames.com/games/files/1394896778_7680_ProjectKF.swf'],[229,'DFG%TG((JRFfgd23','http://www.tremorgames.com/playgame/7679/crest-breakout.html','http://www.tremorgames.com/games/files/1394896704_7679_ProjectWM.swf'],[55,'r54tn7yh8','http://www.tremorgames.com/playgame/4750/zombie-defense-agency.html','http://www.tremorgames.com/games/files/zomTremor.swf'],[25,'jmg65t','http://www.tremorgames.com/playgame/4170/speed-rally.html','http://www.tremorgames.com/games/files/speed-rally.swf' ],[216,'FVgbhNJ&H93erD','http://www.tremorgames.com/playgame/7266/shape-shifters.html','http://www.tremorgames.com/games/files/1362945541_7266_ShapeShifters.swf'],[30,'acf47k','http://www.tremorgames.com/playgame/4561/billi-color-lines.html','http://www.tremorgames.com/games/files/billi-color-lines.swf'],[32,'bg67hy','http://www.tremorgames.com/playgame/4606/penguins-attack-2.html','http://www.tremorgames.com/games/files/WPA_2_TremorGames.swf'],[34,'m8h7yu','http://www.tremorgames.com/playgame/4607/captain-fugly-2.html','http://www.tremorgames.com/games/files/captain-fugly-2.swf'],[170,'gt4dfvce324','http://www.tremorgames.com/playgame/7023/feudalism-ii.html','http://www.tremorgames.com/games/files/1355744490_7023_Feudalism2 Tremor.swf'],[207,'frg$#eDFrfg&sdfg12','http://www.tremorgames.com/playgame/7246/rotation-experiment.html','http://www.tremorgames.com/games/files/1362623612_7246_FD.swf'],[33,'hj76gy','http://www.tremorgames.com/playgame/4663/dogfight-aces.html','http://www.tremorgames.com/games/files/dogfight-aces.swf'],[82,'sdfRgdg456','http://www.tremorgames.com/playgame/5607/easy-way.html','http://www.tremorgames.com/games/files/IGRA.swf'],[81,'d34f6h7j89','http://www.tremorgames.com/playgame/5690/incoming.html','http://www.tremorgames.com/games/files/incoming.swf'],[230,'3445FGT5467tfhfdG','http://www.tremorgames.com/playgame/7678/catsnfish.html','http://www.tremorgames.com/games/files/1394896624_7678_ProjectGP.swf'],[214,'hnBGF%$#&876@1','http://www.tremorgames.com/playgame/7262/dechmog.html','http://www.tremorgames.com/games/files/1362600708_7262_dechmog.swf'],[169,'kjnh67gbf43','http://www.tremorgames.com/playgame/7022/endless-war-3.html','http://www.tremorgames.com/games/files/1355333577_7022_ew3%20Tremor.swf'],[210,'gbFGT65&*$8uaq2','http://www.tremorgames.com/playgame/5058/werebox-2.html','http://www.tremorgames.com/games/files/werebox-2.swf'],[201,'tgfTrfge45#hhs*7fdhs*DF','http://www.tremorgames.com/playgame/7195/three-color-balls.html','http://www.tremorgames.com/games/files/1356867889_7195_ThreeColorBalls_Normal.swf'],[218,'Fvgb&*$5hy#ghtD','http://www.tremorgames.com/playgame/7277/the-engineer.html','http://www.tremorgames.com/games/files/1363614939_7277_Engineer.swf'],[223,'GNHTYFgrbt5674yu','http://www.tremorgames.com/playgame/7464/euridissey-i-the-fall-of-horus.html','http://www.tremorgames.com/games/files/1377619930_7464_EuridisseyTremor.swf'],[225,'GFTR567ujM)(#$th5','http://www.tremorgames.com/playgame/7534/bombrunner.html','http://www.tremorgames.com/games/files/1380453238_7534_bombrunner_tremor.swf'],[224,'GNFHYt*(yh342da','http://www.tremorgames.com/playgame/7479/revive-the-monster.html','http://www.tremorgames.com/games/files/1378479699_7479_revive_the_monster _SecureOpt.swf'],[220,'fvGFRt56yHy#$#$2ws','http://www.tremorgames.com/playgame/7274/zombie-smasher.html','http://www.tremorgames.com/games/files/1362947141_7274_Zombie_Smasher.swf'],[168,'g56tfvb56g','http://www.tremorgames.com/playgame/7024/endless-war-4.html','http://www.tremorgames.com/games/files/1353859784_7024_ew4 Tremor.swf'],[197,'nhgt56ygfvt56','http://www.tremorgames.com/playgame/7182/super-dune-impossible.html','http://www.tremorgames.com/games/files/1358608152_7182_super dune impossible.swf'],[47,'asd4f5tg','http://www.tremorgames.com/playgame/4802/match-move-2.html','http://www.tremorgames.com/games/files/MFP_MM2.swf'],[149,'n8mkl12sd4g','http://www.tremorgames.com/playgame/7002/epic-bungee.html','http://www.tremorgames.com/games/files/1351984436_7002_Bungee Tremor.swf'],[199,'gbn65tg78juy','http://www.tremorgames.com/playgame/7190/carveola-incident.html','http://www.tremorgames.com/games/files/1356835369_7190_Zombie.swf'],[19,'bhngy6','http://www.tremorgames.com/playgame/3687/tremor-gunslinger.html','http://www.tremorgames.com/games/files/I9H_TremorGunslinger_Normal.swf'],[189,'gt5rbvnhy7','http://www.tremorgames.com/playgame/7165/pack-up-the-toy.html','http://www.tremorgames.com/games/files/1355347518_7165_Pack Up the Toy tremor.swf'],[138,'sf56gbn78jmn','http://www.tremorgames.com/playgame/7010/endless-war-defense.html','http://www.tremorgames.com/games/files/1350000811_7010_ewd Tremor.swf'],[148,'sv45gth45gh6','http://www.tremorgames.com/playgame/7001/izzi.html','http://www.tremorgames.com/games/files/1349647467_7001_iZZi Tremor.swf'],[158,'mk876tgbf4','http://www.tremorgames.com/playgame/5934/tower-of-greed.html','http://www.tremorgames.com/games/files/1352659079_5934_TowerofGreed.swf'],[176,'fgVB65&jh*9;{}kmLOpo2','http://www.tremorgames.com/playgame/7098/rawr.html','http://www.tremorgames.com/games/files/1352801906_7098_rawr.swf'],[183,'FVBGTR54$#@#rfgTpo9','http://www.tremorgames.com/playgame/7113/pike-club-2.html','http://www.tremorgames.com/games/files/1355161019_7113_pike_club2.swf'],[187,'gthyt5rfgvb4','http://www.tremorgames.com/playgame/7155/intruder-combat-training-.html','http://www.tremorgames.com/games/files/1354915602_7155_deathmatch_secure.swf'],[194,'hngtry675','http://www.tremorgames.com/playgame/7178/super-mega-bot.html','http://www.tremorgames.com/games/files/1355948580_7178_super_mega_bot_stl_tremorgames.com_v1.1.1.swf'],[200,'gbhtwmkl915','http://www.tremorgames.com/playgame/7198/carveola-incident-2118-ad.html','http://www.tremorgames.com/games/files/1356897432_7198_CarveolaIncident2118AD.swf'],[162,'hb56gthy67uj','http://www.tremorgames.com/playgame/7177/monsters-mash-3.html','http://www.tremorgames.com/games/files/monster-mash-3.swf'],[232,'asdfr45#$tgGTHgrt12','http://www.tremorgames.com/playgame/7968/shape-fold-animals.html','http://www.tremorgames.com/games/files/ShapeFoldAnimals - 2015 04 23 (TremorGames).swf'],[231,'asd45tgfVFr657yh','http://www.tremorgames.com/playgame/7967/zombonarium.html','http://www.tremorgames.com/games/files/zombonarium.swf'],[222,'GVbTYh76*#$gTy1','http://www.tremorgames.com/playgame/7278/cripple-cannon.html','http://www.tremorgames.com/games/files/1363614807_7278_Cripple Cannon.swf'],[209,'gbFVcde#$%2$1','http://www.tremorgames.com/playgame/7235/soul-shift.html','http://www.tremorgames.com/games/files/1362598225_7235_SoulShift.swf'],[215,'hnbFGTr$#@345','http://www.tremorgames.com/playgame/7104/iron-ladies.html','http://www.tremorgames.com/games/files/IronLadies.swf'],[219,'kmJHNbg786&*$@r4','http://www.tremorgames.com/playgame/2844/connect-it.html','http://www.tremorgames.com/games/files/connect-it.swf'],[211,'sdfc456%$#4RFDer@','http://www.tremorgames.com/playgame/7257/beaver-blocks.html','http://www.tremorgames.com/games/files/1362923363_7257_BeaverBlocks.swf'],[173,'fvbg54rfgvv','http://www.tremorgames.com/playgame/7052/cave-explorer.html','http://www.tremorgames.com/games/files/1351091477_7052_cBuild.swf'],[213,'sdfVFD45&*%rtg1','http://www.tremorgames.com/playgame/7263/frozen-age.html','http://www.tremorgames.com/games/files/1362603168_7263_frozenage.swf'],[206,'bgf54f%&hyGTREwe','http://www.tremorgames.com/playgame/7245/minigames-world.html','http://www.tremorgames.com/games/files/1361788509_7245_minig_adfree.swf'],[157,'hnjyuhgr45','http://www.tremorgames.com/playgame/5933/pixel-purge.html','http://www.tremorgames.com/games/files/1352415633_5933_PixelPurge.swf'],[205,'adfvgfr45$%rED','http://www.tremorgames.com/playgame/7244/pandoras-epic-battles.html','http://www.tremorgames.com/games/files/1361732006_7244_questLife.swf'],[172,'jn76tgbvf54','http://www.tremorgames.com/playgame/7070/funny-bees.html','http://www.tremorgames.com/games/files/FunnyBees.swf'],[191,'avg56hnbj78','http://www.tremorgames.com/playgame/7243/terra-god.html','http://www.tremorgames.com/games/files/1361562565_7243_TerraGod.swf'],[150,'jd34fg67h5','http://www.tremorgames.com/playgame/7003/the-gun-game-2.html','http://www.tremorgames.com/games/files/1351700224_7003_Gun Game 2 Tremor.swf'],[139,'juy76hnbg45','http://www.tremorgames.com/playgame/7014/feudalism.html','http://www.tremorgames.com/games/files/1350074796_7014_Feudalism Tremor.swf'],[174,'hyt567jhfe4','http://www.tremorgames.com/playgame/7057/path-of-honor-chapter-1.html','http://www.tremorgames.com/games/files/poh1M.swf'],[151,'b65nhj78mj','http://www.tremorgames.com/playgame/7004/the-gun-game.html','http://www.tremorgames.com/games/files/1349647505_7004_Gun Game Tremor.swf'],[204,'bghnb%$2DEws@','http://www.tremorgames.com/playgame/7238/the-forgotten-dungeon.html','http://www.tremorgames.com/games/files/1361017735_7238_ForgottenDungeon.swf'],[198,'asdvgbrt54rg','http://www.tremorgames.com/playgame/7216/ambush.html','http://www.tremorgames.com/games/files/5PK_Resistance.swf'],[192,'hytnmki89ki','http://www.tremorgames.com/playgame/7169/snake-squad.html','http://www.tremorgames.com/games/files/1355946918_7169_snake_squad_tremor_games_stl_lic_v1.1.2.swf'],[195,'asbg56hn78j3','http://www.tremorgames.com/playgame/7179/on-the-edge.html','http://www.tremorgames.com/games/files/1355594581_7179_on_the_edge_stl_tremorgames.com_v1.1.swf'],[185,'afgt5ry5767','http://www.tremorgames.com/playgame/7140/secret-ways.html','http://www.tremorgames.com/games/files/1355060628_7140_SecretWays.swf'],[164,'nh7yhg5trfd','http://www.tremorgames.com/playgame/7027/platcore.html','http://www.tremorgames.com/games/files/U4Q_Platcore(Tremor).swf'],[146,'gt56hybgfrt','http://www.tremorgames.com/playgame/7031/spell-storm.html','http://www.tremorgames.com/games/files/1350360112_7031_SpellStorm_Tremor.swf'],[166,'mnh67ygtr45','http://www.tremorgames.com/playgame/3864/space-is-key-2.html','http://www.tremorgames.com/games/files/space-is-key-2.swf'],[137,'agt54fghy67u','http://www.tremorgames.com/playgame/5906/skullhunter-players-pack.html','http://www.tremorgames.com/games/files/SkullHunter_PlayersPack.swf'],[140,'hy76tgf45r3','http://www.tremorgames.com/playgame/7037/notebook-wars.html','http://www.tremorgames.com/games/files/notewars.swf'],[136,'t5rfgtrf43','http://www.tremorgames.com/playgame/5899/endless-war-6.html','http://www.tremorgames.com/games/files/1349202105_5899_ew6 Tremor.swf'],[167,'n7uy86yg54r','http://www.tremorgames.com/playgame/7016/space-is-key.html','http://www.tremorgames.com/games/files/1349996691_7016_Space Is Key (Tremor).swf'],[141,'fr5tgbvcde32','http://www.tremorgames.com/playgame/1568/notebook-wars-2.html','http://www.tremorgames.com/games/files/1349972207_7015_notewars2.swf'],[131,'jhbny65tghh','http://www.tremorgames.com/playgame/5910/super-pig.html','http://www.tremorgames.com/games/files/superpig1.swf'],[135,'afrtgbnhyg','http://www.tremorgames.com/playgame/5896/ragdoll-achievement.html','http://www.tremorgames.com/games/files/Ragdoll-Achievement.swf'],[133,'fr54tgbvfth','http://www.tremorgames.com/playgame/5908/fat-snake.html','http://www.tremorgames.com/games/files/MrFatSnake.swf'],[132,'bf45rfgt6yhju','http://www.tremorgames.com/playgame/5909/xenosquad.html','http://www.tremorgames.com/games/files/1348951954_5909_xenosquad.swf'],[119,'sf45rvcxw23','http://www.tremorgames.com/playgame/5888/flashplox.html','http://www.tremorgames.com/games/files/Flash-Plox.swf'],[121,'dfrgthyu76h45','http://www.tremorgames.com/playgame/5864/swordfall-kingdoms.html','http://www.tremorgames.com/games/files/PIE_sfk.swf'],[142,'57hyuj89ikne3','http://www.tremorgames.com/playgame/5671/notebook-wars-3.html','http://www.tremorgames.com/games/files/nw3.swf'],[129,'hbnhy654tdvf','http://www.tremorgames.com/playgame/5891/legend-of-pandora.html','http://www.tremorgames.com/games/files/pandora.swf'],[130,'avgt67yhnju8','http://www.tremorgames.com/playgame/5892/legend-of-the-void.html','http://www.tremorgames.com/games/files/8QC_Game.swf'],[134,'hbn76trf43','http://www.tremorgames.com/playgame/5895/pheus-and-mor.html','http://www.tremorgames.com/games/files/Pheus_and_Mor.swf'],[125,'afr45tgbn67','http://www.tremorgames.com/playgame/5869/scrap-metal-heroes.html','http://www.tremorgames.com/games/files/SMH.swf'],[126,'grf45thy65a','http://www.tremorgames.com/playgame/5870/shatterbot.html','http://www.tremorgames.com/games/files/ShatterBot.swf'],[143,'gtr45bhn678','http://www.tremorgames.com/playgame/5932/arcs.html','http://www.tremorgames.com/games/files/1349701419_5932_ArcsGo.swf'],[144,'gtfbvnh76ju8','http://www.tremorgames.com/playgame/5927/abstract-defense.html','http://www.tremorgames.com/games/files/1349462460_5927_abstract-defense.swf'],[52,'asdf56gfqwe','http://www.tremorgames.com/playgame/4919/caldera-legends.html','http://www.tremorgames.com/games/files/Caldera Legends Sitelock.swf'],[100,'fgrt254hbn76','http://www.tremorgames.com/playgame/5774/-commit-point-five.html','http://www.tremorgames.com/games/files/CommitLoader.swf']]
  14.  
  15. def IsNumeric( v ):
  16. try:
  17. v2 = int( v )
  18. return True
  19. except (ValueError, TypeError):
  20. return False
  21.  
  22. def LoginTremorGames( s, username, password ):
  23. s.headers.update( { 'Origin': 'http://www.tremorgames.com' } )
  24. s.headers.pop( 'X-Requested-With', None )
  25. s.headers.update( { 'Referer': 'http://www.tremorgames.com/index.php' } )
  26. r = s.post( 'http://www.tremorgames.com/index.php', data={ 'loginuser': username, 'loginpassword': password, 'Submit': '' }, allow_redirects=False )
  27. return
  28.  
  29. def GetUserCoins( s ):
  30. s.headers.pop( 'Origin', None )
  31. s.headers.update( { 'X-Requested-With': 'XMLHttpRequest' } )
  32. s.headers.update( { 'Referer': GameURL } )
  33. r = s.get( 'http://www.tremorgames.com/achievements/ajax_getusercoins.php' )
  34. return int( r.text )
  35.  
  36. def GetGameAchievements( s ):
  37. s.headers.pop( 'Origin', None )
  38. s.headers.pop( 'X-Requested-With', None )
  39. s.headers.pop( 'Referer', None )
  40. r = s.get( GameURL, allow_redirects=False )
  41.  
  42. jsonStartIdx = r.text.find( 'AchievementsJS = jQuery.parseJSON(\'' ) + len( 'AchievementsJS = jQuery.parseJSON(\'' )
  43. jsonEndIdx = r.text.find( '\');', jsonStartIdx )
  44.  
  45. return json.loads( r.text[jsonStartIdx:jsonEndIdx] )
  46.  
  47. def GetGameStats( s, playerName ):
  48. s.headers.pop( 'Origin', None )
  49. s.headers.update( { 'X-Requested-With': 'ShockwaveFlash/24.0.0.194' } )
  50. s.headers.update( { 'Referer': GameURL } )
  51. r = s.get( 'http://www.tremorgames.com/achievements/json_get_stats.php', params={ 'PlayerName': playerName, 'GameID': GameID } )
  52. return r.json()
  53.  
  54. def UpdateGameStat( s, playerName, statName, statValue ):
  55. # calculate key
  56. requestKey = hashlib.md5( (playerName + Key + str( statValue )).encode( 'utf-8' ) ).hexdigest().lower()
  57.  
  58. s.headers.update( { 'Origin': 'http://www.tremorgames.com' } )
  59. s.headers.update( { 'X-Requested-With': 'ShockwaveFlash/24.0.0.194' } )
  60. s.headers.update( { 'Referer': GameSWF } )
  61. r = s.post( 'http://www.tremorgames.com/achievements/record_stats.php', data={ 'StatValue': statValue, 'StatName': statName, 'PlayerName': playerName, 'GameID': GameID, 'Key': requestKey } )
  62. return
  63.  
  64.  
  65. #------------------------------------------
  66. #-------------configurations---------------
  67. #------------------------------------------
  68. # log into tremorgames
  69. username = 'ranginggaming'
  70. password = '123456789'
  71.  
  72. #Number of seconds the script waits to start another game
  73. timeAfterEachGame = 15
  74.  
  75. #Speed at which the script does the achievements
  76. #1 = 1x the normal speed
  77. #2 = 2x the normal speed
  78. #3 = 3x the normal speed
  79. #etc...
  80. achievementSpeed = 1
  81. #------------------------------------------
  82. #------------------------------------------
  83. #------------------------------------------
  84.  
  85.  
  86.  
  87. random.shuffle(GameList)
  88. totalGames = len(GameList)
  89. gamesDone = 0
  90. for x in GameList:
  91. print('For debug - ' + str(x))
  92. GameID = x[0]
  93. Key = x[1]
  94. GameURL = x[2]
  95. GameSWF = x[3]
  96. random.seed()
  97. s = requests.Session()
  98. s.headers.update( { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36' } )
  99. s.headers.update( { 'Accept-Language': 'en-US,en;q=0.8' } )
  100.  
  101.  
  102. LoginTremorGames( s, username, password )
  103.  
  104. gameAchievements = GetGameAchievements( s )
  105. #gameStats = GetGameStats( s, username )
  106. os.system('cls')
  107. print('Games done ' + str(gamesDone) + ' of ' + str(totalGames))
  108. print('Doing achievements of: \n' + GameURL + '\n')
  109. # start completing achievements
  110. for achievement in gameAchievements:
  111. # currently only Max and Cumulative stat types supported
  112. if achievement['StatType'] != 'Max' and achievement['StatType'] != 'Cumulative' and achievement['StatType'] != 'Min':
  113. continue
  114.  
  115. # usually the current stat value isn't 0 but something like null or none, so we set it to 0
  116. if not IsNumeric( achievement['ProgressValue'] ):
  117. achievement['ProgressValue'] = '0'
  118.  
  119. statIncrease = 1
  120. statGoal = int( achievement['StatValue'] )
  121. if statGoal >= 100000:
  122. statIncrease = achievementSpeed * random.randrange( 1, 10000 )
  123. elif statGoal >= 10000:
  124. statIncrease = achievementSpeed * random.randrange( 1, 1000 )
  125. elif statGoal >= 1000:
  126. statIncrease = achievementSpeed * random.randrange( 1, 100 )
  127.  
  128.  
  129. if achievement['StatType'] == 'Min':
  130. print( 'Currently completing achievement "' + achievement['AchievementName'] + '" Stat Size = ' + str(statGoal))
  131. statFinal = 0
  132. if(int(achievement['StatValue']) != 0):
  133. statFinal = random.randrange(int( achievement['StatValue'] )/2 , int( achievement['StatValue'] ))
  134. UpdateGameStat( s, username, achievement['StatName'], statFinal)
  135. else:
  136. print( 'Currently completing achievement "' + achievement['AchievementName'] + '" Stat Size = ' + str(statGoal) + ' and increasing at ' + str(statIncrease) + '/sec')
  137. while int( achievement['ProgressValue'] ) < int( achievement['StatValue'] ):
  138. achievement['ProgressValue'] = str( int( achievement['ProgressValue'] ) + statIncrease )
  139.  
  140.  
  141. if achievement['StatType'] == 'Cumulative':
  142. UpdateGameStat( s, username, achievement['StatName'], statIncrease )
  143. else:
  144. UpdateGameStat( s, username, achievement['StatName'], int( achievement['ProgressValue'] ) )
  145.  
  146. print(str(achievement['ProgressValue']) + ' / '+str(statGoal)+' Done!', end='\r')
  147. # so we don't do it too fast
  148. time.sleep( 1/achievementSpeed )
  149.  
  150. print( 'Finished completing achievement\n' )
  151. print('Done game =\n' + GameURL + '\n')
  152. gamesDone = gamesDone + 1
  153. print('Games done ' + str(gamesDone) + ' of ' + str(totalGames))
  154.  
  155. print('Waiting ' + str(timeAfterEachGame) + ' seconds to do the next game!\n')
  156. time.sleep(timeAfterEachGame)
  157. os.system('cls')
  158. print( 'Done!' )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement