hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Automation

 
Reply to topic    hacker.org Forum Index » OneOfUs View previous topic
View next topic
Automation
Author Message
adum



Joined: 19 Apr 2007
Posts: 390

Post Automation Reply with quote
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:
http://www.hacker.org/oneofus/index.php?name=<username>&password=<password>&path=1,2_3,0

Sun Jun 24, 2007 6:34 am View user's profile Send private message Visit poster's website
adum



Joined: 19 Apr 2007
Posts: 390

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

cheers,
adum
Thu Apr 17, 2008 5:54 pm View user's profile Send private message Visit poster's website
coderT



Joined: 12 Nov 2008
Posts: 17

Post Reply with quote
What is POST, can I see an example. (Java version please)
Thanks.
Tue Dec 30, 2008 3:36 am View user's profile Send private message Yahoo Messenger
outsider



Joined: 07 Jan 2009
Posts: 26

Post Reply with quote
try this: http://www.exampledepot.com/egs/java.net/Post.html
Sun Sep 20, 2009 1:31 pm View user's profile Send private message
coderT



Joined: 12 Nov 2008
Posts: 17

Post Reply with quote
Thank you very much. Rolling Eyes
Sun Jan 03, 2010 3:28 am View user's profile Send private message Yahoo Messenger
miroe



Joined: 08 Mar 2009
Posts: 5

Post Reply with quote
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
Sat Sep 04, 2010 8:34 am View user's profile Send private message
Zeta



Joined: 16 Apr 2009
Posts: 62

Post Reply with quote
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
Sat Sep 04, 2010 10:04 am View user's profile Send private message
miroe



Joined: 08 Mar 2009
Posts: 5

Post Reply with quote
Thank you very much! That worked! Very Happy

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 Cool At least, its not as easy as in java, I guess.
Sat Sep 04, 2010 3:17 pm View user's profile Send private message
megabreit



Joined: 03 Jan 2009
Posts: 141

Post Reply with quote
You're using ABAP??? That's bizarre Smile 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...
Mon Sep 06, 2010 6:43 pm View user's profile Send private message
Hippo



Joined: 01 Feb 2014
Posts: 332
Location: Praha 5

Post Reply with quote
megabreit wrote:
You're using ABAP??? That's bizarre Smile 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...
Fri Oct 10, 2014 8:27 am View user's profile Send private message
Display posts from previous:    
Reply to topic    hacker.org Forum Index » OneOfUs All times are GMT
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.