Footy
08-12-2012, 03:46 PM
The Exits mean exit the procedure, and that si what its supposed to do for those. What I mean is this script tans leather, then banks. So it banks fine, goes and tans the leather, then when it gets back to the bank, it says ACA couldnt find the color for all my colors. this is what it returns
SRL Compiled in 16 msec
Object DTM Include: Setup complete.
Current player: My Account
AutoColor = 9539216
Time to walk to the tanner!
Time to walk to the bank!
Failed to find the color, no result.
Failed to find the color, no result.
Failed to find the color, no result.
The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3, 4]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap]
Heres the entire script so far.
program AlKharid_Tanner;
{$i srl/srl.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
type TLeatherRecord = record
LeatherDTM, WaitTimeMin, WaitTimeMax:integer;
end;
var
LDTM:TLeatherRecord;
Hides_Tanned, Times_Reset:Integer;
Resetting:boolean;
const
Row = 2; //Row of item to tan in bank.
Column = 2; //Column of item to tan in bank.
Hides_To_Tan = 200; //How many hides are you tanning?
Profit_per_hide = 54; //How much profit do you make per hide tanned? Used in progress report.
procedure DeclarePlayers;
Begin
HowManyPlayers := 3;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Username Here!
Players[0].Pass := ''; //Password Here!
Players[0].Pin := ''; //Pin here!
Players[0].Active := True;
Players[0].Strings[0] := 'hardleather'; //What Are we Tanning? Options(GreenLeather, RedLeather, BlackLeather, BlueLeather, RoyalLeather, HardLeather, SoftLeather) Dont Missspell them!
Players[1].Name := ''; //Username Here!
Players[1].Pass := ''; //Password Here!
Players[1].Pin := ''; //Pin here!
Players[1].Active := False; //Set to true if you are using
Players[1].Strings[0] := 'greenleather';
Players[2].Name := ''; //Username Here!
Players[2].Pass := ''; //Password Here!
Players[2].Pin := ''; //Pin here!
Players[2].Active := False; //Set to true if you are using
Players[2].Strings[0] := 'royalleather';
End; //Copy and paste for more players
Procedure LoadTLeatherRecord;
begin
case lowercase(Players[CurrentPlayer].Strings[0]) of
'greenleather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYEhkZGBIAeJQIA4A4hwgvg TED4D4JBBfAOKLQMxpywVUzYSCQSLogBELBgMADIgGaQ==');
LDTM.WaitTimeMin := 1000;
LDTM.WaitTimeMax := 1400;
end;
'blueleather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYChkZGBIB+JUIK4A4mogvg LEJ4D4FhDfg7K5eTyBqplQMBcDJmDEgsEAADGZBtM=');
LDTM.WaitTimeMin := 1200;
LDTM.WaitTimeMax := 1800;
end;
'redleather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYNjAyMCwGIiXA/EeIF4HxJeA+CwQ3wXiy0B8BIhteTmBqplQMBcDJmDEgsEAAKFa B/E=');
LDTM.WaitTimeMin := 2000;
LDTM.WaitTimeMax := 3000;
end;
'blackleather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYNBiZGBQAmJTIJYHYjMgvg jE94D4FBCfAOLLIDlZWaBqJhTMxYAJGLFgMAAAqwgFag==');
LDTM.WaitTimeMin := 2500;
LDTM.WaitTimeMax := 3500;
end;
'softleather': begin
LDTM.LeatherDTM := DTMFromString('mggAAAHicY2NgYIgH4mwgTgXiICAOBeIMIL 7IyMBwDYiPAfE5IL4DxbYWnEBZJgzMyoAdMOLAEAAA+wgH0Q== ');
LDTM.WaitTimeMin := 0;
LDTM.WaitTimeMax := 0;
end;
'hardleather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYLgDxE+B+DkQXwbiSyDMyM BwHIhvAfEdID4NxDoaskAZJhTMxYAJGLFgMAAAAcAI+g==');
LDTM.WaitTimeMin := 0;
LDTM.WaitTimeMax := 0;
end;
'royalleather': begin
LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYFjOyMAwA4jXAfEWIJ4DxJ eA+BoQ3wPiU1DsIB0OVM2EgrkYMAEjFgwGAKx3CDA=');
LDTM.WaitTimeMin := 3000;
LDTM.WaitTimeMax := 4000;
end;
end;
end;
Procedure EnergyChecker;
var
x, y:integer;
begin
if not(loggedin) then
exit;
if findcolortolerance(x, y, 6740716, 406, 91, 742, 123, 10) then
Exit;
RestUntil(85);
Setrun(true);
end;
function BankGroundColor: Integer; //CREDITZ TO ACA
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.62);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 5601960, MMX1, MMY1, MMX2, MMY2, 7);
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[i], X, Y, Z);
if (X >= 17.77) and (X <= 31.27) and (Y >= 16.80) and (Y <= 29.35) and (Z >= 9.49) and (Z <= 16.60) then
begin
Result := arC[i];
// Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Procedure WalkOfShame;
var
LodeTeleDTM, LodescreenDTM, Counter, x, y:integer;
begin
LodeTeleDTM := DTMFromString('mlwAAAHicY2dgYLBjYmBwBmJHIDYFYisgNg diGyAWZmRgEABieSAWBWJ+IJYBYgkgLoubwdA25wYG3nfkE4MI A27AiAdDAQBVqBA4');
LodeScreenDTM := DTMFromString('mrAAAAHic42BgYOBgZGDwBuKnQDYrkN4MpH WB9DsGCDsAiEOAOByII6EYxI4C4kAgFpNTYnj9YA9OLAJUw4wH MxLAMAAAtbUYsg==');
wait(randomrange(400, 2000));
Gametab(tab_magic);
Marktime(counter);
repeat
wait(randomrange(25, 200));
if timefrommark(counter) > 8000 then
begin
writeln('We couldnt find the hometele button! Logging out!');
Logout;
Exit;
end;
until(findDTM(LodeTeleDTM, x, y, MIX1, MIY1, MIX2, MIY2));
Mouse(x, y, 3, 3, 1);
Marktime(counter);
repeat
wait(randomrange(25, 200));
if timefrommark(counter) > 10000 then
begin
writeln('We couldnt open the Lodestone screen! Logging out!');
Logout;
Exit;
end;
until(FindDTM(LodeScreenDTM, x, y, MSX1, MSY1, MSX2, MSY2));
Marktime(counter);
LodestoneTeleport('Al Kharid');
wait(randomrange(16000, 20000));
RadialWalkTolerance(6654870, 345, 356, 75, 2, 2, 20);
repeat
wait(randomrange(50, 250));
until not(ismoving);
RadialWalkTolerance(BankGroundColor, 300, 325, 75, 2, 2, 15);
repeat
wait(randomrange(100, 500));
until not(ismoving);
Resetting := True;
inc(Times_reset);
end;
Procedure BankFailSafe;
var
cx, cy:integer;
begin
if not(loggedin) then
exit;
if ObjDTM_find('87:80:4:7:7:94:44:7:7:81:40:7:7:88:11 7:7:7:49:103:4:65:63:119:62:120:97:62:94', cx, cy, true) then
exit else
WalkOfShame;
end;
function BankColor1: Integer; //Credit to ACA
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.19, 0.77);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 8820910, MSX1, MSY1, MSX2, MSY2, 7);
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[i], X, Y, Z);
if (X >= 25.94) and (X <= 40.31) and (Y >= 25.83) and (Y <= 40.15) and (Z >= 21.37) and (Z <= 33.65) then
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function BankColor2: Integer; //Credit to ACA
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(1.24, 0.05);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 8486529, MSX1, MSY1, MSX2, MSY2, 9);
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[i], X, Y, Z);
if (X >= 13.63) and (X <= 28.96) and (Y >= 14.21) and (Y <= 30.01) and (Z >= 15.91) and (Z <= 33.55) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Function OpenBankCustom:boolean;
var
counter, BankFails, x, y:integer;
begin
if resetting = true then
begin
Writeln('We are now back on course, Lets roll');
Resetting := false;
end;
if not(loggedin) then
exit;
if bankfails >= 3 then
begin
writeln('We failed 3 times trying to open the bank! Closing script and logging out!');
Logout;
Exit;
end;
if FindObjTPAMulti(x, y, [BankColor1, BankColor2], 5, 2, 15, 15, 75, ['Bank Bank', 'ank B', 'Bank B', 'k Ban', 'nk Ba']) then
begin
Mouse(x, y, 7, 3, mouse_right);
WaitOption('Bank Bank', 1000);
Marktime(Counter);
repeat
wait(randomrange(50, 200));
if TimeFromMark(Counter) > 7000 then
begin
writeln('The bank never opened! Lets try again');
inc(BankFails);
Exit;
end;
until(BankScreen or PinScreen);
end else
begin
writeln('We couldnt find the bank! Lets try again!');
inc(BankFails);
Exit;
end;
if (bankscreen or pinscreen) then
Result := True else
Result := False;
end;
Procedure SetupStuff;
begin
SetupSRL;
ObjDTM_Setup;
DeclarePlayers;
LoadTLeatherRecord;
Loginplayer;
wait(randomrange(100, 200));
Makecompass('W');
end;
Procedure WalkToBank;
begin
if resetting = true then
exit;
if not(loggedin) then
exit;
EnergyChecker;
writeln('Time to walk to the bank!');
RadialWalkTolerance(6523286, 265, 275, 75, 2, 2, 20);
repeat
wait(randomrange(25, 150));
until(not(ismoving));
RadialWalkTolerance(BankGroundColor, 295, 315, 65, 2, 2, 20);
repeat
wait(randomrange(25, 150));
until(not(ismoving));
EnergyChecker
BankFailsafe;
end;
Procedure WithDrawStuff;
begin
if resetting = true then
exit;
if not(loggedin) then
exit;
Wait(randomrange(50, 250));
Withdraw(column - 1, row - 1, 28);
wait(randomrange(100, 300));
end;
Procedure Bankprocedure;
var
counter:integer;
begin
if resetting = true then
exit;
if not(loggedin) then
exit;
Marktime(Counter);
while not(Bankscreen or Pinscreen) do
wait(randomrange(100, 400));
if timefrommark(counter) > 10000 then
begin
Writeln('We couldnt open the bank! Logging out!');
Logout;
Exit;
end;
repeat
If (PinScreen) Then (InPin(Players[0].Pin));
until (BankScreen);
DepositAll;
WithDrawStuff;
closebank;
wait(randomrange(100, 300));
Hides_Tanned := Hides_Tanned + 28;
end;
Procedure Antiban;
begin
if not(loggedin) then
exit;
case random(200) of
1: begin writeln('Antiban: Wait'); wait(randomrange(10000, 30000)); end;
2..5: begin writeln('Antiban: Checking skills'); Gametab(tab_stats) wait(randomrange(10000, 20000)); gametab(tab_Inv); wait(randomrange(100, 200)); end;
6..8: begin writeln('Antiban: Checking crafting XP'); Gametab(tab_stats) wait(randomrange(200, 600)); HoverSkill('Crafting', false); wait(randomrange(2000, 10000)); Gametab(tab_Inv); wait(randomrange(200, 450)); end;
9..12: begin writeln('Antiban: Sleepandmovemouse'); sleepandmovemouse(randomrange(1000, 10000)); end;
14..15: begin writeln('Antiban: Checking whos online'); Gametab(tab_Friends); wait(randomrange(2000, 3000)); Gametab(tab_Inv); wait(randomrange(100, 200)); end;
end;
end;
Procedure Proggy;
begin
if not(loggedin) then
exit;
Writeln('***************************************** **********');
Writeln('Time running = ' + (TimeRunning));
Writeln('We have Tanned ' + IntToStr(Hides_Tanned) + ' Hides so far!!');
Writeln('We have Earned ' + IntToStr(Profit_per_hide * Hides_Tanned) + ' GP so far!');
Writeln('We are Tanning ' + IntToStr(round(3600000 * 1.0 / GetTimeRunning * Hides_Tanned)) + ' Hides Per hour!');
Writeln('We are Earning ' + IntToStr(round(3600000 * 1.0 / GetTimeRunning * Profit_per_hide)) + ' Gp Per hour!');
Writeln('Thanks for using Footys Generic Tanner! Please leave feedback on the script thread!');
Writeln('***************************************** **********');
end;
Procedure WalkToTanner;
begin
if not(loggedin) then
exit;
if resetting = true then
exit;
writeln('Time to walk to the tanner!');
wait(randomrange(200, 600));
RadialWalkTolerance(6917275, 120, 134, 72, 2, 2, 20);
repeat
wait(randomrange(25, 150));
until(not(ismoving));
RadialwalkTolerance(49107, 40, 100, 75, 2, 2, 30);
repeat
wait(randomrange(25, 150))
until(not(ismoving));
EnergyChecker;
end;
function TannerCapeColor: Integer; //Creditz to ACA
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.09, 2.47);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 15324904, MSX1, MSY1, MSX2, MSY2, 9);
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[i], X, Y, Z);
if (X >= 57.29) and (X <= 87.20) and (Y >= 58.19) and (Y <= 88.80) and (Z >= 67.85) and (Z <= 102.98) then
begin
Result := arC[i];
// Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function TannerShirtColor: Integer;
var //CREDITS TO ACA
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.14);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 3363187, MSX1, MSY1, MSX2, MSY2, 3);
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
ColorToRGB(arC[i], R, G, B);
if (R >= 104) and (R <= 126) and (G >= 73) and (G <= 89) and (B >= 46) and (B <= 56) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 8.77) and (X <= 12.66) and (Y >= 8.09) and (Y <= 11.64) and (Z >= 3.77) and (Z <= 5.21) then
begin
Result := arC[i];
// Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Function ClickTanner:boolean;
var
TanScreenDTM, counter, x, y:Integer;
begin
TanScreenDTM := DTMFromString('mggAAAHicY2NgYHjLyMBwE0j3A7EjEOsDcS wQPwGKLwXiqUC8EIinAPFkIC61EWb4//8/BuYC6mHFghlxYAgAAPN8FvQ=');
if not(loggedin) then
exit;
wait(randomrange(500, 1000));
if findobjTPAMulti(x, y, [TannerCapeColor, TannerShirtColor], 5, 2, 10, 10, 20, ['llis', 'Ellis']) then
begin
wait(randomrange(100, 300));
Mouse(x, y, 2, 2, mouse_right);
waitoption('ides', 1000);
end else
begin
Mouse(257, 152, 4, 4, mouse_right);
WaitOptionmulti(['hides', 'ide', 'an hi'], 1000);
end;
Marktime(counter);
repeat
wait(randomrange(50, 150));
if TimeFromMark(counter) > 8000 then
begin
writeln('Tanning screen not opening up! Logging out!');
Logout;
Exit;
end;
until(FindDTM(TanScreenDTM, x, y, MCX1, MCY1, MCX2, MCY2));
Result := True;
FreeDTM(TanScreenDTM);
wait(randomrange(1000, 2000));
end;
Procedure TanHides;
var
Counter, x, y:integer;
begin
if resetting = true then
exit;
if not(loggedin) then
exit;
if FindDTM(LDTM.LeatherDTM, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
Mouse(x, y, 5, 5, mouse_left);
exit;
end else
begin
MMouse(501, 427, 2, 10)
wait(randomrange(LDTM.WaitTimeMin, LDTM.WaitTimeMax));
Mousebox(5, 341, 505, 426, 3);
Marktime(counter);
repeat
wait(randomrange(50, 200));
if TimefromMark(counter) > 10000 then
begin
writeln('We couldnt find the LeatherDTM! Logging out!');
Logout;
exit;
end;
until(findDTM(LDTM.LeatherDTM, x, y, MCX1, MCY1, MCX2, MCY2));
mouse(x, y, 5, 5, mouse_left);
exit;
end;
Writeln('Strings[0] String " ' + (Players[0].Strings[0]) + ' " Is unknown. Please enter an option from the list. Logging out!');
Logout;
Exit;
end;
Procedure ReleaseDTMs;
begin
FreeDTM(LDTM.LeatherDTM);
end;
begin
repeat
SetupStuff;
repeat
repeat
OpenBankCustom;
until(BankScreen or pinscreen);
Bankprocedure;
WalkToTanner;
if ClickTanner then
TanHides;
WalkToBank;
Proggy;
until((Hides_Tanned >= Hides_To_Tan) or not(loggedin) or (times_reset > 2));
ReleaseDTMs;
Nextplayer(false);
until(allplayersinactive);
end.
Footy
08-12-2012, 11:28 PM
Anyway as per the PM:
Function OpenBankCustom: Boolean;
var
B: TBox;
Location: TPoint;
CTS, I, L: Integer;
ATPA: T2DPointArray;
TPA, TPA2: TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 2.40);
FindColorsTolerance(TPA, 8434655, MSX1, MSY1, MSX2, MSY2, 15);
If (Length(TPA) < 1) then Exit;
SortTPAFrom(TPA, Point(MSCX, MSCY));
ATPA:= TPAToATPAEx(TPA, 31, 190);
L := Length(ATPA);
If (L < 1) then Exit;
SetColorSpeed2Modifiers(0.11, 0.20);
SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
For I := 0 To L Do
begin
B := GetTPABounds(ATPA[I]);
with B do
begin
If (FindColorsTolerance(TPA2, 4937053, MSX1, MSY1, MSX2, MSY2, 20)) then
begin
Location := MiddleTPA(TPA2);
MMouse(Location.X, Location.Y, 0, 0);
If (WaitUptextMulti(['ank', 'Bank', 'ooth', 'booth', 'ank boo'], 600)) then
begin
ClickMouse2(MOUSE_LEFT);
Result := True;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
end;
end;
end;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
Thank you soooo much brandon! Rep+! Do you mind if I use this in my script when it goes public, with credit, of course?
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.