0

I'm new to programming but I really wish to improve, right now learning Java. Basically there is this game, online strategy it's pretty basic with most of the images are static and very few of them change. I wish to change how I view the game from my end and add some functionality to it as well.

For example the website displays an orange rectangle, I wish to display a red rectangle by drawing over it. Or drawing a button when, if clicked, re-directs me to another part of the game. Originally I am using Selenium Chrome WebDriver to navigate the website but it seems you can't paint or display your own images over it. So I was wondering if I should use Selenium headless in the background performing tasks while I just make a Java Application. Make the WebDriver capture the image every second and display it on the Java Application every second, and than edit that image to my liking? Would this be effective way to do it or is there better options?

Var_Matt1
  • 19
  • 5

1 Answers1

1

It is not clear what you are actually trying to achieve here. And whether your approach is likely to be "effective" depends what you are trying to achieve!

However, I can see some issues:

  • I don't know if it is technically possible to get the Selenium WebDriver to do that ...

  • Capturing images at a high rate could be problematic from a performance perspective.

  • Once you have captured the images:

    • Modifying the images by hand would be tedious and labour intensive. (And probably not what you want to do.)

    • Modifying static images programatically would be possible, but fiddly to implement and incredibly fragile. The slightest change to the game's screen rendering could result in your "tweaks" writing to the wrong place on the image.

    • Making changes to the dynamic part of images would be next to impossible ... except in the destructive sense.

    • You can't affect game play by this approach. Nothing you do to the images will impact on the browser and hence on the server. You can't add functionality this way.

In short, this is a poor idea, and unlikely to achieve anything worthwhile.


Can I think of any good options? No I can't.

The best I can think of would be to:

  • reverse engineer the HTML / Javascript uploaded to your browser,
  • figure out what you want to change in that content, and
  • place an HTTP proxy between your web browser and the server that injects the relevant changes into the content.

However:

  • It will be a lot of tricky and tedious work to implement.
  • It will be fragile; i.e. changes to the game / game server are liable to break your "hacks".
  • It could be a violation of the game owner's copyright and/or the license that grants you the right to use the game. This could result in your game accounts being cancelled, along with the accounts of anyone else who uses your "hacks".

My advice? Just play the game!

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • I don't want to edit the images, I just want to overlay my own image over the image the game provides. I guess I could just use DJ Native Swing for that? – Var_Matt1 Jun 15 '13 at 05:36