3 Replies - 968 Views - Last Post: 13 February 2017 - 10:31 AM

#1 LeeroyJenkins   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 11-February 17

'Reading' output from a flash game

Posted 11 February 2017 - 09:32 AM

TL DR: How can I get a computer program to 'see' what is on my monitor?

Suppose that I wanted to write an 'A.I' program for a flash game freely available on the web, such as 'pong' (A typical example would be that found on http://www.ponggame.org/ .) The program that I write would need to be able to tell what its opponent is doing, and hence would need to be able to 'see' what is on my computer monitor. Is there any way to do this.

One solution would be to create my 'own' version of the game as part of the program, but I don't want to do this unless it is essential. If there is some way to download the source code for a flash game such as this, and incorporate it into a different program, then this would be a possibility.

I am anticipating that my AI program would be predominatly written in Python, but this need not be the case if another language would be superior.

Thanks in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: 'Reading' output from a flash game

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14434
  • View blog
  • Posts: 57,859
  • Joined: 12-June 08

Re: 'Reading' output from a flash game

Posted 11 February 2017 - 09:35 AM

Three things:

First - Flash wouldn't be my first choice to write this in.
Second - I would check to see if this is considered 'cheating' and against the terms of use for the game.
Third - how was that user name not taken already!?
Was This Post Helpful? 0
  • +
  • -

#3 LeeroyJenkins   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 11-February 17

Re: 'Reading' output from a flash game

Posted 11 February 2017 - 09:39 AM

View Postmodi123_1, on 11 February 2017 - 09:35 AM, said:

Three things:

First - Flash wouldn't be my first choice to write this in.
Second - I would check to see if this is considered 'cheating' and against the terms of use for the game.
Third - how was that user name not taken already!?


Thanks for replying.

First - I'll bear that in mind. The thing is that somebody else has *already* written the flash game, so to be able to write a script for it I need to interact with it.

Second - I would not be playing against a human being here, so there is no possibility of 'cheating' in this case. The project is purely for my own amusement and not to gain a competitive advantage. (I got the idea of doing this from some guy off Youtube who wrote a machine learning algorithm which 'learned' how to play Super Mario World.)

Third - I know!
Was This Post Helpful? 0
  • +
  • -

#4 ArtificialSoldier   User is online

  • D.I.C Lover
  • member icon

Reputation: 2110
  • View blog
  • Posts: 6,453
  • Joined: 15-January 14

Re: 'Reading' output from a flash game

Posted 13 February 2017 - 10:31 AM

Quote

The thing is that somebody else has *already* written the flash game, so to be able to write a script for it I need to interact with it.

You're going to be limited by what the game supports and how it was written, and it's going to be difficult if it doesn't have a published API or code. Browsers allow you to interact with Flash using Javascript, but the Flash movie has to be written to support that.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1