SRL Archive - OSR Help

BMP's and DTM's not working for deposit box?


Leyser

2012-05-31 12:32:00

I have tried banking willow logs in the deposit box in Port Sarim, but it doesent seem to even hover over the log when I use DTM's I have even tried BMP's but still no luck heres part of my code:


procedure WalkToDepositBox;
var
x, y:Integer;
x2, y2:Integer;
begin
MakeCompass('N');
wait(100+random(133)); //Walking
Wait(50+random(200));
SPS_Areas := ['9_5'];
MyPath :=[Point(3870, 2089), Point(3862, 2096), Point(3844, 2105), Point(3823, 2108), Point(3809, 2111), Point(3792, 2118), Point(3783, 2140), Point(3793, 2155), Point(3805, 2159), Point(3811, 2159)];
if SPS_WalkPath(MyPath) then //Walking
begin
wait(10000+random(1575));
if FindObjCustom(x, y, ['deposit', 'ox'], [3818317, 3357506], 8) then
begin
if IsUpText('ox') then
wait(1500+Random(560));
Mouse(x, y, 5, 5, 1);
wait(3000+random(1212));
if FindBitmap(WillowLog, x2, y2) then
begin
MMouse(x2, y2, 5, 5);
ChooseOption('eposit-All');
end;
end;
end;
end;


Sirenia

2012-05-31 12:33:56

Im sorry but I dont think its a bitmap or dtm in your script?

Leyser

2012-05-31 12:35:31

What do you mean?

I declared the BMP in the main loop.

This is just me showing the BMP one.

Sirenia

2012-05-31 12:41:28

From: Leyser
What do you mean?

I declared the BMP in the main loop.

This is just me showing the BMP one.

Uhm try to post the whole script so we can see where the problem is ;P
If you want to call a bitmap or dtm you have declared then you have to write FindDTM(x, y and stuff) or FindBitmap(x, y and stuff) or some kind

Edit: sorry my brain is tarded and didnt see where you called findbitmap… gimme 2sec

Leyser

2012-05-31 12:47:43


program LeyserChopper;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i srl/srl/core/sps/sps.simba}

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

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
Players[0].BoxRewards := ['Xp', 'mote', 'ostume'];
end;

var
WillowLog:Integer;
XpGained, XpPerHour, TimeGoingOnFor, CurrentEXP, OriginalXP:Integer;
MyPath:TPointArray;
procedure WalkToDepositBox;
var
x, y:Integer;
x2, y2:Integer;
begin
MakeCompass('N');
wait(100+random(133)); //Walking
Wait(50+random(200));
SPS_Areas := ['9_5'];
MyPath :=[Point(3870, 2089), Point(3862, 2096), Point(3844, 2105), Point(3823, 2108), Point(3809, 2111), Point(3792, 2118), Point(3783, 2140), Point(3793, 2155), Point(3805, 2159), Point(3811, 2159)];
if SPS_WalkPath(MyPath) then //Walking
begin
wait(10000+random(1575));
if FindObjCustom(x, y, ['deposit', 'ox'], [3818317, 3357506], 8) then
begin
if IsUpText('ox') then
wait(1500+Random(560));
Mouse(x, y, 5, 5, 1);
wait(3000+random(1212));
if FindBitmap(WillowLog, x2, y2) then
begin
MMouse(x2, y2, 5, 5);
ChooseOption('eposit-All');
end;
end;
end;
end;
function IsWoodcutting: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 5000) > 400);
end;
procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(8) of
0:
begin
HoverSkill('Woodcutting', false);
wait(500+Random(250));
end;
1:
begin
PickUpMouse;
Wait(500+Random(401));
end;
2: begin
RandomRClick;
Wait(500+Random(401));
end;
3: begin
ExitSquealOfFortune;
Wait(500+Random(401));
end;
4: begin
FindSpinTicket;
Wait(500+Random(401));
end;
5: begin
BoredHuman;
Wait(500+Random(401));
end;
6: begin
WriteLn('Bored...');
Wait(500+Random(401));
end;
end;
end;

procedure ProgressReport;

begin
ClearDebug;
TimeGoingOnFor := (GetTimeRunning/1000);
CurrentEXP := GetXPBar(1);
XpGained := (CurrentEXP - OriginalXP);
XpPerHour :=(3600*(XpGained))/((TimeGoingOnFor));
begin
WriteLn('/////\\\\\/////LeyserChopper\\\\\/////\\\\\###########')
WriteLn('/////\\\\\/////Version-----1\\\\\/////\\\\\###########')
WriteLn('Proggy For '+ Players[0].Nick +'')
WriteLn('Running For '+ IntToStr(TimeGoingOnFor) +'')
WriteLn('CurrentXP '+ IntToStr(CurrentEXP) +'')
WriteLn('Gained XP '+ IntToStr(XpGained) +'')
WriteLn('XpPerHour '+ IntToStr(XpPerHour) +'')
end;
end;
procedure ChopTree;
var
x, y:Integer;
begin
repeat
FindNormalRandoms;
if FindObjCustom(x, y, ['illow', 'hop'], [15160633, 1054741], 9) then
begin
GetMousePos(x, y);
Case Random(2) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
WaitOption('hop', 500);
End;
End;
While IsWoodcutting Do Wait(20+random(50));
end;
until(InvFull)

end;

procedure LoadBMPs;

begin
WillowLog := BitmapFromString(14, 12, 'meJwTsXYWtnAAITM7IRNrIAIyQA' +
'giCEMi1s7mfsFwlWhqgLLIyDIgVARuLIYCUVtXCAMobhUUgaYXLgt' +
'VA3aVgL4Z0EyIsSiyMPcIGlkA1fBrGfBp6MKVITsAaAhQDb+uMVAN' +
'r6oWUBkQIXxk4QAXBCoAIaBKXWOgmUAE1QhHGLJABA86PUdXCBtiI' +
'5oscqCZ+QQau/ughTNWBAwlIAK6FtNfZKsEAA3NXL4=');
end;

procedure FreeBMPs;

begin
FreeBitMap(WillowLog);
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
GetXpBar(1);
SetAngle(0);
repeat
ChopTree;
until(InvFull)
if (InvFull) then
WalkToDepositBox;
end.

Sirenia

2012-05-31 12:51:00

From: Leyser

program LeyserChopper;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i srl/srl/core/sps/sps.simba}

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

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
Players[0].BoxRewards := ['Xp', 'mote', 'ostume'];
end;

var
WillowLog:Integer;
XpGained, XpPerHour, TimeGoingOnFor, CurrentEXP, OriginalXP:Integer;
MyPath:TPointArray;
procedure WalkToDepositBox;
var
x, y:Integer;
x2, y2:Integer;
begin
MakeCompass('N');
wait(100+random(133)); //Walking
Wait(50+random(200));
SPS_Areas := ['9_5'];
MyPath :=[Point(3870, 2089), Point(3862, 2096), Point(3844, 2105), Point(3823, 2108), Point(3809, 2111), Point(3792, 2118), Point(3783, 2140), Point(3793, 2155), Point(3805, 2159), Point(3811, 2159)];
if SPS_WalkPath(MyPath) then //Walking
begin
wait(10000+random(1575));
if FindObjCustom(x, y, ['deposit', 'ox'], [3818317, 3357506], 8) then
begin
if IsUpText('ox') then
wait(1500+Random(560));
Mouse(x, y, 5, 5, 1);
wait(3000+random(1212));
if FindBitmap(WillowLog, x2, y2) then
begin
MMouse(x2, y2, 5, 5);
ChooseOption('eposit-All');
end;
end;
end;
end;
function IsWoodcutting: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 5000) > 400);
end;
procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(8) of
0:
begin
HoverSkill('Woodcutting', false);
wait(500+Random(250));
end;
1:
begin
PickUpMouse;
Wait(500+Random(401));
end;
2: begin
RandomRClick;
Wait(500+Random(401));
end;
3: begin
ExitSquealOfFortune;
Wait(500+Random(401));
end;
4: begin
FindSpinTicket;
Wait(500+Random(401));
end;
5: begin
BoredHuman;
Wait(500+Random(401));
end;
6: begin
WriteLn('Bored...');
Wait(500+Random(401));
end;
end;
end;

procedure ProgressReport;

begin
ClearDebug;
TimeGoingOnFor := (GetTimeRunning/1000);
CurrentEXP := GetXPBar(1);
XpGained := (CurrentEXP - OriginalXP);
XpPerHour :=(3600*(XpGained))/((TimeGoingOnFor));
begin
WriteLn('/////\\\\\/////LeyserChopper\\\\\/////\\\\\###########')
WriteLn('/////\\\\\/////Version-----1\\\\\/////\\\\\###########')
WriteLn('Proggy For '+ Players[0].Nick +'')
WriteLn('Running For '+ IntToStr(TimeGoingOnFor) +'')
WriteLn('CurrentXP '+ IntToStr(CurrentEXP) +'')
WriteLn('Gained XP '+ IntToStr(XpGained) +'')
WriteLn('XpPerHour '+ IntToStr(XpPerHour) +'')
end;
end;
procedure ChopTree;
var
x, y:Integer;
begin
repeat
FindNormalRandoms;
if FindObjCustom(x, y, ['illow', 'hop'], [15160633, 1054741], 9) then
begin
GetMousePos(x, y);
Case Random(2) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
WaitOption('hop', 500);
End;
End;
While IsWoodcutting Do Wait(20+random(50));
end;
until(InvFull)

end;

procedure LoadBMPs;

begin
WillowLog := BitmapFromString(14, 12, 'meJwTsXYWtnAAITM7IRNrIAIyQA' +
'giCEMi1s7mfsFwlWhqgLLIyDIgVARuLIYCUVtXCAMobhUUgaYXLgt' +
'VA3aVgL4Z0EyIsSiyMPcIGlkA1fBrGfBp6MKVITsAaAhQDb+uMVAN' +
'r6oWUBkQIXxk4QAXBCoAIaBKXWOgmUAE1QhHGLJABA86PUdXCBtiI' +
'5oscqCZ+QQau/ughTNWBAwlIAK6FtNfZKsEAA3NXL4=');
end;

procedure FreeBMPs;

begin
FreeBitMap(WillowLog);
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
GetXpBar(1);
SetAngle(0);
repeat
ChopTree;
until(InvFull)
if (InvFull) then
WalkToDepositBox;
end.

Ah I see you need to call LoadBmps in your mainloop or it wont load the bitmap :)

Leyser

2012-05-31 12:53:05

Thanks! :D

Sirenia

2012-05-31 13:06:30

From: Leyser
Thanks! :D

Another thing I saw in ur script is that when you do
if FindBitmap(WillowLog, x2, y2) then
begin
MMouse(x2, y2, 5, 5);
ChooseOption('eposit-All');
end;
it will only mouse over the bitmap but never really click it. Change it to
if FindBitmap(WillowLog, x2, y2) then
begin
MMouse(x2, y2, 5, 5);
if WaitUptext('illow', 1000) then
begin
ClickMouse2(false);
WaitOption('eposit-All', 1000);
end;
end;
And it should actually work