Click and Mouse

Started by Gius, Wed 03/12/2008 08:51:56

Previous topic - Next topic

Gius

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

Pumaman

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.

Gius

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

Khris

Code: ags
// 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);
  }

Gius


SMF spam blocked by CleanTalk