When I start the script I have flax in the inventory, flax in first bank slot. The bank slot is never accessed. It is stuck in an infinite loop outputting "banking" in the proggy. I managed to alerter the code to get rid of the infinite loop and it is still very buggy. It waits for over half a minute at the top bank.
program HaxzFlaxer;
{$DEFINE SMART}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/misc/SmartGraphics.Simba}
const
CombatRandoms = False; //True to enable running away from randoms that hits you
//If someone stand in the same position as you gets hit, it will try to run away too
User = '' ; //Username here
Pass = '' ; //Password here
Nick = '' ; //Nickname here
var
x, y, Trips, Banked, BankTrue, fail, FlaxDTM, i, t, mapshift: Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := User; //UserName
Players[0].Pass := Pass; //Password
Players[0].Nick := Nick; //Enter part of your ingame character name,3-4 characters
Players[0].Active := True;
end;
procedure SetupSRL2;
var
t: Integer;
begin
{$IFNDEF SMART}
{$IFDEF SIMBA}
if (not IsTargetValid) then
srl_Warn('SetUpSRL', 'Target client is not valid! ' +
'Drag the crosshairs over the target client.', warn_Terminate);
{$ENDIF}
{$ENDIF}
SetupBoxes; //Sets up box variables in globals.simba
t := GetTimeRunning;
MouseSpeed := 15;
{$IFDEF UseLaptopMouse}LMouse_MissChance := 75;{$ENDIF}
CheckHPFirst := True;
Reincarnate := False;
TalkAfterRandoms := False;
SRL_CombatRandoms := True;
setlength(SRL_FindRandomRunDirection,3);
RoadColor := 0;
WaterColor := 0;
BankColor := 0;
SRL_DisableRandoms := False;
SRL_OnFindRandomCall := nil;
LampSkill := 'mining';
//SetUpSRLReport;
LoadCosineArrays;
SymbolAccuracy:= 0.8;
LoadSRLBitMaps;
LoadSRLFonts;
{$IFNDEF SRL_RANDOMS_TEST}
_SetRandoms();
{$ENDIF}
SetupSRLAutoResponder;
SRL_RandomScreenShot := False;
UseFindMod := True;
LogoutOnMod := True;
UseFindTrade := True;
UseAutoResponder := True;
SRL_DisableIPLog := false;
SRL_SavePath := includePath + 'SRL-OSR/logs/';
SRL_StartTime := theDate(DATE_MONTH)+' at '+theTime;
WarnSensitivity := -2;
SetupAutoColors;
CheckUserNicks;
{$IFDEF LoadExtraFonts}
srl_UpdateFonts(srl_FontsUp2date);
{$ENDIF}
AddOnTerminate('FreeSRL');
SetSupressExceptions(true);
Writeln ('SRL Compiled in '+ IntToStr(GetTimeRunning - t) + ' msec');
{$IFDEF SRL_SMART}
{$IFDEF SIMBAMAJOR980}
if (Smart_Server = 0) then
begin
Smart_Server := RandomWorld(Smart_Members, False);
Smart_Signed := True;
Smart_SuperDetail := False;
end;
Writeln('SMART Initialized.' + #10 + 'Loaded: Server ' + IntToStr(Smart_Server) + ', Members: ' + BoolToStr(Smart_Members)
+ ', Signed: ' + BoolToStr(Smart_Signed) + ', Super Detail: ' + BoolToStr(Smart_SuperDetail) + '.');
SmartSetupEx(Smart_Server, Smart_Members, Smart_Signed, Smart_SuperDetail);
SetTargetArray(SmartImageArray, 765, 553);
{$ELSE}
SetupSmart(Smart_ForceNew);
{$ENDIF}
repeat
SmartSetRefresh(100);
{$IFNDEF SIMBAMAJOR980}
{$IFDEF SMART}
If Smart_FixSpeed then
FixSmartSpeed;
{$ENDIF}
{$ENDIF}
Wait(100);
if (GetTimeRunning - t) > 120000 then
Break;
until(RSReady);
{$ENDIF}
SmartSetRefresh(40);
SetupGauss;
Proc_WorldSwitcherEnabled;
if Length(Players) > 0 then
SetScreenName(Players[CurrentPlayer].Nick);
end;
procedure SetupLogin;
var
HideName: String;
begin
ClearDebug;
DeclarePlayers;
SetupSRL2;
writeln(ToStr(SmartGetRefresh));
LoginPlayer;
repeat
wait(500);
until LoggedIn;
{$IFDEF SMART}
SMART_ClearCanvas;
{$ENDIF}
SetAngle(0);
//MouseSpeed := 100;
MakeCompass(100);
SRL_CombatRandoms := CombatRandoms;
SRL_FindRandomRunDirection := ['150'];
end;
Procedure StartDTM;
begin
FlaxDTM := DTMFromString('mAAEAAHic42FgYOCCYlYglgBifiCWAmJmBggQBWI+IOYEYmEg5gFiIah6mDwbVIwLqp8RiNmhmMGOEyqCHYes38yQeOIMQ/TegwycSXxg/fgAPxrGbTJ2jAwA+WkHww==');
end;
Procedure KillDTM;
begin
FreeDTM(FlaxDTM);
end;
Function SpinScreen: Boolean;
begin
ColorToleranceSpeed(1);
Result := CountColorTolerance(2070783, 155, 29, 360, 50, 50) > 200;
end;
Function AmountScreen: Boolean;
begin
ColorToleranceSpeed(1);
Result := CountColorTolerance(0, 9, 347, 95, 468, 10) < 10;
end;
Function TopFloor: Boolean;
begin
ColorToleranceSpeed(1);
Result := CountColorTolerance(4772330, MMX1, MMY1, MMX2, MMY2, 30) > 1;
end;
Function FoundBlue: Boolean;
begin
ColorToleranceSpeed(1); {262 382 186}
if (CountColorTolerance(14013710, 37, 0, 236, 18, 50) > 100) and (CountColorTolerance(14013710, 37, 0, 236, 18, 50) < 300) then
Result := True;
end;
Function FindGrass: Boolean;
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.49,1.07);
Result := CountColorTolerance(1927519, 493, 312, MSX2, MSY2, 8) > 50;
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
Function FindSpin: Boolean;
var
a, i,t: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
Box : TBox;
begin
MarkTime(t);
repeat
FindNormalRandoms;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(1.02,0.66);
FindColorsTolerance(TPA, 940418, MSX1, MSY1, MSX2, MSY2, 6);
SortTPAFrom(TPA, Point(MMCX, MMCY));
TPAtoATPAExWrap(TPA, 24, 34, ATPA);
SortATPASize(ATPA, true);
if Length(ATPA) < 1 then
begin
writeln('Fail to find spin wheel');
Inc(fail);
if (fail) > 2 then
TerminateScript;
end else
begin
for i := 0 to High(ATPA) do
begin
//SMART_DrawDots(ATPA[i]);
MP := MiddleTPA(ATPA[i]);
Box := IntToBox(MP.x-12, MP.y-17, MP.x+12, MP.y+17);
SMART_DrawBox(box);
MMouse(MP.x, MP.y, 1, 1);
ClickMouse2(mouse_Right);
if WaitOption('pin', 500) then
Result := True
else
writeln('Fail');
Break;
end;
end;
if Result then
Break;
until TimeFromMark(t) > 60000;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
Function FindDoor: Boolean;
var
a, i,t: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
Box : TBox;
begin
MarkTime(t);
fail := 0;
repeat
FindNormalRandoms;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.72,1.91);
FindColorsTolerance(TPA, 2185301, MSX1, MSY1, MSX2, MSY2, 6);
SortTPAFrom(TPA, Point(MMCX, MMCY));
TPAtoATPAExWrap(TPA, 40, 34, ATPA);
SortATPASize(ATPA, true);
if Length(ATPA) < 1 then
begin
writeln('Fail to find spin wheel');
Inc(fail);
if (fail) > 2 then
TerminateScript;
end else
begin
for i := 0 to High(ATPA) do
begin
SMART_DrawDots(ATPA[i]);
MP := MiddleTPA(ATPA[i]);
Box := IntToBox(MP.x-20, MP.y-17, MP.x+20, MP.y+17);
//SMART_DrawBox(box);
MMouse(MP.x, MP.y, 1, 1);
ClickMouse2(mouse_Right);
if WaitOption('pen', 500) then
begin
Result := True;
FFlag(1);
SMART_ClearCanvas;
Break;
end else
begin
writeln('Fail');
SMART_ClearCanvas;
end;
Inc(fail);
if fail > 2 then
Break;
end;
end;
if (Result) or (fail > 3) then
Break;
until (TimeFromMark(t) > 60000);
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
Function FindStairs: Boolean;
var
a, i,t: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
Box : TBox;
begin
MarkTime(t);
repeat
FindNormalRandoms;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10,1.83);
FindColorsTolerance(TPA, 273989, 272, 157, 514, 273, 6);
SortTPAFrom(TPA, Point(MMCX, MMCY));
TPAtoATPAExWrap(TPA, 38, 20, ATPA);
SortATPASize(ATPA, true);
writeln(Length(ATPA));
if Length(ATPA) < 1 then
begin
writeln('Fail to find spin wheel');
Inc(fail);
if (fail) > 2 then
TerminateScript;
end else
begin
for i := 0 to High(ATPA) do
begin
SMART_DrawDots(ATPA[i]);
MP := MiddleTPA(ATPA[i]);
if CountColorTolerance(273989, MP.x-19, MP.y-10, MP.x+19, MP.y+10, 6) > 100 then
begin
writeln(tostr(CountColorTolerance(273989, MP.x-19, MP.y-10, MP.x+19, MP.y+10, 6)));
Box := IntToBox(MP.x-19, MP.y-10, MP.x+19, MP.y+10);
//SMART_DrawBox(box);
MouseSpeed := 150;
MMouse(MP.x-5, MP.y, 0, 0);
MouseSpeed := 15;
ClickMouse2(mouse_Right);
if WaitOption('down', 500) then
begin
Result := True;
Break;
end else
writeln('Fail');
SMART_ClearCanvas;
end;
end;
end;
if Result then
Break;
until TimeFromMark(t) > 60000;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
Function BankBoothFind: Boolean;
var
a, i,t: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
Box : TBox;
begin
MarkTime(t);
repeat
FindNormalRandoms;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.20,0.41);
FindColorsTolerance(TPA, 7702677, MSX1, MSY1, MSX2, MSY2, 7);
SortTPAFrom(TPA, Point(MMCX, MMCY));
TPAtoATPAExWrap(TPA, 30, 30, ATPA);
SortATPASize(ATPA, true);
begin
for i := 0 to High(ATPA) do
begin
SMART_DrawDots(ATPA[i]);
MP := MiddleTPA(ATPA[i]);
//Box := IntToBox(MP.x-15, MP.y-15, MP.x+15, MP.y+15);
//SMART_DrawBox(box);
MouseSpeed := 150;
MoveMouse(mp.x+10, mp.y);
{MMouse(MP.x, MP.y, 0, 0);
MouseSpeed := 15;
ClickMouse2(mouse_Right);}
if WaitUptext('ank', 500) then
begin
ClickMouse2(mouse_Left);
Result := True;
Break;
end else
writeln('Fail');
SMART_ClearCanvas;
end;
end;
if Result then
Break;
until TimeFromMark(t) > 60000;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
Procedure SpinFlax;
var
x, y: Integer;
begin
if FindSpin then
writeln('Found spin wheel');
if WaitFunc(@SpinScreen, 50, 7000) then
begin
writeln('Spin strings');
while not WaitOption('X', 500) do
MouseBox(243, 94, 281, 129, mouse_Right);
if WaitFunc(@AmountScreen, 50, 5000) then
TypeSend('28');
GameTab(tab_Inv);
end else
begin
writeln('Find Door');
FindDoor;
SpinFlax;
end;
end;
Procedure ProcessBank;
var
BankerPos: TPointArray;
MP: TPoint;
begin
writeln('At top floor');
//MouseBox(7, 82, 10, 83, mouse_Left);
BankerPos := GetMiniMapDots('npc');
MP := MiddleTPA(BankerPos);
Mouse(MP.x+10, MP.y, 0, 0, mouse_Left);
BankBoothFind;
if WaitFunc(@BankScreen, 50, 10000) then
begin
writeln('Found bank screen');
for i := 1 to 28 do
begin
if ExistsItem(i) then
begin
InvMouse(i, mouse_Right);
if WaitOption('All', 1000) then
wait(1000);
end;
end;
MouseBankSlot(1, mouse_Right);
WaitOption('All', 500);
end;
end;
Procedure RotateLeft(waittime: Integer);
begin
KeyDown(37);
wait(waittime);
KeyUp(37);
end;
Procedure RotateRight(waittime: Integer);
begin
KeyDown(39);
wait(waittime);
KeyUp(39);
end;
Procedure GoUp;
var
Green: Boolean;
Right, t: Integer;
begin
Right := 0;
MarkTime(t);
while TimeFromMark(t) < 60000 do
begin
{512, 308}
if TimeFromMark(t) > 60000 then
begin
writeln('Fail ladder failsafes');
Logout;
TerminateScript;
end;
Mouse(512, 308, 0, 2, mouse_Right);
if WaitOption('up', 500) then
begin
if WaitFunc(@TopFloor, 50, 8000) then
begin
writeln('Successfully go upstairs');
Exit;
end else
FindDoor;
end else
begin
if Green = false then
begin
RotateLeft(30);
if FindGrass then
Green := True;
end else
begin
RotateRight(30);
Inc(Right);
if Right = 5 then
begin
Green := False;
Right := 0;
end;
end;
end;
end;
{writeln('Going up');
Mouse(505, 335, 0, 3, mouse_Right);
if not WaitOption('up', 500) then
begin
KeyDown(37);
wait(50);
KeyUp(37);
end else
begin
if WaitFunc(@TopFloor, 50, 8000) then
begin
writeln('Successfully go upstairs');
Exit;
end else
FindDoor;
end;
if not FindDoor then
begin
KeyDown(37);
wait(50);
KeyUp(37);
end else
begin
Mouse(505, 335, 0, 3, mouse_Right);
WaitOption('up', 500);
if WaitFunc(@TopFloor, 50, 8000) then
begin
writeln('Failsafe 1, Successfully go upstairs');
Exit;
end;
end;
KeyDown(39);
wait(150);
KeyUp(39);
Mouse(505, 335, 0, 3, mouse_Right);
WaitOption('up', 500);
if WaitFunc(@TopFloor, 50, 8000) then
begin
writeln('Failsafe 2, Successfully go upstairs');
Exit;
end;
KeyDown(39);
wait(50);
KeyUp(39);
Mouse(505, 335, 0, 3, mouse_Right);
WaitOption('up', 500);
if WaitFunc(@TopFloor, 50, 8000) then
begin
writeln('Failsafe 1, Successfully go upstairs');
Exit;
end;
KeyDown(37);
wait(100);
KeyUp(37);
Mouse(505, 335, 0, 3, mouse_Right);
WaitOption('up', 500);
if WaitFunc(@TopFloor, 50, 8000) then
begin
writeln('Failsafe 1, Successfully go upstairs');
Exit;
end;
writeln('Fail all failsafes');
TerminateScript;}
end;
Procedure GoDown;
begin
Mouse(701, 103, 4, 4, mouse_Left);
//MMouse(429, 204, 3, 0);
repeat
wait(10);
until FFlag(15);
FindStairs;
{ClickMouse2(mouse_Left);}
while TopFloor do wait(100);
writeln('Reached second floor');
wait(500);
end;
procedure Proggy;
var
Sec: Integer;
begin
Sec := GetTimeRunning/1000;
Writeln('+++++++++++++++++++++++++++++++++++++++++++++++++++++++');
Writeln(' Haxz Flax Spinner ');
Writeln('+++++++++++++++++++++++++++++++++++++++++++++++++++++++');
Writeln('Trips Done : ' + IntToStr(Trips));
Writeln('Trips / Hour : ' + IntToStr(Round(3600 * Trips / Sec)));
Writeln('Total Bowstrings : ' + IntToStr(Banked));
Writeln('Bowstrings/ Hour : ' + IntToStr(Round(3600 * Banked / Sec)));
Writeln('Time Ran : ' + TimeRunning);
Writeln('-------------------------------------------------------');
end;
begin
SetupLogin;
StartDTM;
AddOnTerminate('KillDTM');
SetRun(true);
if TopFloor then
begin
ProcessBank;
GoDown;
end;
repeat
SpinFlax;
MarkTime(t)
while ExistsItemDTM(FlaxDTM, x, y) do
begin
wait(100);
if FindNormalRandoms then
begin
writeln('Found randoms');
SpinFlax;
end;
if FindNPCChatText('gratu', Nothing) then
begin
writeln('Leveled up');
SpinFlax;
end;
if TimeFromMark(t) > 120000 then
begin
DecEx(Banked, 28);
Dec(Trips);
Break;
end;
end;
writeln('Done');
IncEx(Banked, 28);
Inc(Trips);
GoUp;
ProcessBank;
Proggy;
GoDown;
until false;
end.
It never manages to complete one full inventory on its own. Once it finishes stringing it cannot find the stairs.
Brightness is on full.
I have the latest simba/smart/osrs etc.