goldaryn

Automatic version checker for ROTMG / Flash projector

Mar 29th, 2013
679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '
  2. '   Automatic version checker for Realm of the Mad God / Flash projector
  3. '   by goldaryn
  4. '
  5. '
  6. '   This VBscript checks the ROTMG website to see what is the latest
  7. '   build of ROTMG, and runs Flash projector with the correct URL.
  8. '   It automates this process: https://forums.wildshadow.com/node/196842#comment-1047626
  9. '   Save this code as a .vbs file in the same directory as your flash projector.
  10. '
  11.  
  12. ' The filename of the Flash projector file. Edit if necessary.
  13. projector = "flashplayer_12_sa.exe"
  14.  
  15. ' Where to find the current version of ROTMG.
  16. rotmg_version_url = "http://www.realmofthemadgod.com/version.txt"
  17.  
  18. ' This code loads the URL above and puts the content into the variable xmlhttp.responseText
  19. Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
  20. xmlhttp.open "GET", rotmg_version_url, 0
  21. xmlhttp.send ""
  22.  
  23. ' This code creates the correct URL to launch using Flash projector
  24. rotmg_latest_swf = "http://www.realmofthemadgod.com/AGCLoader" & xmlhttp.responseText & ".swf"
  25.  
  26. ' This is a popup giving the user some information before launching. vbCr & vbLf stuff adds line breaks
  27. wscript.Echo "Current version is " & xmlhttp.responseText & "." & vbCr & vbLf & vbCr & vbLf & "Launching " & projector & " with argument " & rotmg_latest_swf
  28.  
  29. ' Launch Flash projector!
  30. Set objShell = WScript.CreateObject("WScript.Shell")
  31. objShell.Run (projector & " " & rotmg_latest_swf)
  32.  
  33. ' Clean up
  34. Set xmlhttp = Nothing
Advertisement
Add Comment
Please, Sign In to add comment