PDA

View Full Version : Help on simple script



Rriku113
08-26-2007, 12:12 AM
program New;

var
x,y: Integer;

const
brushcolor= 16711680;
begin
if(Findcolor(x,y,brushcolor,0,0,600,600)) then
begin
MovemouseSmoothEx(x,y +random(0),20,40,45,25,20);
Wait(100+random(10));
Clickmouse(x,y,true);
end else
Writeln('Did not find the brush!')
end;

begin
Holdmouse(180,157,true);
Wait(100);
ReleaseMouse(180,273,true);
Writeln('Draw first line')
end.

I always get this error:
Line 16: [Error] (16:4): period ('.') expected in script

All im trying to do is get paint to draw a line with the spraypaint.
Yes im a noob at this scar stuff.

HyperSecret
08-26-2007, 12:57 AM
well first you need to make procedures so that you can call upon them to run in the script when you want.

here this should work for what you want:

program New;

var
x,y: Integer;

const
brushcolor= 16711680;

procedure ClickBrush;
begin
if(Findcolor(x,y,brushcolor,0,0,600,600)) then
begin
MovemouseSmoothEx(x,y,0,20,40,45,25);
Wait(100+random(10));
Clickmouse(x,y,true);
end else
Writeln('Did not find the brush!')
end;

procedure DrawLine;
begin
Holdmouse(180,157,true);
Wait(100);
ReleaseMouse(180,273,true);
Writeln('Draw first line')
end;

begin
ClickBrush;
DrawLine;
end.

also having the random(0) wont do anything b/c there is nothing that it is randomizing so that should work let me know if there is somethin wrong, also you had to many parameters/numbers in the MousemouseSmoothEx function i fixed that for ya

also your standards a pretty far off, read up on that w/ the search button and its ez

Pwnt by Pwnt
08-30-2007, 01:40 AM
O_o first of all, wrong section, should be posted in script help section, and second, it doesnt move mouse, it just click at one spot and stays... =\ you should try SRL in your scripts, because that will help A LOT when u start scripting for RS :) but good try ;)