Log in

View Full Version : Help!!!



i need to bot!
01-26-2012, 11:06 PM
Just a note: Thanks for all of the help i have received in the past :D

Now, my script is working, but all it does is open the bank, withdraw, then repeat; even though it has instructions to then run to location 1, then location 2, etc... I really can't figure this one out :(

here's the script:
(i know there are many flaws, but I just want the walking to work before i move on)
program MehScript;

{$DEFINE Smart}
{$i srl/srl.simba}
{$i SRL/SRL/misc/paintsmart.scar}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
BoxRewards := ['XP','xp','lamp'];
LampSkill := 'Farming';
Active := True;
LoginPlayer
end;
end;

var
x, y: integer;
aFound: Extended;

function BankColour: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.19, 0.49);

if not (FindColorsTolerance(arP, 4664116, MSX1, MSY1, MSX2, MSY2, 11)) then
begin
Writeln('Failed to find the color, no result(bankcolour).');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

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

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

procedure bankbanker;
begin
makecompass (0);
if findobjcustom(x, y, ['ank'], [BankColour], 2) then
begin
Mouse(x, y, 0, 0, false);
chooseoption ('Bank Banker');
repeat
wait (10+ random (80));
until (bankscreen)
depositall;
if (bankscreen) then
exit;
end;
end;

function Vial: boolean;
var
x, y, Location01, Vial01: Integer;
begin
Result := (false);
Location01 := DTMFromString('m1gAAAHic42JgYEhmYmBIA2J9IA4D4mAgNg FiCyjuh2JpBgh2BWIuKK4E4iQgToWyG4D4OzsrUfgFMwNDCgNh zEgkRgAA6uQU4Q==');
Vial01 := DTMFromString('mfgEAAHicrcxfCkBwDMDx4QYO58GjUkQR4Q Dk34MQuaJj+P5qbx5Zfda2trkismDEhAE9WnTaz7qz4cCFU+td 5ysSBAgRaZ+jRI1GmbpCgQwpYr0z957nk+3PbuePLyLWT97xAE p4E/g=');
begin
if FindDTM(Vial01, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln ('found vial in bank!');
Mouse (x, y, 0, 0, false);
ChooseOption ('ithdraw-50');
Wait(1000+Random(300));
Closebank;
if FindDTMRotated(Location01, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
Mouse (x, y, 0, 0, true);
Writeln ('found fountain(1)!clicking!');
Wait(1000+Random(300));
end;
end;
end;


function WalkToBank: boolean;
var
x, y, Location1: Integer;
begin
Result := (false);
Location1 := DTMFromString('mlwAAAHicY2dgYGhnYmAwg2I7KC4H4iogdg LKBwBxMBCHAHE4EBtC8Uc2JpzYCCiPCzPiwVAAAH0sDJw=');
begin
if FindDTM(Location1, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Writeln ('found bank!clicking!');
Mouse (x, y, 0, 0, true);
freeDTM (Location1);
Wait(1000+Random(300));
MakeCompass('S');
end;
end;
end;



function FountC(var fx, fy: Integer): Boolean;
var
arP: TPointArray;
ararP: T2DPointArray;
tmpCTS, i, arL: Integer;
P: TPoint;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 3.26);

if not(FindColorsTolerance(arP, 15574402, MSX1, MSY1, MSX2, MSY2, 6)) then
begin
Writeln('Failed to find the color, no object found.(fountain)');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

SortTPAFrom(arP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arP, 10, 10);
arL := High(ararP);

for i := 0 to arL do
begin
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Take')) then
begin;
Result := True;
Break;
end;
end;

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

if (i = arL + 1) then
begin
Writeln('FindObject could not find object.(fountain)');
Exit;
end;

GetMousePos(fx, fy);
end;

procedure fountainclick; // click vial -> fountain
begin
if (invcount = 28) then
begin
if findobjcustom (x, y, ['Use Vial -> Fountain'], [FountC(X, Y)], 2) then
begin
Mouse(x, y, 0, 0, true);
wait (20000+random (1000));
end;
end;
end;



function WalkToFount2: boolean;
var
x, y, Location2: Integer;
begin
Result := (false);
Location2 := DTMFromString('mAAEAAHic42FgYLBgYmCwh+IwII4EYmsojg XiKCDOAeLJUKwE1FMAxMVAXA7F7UDcBcQyUKwDxB1A3AfEX38w MHxmZCIav2BmYEhhIB4zkoiRAQBnxxqJ');
begin
if FindDTMRotated(Location2, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
Mouse (x, y, 0, 0, true);
Writeln ('found fountain!clicking!');
Wait(1000+Random(300));
begin
if findobjcustom (x, y, ['Foun'], [FountC(X, Y)], 2) then
begin
Mouse(x, y, 0, 0, true);
wait (20000+random (1000));
end;
end;
end;
end;



begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
repeat
bankbanker;
Vial;
WalkToFount1;
WalkToFount2;
fountainclick;
WalkToBank;
until (invcount > 28);
end.


Could anyone see why it isn't moving onto 'WalktoFount2'

a big thanks :D

edit: in an attempt to begin walk to bank 1, i moved it into the vials procedure xD
edit again:mouse clicking is gonna be mucked up, i just wanna solve this problem first before solving the rest :)

lilcmp1
01-26-2012, 11:32 PM
I don't see a procedure named WalktoFount1 O_o also does it say found fountain clicking?

i need to bot!
01-27-2012, 06:43 AM
anyone :)

Inception
01-27-2012, 06:59 AM
First of all, you need to work on your standards. And WalkToFount1 doesn't exist, as stated above.

Secondly, try this:

function WalkToFount2: boolean;
var
x, y, Location2: Integer;
begin
Result := (false);
Location2 := DTMFromString('mAAEAAHic42FgYLBgYmCwh+IwII4EYmsojg XiKCDOAeLJUKwE1FMAxMVAXA7F7UDcBcQyUKwDxB1A3AfEX38w MHxmZCIav2BmYEhhIB4zkoiRAQBnxxqJ');

if FindDTMRotated(Location2, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse (x, y, 0, 0, true);
Writeln ('found fountain!clicking!');
Wait(1000+Random(300));
end;
if findobjcustom (x, y, ['Foun'], [FountC(X, Y)], 2) then
begin
Mouse(x, y, 0, 0, true);
wait (20000+random (1000));
end;
end;

If "found fountain!clicking!" isn't written, then you need to change your DTM.