Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
require 'open-uri'
#email/encrypted password#
$user_email = "EMAIL HERE"
$user_password = "PASSWORD HERE"class SocketAAA
attr_accessor :url, :user_agent, :uri, :exit_conditions, :wait_conditions, :filedef initialize(email, password, file, uri)
@user_agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
@uri, @wait_conditions, @exit_conditions = uri, [], []
@url = "http://a3.alienaa.com/cgi-bin/%s?&email=%s&pass=%s" % [file, email, password]
end# expects the source of the page as an argument (page.read etc)
def check_conditions(page)
gets and exit if @exit_conditions.detect {|e| page[/#{e}/i]}
emulate_human_response(5) if @wait_conditions.detect {|e| page[/#{e}/i]}
end# connects to the site with a block and makes the page open-uri
def connect
open(@url + @uri, "Referer" => @url, "User-Agent" => @user_agent) do |page|
yield page if block_given?
end
end# simulates human response time
def emulate_human_response(time_to_wait = 0.00002)
sleep(rand(0.00005) + rand(time_to_wait))
end
end# replace "socket.emulate_human_response" with
def easy_sock(uri, file = "view.fcgi", email = $user_email, password = $user_password)
socket = SocketAAA.new(email, password, file, uri)
socket.wait_conditions.push("throttle")
socket.exit_conditions.push("important message", "banned from logging into", "georgetown jail", "no cookies", "getting overwhelmed", "fished out", "out of dough")
socket.connect do |page|
$source = page.read
socket.check_conditions($source)
end
#socket.emulate_human_response
end$source = ""
easy_sock("&step=pit&do=2&lvl=13")
#easy_sock("&step=pit&showmap=1")
prev_dir = " "
directions = ["w", "n", "e", "s"]
loop do
puts prev_dir
easy_sock("&step=pit&do=2&lvl=13")
if (/&step=pit&leave=1/ =~ $source && prev_dir != "left")
easy_sock("&step=pit&leave=1")
puts "entered!"
prev_dir = "left"
next
elsif (/&step=pit&next=1/ =~ $source)
easy_sock("&step=pit&next=1")
next
end
if (prev_dir == "left")
prev_dir = " "
end
# Check to see for a mine, then mine it
if (/&step=pit&mine1=1/ =~ $source)
easy_sock("&step=pit&mine1=1")
puts "Mined!"
next
end
# Sets it up to get moving!
if (prev_dir == " ")
if (/&step=pit&go=s>/ =~ $source)
easy_sock("&step=pit&go=s")
prev_dir = "s"
next
elsif (/&step=pit&go=w>/ =~ $source)
easy_sock("&step=pit&go=w")
prev_dir = "w"
next
elsif (/&step=pit&go=e>/ =~ $source)
easy_sock("&step=pit&go=e")
prev_dir = "e"
next
elsif (/&step=pit&go=n>/ =~ $source)
easy_sock("&step=pit&go=n")
prev_dir = "n"
next
end
endif (prev_dir == "s")
unless (/&step=pit&go=w>/ =~ $source)
if (/&step=pit&go=s>/ =~ $source)
easy_sock("&step=pit&go=s")
prev_dir = "s"
next
elsif (/&step=pit&go=e>/ =~ $source)
easy_sock("&step=pit&go=e")
prev_dir = "e"
next
else
easy_sock("&step=pit&go=n")
prev_dir = "n"
next
end
else
easy_sock("&step=pit&go=w")
prev_dir = "w"
next
end
endif (prev_dir == "w")
unless (/&step=pit&go=n>/ =~ $source)
if (/&step=pit&go=w>/ =~ $source)
easy_sock("&step=pit&go=w")
prev_dir = "w"
next
elsif (/&step=pit&go=s>/ =~ $source)
easy_sock("&step=pit&go=s")
prev_dir = "s"
next
else
easy_sock("&step=pit&go=e")
prev_dir = "e"
next
end
else
easy_sock("&step=pit&go=n")
prev_dir = "n"
next
end
endif (prev_dir == "n")
unless (/&step=pit&go=e>/ =~ $source)
if (/&step=pit&go=n>/ =~ $source)
easy_sock("&step=pit&go=n")
prev_dir = "n"
next
elsif (/&step=pit&go=w>/ =~ $source)
easy_sock("&step=pit&go=w")
prev_dir = "w"
next
else
easy_sock("&step=pit&go=s")
prev_dir = "s"
next
end
else
easy_sock("&step=pit&go=e")
prev_dir = "e"
next
end
endif (prev_dir == "e")
unless (/&step=pit&go=s>/ =~ $source)
if (/&step=pit&go=e>/ =~ $source)
easy_sock("&step=pit&go=e")
prev_dir = "e"
next
elsif (/&step=pit&go=n>/ =~ $source)
easy_sock("&step=pit&go=n")
prev_dir = "n"
next
else
easy_sock("&step=pit&go=w")
prev_dir = "w"
next
end
else
easy_sock("&step=pit&go=s")
prev_dir = "s"
next
end
end
end

yes its ruby i need help to speed it up because my friend uses the same one but he did something to it and it runs 5x the speed of mine's

![]() |
batch change file modifie...
|
VBScript to connect to SQ...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |