Page 1 of 1
PHP To Simulate a "Click" or a "Keystroke&quo
Posted: Fri Aug 13, 2004 11:09 pm
by ForceGamerDotCom
Okay this one is a doozy.
I need to somehow make PHP simulate a Click on a certain coordinate of the screen, and I also need PHP to simulate a keystroke, such as sending F11 to a system. I need to incorporate PHP into my C++ core program... It is for a bot for a game.
Any help at all would be much appreciated.
Posted: Sat Aug 14, 2004 7:42 am
by m3mn0n
Sounds like a client-side application your developing.
PHP is server-side.
Posted: Sat Aug 14, 2004 1:57 pm
by ForceGamerDotCom
Isn't Javascript server-side? PHP is mainly goigng to be a data holder for the C++ to use. I may just use the PHP to hold coordinates and use C++ to simulate the clicks...
Basically I am trying to make a PHP version of JS SpiderMonkey.
Posted: Sun Aug 15, 2004 1:24 am
by John Cartwright
javascript is client side..
php spits out its parsed data and will do nothing until the page has been refreshed.
Posted: Sun Aug 15, 2004 1:00 pm
by arcanechaos
php doesnt run on the persons machine, it executes before you get the page displayed on your screen. javascript runs on any javascript enabled browser, and executes after the page has been loaded. two different types of usage. sounds like you need php to get the info, javascript to use the info, and c/c++ to do the rest.
Posted: Mon Aug 16, 2004 3:22 am
by LiquidPro
however what you could do is you could use an image map on your coordinate system, that would link to a PHP page that would execute the query to store the click... then refresh the current page.
as for the F11, no clue how you're going to do that... the only thing i could think of would be to use a javascript keyhook to catch the F11 keystroke, then have it execute a certain PHP page and refresh the current page or whatever you want to do.
goodluck, sounds like a tough situation...
Posted: Mon Aug 16, 2004 3:25 am
by feyd
this isn't for a website, people.. it's for an application that scripts another application.. basically.
Posted: Mon Aug 16, 2004 11:11 am
by ForceGamerDotCom
I figured it out -- I have to write a C++ interpreter for PHP, simple as that. My PHP only holds arrays that contain values for coordinates, and names of different things that need to be used. Also like 50 or so defines... As for keystrokes I am not sure how I am going to do that yet.
Posted: Tue Aug 17, 2004 4:17 am
by protokol
Just out of curiosity, if you're using C++, then what do you need PHP for?
Posted: Tue Aug 17, 2004 5:57 am
by d_d
I'm wondering that as well. Since it's a bot for a game I am assuming it's for windows. If so there are plenty of languages other than c/c++ capable of doing a mouseclick and sending a keystroke. Whatever features of php you require must be doable in one of them with less effort than writing an interpreter.
Also if you are going to write an interpreter for php in c++ then you are going to have to implement the functionality of php that you require in c++ to interpret it. Why not just cut out a lot of work and do it all in c++ to start with? Unless some form of scripting is needed.