Live data from Hacker News

Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

alex.nisnevich.com

91–100 of 246 posts

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#91
post #89

Earlier quoted context omitted.

Is there anything else you could modify to change what the raft does?

Yes...but I can't do it at an intelligent time.

Do you have any tools available to you that let you execute code at a chosen time?

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#94
The level files are 503ing, but it looks like the level counter is still incrementing if I go out of the exit and back in again. You might want to add some response code validation in.

    GET http://alex.nisnevich.com/untrusted/levels/10_ambush.jsx 503 (Service Unavailable) jquery.min.js:6
    GET http://alex.nisnevich.com/untrusted/levels/11_robot.jsx 503 (Service Unavailable) jquery.min.js:6
    GET http://alex.nisnevich.com/untrusted/levels/12_robotNav.jsx 503 (Service Unavailable) jquery.min.js:6
    GET http://alex.nisnevich.com/untrusted/levels/13_robotMaze.jsx 503 (Service Unavailable) jquery.min.js:6
    GET http://alex.nisnevich.com/untrusted/levels/14_crispsContest.jsx 503 (Service Unavailable) jquery.min.js:6
    GET http://alex.nisnevich.com/untrusted/levels/15_exceptionalCrossing.jsx 503 (Service Unavailable) jquery.min.js:6
    GET http://alex.nisnevich.com/untrusted/levels/16_lasers.jsx 503 (Service Unavailable) jquery.min.js:6
    GET http://alex.nisnevich.com/untrusted/levels/17_pointers.jsx 503 (Service Unavailable) jquery.min.js:6
    GET http://alex.nisnevich.com/untrusted/levels/19_documentObjectMadness.jsx net::ERR_CONNECTION_REFUSED jquery.min.js:6
    GET http://alex.nisnevich.com/untrusted/levels/20_bossFight.jsx net::ERR_CONNECTION_REFUSED jquery.min.js:6
    GET http://alex.nisnevich.com/untrusted/levels/21_endOfTheLine.jsx net::ERR_CONNECTION_REFUSED

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#95
post #20
post #12

This is fun. But I have one wish. Overwrite console.log() so it logs onto the website and I don't need to open firebug :) Edit: I think I solved lvl two to four all the same way. Not sure if that's intended. But I also don't want to spoil it for others. Edit 2: This worked again at lvl 6, so I'll assume that's a bug. Click this pastebin for spoilers: http://pastebin.com/yfhDhE7P

Good catch! We haven't been checking yet for tampering with functions, but we probably should. Don't think of it as a bug so much as a cheatcode you discovered :-)

First of all, this is absolutely impressive in concept.

Yes, it's too easy that way:

    map.pO = map.placeObject;
    map.placeObject = function(x, y, w){
        return map.pO(x, y, w=='block'?'empty':w);
    }
Does not even need call. But while you cannot protect from `Function['p'+'rototype']['c'+'all']`, I think using `defineProperty` to stop mucking with the code would go a long way into preventing blatant cheating at little cost. That or enclosed reference funcs.

Btw, you trust the level increment counter before succeeding in loading the level. Right now calls are 503ing, so basically I'm [gisting bogus solutions](https://gist.github.com/anonymous/f1b06d63848d6d013e26) but it's also saving those bogus level ups in localstorage...

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#96
post #91
post #89

Earlier quoted context omitted.

Yes...but I can't do it at an intelligent time.

Do you have any tools available to you that let you execute code at a chosen time?

hah, I tried that multiple times, i get: You are not allowed to use call!

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#97
post #10

This worked for the whole first chapter for me (and has some obvious further applications): startLevel["constructor"]("m", "console.log(m);" + "var old = m.placeObject;\n" + "m.placeObject = function(x,y,t) { \n" + "console.log(t);\n" + "if (t === 'exit' || t === 'computer') {\n" + "console.log('adding' + t);\n" + "return old['ca' + 'll'](m, x,y,t) }};")(map); EDIT: I wonder if you could wrap the user's code in, e.g.…

nice! similarly, var oldPlaceObject = map.placeObject; var newPlaceObject = function(x, y, type) { if (type !== 'block') { map.placeObject = oldPlaceObject; map.placeObject(x, y, type); map.placeObject = newPlaceObject; } }; map.placeObject = newPlaceObject; was my solution to multiple levels ;).

I also had to overwrite the map.verifyXitems (or whatever it was) to return true regardless.

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#98
Hey guys, one of the developers here.

Thank you all so much for all of your feedback! I never thought this game would become so popular.

It seems that our server is more or less overloaded right now, so AJAX requests for new levels are sometimes failing. This appears to be the cause of the bugs that some of you have experienced where levels load incorrectly or are overwritten by previous levels. Sorry about that. :-/ We will work on making the game more robust in the case of failures like this.

If you want to run the game locally, you can clone it from https://github.com/AlexNisnevich/untrusted and follow the instructions there.

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#100
post #37

Earlier quoted context omitted.

I made a wall to circle around the drone. Pretty fun.

I found it easier to make myself invincible. map.getPlayer().killedBy = function() {}; Drone just follows you around like harmless puppy. https://gist.github.com/anonymous/dfb6822e683ea7418ea8

Works for the water as well. :]
Post reply on HN