Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Gius on Wed 03/12/2008 08:51:56

Title: Click and Mouse
Post by: Gius on Wed 03/12/2008 08:51:56
hi to everybody, 
I desire to have in my game 
a mouse that click with the left key every 5 seconds,
 
I use ags 2.72 and me I have begun this way: 

/ / room script file 
  int OverF; 
  int OverQ; 
  int LioScore;   
  int HioScore; 
  string FScore; 
  string QScore; 
 
function LioGoal () { 
QioScore++;   
StrFormat (QScore, "cycle% d",QioScore);   
SetTextOverlay(OverQ,100,61,300,0,0,QScore);   

function HioGoal () { 
FioScore++;   
StrFormat (FScore, "second:% d",FioScore);   
SetTextOverlay(OverF,100,21,300,0,0,FScore);   


/ / script for Room: Player enters room (after fadein) 
HideMouseCursor (); 
 
FioScore=0; 
QioScore=5;   
OverQ=CreateTextOverlay(100,21,300,0,0, "");   
OverF=CreateTextOverlay(100,21,300,0,0, "seconds: 0"); 


  / / script for Room: Repeatedly execute 
ShowMouseCursor (); 
LioGoal (); 
 
if (QioScore==39){QioScore=0;HioGoal ();} 
if (FioScore==5){FioScore=0;......................................????????} 

 
I don't know whether to end. 
Can you help me kindly? 
thanks
Title: Re: Click and Mouse
Post by: Pumaman on Wed 03/12/2008 20:46:59
What do you mean? You want the player to click every 5 seconds? What happens if they don't?

It's not clear what you are trying to do.
Title: Re: Click and Mouse
Post by: Gius on Thu 04/12/2008 16:09:53
hello Chris,
the file .exe AGS  not work with the click of the mouse with HeadMouse,
I wanted to create a click the left mouse button automatically
every 5 seconds, I use AGS 2.72.

thanks
Title: Re: Click and Mouse
Post by: Khris on Thu 04/12/2008 18:16:38
// global script header
import function on_mouse_click(MouseButton button);

// room script file

int timer;

// inside room's Repeatedly execute 

  timer++;
  if (timer > GetGameSpeed()*5) {  // 5 seconds
    timer=0;
    on_mouse_click(eMouseLeft);
  }
Title: Re: Click and Mouse
Post by: Gius on Thu 04/12/2008 19:06:56
thanks KhrisMUC