Advertisement
Guest User

Untitled

a guest
Dec 4th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. --ROBLOX LAUNCHER
  2.  
  3. --Find the current version file
  4. function FindRbxPlayer()
  5.     function scandir(directory,mode)
  6.         local i, t, popen = 0, {}, io.popen
  7.         for filename in popen('dir "'..directory..'" /b '.. mode):lines() do
  8.             i = i + 1
  9.             t[i] = filename
  10.         end
  11.         return t
  12.     end
  13.  
  14.     for
  15.         i,v in pairs (scandir("%appdata%/../Local/Roblox/Versions","/ad"))
  16.     do
  17.         for k,x in pairs (scandir("%appdata%/../Local/Roblox/Versions/"..v,"/a-d")) do
  18.             if x=="RobloxPlayerBeta.exe" then
  19.                 return v
  20.             end
  21.         end
  22.     end
  23. end
  24.  
  25. --sets the current version to the found version
  26. local CURRENTVERSION=FindRbxPlayer()
  27. --These are here just because
  28. local presets= { ["kk"]=157005930, ["cf"]=101554146,["piggy"]=155856024,["mc"]=170222579, ["ap"]=1600503;
  29.                 ["aph"]=99015795}
  30. function LaunchGame()
  31.     print("Paste a place ID here.")
  32.     local input=io.stdin:read()--accept user input
  33.     if
  34.         input=="RESET" --allow resetting to find new version in case of update
  35.     then
  36.         CURRENTVERSION=FindRbxPlayer()
  37.         LaunchGame()
  38.     end
  39.     local ID=( presets[input] or input)--Did you shortcut?
  40.     presets["last"]=input
  41.     print("Launching game, please wait..")
  42.     --launches a game with the given ID
  43.     os.execute("%appdata%/../Local/Roblox/Versions/"..CURRENTVERSION.."/RobloxPlayerBeta.exe --id "..ID)
  44.     print("Game closed.")
  45.     LaunchGame() --allows you to paste another ID
  46. end
  47. LaunchGame()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement