SRL Archive - Help

DTM help xD


i need to bot!

2012-01-19 18:31:26

Hi again :)

Thanks for the great responses on my other threads- i may not post, but I definitely read through all the responses :D

Now, I was wondering what is wrong with this bit of code here:

function WithdrawPieShell: boolean;
var
x, y, PieShell: Integer;
begin
Result := (false);
Result := (FindDTM(PieShell,x, y, MIX1, MIY1, MIX2, MIY2));
begin
PieShell := DTMFromString('78DA637CC4C0C0B0900105CC297505D38C503' +
'EE34B4C350C0C4C986A66125003B26B150135D781C44AFC6A00FD' +
'0F0904');
begin
if (invcount > 0) then
depositall;
if (invcount = 0) then
begin
if FindDTM(PieShell,x, y, MIX1, MIY1, MIX2, MIY2) then
begin
repeat
Mouse (x, y, 0, 0, False);
ChooseOption ('ithdraw-7');
until (invcount = 7);
if (invcount = 7) then
end;
if result = (false) then
Writeln ('failed to find pie shell dtm :(');
end;
freeDTM(PieShell);
end;
end;
end;

If you notice 'Writeln ('failed to find pie shell dtm :(');' well, my whole debug box is filled with that :( I am trying to remove 7 pie shells from the bank, and i can't find anything wrong with it :'(
Edit: I made the DTM today! And they don't change :O it can't be wrong; maybe the 'MIX1, MIY1, MIX2, MIY2' is searching in the wrong place- i really don't know

Thanks for any help XD

PatDuffy

2012-01-19 18:36:41

You have to call the DTM from string stuff before you search for it.

Heavenzeyez1

2012-01-19 18:38:13

From: i need to bot!
Hi again :)

Thanks for the great responses on my other threads- i may not post, but I definitely read through all the responses :D

Now, I was wondering what is wrong with this bit of code here:

function WithdrawPieShell: boolean;
var
x, y, PieShell: Integer;
begin
Result := (false);
Result := (FindDTM(PieShell,x, y, MIX1, MIY1, MIX2, MIY2));
begin
PieShell := DTMFromString('78DA637CC4C0C0B0900105CC297505D38C503' +
'EE34B4C350C0C4C986A66125003B26B150135D781C44AFC6A00FD' +
'0F0904');
begin
if (invcount > 0) then
depositall;
if (invcount = 0) then
begin
if FindDTM(PieShell,x, y, MIX1, MIY1, MIX2, MIY2) then
begin
repeat
Mouse (x, y, 0, 0, False);
ChooseOption ('ithdraw-7');
until (invcount = 7);
if (invcount = 7) then
end;
if result = (false) then
Writeln ('failed to find pie shell dtm :(');
end;
freeDTM(PieShell);
end;
end;
end;

If you notice 'Writeln ('failed to find pie shell dtm :(');' well, my whole debug box is filled with that :( I am trying to remove 7 pie shells from the bank, and i can't find anything wrong with it :'(

Thanks for any help XD


You should use standards, then it will be easier for all of us to read, but it seems to me that you have created a DTM which script cannot find, have you read the tutorials? Here's a good one.

~Eerik.

E: I was ninjad by better answer, here's how you should do it:

begin
Result := (false);
PieShell := DTMFromString('78DA637CC4C0C0B0900105CC297505D38C503' +
'EE34B4C350C0C4C986A66125003B26B150135D781C44AFC6A00FD' +
'0F0904');
Result := (FindDTM(PieShell, x, y, MIX1, MIY1, MIX2, MIY2));

i need to bot!

2012-01-19 18:56:40

Thanks, but I still get the error; I'll try again tommorow

bg5

2012-01-19 21:42:51

You really should work or standards ,if you want help ,show us clear code.


function WithdrawPieShell: boolean;
var
x, y, PieShell: Integer;
begin
Result := (false); // you dont need this line , boolean is always false ,when created
Result := (FindDTM(PieShell, x, y, MIX1, MIY1, MIX2, MIY2)); // This line is before you even define DTM :) So it's searching for DTM which is empty! = always false
begin
PieShell := DTMFromString('78DA637CC4C0C0B0900105CC297505D38C503' + 'EE34B4C350C0C4C986A66125003B26B150135D781C44AFC6A00FD' + '0F0904');
begin
if (invcount > 0) then
depositall;
if (invcount = 0) then // you can use 'else' instead of second 'if'
begin
if FindDTM(PieShell, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
repeat
Mouse(x, y, 0, 0, False);
ChooseOption('ithdraw-7');
until (invcount = 7);
if (invcount = 7) then
end;
if result = (false) then // According to what you did at beginning ,result will be always false
Writeln('failed to find pie shell dtm :(');
end;
freeDTM(PieShell);
end;
end;
end;

x[Warrior]x3500

2012-01-19 21:58:39


function WithdrawPieShell: boolean;
var
x, y, PieShell: Integer;
begin
Result := false;
PieShell := DTMFromString('78DA637CC4C0C0B0900105CC297505D38C503' +
'EE34B4C350C0C4C986A66125003B26B150135D781C44AFC6A00FD' +
'0F0904');
if (invcount > 0) then
depositall;
if FindDTM(PieShell,x, y, MIX1, MIY1, MIX2, MIY2) then
begin
repeat
Mouse(x, y, 3,3, False);
ChooseOption ('ithdraw-7');
until (invcount = 7); //add failsafe
end;
if (not(result)) then
Writeln ('failed to find pie shell dtm :(');
freeDTM(PieShell);
end;

its a little better now. couldn't spend too much time on it.

i need to bot!

2012-01-20 18:49:12

Awesome, thanks for the help… but it still doesn't find the DTM

Runescape Pro

2012-01-20 18:57:36

Pay attention, I'm going to blow your mind. :P jk
The reason it is not being found is because I believe you said your trying to get it from the bank? MIX1 and other variations of MI stand for main inventory. The bank screen is in the main screen aka MS. Example MSX1. Now there is also MCX1 which would be the chat box. I hope I solved the problem and good luck.

i need to bot!

2012-01-21 05:40:08

From: Runescape Pro
Pay attention, I'm going to blow your mind. :P jk
The reason it is not being found is because I believe you said your trying to get it from the bank? MIX1 and other variations of MI stand for main inventory. The bank screen is in the main screen aka MS. Example MSX1. Now there is also MCX1 which would be the chat box. I hope I solved the problem and good luck.


^Awesome, that was exactly what i was looking for :) but…

now i get:

Warning! You passed wrong values to a finder function: ys > ye (515,337). Swapping the values for now.
Warning! You passed a wrong ye to a finder function: 515. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.

:O i mean, wth

btw, im using

if FindDTM(PieShell, x, y, MSX1, MSX2, MSY1, MSY2) then
begin
Writeln ('found pie shell dtm :)');

god i fail :(

Chris

2012-01-21 05:46:07

From: i need to bot!
^Awesome, that was exactly what i was looking for :) but…

now i get:

Warning! You passed wrong values to a finder function: ys > ye (515,337). Swapping the values for now.
Warning! You passed a wrong ye to a finder function: 515. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.

:O i mean, wth

btw, im using

if FindDTM(PieShell, x, y, MSX1, MSX2, MSY1, MSY2) then
begin
Writeln ('found pie shell dtm :)');

god i fail :(



Should be:
if FindDTM(PieShell, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln ('found pie shell dtm :)');

See the difference? ;)

i need to bot!

2012-01-21 06:02:27

Actually took some time to spot the difference :D

still get this though :(

Warning! You passed wrong values to a finder function: ys > ye (515,337). Swapping the values for now.
Warning! You passed a wrong ye to a finder function: 515. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.

Chris

2012-01-21 06:18:46

Are you using that code anywhere else in your script? I dont think this part gives the warning anymore after you have changed it to what ive posted :p

i need to bot!

2012-01-21 06:21:38

It still has

Writeln ('found pie shell dtm :)');

well, here is the rest of my script:

program MehScript;

{$DEFINE Smart}
{$i srl/srl.simba}

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

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Pin := '';
Players[0].Active := true;
LoginPlayer
end;

var
x, y: integer;

function WithdrawPieShell: boolean;
var
x, y, PieShell: Integer;
begin
Result := (false);
PieShell := DTMFromString('78DA639CCAC0C050C98002E696BB816946289' +
'FF10390686640034C286A00BFF403E2');
Result := (FindDTM(PieShell, x, y, MSX1, MSX2, MSY1, MSY2));
begin
if (invcount > 0) then
depositall;
if (invcount = 0) then
begin
if FindDTM(PieShell, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln ('found pie shell dtm :)');
if result = (false) then
begin
Writeln ('not found pie shell');
repeat
Mouse (x, y, 0, 0, False);
ChooseOption ('ithdraw-7');
until (invcount = 7);
if (invcount = 7) then
end;
end;
freeDTM(PieShell);
end;
end;
end;


function WithdrawStrawberry: boolean;
var
x, y, Strawberry: Integer;
begin
Result := (false);
Result := (invcount = 7);
Strawberry := DTMFromString('78DA638C616060C86240018BAD8CC1342394C' +
'F5800240E30A0012654351540E2100135F540620701350D406223' +
'01355D40620101351D40622501351381C444026A26038999F8D50' +
'0003DBF0B74');
begin
if FindDTM(Strawberry, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
if isuptext ('strawberry') then
begin
repeat
Mouse (x, y, 0, 0, False);
ChooseOption ('ithdraw-7');
until (result);
end;
if (false) then
begin
if FindDTM(Strawberry, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse (x, y, 0, 0, False);
ChooseOption ('ithdraw-7');
end;
end;
end;
end;
end;



procedure WithdrawCookingApple;
var
x, y, CookingApple: Integer;
begin
CookingApple := DTMFromString('78DA630C626060B0624001DCBEBC609A11CA6' +
'79C05249218D00013AA9AD940229A809A45402200BF1A004C6C03' +
'E4');
begin
if FindDTM(CookingApple, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
repeat
Mouse (x, y, 0, 0, False);
ChooseOption ('ithdraw-7');
until (invcount = 21);
end;
freeDTM(CookingApple);
if (invcount = 28) then
begin
closebank;
end;
end;
end;

procedure WithdrawWatermelon;
var
x, y, Watermelon: Integer;
begin
Watermelon := DTMFromString('78DA638C6660603066400109F542609A11CA6' +
'7BC09248C18D00013A61A2B026A2E020975FC6A00A24404A4');
begin
if FindDTM(Watermelon, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
repeat
Mouse (x, y, 0, 0, False);
ChooseOption ('ithdraw-7');
until (invcount = 28);
end;
freeDTM(Watermelon);
end;
end;

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;

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

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

function PieShell: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.20, 0.35);

if not (FindColorsTolerance(arP, 4552348, MSX1, MSY1, MSX2, MSY2, 1)) then
begin
Writeln('Failed to find the color, no result(pieshell).');
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;

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

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

function Strawberry: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.20, 0.35);

if not (FindColorsTolerance(arP, 4552348, MSX1, MSY1, MSX2, MSY2, 1)) then
begin
Writeln('Failed to find the color, no result(Strawberry).');
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;

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

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

function Watermelon: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06, 0.08);

if not (FindColorsTolerance(arP, 2710312, MSX1, MSY1, MSX2, MSY2, 6)) then
begin
Writeln('Failed to find the color, no result(Watermelon).');
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;

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

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function Apple: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.40, 0.07);

if not (FindColorsTolerance(arP, 1076776, MSX1, MSY1, MSX2, MSY2, 12)) then
begin
Writeln('Failed to find the color, no result(Apple).');
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;

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

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

procedure camera;
begin
makecompass(180);
end;

procedure bankbanker;
begin
if findobjcustom(x, y, ['ank'], [BankColour], 2) then
begin
Mouse(x, y, 0, 0, false);
chooseoption ('Bank Banker');
if (bankscreen) then
end;
end;

procedure Depositstuff;
begin
if (bankscreen) then
begin
if (InvCount > 0) then
begin
depositall;
end;
end;
end;

procedure UsePieShell;
begin
if (invcount = 28) then
begin
if (bankscreen) then
closebank;
begin
if findobjcustom(x, y, ['Pie Shell'], [PieShell], 2) then
begin
Mouse(x, y, 0, 0, true);
chooseoption ('Use');
end;
end;
end;
end;

begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
camera;
repeat
bankbanker;
until (bankscreen);
Depositstuff;
begin
repeat
WithdrawPieShell;
until (invcount = 7);
if (invcount = 7) then
begin
repeat
WithdrawStrawberry;
until (invcount = 14)
WithdrawWatermelon;
if (invcount = 14) then
begin
repeat
WithdrawCookingApple;
until (invcount = 21)
if (invcount = 21) then
begin
repeat
UsePieShell;
until (invcount = 28)
end;
end;
end;
end;
end.


Chris

2012-01-21 06:38:03

Ill look into it later today, I cant display it on my mobile :p

i need to bot!

2012-01-21 06:46:18

kl thanks for the help :)

Chris

2012-01-21 10:48:27

function WithdrawPieShell: boolean;
var
x, y, PieShell: Integer;
begin
Result := (false);
PieShell := DTMFromString('78DA639CCAC0C050C98002E696BB816946289' +
'FF10390686640034C286A00BFF403E2');
Result := (FindDTM(PieShell, x, y, MSX1, MSX2, MSY1, MSY2));

;)

i need to bot!

2012-01-21 14:56:29

thanks xD could i pm you for help if i get stuck :D this was really pissing me off

Chris

2012-01-21 15:22:38

From: i need to bot!
thanks xD could i pm you for help if i get stuck :D this was really pissing me off


Yeah you can always pm me :thumbsup:

i need to bot!

2012-01-21 16:55:14

now i get :(


The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

Brandon

2012-01-21 16:59:47

From: i need to bot!
get


The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

now … :(


Don't worry about it.. this is because the script terminated prematurely (Before it's end)..

Basically if you stop the script before it stops naturally, sometimes it does not get time to free those things. Usually when you terminate rather than stopping and waiting. it's no biggie.. happens to almost every scripter here.