Advertisement
leonardi

Launcher

Oct 26th, 2013
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.75 KB | None | 0 0
  1. import subprocess, http.client, urllib.parse, os, urllib, zipfile, urllib.request, zipfile
  2.  
  3. if not os.path.isdir("C:\\OmniTek\\.minecraft"):
  4.     os.makedirs("C:\\OmniTek\\.minecraft")
  5.     print("Cave Johnson here, We're going to attempt to download the modpack for you now. \n We're just throwing science at the walls here, we'll see what sticks. \n \n \n We'll notify you when we think we're done")
  6.     testing, headers = urllib.request.urlretrieve("http://ubuntuone.com/3qw8Y9MoDg3HZPJ0KpfndS", filename="C:\\OmniTek\\.minecraft\\OmniTek.zip")
  7.     with zipfile.ZipFile("C:\\OmniTek\\.minecraft\\Omnitek.zip", "r") as z:
  8.         z.extractall("C:\\OmniTek\\.minecraft")
  9.     print("Cave Johnson here, We're done here")
  10.  
  11. username = input("Enter your Minecraft Username: ")
  12. password = input("Enter your Minecraft Password: ")
  13.  
  14. gigs = input("Enter a number between 1 and 4 to let us know how much RAM memory you would like to use for your Minecraft!")
  15.  
  16. webReq = ("/?user=" + username + "&password=" + password + "&version=13")
  17. print(webReq)
  18.  
  19. conn = http.client.HTTPConnection("login.minecraft.net")
  20.  
  21.  
  22. conn.request("POST", webReq)
  23. r1 = conn.getresponse()
  24. r2 = str(r1.read())
  25. print(r1.status, r1.reason)
  26. print(r2)
  27.  
  28. sep = ":"
  29. splitted = r2.split(sep, 10)
  30.  
  31. authCode = (splitted[3])
  32. print(authCode)
  33.  
  34. stringy = ("set APPDATA=C:\\OmniTek \njava -XX:MaxPermSize=256m -Xms"+gigs+"g -Xmx"+gigs+"""g -Djava.library.path=natives/ -cp "minecraft.jar";"lwjgl.jar";"lwjgl_util.jar";"jinput.jar" net.minecraft.client.Minecraft"""+" "+username+" "+password+" "+authCode+"\npause")
  35.  
  36. with open('C:\\OmniTek\\.minecraft\\bin\\start.bat', 'w') as f:
  37.             f.write(stringy)
  38.  
  39.  
  40. subprocess.Popen("C:\\OmniTek\\.minecraft\\bin\\start.bat")
  41.  
  42.  
  43. input("press enter to close")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement