SRL Archive - OSR Help

Random Clicking


Raskolnikov

2010-03-31 04:28:12

I have a script here that is supposed to cut and drop yews. However, I am having a problem where the program will click one yew, then it will start clicking the inventory tab. I'm not sure what is going on. I have everything up to date. Also, IsUpText doesn't seem to be working for me.

program New;
{.include SRL/SRL.scar}
const
German = False;
var
MoreColors: TIntegerArray;

procedure DeclarePlayers;
begin
CurrentPlayer := 0;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);

Players[0].Name := ''; //username
Players[0].Pass := ''; //Password
Players[0].Nick := ''; //3-4 letters of user name
Players[0].Active := True; //Player active
end;

procedure SetupColors;
begin
MoreColors := [3239009, 2384725, 467995, 1258284, 5212029, 2583904];
SetupSRL;
ActivateClient;
DeclarePlayers;
Wait(1000+random(200));
if not LoggedIn then LoginPlayer;
end;

function MMouseIsText(x, y, ranx, rany: integer; UpText:string): boolean;
begin
if not LoggedIn then Exit;
MMouse(x, y, ranx, rany);
Wait(50+random(11));
if German then
Result := IsUpText('au')
else
Result := IsUpTextMultiCustom(['ew', 'Ye', 'Yew']);
end;

function ReturnYew: TPoint;
var
MorePoints: TPointArray;
ATPA: T2DPointArray;
t, m, w, cu, time: integer;
APoint: TPoint;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(2);
MarkTime(time);
m := High(MoreColors);
for t:=0 to m do
begin
if FindColorsSpiralTolerance(MSCX, MSCY, MorePoints, MoreColors[t], MSX1, MSY1, MSX2, MSY2, 15) then
Break;
end;
ATPA := SplitTPA(MorePoints, 15);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
cu := High(ATPA);
for w:=0 to cu do
begin
Result := MiddleTPA(ATPA[0]);
Writeln('Time: '+ IntToStr(TimeFromMark(time)));
Writeln('Done');
ColorToleranceSpeed(1);
Exit;
end;
end;

procedure Cut;
var ThePoint: TPoint;
begin
repeat
if not LoggedIn then Exit;
MakeCompass('N');
ThePoint := ReturnYew;
Mouse(ThePoint.x, ThePoint.y, 6, 6, true);
Wait(4000+random(900));
until(InvFull);
end;

procedure Drop;
begin
DropAllExcept([1]);
end;

procedure MainLoop;
begin
Cut;
Drop;
end;

begin
SetupColors;
MainLoop;
end.

Thanks

YoHoJo

2010-03-31 05:28:01

Well, SRL shouldn't click a gametab if its already on that gametab
(If inventory tab is already clicked, it shouldn't be clicking it any more)

Make sure your SRL is SVNed to :
http://www.villavu.com/repositories/srl-opendev

Also, uptext is broken in older versions of scar
It is only working in the pre-release version so SVN your SCAR folder to:
http://freddy1990.com/svn/scarprerelease

Blumblebee

2010-03-31 12:10:05

it happens when your gametab.scar isn't up to date, it doesn't think it's in the proper tab. (atleast that's what happened to me when I wasn't up to date) So you need SRL-open Dev (like Yohojo provided).

Coh3n

2010-03-31 23:41:19

For Uptext, try a longer wait than 50ms. I *think* that should be enough, but try something like 200 + Random(100).