Jump to content



Photo

alienaa mining script


  • Please log in to reply
6 replies to this topic

#1 convict

convict

    Seeker

  • Active Members
  • 5 posts

Posted 17 August 2007 - 12:53 AM

ok I found a code for mining script but when I compile it to a .exe file it wont run can someone fix this code to run for me




#!/usr/bin/ruby
require 'open-uri'

#E-Mail and Password... replace /'s with %2f
email = "regular@email.com"
password = "*************"

#Whatever the file name is that you're using... Mining is view.fcgi (if I remember, chatbox is comm.fcgi etc.)
file_name = "view.fcgi"

#What it says in the address bar besides the email and password. Make sure a & precedes every variable
uri = "&step=pit&do=2&lvl=13"

#Don't change this...
referer = "http://a3.alienaa.com/cgi-bin/#{file_name}"
url = "http://a3.alienaa.com/cgi-bin/#{file_name}?&email=#{email}&pass=#{password}"
user_agent = "Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1)"

#Amount of veins to mine
veins = -1
to_mine = 200

#Final URL to use in open()
goto = "#{url}#{uri}"

#Previous direction that was gone. options are: n (north), e (east), s (south), w (west)
prev_dir = ""

#Method for when it gets stuck with only one option (going east, only option west, so it can't move)
def stuck line, prev_dir
if (prev_dir == "e" || prev_dir == "w")
if (!(/&go=s>/ =~ line) && (!(/&go=n>/ =~ line)))
return true
end
elsif (prev_dir == "s" || prev_dir == "n")
if (!(/&go=w>/ =~ line) && (!(/&go=e>/ =~ line)))
return true
end
end
end

#method for finding out which to map to
def prev dir
if (dir == "e")
return "w"
elsif (dir == "w")
return "e"
elsif (dir == "s")
return "n"
elsif (dir == "n")
return "s"
end
end


#timer vars, to change up the directions (so it doesn't get into a pattern)
set_arr = ['e','s','w','n']
rand_arr = []
trail = []
trail_moves = 0
moves = 0

def track_back prev_dir
case prev_dir
when "e"
return "w"
when "w"
return "e"
when "n"
return "s"
when "s"
return "n"
end
end

while (veins < to_mine)
#1 second sleep for one connection a second
sleep(0.10);
goto = "#{url}#{uri}"
open( goto, "Referer"=>referer, "User-Agent"=>user_agent ) do |site|
line = site.read
if (/&step=pit&mine=1/ =~ line)
if (/&step=pit&mine=1&shovel=1/ =~ line)
uri = "&step=pit&mine=1&shovel=1"
puts "Shoveled for extra ore! Sweet!"
#veins += 1
else
uri = "&step=pit&mine=1"
puts "Mined"
#veins += 1
end
break
elsif ((/&leave=1/ =~ line || /&next=1/ =~ line) && (prev_dir == "" || prev_dir == "leave"))
if (/&leave=1/ =~ line)
uri = "&step=pit&leave=1"
prev_dir = "leave"
elsif (/&next=1/ =~ line)
uri = "&step=pit&next=1"
prev_dir = "next"
trail = []
trail_moves = 0
end
break
else
if (prev_dir == "leave") #Check to see if on the wrong level
break
end
puts prev_dir if (trail_moves <= 150)
moves += 1
if (moves > 40 )
while (!(set_arr.empty?))
rand_arr.push(set_arr.delete_at(rand(set_arr.size)))
end
set_arr = rand_arr
rand_arr = []
puts "Directions Randomized!"
moves = 0
end
if (trail_moves > 50) #Maximum amount of steps, traces back
trace_pop = trail.pop
uri = "&step=pit&go=#{trace_pop}"
print "trace"
puts trace_pop
if (trail.empty? or /&do=1&lvl=13/ =~ line)
if (/&do=1&lvl=13/ =~ line)
uri = "&step=pit&do=2&lvl=13"
end
trail_moves = 0
trail = []
prev_dir = ""
end
moves = 0
break
end
if (/&do=1&lvl=13/ =~ line) #Check to see if you died during the pit
uri = "&step=pit&do=2&lvl=13"
prev_dir = ""
puts "Dead, restarting"
trail_moves = 0
trail = []
moves = 0
break
end
if (prev_dir == "" || prev_dir == "next")
uri = "&step=pit&go=s"
prev_dir = "s"
trail.push("n")
trail_moves += 1
break
elsif (/&go=#{prev_dir}>/ =~ line)
uri = "&step=pit&go=#{prev_dir}"
trail.push(track_back(prev_dir))
trail_moves += 1
break
elsif ((/&go=#{set_arr[0]}>/ =~ line) && (prev_dir != prev(set_arr[0]) || stuck(line, prev_dir)))
uri = "&step=pit&go=#{set_arr[0]}"
prev_dir = "#{set_arr[0]}"
trail.push(track_back(prev_dir))
trail_moves += 1
break
elsif ((/&go=#{set_arr[1]}>/ =~ line) && (prev_dir != prev(set_arr[1]) || stuck(line, prev_dir)))
uri = "&step=pit&go=#{set_arr[1]}"
prev_dir = "#{set_arr[1]}"
trail.push(track_back(prev_dir))
trail_moves += 1
break
elsif ((/&go=#{set_arr[2]}>/ =~ line) && (prev_dir != prev(set_arr[2]) || stuck(line, prev_dir)))
uri = "&step=pit&go=#{set_arr[2]}"
prev_dir = "#{set_arr[2]}"
trail.push(track_back(prev_dir))
trail_moves += 1
break
elsif ((/&go=#{set_arr[3]}>/ =~ line) && (prev_dir != prev(set_arr[3]) || stuck(line, prev_dir)))
uri = "&step=pit&go=#{set_arr[3]}"
prev_dir = "#{set_arr[3]}"
trail.push(track_back(prev_dir))
trail_moves += 1
break
end
end
end
end





#2 NELyon

NELyon

    Do you wanna brew my avatar?

  • Active Members
  • PipPipPipPipPipPip
  • 3,526 posts

Posted 17 August 2007 - 02:54 AM

Um, this isn't even an autoit code: V2 or V3.


This is ruby afaik...

#3 convict

convict

    Seeker

  • Active Members
  • 5 posts

Posted 18 August 2007 - 05:17 AM

Um, this isn't even an autoit code: V2 or V3.
This is ruby afaik...



well as I said... I dont know anything about this stuff... could you please help me?

#4 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,315 posts

Posted 20 August 2007 - 03:35 AM

ok I found a code for mining script but when I compile it to a .exe file it wont run can someone fix this code to run for me


This is not AutoIt code.

#5 sandman

sandman

    I ❤ WordPress

  • Active Members
  • PipPipPipPipPipPip
  • 1,303 posts

Posted 21 August 2007 - 01:46 AM

Yep, looks like Ruby. Try asking over at their forums for help; because, well, I have no idea.

"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();


#6 convict

convict

    Seeker

  • Active Members
  • 5 posts

Posted 28 August 2007 - 07:47 AM

Yep, looks like Ruby. Try asking over at their forums for help; because, well, I have no idea.

what do I need to download to make that script work?

#7 randallc

randallc

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,902 posts

Posted 28 August 2007 - 07:57 AM

what do I need to download to make that script work?

hi,
welcome to Ruby forums.... follow the link;
Rubyrandall




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users