L2Program
2010-02-27 11:14:59
I've just added a login procedure that works to my thieving script, but when I play the script now it will keep repeating the login script, and not do the pickpocketing script at all.
Few reasons why I think the pickpocketing script wont work:
I've added finding more than one colour - probably done incorrectly
I was told to free my bitmaps - also possibly done in the wrong place.
Hope anyone can help!
[PHP]program Pickpocketing;
{.include SRL/SRL.scar}
{ Author Lewis }
//credits to: caused, members from srl forums.
// notes to me to complete:
// Eating on low HP
// World Selection
// username and password and world as constants.
const
Target1= 11371366;//colour of the Target
Target2= 11371366;//Different colour of same target
Target3= 11371366;//Different colour of same target
var
pickpocketbmp : Integer;
var x,y: Integer;
procedure LoadBmps;
begin
pickpocketbmp := BitmapFromString(26, 12, 'beNoLcY8NgaL/YADn' +
'UoggpjEwMBCvmLqm4VFMFdPgDoYrQPPFfySAXxCIGMAATQGaIISLr' +
'BdZHKt3MI1C8xEuNp6gwOMjrG4mGLB4fITVzfhjAS05oTkP09lYY4' +
'EgGzPM8cQCFRAAosKhNg==');
end;
procedure FreeBmps;
begin
FreeBitmap(pickpocketbmp);
end;
procedure Logon;
begin
MouseBox(310, 184, 453, 195, 1);
begin
Wait(1000+random(100));
SendKeys('user');
Wait(1000+random(100));
MouseBox(343, 328, 414, 338, 1);
Wait(1000+random(100));
SendKeys('pass');
Wait(1000+random(100));
MouseBox(355, 368, 406, 375, 1);
Wait(3000+random(100));
end;
end;
Procedure EatingOnLowHP;
begin
end;
procedure PickPocket;
begin
if FindColorTolerance(x, y, Target1, MSX1, MSY1, MSX2, MSY2, 3) then
else
if FindColorTolerance(x, y, Target2, MSX1, MSY1, MSX2, MSY2, 3) then
else
if FindColorTolerance(x, y, Target3, MSX1, MSY1, MSX2, MSY2, 3) then
begin
Mouse(x, y, 4, 4, False);
if(FindBitmap(pickpocketbmp,x,y)) then
Mouse(x, y, 4, 4, True);
Wait(2500+random(100));
end else Logon;
end;
begin
SetupSRL;
LoadBmps;
Logon;
repeat
EatingOnLowHP;
PickPocket;
FreeBmps;
until(false);
end.[/PHP]
Few reasons why I think the pickpocketing script wont work:
I've added finding more than one colour - probably done incorrectly
I was told to free my bitmaps - also possibly done in the wrong place.
Hope anyone can help!
[PHP]program Pickpocketing;
{.include SRL/SRL.scar}
{ Author Lewis }
//credits to: caused, members from srl forums.
// notes to me to complete:
// Eating on low HP
// World Selection
// username and password and world as constants.
const
Target1= 11371366;//colour of the Target
Target2= 11371366;//Different colour of same target
Target3= 11371366;//Different colour of same target
var
pickpocketbmp : Integer;
var x,y: Integer;
procedure LoadBmps;
begin
pickpocketbmp := BitmapFromString(26, 12, 'beNoLcY8NgaL/YADn' +
'UoggpjEwMBCvmLqm4VFMFdPgDoYrQPPFfySAXxCIGMAATQGaIISLr' +
'BdZHKt3MI1C8xEuNp6gwOMjrG4mGLB4fITVzfhjAS05oTkP09lYY4' +
'EgGzPM8cQCFRAAosKhNg==');
end;
procedure FreeBmps;
begin
FreeBitmap(pickpocketbmp);
end;
procedure Logon;
begin
MouseBox(310, 184, 453, 195, 1);
begin
Wait(1000+random(100));
SendKeys('user');
Wait(1000+random(100));
MouseBox(343, 328, 414, 338, 1);
Wait(1000+random(100));
SendKeys('pass');
Wait(1000+random(100));
MouseBox(355, 368, 406, 375, 1);
Wait(3000+random(100));
end;
end;
Procedure EatingOnLowHP;
begin
end;
procedure PickPocket;
begin
if FindColorTolerance(x, y, Target1, MSX1, MSY1, MSX2, MSY2, 3) then
else
if FindColorTolerance(x, y, Target2, MSX1, MSY1, MSX2, MSY2, 3) then
else
if FindColorTolerance(x, y, Target3, MSX1, MSY1, MSX2, MSY2, 3) then
begin
Mouse(x, y, 4, 4, False);
if(FindBitmap(pickpocketbmp,x,y)) then
Mouse(x, y, 4, 4, True);
Wait(2500+random(100));
end else Logon;
end;
begin
SetupSRL;
LoadBmps;
Logon;
repeat
EatingOnLowHP;
PickPocket;
FreeBmps;
until(false);
end.[/PHP]