SRL Archive - General Botting Help

I can't figure out what i'm doing wrong.


Denaa

2014-03-26 21:13:46

Basically I'm trying to do nothing more than have the bot do the following things: Recognize 3 colors

thats literally all it needs to do, click 3 colors. it should be so simple, right? BUT…this is my first day of ever actually coding anything (or trying to) and I can't seem to get it to work. also I dont know how to make it right click and recognize the names of objects or anything "advanced" (in my mind), anyway I just want to know what i've done wrong xd it only has 3 jobs

Program Autocolor;


{$i srl-6/srl.simba}

begin
clearDebug();
setupSRL();
end.



function AutoColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.25, 0.17);

FindColorsSpiralTolerance(MMCX, MMCY, arP, 5989745, MMX1, MMY1, MMX2, MMY2, 16);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC, X, Y, Z);

if (X >= 5.06) and (X <= 26.27) and (Y >= 5.33) and (Y <= 26.35) and (Z >= 4.23) and (Z <= 25.54) then
begin
Result := arC;
Writeln('AutoColor = ' + IntToStr(arC));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

begin
SetupSRL;
AutoColor;
end.

Denaa

2014-03-26 21:14:59

Also I want this script to repeat itsself indefinatly, I'm not sure if it'll do that automatically or if I have to do something specific…I have yet to see it actually do anything :(

Denaa

2014-03-26 23:15:04

Program ChopTree;


{$i srl-6/srl.simba}


begin
clearDebug();
setupSRL();
end.

Procedure ClickTree;
var
X,Y:Integer;
begin;
FindColorTolerance; (X, Y, 8817305, 539, 364, 153, 138, 5) Then

Begin
mouse(x, y,1,1); // moves the mouse to were the colot is found
wait(250); // waits one fourth of a second
ClickMouse(X, Y, mouse_Left)// clicks
End;
End;
begin
MouseSpeed :=15;
SetupSRL;
end.


it just says "waiting 5 minutes for rs to load :\"

Foundry

2014-03-27 00:22:42

I'm going to assume this is for RS3 since you include SRL6. You should check out The Mayors tutorial in the link below.

http://villavu.com/forum/showthread.php?t=107757