Omrii
06-18-2016, 05:31 PM
If anyone cares for a script that does not use matchwait. This has been tested a reasonable amount.
@pickaxe_container = "rucksack"
@loot_container = "longcoat"
@cycle_number = 20
def pickaxe()
if GameObj.right_hand.noun =~ /pickaxe/
return
else
fput("put ##{GameObj.right_hand.id} in my #{@loot_container}") if !GameObj.right_hand.id.nil?
result = dothistimeout(
"get my pickaxe from my #{@pickaxe_container}",
2,
/Get what|You remove/
)
if result =~ /Get what/
echo "You appear to be out of pickaxes."
exit
end
if GameObj.right_hand.noun !~ /pickaxe/
echo "Something strange happened."
exit
end
end
end
def storage()
if GameObj.left_hand.nil?
return
else
fput("put ##{GameObj.left_hand.id} in my #{@pickaxe_container}") if GameObj.left_hand.noun =~ /pickaxe/
fput("put ##{GameObj.left_hand.id} in my #{@loot_container}") if !GameObj.left_hand.id.nil?
end
end
@cycle_number.to_i.times{
storage()
pickaxe()
loop{
fput("dig")
waitrt?
break if !GameObj.left_hand.id.nil? || GameObj.right_hand.id.nil?
}
fput("put my pickaxe in my #{@pickaxe_container}") if GameObj.right_hand.noun =~ /pickaxe/
if !GameObj.left_hand.id.nil?
if GameObj.left_hand.noun =~ /casket|coffin|sarcophagus/
fput("pry ##{GameObj.left_hand.id}")
waitrt?
fput("pry ##{GameObj.left_hand.id}")
waitrt?
fput("look in ##{GameObj.left_hand.id}")
fput("get coin from ##{GameObj.left_hand.id}")
waitrt?
fput("empty ##{GameObj.left_hand.id} into my #{@loot_container}")
waitrt?
fput("put ##{GameObj.left_hand.id} in crate")
else
multifput("open ##{GameObj.left_hand.id}","look in ##{GameObj.left_hand.id}")
sleep 0.5
GameObj[GameObj.left_hand.id].contents.each{|item|
fput("get ##{item.id}")
waitrt?
sleep 0.1
fput("put ##{item.id} in my #{@loot_container}") if !GameObj.right_hand.id.nil?
}
fput("look in ##{GameObj.left_hand.id}")
sleep 0.5
if GameObj[GameObj.left_hand.id].contents.length.to_i == 0
fput("put ##{GameObj.left_hand.id} in crate")
sleep 0.1
else
exit
end
end
end
}
@pickaxe_container = "rucksack"
@loot_container = "longcoat"
@cycle_number = 20
def pickaxe()
if GameObj.right_hand.noun =~ /pickaxe/
return
else
fput("put ##{GameObj.right_hand.id} in my #{@loot_container}") if !GameObj.right_hand.id.nil?
result = dothistimeout(
"get my pickaxe from my #{@pickaxe_container}",
2,
/Get what|You remove/
)
if result =~ /Get what/
echo "You appear to be out of pickaxes."
exit
end
if GameObj.right_hand.noun !~ /pickaxe/
echo "Something strange happened."
exit
end
end
end
def storage()
if GameObj.left_hand.nil?
return
else
fput("put ##{GameObj.left_hand.id} in my #{@pickaxe_container}") if GameObj.left_hand.noun =~ /pickaxe/
fput("put ##{GameObj.left_hand.id} in my #{@loot_container}") if !GameObj.left_hand.id.nil?
end
end
@cycle_number.to_i.times{
storage()
pickaxe()
loop{
fput("dig")
waitrt?
break if !GameObj.left_hand.id.nil? || GameObj.right_hand.id.nil?
}
fput("put my pickaxe in my #{@pickaxe_container}") if GameObj.right_hand.noun =~ /pickaxe/
if !GameObj.left_hand.id.nil?
if GameObj.left_hand.noun =~ /casket|coffin|sarcophagus/
fput("pry ##{GameObj.left_hand.id}")
waitrt?
fput("pry ##{GameObj.left_hand.id}")
waitrt?
fput("look in ##{GameObj.left_hand.id}")
fput("get coin from ##{GameObj.left_hand.id}")
waitrt?
fput("empty ##{GameObj.left_hand.id} into my #{@loot_container}")
waitrt?
fput("put ##{GameObj.left_hand.id} in crate")
else
multifput("open ##{GameObj.left_hand.id}","look in ##{GameObj.left_hand.id}")
sleep 0.5
GameObj[GameObj.left_hand.id].contents.each{|item|
fput("get ##{item.id}")
waitrt?
sleep 0.1
fput("put ##{item.id} in my #{@loot_container}") if !GameObj.right_hand.id.nil?
}
fput("look in ##{GameObj.left_hand.id}")
sleep 0.5
if GameObj[GameObj.left_hand.id].contents.length.to_i == 0
fput("put ##{GameObj.left_hand.id} in crate")
sleep 0.1
else
exit
end
end
end
}