Cavern Master

Sjune
Posts: 2
Joined: Mon Mar 09, 2009 9:27 am

Post by Sjune »

As me in Poker, my bot was a Rock. Beat him in two rounds without getting any damage...
General_Payne
Posts: 20
Joined: Mon Jun 20, 2011 6:25 pm

Writing a Bot

Post by General_Payne »

Well, iv never done any code before relating to internet.

Iv used python for alot of the challenges but with this i have no idea where to start

a google suggested urllib2 but with the below I got a 'not logged in'

import urllib2
response = urllib2.urlopen('http://www.hacker.org/challenge/misc/d/cavern.php')
html = response.read()
print html

so i tried adding &name=General_Payne&password=[mypassword] to the url. Errored out.

Any clues / how to submit, what to do would be much appreciated
User avatar
CodeX
Posts: 350
Joined: Fri Oct 17, 2008 5:28 pm

Post by CodeX »

For the first parameter you would have ? instead of & e.g. .../cavern.php?name=General_...
You may also have to urlencode your password which can be done in python with something like

Code: Select all

from urllib import urlencode
encodedPassword = urlencode( "!@#$%^&*()_+ oh no my password" )
query = "/challenge/misc/d/cavern.php?name=General_Payne&password=%s"%encodedPassword
urlllib2 doesn't have a urlencode function so you have to get it from urllib instead
General_Payne
Posts: 20
Joined: Mon Jun 20, 2011 6:25 pm

Reply

Post by General_Payne »

Thanks alot Codex

Id just managed to figure out how to do it before checking this again. Now my issue is my damn bot refuses to go down stairs its i the top left or bottom right square, but thats just a code error.

Iv rewritten it from scratch twice and get the same issue so im being rather dim somewhere lol
cakeeatinghaxxor
Posts: 4
Joined: Wed Jul 20, 2011 9:04 pm

Post by cakeeatinghaxxor »

This challenge took my bot hours just to level up...
The boss summoned not until level 127. So i had to bot up to level 133...

But i really recommend Ruby for this challenge - mechanize and nokogiri are just nice.
moose
Posts: 67
Joined: Fri Jul 16, 2010 7:32 pm

Post by moose »

# My current level: 128 (4883 XP)
# dungeon level: 123
# HP: 2640
# Weapon: Level 122 Slicer +5 (Strength: 127)
# Inventory: Aquamarine potion +4, Aquamarine potion +5, Magenta potion +4

I hope it will summon soon...

edit: Never mind, I got it :D That was easy ... hat more than 2000 HP and the +5 heal potion left.
Hckr
Posts: 27
Joined: Thu Mar 25, 2010 2:16 pm

Post by Hckr »

Very cool challenge :D
fragman
Posts: 15
Joined: Thu Mar 05, 2009 2:28 pm

Post by fragman »

bot is currently running, I just hope 10 levels above DungeonLevel will be enough for the boss :/
destiny
Posts: 25
Joined: Thu Jul 03, 2014 4:08 pm
Location: UK

Post by destiny »

I really enjoyed this challenge since I haven't written a bot like this before. I used ruby with the mechanize gem to complete this, and although my script wasn't perfect it did the job of killing the boss with ease. Funnily enough even the logging in to start the game was a challenge since it took me a little while to figure out how to use mechanize since the examples in the docs weren't great.
Jijel
Posts: 4
Joined: Sun Sep 21, 2014 8:36 pm

Post by Jijel »

and year since someone posted here. I used JavaScript and tampermonkey for this one. It goes about 50 levels per hour. I am currently at dungeon level 102 and hero level 109. :P As for the logging, I just use console.log to print the bit of the page that is needed and I leave it in it's own tab.
Kaaser
Posts: 4
Joined: Thu Mar 14, 2013 7:22 pm

Great Challenge

Post by Kaaser »

The first bot I wrote.I used python and splinter, but my bot needed some time. At the end I was scared whether the bot win or not so I did it myself. I was 14 levels above the dungeon level drank a magenta potion +5 and killed the boss with one hit. My bot needed a week in the 24 hours a day mode to be all the time between 14 and 20 Levels above the dungeon level. Maybe not the best bot x)
User avatar
Hippo
Posts: 339
Joined: Sat Feb 01, 2014 12:05 am
Location: Praha 5

Re: Great Challenge

Post by Hippo »

Kaaser wrote:The first bot I wrote.I used python and splinter, but my bot needed some time. At the end I was scared whether the bot win or not so I did it myself. I was 14 levels above the dungeon level drank a magenta potion +5 and killed the boss with one hit. My bot needed a week in the 24 hours a day mode to be all the time between 14 and 20 Levels above the dungeon level. Maybe not the best bot x)
So Cave Master would be challenging ;). Funny, it's exactly 2 years I have solved it.
iFurySt
Posts: 1
Joined: Wed Aug 10, 2016 2:37 pm
Contact:

Re: Great Challenge

Post by iFurySt »

Hippo wrote:
Kaaser wrote:The first bot I wrote.I used python and splinter, but my bot needed some time. At the end I was scared whether the bot win or not so I did it myself. I was 14 levels above the dungeon level drank a magenta potion +5 and killed the boss with one hit. My bot needed a week in the 24 hours a day mode to be all the time between 14 and 20 Levels above the dungeon level. Maybe not the best bot x)
So Cave Master would be challenging ;). Funny, it's exactly 2 years I have solved it.
sorry i am laughing XD
KeysRFaded
Posts: 1
Joined: Tue Aug 23, 2016 12:04 am

Post by KeysRFaded »

could somebody please point me in the right direction of building my own bot. some useful links and info. no answers though please.... i dont know where to start and looking for only that. greatly appreciated :)
Schnabeltier
Posts: 1
Joined: Mon Oct 27, 2008 1:26 pm

Post by Schnabeltier »

Is it still possible to solve this challenge? I always get the message "off board" on the screen, when I am clicking in one direction in one step and in its counter direction in the next. (e.g. East, then West; or South, then North; or vice versa)
Post Reply