Naike
2010-10-04 17:47:13
- Picks Flax
- Banks
- Multiplayer
Written to be based on SRL/Reflection functions, so it'll will hardly ever break.
program SimpleFlaxPicker;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
{$i srl\srl\misc\debug.scar}
const
{---SMART Setup Constants---}
WORLD = 32;
MEMBERS = false;
SIGNED = true;
{---------------------------}
procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
end;
var
AtField: Boolean;
Procedure AntiBan;
var
a: Boolean;
begin
If Not LoggedIn then
Exit;
a := True;
Case Random(400)of
0..5: SleepAndMoveMouse(1000+Random(4000));
12: GameTab(RandomRange(tab_Combat, tab_Notes));
13..16: GameTab(tab_Inv);
51..70: SetRun(True);
else a := False;
end;
If a then
DebugLn('Antiban..');
end;
Function GlobalWalk: Boolean;
var
TileArr: TTileArray;
begin
If AtField then
TileArr := [Point(2732, 3452),
Point(2727, 3462),
Point(2728, 3475),
Point(2725, 3490)]
else
begin
TileArr := [Point(2727, 3480),
Point(2728, 3465),
Point(2730, 3450),
Point(0, 0)];
Case Random(2) of
0: TileArr[3] := Point(2738, 3440);
1: TileArr[3] := Point(2741, 3447);
end;
end;
Result := WalkPath(TileArr);
If Result then
AtField := Not AtField;
end;
Procedure Walk;
begin
If Not GlobalWalk then
If Not FindNormalRandoms then
Logout
else
GlobalWalk;
end;
Function FindFlax: Boolean;
var
TPA, tTPA, MPoints: TPointArray;
ATPA: T2DPointArray;
Cords: TPoint;
I: Integer;
begin
If Not LoggedIn Then
Exit;
If IsUpText('ick')then
begin
Result := True;
Exit;
end;
Wait(900+Random(700));
FindColorsTolerance(tTPA, 15788650, MSX1, MSY1, MSX2, MSY2, 30);
FindColorsTolerance(TPA, 15788650, MSX1, MSY1, MSX2, MSY2, 15);
TPA := CombineTPA(tPA, TPA);
ATPA := SplitTPA(TPA, 20);
SetArrayLength(MPoints, GetArrayLength(ATPA));
For I:=0 to High(ATPA)do
MPoints[I] := MiddleTPA(ATPA[I]);
SortTPAFrom(MPoints, Point(MSCX, MSCY));
For I:=0 to High(MPoints)do
begin
MMouse(MPoints[I].X, MPoints[I].Y, 5, 5);
Result := Wai2tUpText('Pick Flax', 150+Random(50));
If Result then
Break;
end;
end;
Procedure PickFlax;
var
X, Y, iTime: Integer;
begin
If(Not LoggedIn)or(InvFull)then
Exit;
iTime := GetSystemTime;
Repeat
If FindFlax then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, True);
end else
FindNormalRandoms;
AntiBan;
FindNormalRandoms;
Wait(100+Random(700));
Until(InvFull)or(TimeFromMark(iTime) > 1000*60*10)or(Not LoggedIn);
end;
Procedure Bank;
begin
If Not LoggedIn then
Exit;
If not R_OpenBankBooth('seers')then
If FindNormalRandoms then
Bank
else
Logout;
FindNormalRandoms;
DepositAll;
Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[0] + 28;
Case Random(4) of
0: CloseBank;
end;
FindNormalRandoms;
end;
Procedure NewPlayer;
var
Arr: TIntegerArray;
I: Integer;
begin
SetAngle(True);
GameTab(tab_Inv);
end;
Procedure ProgressReport;
var
I: Integer;
begin
ClearDebug;
For I:=0 to HowManyPlayers-1 do
Writeln('#' + ToStr(I) + ' - ' + Players[I].Nick + ' - Active: ' + ToStr(Players[I].Active) + ' - Flax picked: ' + ToStr(Players[I].Integers[0]));
end;
var
T: TPoint;
begin
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;
SetupSRL;
DeclarePlayers;
If Not LoggedIn then
LoginPlayer;
NewPlayer;
Repeat
If Not LoggedIn then
begin
NextPlayer(False);
NewPlayer;
end;
ProgressReport;
Walk;
PickFlax;
Walk;
Bank;
Until(AllPlayersInactive);
end.written in an hour/two, bugs may occur.
Bigger releases will be found in the members section in the future.