Log in

View Full Version : is there a way....



lilboy543
04-24-2007, 10:37 PM
is there a way to make procedures into commands. example)(i am not going to use correct commands but pretend they are =))

Can i make this into a simple command like clickcolorspiral; but still have it perform the same function.

begin
if (findcolorspiral(x,y,x,y))then
mouse(x,y,1,1,true
end;

rader720
04-24-2007, 10:46 PM
procedure clickcolorspiral;
begin
if findcolorspiral(x,y,color,x1,y1,x2,y2) then
cmouse(x,y,1,1,true);
end;
like tht
?

Ramage
04-24-2007, 10:47 PM
program New;
{.include SRL\SRL.scar}

function ClickColorSpiral(x, y, col, MSA1, MSB1, MSA2, MSB2 : integer) : boolean;
var
a, b : integer;
begin
if(findcolorspiral(a, b, col, MSA1, MSB1, MSA1, MSB2)) then
begin
Mouse(a, b, 1, 1, true)
Result := true;
end else
Result := false;
end;

begin
if(ClickColorSpiral(x, y, 771572, 2, 3, 86, 25)) then
Writeln('Done')
end.
No Scar on this pc... Should work.

Smartzkid
04-24-2007, 10:51 PM
function clickcolorspiral(color, x1, y1, x2, y2 :integer):boolean;
var
xx,yy:integer;
begin
if (findcolorspiral(xx, yy, color, x1, y1, x2, y2))then
begin
mouse(x, y, 1, 1, true);
result := true;
end;
end;

EDIT:

Wow, I really got beaten to this one...

lilboy543
04-25-2007, 12:02 AM
uh.... no not what i meant i think but ty anyway.

wat i ment is you guys know how there is commands like findnormalrandoms;
that find and solve randoms that normally take alot of procedures.
how do i make sumthing like begin
if (findcolorspiral(x,y,x,y))then
mouse(x,y,1,1,true
end;

into a 1 line command so that if i type in clickcolorspiral; it will find the color spiral and click on it.

a better example would be this.

begin begin
if (findcolorspiral(x,y,x,y))then ///to this/// > clickcolorspiral;
mouse(x,y,1,1,true end;
end;

but have both commands work the same.

omgh4x0rz
04-25-2007, 12:09 AM
lol, that is exactly what they gave you. Once you make the procedure like smartz and ramage gave you, you just call the name of it and can use it whenever you want with one line.

I suggest you read some good tutorials about making procedures and functions.

lilboy543
04-25-2007, 12:29 AM
so what they gave me all i have to do is hit run and i can use the command with one word?

Rune Hacker
04-25-2007, 12:57 AM
Go into your scar folder, click on includes, click on srl, click on srl again, click on core, then open up soemthing and those are the procedures you use......What you were given here is exactly what the ones in srl are. SRL is just a bunch of pre-made procedures by soemone else to make it easier for you.

Ramage
04-25-2007, 06:31 AM
so what they gave me all i have to do is hit run and i can use the command with one word?
In a way yes, it uses the same params as FindColorSpiral.

igotgrapes
06-07-2007, 11:19 PM
wrong thread.

alach11
06-07-2007, 11:52 PM
So you make the procedure called "attack" right? And you have it at the beginning of the script. So when you want to do that procedure, instead of retyping it, just say "attack;".