Jump to content
zaider

Random - IntToStr

Recommended Posts

First of all I want to underline that I am not a pro scripter, so don't blame me for not knowing! :)

 

I have written this script, but I don't seem to get it to work like I want.

 

Procedure check;

var

x,y:integer;

begin

if FindColor(x,y,3038369,1,1,405,371) then

begin

ClickMouse(x,y, true);

end;

 

begin

repeat

ClickMouse(10,10,true)

check;

SendKeys('/goto' +IntToStr(Random(10)));

Wait(5000);

until(False);

end.

 

Basically I want the script to click on a color when it pops up and other than that I want it to type /goto 1-10 (random) every 5000 ms, but where should I add +chr(13)? I have tried like everywhere in the SendKeys line but it gives me error all the time. Also as the script looks now, it says "Identifier expected" at line 17.

 

---------- Post added at 06:35 PM ---------- Previous post was at 06:02 PM ----------

 

Fixed.

 

program New;

 

 

Procedure check;

var

x,y:integer;

begin

if FindColor(x,y,3038369,1,1,405,371) then

begin

ClickMouse(x,y, true);

end;

 

end;

 

begin

repeat

check;

ClickMouse(10,10,true)

Wait(8000+random(1000));

check;

SendKeys('/goto ' +IntToStr(Random(101)));

SendKeys(#13)

check;

Wait(5000+random(1000));

until(False);

end.

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...