Jump to content
Activist

While Loop - Compiler Error

Recommended Posts

Hey guys!

So I'm currently writing a script, I've hit a problem and Google doesn't seem to be helping.

 

program New;

var eTimeRemainingMinutes: integer;
var eTimeRemainingSeconds: integer;
var aTimeRemainingMinutes: integer;
var aTimeRemainingSeconds: integer;
var capTimeRemaining: integer;
var eTimeRemaining: integer;
var aTimeRemaining: integer;
var capTimeUsed: integer;
var eCompleted: integer;
var aTimeWaited: integer;

begin
eTimeRemainingMinutes := 1; //CUSTOM
eTimeRemainingSeconds := 2; //CUSTOM

aTimeRemainingMinutes  := 3; //CUSTOM
aTimeRemainingSeconds  := 4; //CUSTOM

capTimeRemaining     := 45; //CUSTOM


eTimeRemaining := (eTimeRemainingMinutes*60 + eTimeRemainingSeconds) * 1000;
aTimeRemaining := (aTimeRemainingMinutes*60 + aTimeRemainingSeconds) * 1000;
capTimeRemaining := (capTimeRemaining*60) * 1000;
capTimeUsed := 0;


//INSERT command to open application

//INSERT clickmouse(-88,140) // Goto main area

 while (capTimeRemaining <= capTimeUsed) do [b]//HERE IS THE ERROR LINE[/b]
 begin
   wait(eTimeRemaining+random(3000));
   capTimeUsed := capTimeUsed + eTimeRemaining;
   earnsCompleted := 0;
   aTimeWaited := eTimeRemaining;

   while not aTimeRemaining <= aTimeWaited do
   begin  
     //INSERT clickmouse(-887,278); //Shortcut to e
     wait(random(3000));
     //INSERT clickmouse(-887,278); //Commence e
     earnsCompleted := earnsCompleted + 1;
     wait(2*60*1000);
     capTimeUsed := capTimeUsed + 120;
     aTimeWaited := eCompleted*180 + eTimeRemaining - 60;
     wait(60*1000+random(3000));
     capTimeUsed := capTimeUsed + 63;
     aTimeWaited := eCompleted*180 + eTimeRemaining;  
   end;

   //INSERT mouseclick(-364, 345); //Choose a
   //INSERT mouseclick(-272, 378); //Commence a

   aTimeRemaining := 20*60;
   eTimeRemaining := 60; 
 end;  

//FUNCTION Play a sound to notify the user that the cap time is complete
end.

 

Whenever I try run it, it comes up with "Compiler Error" & "Invalid number of parameters" on the line with the first while loop and I can't figure out why.

 

This is my first time writing a SCAR script from scratch and I've following the tutorial guidelines as best as I can. :/

Please ignore the "//INSERT mouseclick" selfnote etc, I am intending to change that to proper code which instructs mouseclicking later.

 

Thanks in advance!

Link to comment
Share on other sites

Wow, thanks for such commitment in helping, testing it out in all those versions. I current am running 3.38 though.

Oddest thing in the world! I just copied that code, did the same as you regarding the variable & suddenly it works on a fresh page. O_o

 

Thank you for your help! :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...