Automation

Post Reply
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Automation

Post by adum »

Like all our puzzles, this is designed to be solved by a computer past a certain point.

Accessing your current level
The URL for the puzzle is http://www.hacker.org/oneofus/index.php
The URL will accept parameters in the query part of the URL that correspond to your registered account:
name=<username>
password=<password>

Just making a normal HTTP request to the above URL with your name and password will retrieve the current puzzle. To parse this information, look for the line that says FlashVars="...". inside the quotes are params separated by ampersands. The 'board' parameter is the map, where character pairs determine the shapes and colors. (Each 'shape' of block is a different letter, starting with 'A'. Similarly, the 'colors' start with 'a'.) It's all one string, but you can break it up knowing boardX. (The first boardX * 2 characters make the first row, etc.)


Submit a Solution via an HTTP GET:


To submit a solution, use the following parameter:
path=<moves>
where the moves are a sequence of move pairs, two hexadecimal strings each, with a separator of a comma between x and y, and a separator of a '_' between moves.
For example, to submit a solution where you clicked one square over and two down, then three squares over and zero down, you would do an HTTP GET on the following URL:

Code: Select all

http://www.hacker.org/oneofus/index.php?name=<username>&password=<password>&path=1,2_3,0
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post by adum »

hi snark -- yes, you need to use POST. all the puzzles will accept it.

cheers,
adum
coderT
Posts: 17
Joined: Wed Nov 12, 2008 5:37 am

Post by coderT »

What is POST, can I see an example. (Java version please)
Thanks.
outsider
Posts: 37
Joined: Wed Jan 07, 2009 12:15 pm

Post by outsider »

coderT
Posts: 17
Joined: Wed Nov 12, 2008 5:37 am

Post by coderT »

Thank you very much. :roll:
miroe
Posts: 5
Joined: Sun Mar 08, 2009 2:58 am

Post by miroe »

Hi,

I'm using a programming language which does not allow HTTP sockets or similar stuff. So I thought to use HTML forms with my web browser to post the solutions manually. Works well for the challenge Crossflip, but for OneOfUs, the parameter is not accepted. I'm using:

<html><body><form action="http://www.hacker.org/oneofus/index.php" method="post">
<input type="hidden" name="path" value="22,24_05,24_[....]"><input type="submit" value="Send"></form></body></html>

When I press the send button, my solution is ignored and the same level again is shown. With get, of course the size limitation for the request url comes into place. I tried on IE, Safari and Opera, always with the same result.

Do you have any idea what I could do?

Btw, really great challenges here!

Kind regards, many thanks
Michael
Zeta
Posts: 62
Joined: Thu Apr 16, 2009 3:37 pm

Post by Zeta »

Try adding "name" and "password" (or "spw") parameters to your form and prevent sending the session cookies. The POST hander probably doesn't recognize your cookies and somehow forwards the request to the normal GET handler or in presence of session cookies the POST request is not handled correctly.

Out of curiosity: What language are you using?

You may want to investigate some kind of glue language like python, perl or ruby.
On linux you can always use the bash together with curl. Windows has the power shell and you can do .NET scripting using system.net.webclient.
Last edited by Zeta on Sat Sep 04, 2010 6:00 pm, edited 1 time in total.
miroe
Posts: 5
Joined: Sun Mar 08, 2009 2:58 am

Post by miroe »

Thank you very much! That worked! :D

I'm using ABAP. The only language I know well enough to get some of the challenges solved. I think it contains webclient functionality as well, but I was too lazy to figure out how that works 8) At least, its not as easy as in java, I guess.
megabreit
Posts: 141
Joined: Sat Jan 03, 2009 3:33 pm

Post by megabreit »

You're using ABAP??? That's bizarre :-) Is it usable outside a SAP application server? Or do you have a "home" SAP system running?
I wonder if people do challenges with other "unusual" programming languages like Postscript...
User avatar
Hippo
Posts: 339
Joined: Sat Feb 01, 2014 12:05 am
Location: Praha 5

Post by Hippo »

megabreit wrote:You're using ABAP??? That's bizarre :-) Is it usable outside a SAP application server? Or do you have a "home" SAP system running?
I wonder if people do challenges with other "unusual" programming languages like Postscript...
It would be real challenge to solve challenges in TeX...
Post Reply