Log in

View Full Version : Targeting Yews, Not Regular Trees



marneus901
03-25-2007, 08:10 PM
FIXED

my [unfinished] code

//This Script Made By Marneus901
//First Script Made By Me, And Tanks To Communities
//Such As Sythe.org And SRL-forums.com For Tutorials
//And Inspiration


//NOTE:: Does Not Do Randoms Yet

//(FOR PROGRAMMING PURPOSES) Then Make -Y CORD Directly Abouve Shope Inside Castle Garden
//Then More Up But To The Left (-X)
//Then Directly Abouve Again (-Y)
//If Cannot Find Tree, Then Head East (X)
//If Already Moved East, And Cannot Find Tree, Move West (-X)
//If West, Full Load, Head To Bank
//If East, Full Load, Head West, Then Move To Bank
//Use Shotcut Symbol
//Then Directly South
//Repeat
//Repeat (Should Be Out Of Varrock Gardens After This)
//Click On BankSymbol

program AutoYewCutter;
{.include SRL/SRL.scar}
var
myx,myy:Integer;
InfoManSymbol:Integer;
SmithSymbol:Integer;
AbleToFindBmps:Integer;
SmithPlace:Integer;
TreeMini:Integer;
YewTree:Integer;

const
Username='username';
Password='password';
BankIconColor= 4048866; //Get The Yellow Part Of Symbol In Mini-Map
//InfoGuySymbol= 7755818; //The Blue Color Of Information Guide Below Bank (On Mini-Map)
StaffShopIcon= 1200010; //Brown Color Of Staff Shop Symbol In MiniMap
ShortcutSymbol= 2395905; //On MiniMap
YewTreeSymbol= 95746;//WellGee?
YewTreeColor= 1986624;

procedure WalkToTrees;
begin
HighestAngle;
Wait(2000);
{MakeCompass('S');
MakeCompass('N'); }
//Wait(1500);
//Well, Your Character Is Always At The Cordinate 268, 170
//North Square Is 270, 150 = y cord - 20
//West 230, 185
//South 265, 225 = y cord + 40
//East 305, 185
{ repeat
if (FindBitmap(InfoManSymbol, myx, myy)) then
begin
AbleToFindBmps := 1;
end else
AbleToFindBmps := 0;
if (FindBitmap(SmithSymbol, myx, myy)) then
begin
AbleToFindBmps := 1;
end else
AbleToFindBmps := 0;
if (FindBitmap(TreeMini, myx, myy)) then
begin
AbleToFindBmps := 2;
end else
AbleToFindBmps := 0;
Writeln('Unable To Find SmithSymbol Or InfoManSymbol');
wait(2000);
until(AbleToFindBmps=1);
Mouse(myx, myy -10, 0, 0, True);
if(not(AbleToFindBmps=2))then
begin
repeat
if (FindBitmap(SmithPlace, myx, myy)) then
begin
AbleToFindBmps := 1;
end else
AbleToFindBmps := 0;
wait(2000);
Writeln('Unable To Find SmithPlace');
until(AbleToFindBmps=1);
Mouse(myx+26, myy-86, 0, 0, true);
end; }
Wait(500);
Mouse(269+420, 156-119, 0, 0, true);
Wait(20000);
Mouse(642, 19, 0, 0, true);
Wait(30000);
Mouse(642, 19, 0, 0, true);
Wait(15000);
Mouse(655, 19, 0, 0, true);
Wait(15000);
repeat
if (FindBitmap(YewTree, myx, myy)) then
begin
AbleToFindBmps := 1;
end else
AbleToFindBmps := 0;
wait(2000);
Writeln('Unable To Find YewTree');
until(AbleToFindBmps=1);
Writeln('Found Yew Tree');
Mouse(myx, myy, 0, 0, true);
Wait(10000);
{ FindColor(x,y,YewTree,0,0,518,340)
repeat
if(IsUpText('Chop Down Yew')=true) then
begin
end else
Writeln('Sorry Cannot Find Yew Tree ATM, Trying Again...');
until(IsUpText('Chop Down Yew')=false)
Mouse(myx, myy, 0, 0, false);}

end;


Procedure ChoptheTrees;
begin
repeat
if (FindMSColor(x,y,3438704))or
(FindMSColor(x,y,3887184))or
(FindMSColor(x,y,1925200))then
MMouse(x,y,1,1)
If IsUpText('Chop down Yew') then
Mouse(x,y,1,1,true)
wait(5000+Random(5000))
until (invfull = true)
end;



procedure LetsLogin;
begin
Mouse(457, 290, 0, 0, true);
Wait(2000);
SendKeys(Username+chr(13));
SendKeys(Password);
Wait(2000);
Mouse(304,325,0,0,true);
Wait(6000);
Mouse(392, 338, 0, 0, true);
Wait(3000);
end;

procedure LetsLogout;
begin
Wait(1000);
Mouse(645, 485, 0, 0, true);
Wait(3000);
Mouse(629, 377, 0 ,0 ,true);
end;

procedure GetAllBmps;
begin
InfoManSymbol := BitmapFromString(7, 10, 'z78DA333040006347' +
'33370B3364D2000310238E4B8D010EBB885149891AEADA45A A4AE' +
'2012E330185155263');
SmithSymbol := BitmapFromString(9, 7, 'z78DA33300001130B132' +
'76337032436B548030C80DF2E03A201A9EAC9D345AA0B890F 0D00' +
'16CA4D55');
SmithPlace := BitmapFromString(20, 21, 'z78DA33353531377435' +
'0593AEE66E666EE6A64822D42521E69BBB989B19B998D2CC5 E886' +
'998242E7B7191B84C26D9BFE6E646C616A6F40FE7517B47ED 1DB5' +
'7708DA0B2147ED1DAEF68EE47C84BFCE2586A4967FCDCDCD5 C8C2' +
'D68490EA4BD007C502882');
TreeMini := BitmapFromString(1, 26, 'z78DA33753277367435059' +
'326AEE62EC626986C086966446F1200DF4E2342');
YewTree := BitmapFromString(17, 17, 'z78DAE5944112C3200845A' +
'FF445D39025439AFB1FA9D3B8314331D4B49B9605E3E8F0DF F811' +
'81FF0A655575F3679513CD193911AF90368F110F55F769061 DF46' +
'5D99E3B5DD682157489E264615109517C7D87B2DF8B481929 EEDE' +
'18C57AF82EE5C4318752DD1BA544BB13A75856AD2D25035B5 D7BF' +
'A91576D59AD424BB1A7F1A9E94FBAA55CF90D5ED4EE535029 B752' +
'98E47BBF4DEB4FBFCBBF1A0F883166A0');
end;



begin
SetupSRL;
GetAllBmps;
//LetsLogin;
//Wait(4000);
WalkToTrees;
ChoptheTrees;
Wait(1000);
//LetsLogout;
FreeBitmap(InfoManSymbol);
end.