Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

TBH I just did it because I could.


Random idea: write a brand new game that talks to the Browser Quest server. Use the input of other players moving around as input into your own game (maybe some sort of ambient art thingy).


How'd you do it? I'm trying to do:

localStorage.data = localStorage.data.replace('sword1', goldensword')

But it just reverts after I type that into the console. Could someone explain how it works?


I ran this line

  localStorage.data = JSON.stringify((function (data) { data.player.weapon = 'goldensword'; return data })(JSON.parse(localStorage.data)))
and then reloaded the page, and I had the golden sword.


Ah, I see. I didn't reload the page. I wonder if there is any way to do this without reloading the page...

It be fun to show off if someone figured it out.


The client server protocol only lets you specify arbitrary equipment when you connect. To change equipment during the game, you have to Types.Messages.LOOT a dropped item.


Sorry, I don't understand. Types.Messages.LOOT can be used how exactly?


LOOT is an action in the client server protocol - you can't easily use it. The important part is that you can only equip an item that is available to be picked up, unlike when you first connect. You can specify any weapon and armor when you first connect, which is why editing the local storage works.


I actually did this in Chrome by just opening up the developer console, clicking on the Resources tab, and modifying the value directly. You'll see Local Storage under Databases in that tree on the left.


I did the same thing. You can actually change the weapon to "flask" (so it doesn't show up) and armor to things like "boss", "rick", "nyan", etc. "Rat" is pretty fun too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: