Created
September 18, 2012 05:59
-
-
Save goldblattster/3741503 to your computer and use it in GitHub Desktop.
egoidle.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'win32/registry' | |
puts 'Welcome to Sushi\'s eGO Counter-Strike: Global Offensive server idling tool!' | |
puts | |
puts 'Pick a server to join...' | |
def get_option | |
puts | |
puts '1) Office' | |
puts '2) Dust2' | |
puts '3) Rotation' | |
puts '4) Jail' | |
puts | |
print 'Type an option and then press ENTER [1-4]: ' | |
gets.to_i | |
end | |
def connect(option) | |
steam_path = nil | |
if File.exists? 'Steam.exe' | |
steam_path = 'Steam.exe' | |
else | |
if steam_path == nil | |
Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\\Valve\\Steam') do |reg| | |
unless reg['InstallPath'].nil? | |
steam_path = reg['InstallPath'] + '\\Steam.exe' | |
end | |
end | |
end | |
if steam_path == nil | |
Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\\Wow6432Node\\Valve\\Steam') do |reg| | |
unless reg['InstallPath'].nil? | |
steam_path = reg['InstallPath'] + '\\Steam.exe' | |
end | |
end | |
end | |
end | |
unless steam_path.nil? | |
case option | |
when 1 | |
system(steam_path + ' -applaunch 730 -textmode -nosound -nopreload +connect 184.173.227.124:27016') | |
when 2 | |
system(steam_path + ' -applaunch 730 -textmode -nosound -nopreload +connect 184.173.227.126:27016') | |
when 3 | |
system(steam_path + ' -applaunch 730 -textmode -nosound -nopreload +connect 174.36.42.206:27015') | |
when 4 | |
system(steam_path + ' -applaunch 730 -textmode -nosound -nopreload +connect 174.36.42.207:27016') | |
end | |
exit | |
else | |
puts 'Please put this file in your Steam directory and try running it again.' | |
exit | |
end | |
end | |
connect get_option |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment