EtherFreak
12-17-2010, 11:10 PM
So, i have a beta together. the cutting is working well, and the burner seems to be working without any issues. the walking from the bank is working ok, but the walking to the bank is giving me grief.
you can start out in the cutting resource, or al kaharid bank, and click run. Axe MUST be equipped, and if you want to burn, you need a tinderbox in inv slot 1.
please leave feedback to the issues encountered, details are preferred.
program Daemapwil;
//{.Include SRL\SRL\Misc\SMART.SCAR}
{.include SRL/SRL.scar}
Const
// ----------------SETUP-----------------------------
// start out in Al Kharid Bank
// maple color 2572922, willow color 3169612
TreeColor=2572922 ; //color picker for tree
shipmaster= 4872837 ;//color unique to the shipmaster
Dung=2438909 ;//color of dungon entrance
treeuptext='ple' ; //'low' or 'ple'
loadcount= 10 ; //total loads to complete
threelet='' ;//2-4th letters of name. I.E. Johntrucker='ohn'
borb=0 ; // bank=0 burn=1
// ---------------END SETUP----------------------------------------
var
x, y, leng: integer;
count,mwtime: integer;
icount, ecount:integer;
kill: integer;
TPA:TPointArray;
ATPA:T2DPointArray;
I: Integer;
counter: Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
// ----------------SETUP-----------------------------
Name := '';
Pass := '';
Nick := '';
Active := True;
end;
end;
// ---------------END SETUP----------------------------------------
Procedure findshipmaster;
begin
findcolortolerance(x,y,shipmaster,MSX1,MSY1,MSX2,M SY2,4);
mmouse(x,y,5,5);
wait(200);
getmousepos(x,y);
if ( WaitUpTextMulti(['Fre', 'nik'], 200) ) then
begin
mouse(x,y,1,1,false);
wait(200);
FindText(x, y, 'Sail', UpChars, msx1, msy1, msx2, msy2);
wait(200);
mouse((18+x),(y+2),16,2,true);
wait(6000+random(2000));
end else
begin
kill:=kill+1;
writeln('could not find shipmaster');
if kill<9 then
begin
writeln('trying again');
findshipmaster;
end;
kill:=0;
exit;
end;
wait(3000);
end;
procedure opendung;
begin
findcolortolerance(x,y,Dung,MSX1,MSY1,MSX2,MSY2,12 );
mmouse(x,y,5,5);
wait(200);
getmousepos(x,y);
if ( WaitUpTextMulti(['Ent', 'Mys','ent'], 200) ) then
mouse(x,y,1,1,true) else
begin
writeln('could not find dungen');
kill:=kill+1;
if kill<9 then
begin
writeln('trying again');
opendung;
end;
kill:=0;
exit;
end;
wait(4000+random(1000));
end;
procedure findtreetpa;
begin
mousespeed:=(7+random(3));
FindColorsTolerance(TPA, TreeColor, MSX1, MSY1, MSX2, MSY2,6);
ATPA := TPAToATPAEx(TPA, 40, 40);
end;
procedure gettreexy;
begin
if ( Length(ATPA)=0 ) then
exit;
SortATPAFrom(ATPA, Point(MSCX, MSCY));
MiddleTPAEx(ATPA[i], x, y);
end;
procedure clicktree;
begin
MMouse(x, y, 20, 20);
MMouse(x, y, 8, 8);
wait(random(300)+300);
getmousepos(x,y);
begin
if ( WaitUpTextMulti([Treeuptext], 200) ) then
begin
writeln('Clicking tree');
Mouse(x,y,1,1,true);
end else
exit;
end;
end;
procedure initrun;
begin
wait(200);
Smart_Members := True;
Smart_Server := 77;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer;
counter:=0;
icount:=0
kill:=0;
count:=0;
wait(5000);
SetAngle(true);
SymbolAccuracy := 0.5;
end;
procedure findtreetpachop;
begin
mousespeed:=(7+random(3));
FindColorsTolerance(TPA, TreeColor, 180,100,300,220,6);
ATPA := TPAToATPAEx(TPA, 40, 40);
end;
procedure activechop;
begin
wait(5000);
if IsChatBoxTextBetween('swing',clblack,7,8) then
begin
writeln('Chopping down a tree');
findtreetpachop;
leng:=length(ATPA);
repeat //checking to see if a log was cut
wait(1000);
if random(60)=10 then
begin
writeln('checkin woodcutting stat');
HoverSkill('woodcutting',false);
wait(2000+random(4000));
GameTab(tab_Inv);
end;
if IsChatBoxTextAnyLine (threelet,clBlue) then
begin
writeln('Someone said your name, logging out to be safe');
logout;
end;
findtreetpachop;
if ( Length(ATPA)>leng ) then
begin
leng:=length(ATPA);
writeln('Tree grew back')
end;
if invfull then
exit;
if length(ATPA)=0 then
exit;
until ( Length(ATPA)<leng )
writeln('Tree fell down');
wait(random(10000));
end;
end;
Procedure cutting;
begin
repeat
findtreetpa;
gettreexy;
clicktree;
findtreetpachop;
activechop;
until invfull
end;
Procedure invburn;
begin
if treeuptext='low' then
LinearWalkTolerance(5264467,1,60,0,0,18);
LinearWalkTolerance(10063496,350,60,0,0,18);
opendung;
wait(2000);
radialwalktolerance(5131856,200,230,20,0,0,16);
counter:=2;
repeat
invmouse(1,1);
wait(800+random(200));
invmouse(counter,1);
counter:=1+counter;
wait(1100+random(500));
invmouse(counter,1);
wait(900+random(1000));
invmouse(1,1);
wait(900+random(500));
counter:=1+counter;
until counter=28
invmouse(1,1);
wait(800+random(200));
invmouse(28,1);
wait(1100+random(500));
radialwalktolerance(5131856,89,92,70,0,0,16);
radialwalktolerance(5131856,85,90,70,0,0,16);
opendung;
wait(1000);
radialwalktolerance(662574,150,180,30,0,0,16);
if treeuptext='low' then // for willow tree location
radialwalktolerance(1730613,150,180,35,0,0,16);
end;
Procedure traveltobank;
begin
if treeuptext='low' then
LinearWalkTolerance(5264467,1,60,0,0,18);
LinearWalkTolerance(10063496,1,60,0,0,18);
opendung;
radialwalktolerance(5723993,360,10,74,0,2,18);
wait(20000);
radialwalktolerance(5723993,80,100,40,0,0,6);
radialwalktolerance(60909,50,100,40,0,0,6);
wait(2000);
findshipmaster;
wait(2000);
radialwalktolerance(6917299,80,100,40,0,0,18);
openbankfast('akb');
wait(500);
depositall;
wait(500);
end;
Procedure travelfrombank;
begin
radialwalktolerance(2714496,270,290,73,2,0,18);
wait(10000);
findshipmaster;
radialwalktolerance(5723993,175,185,74,0,-2,16);
wait(20000);
radialwalktolerance(5131856,170,180,40,0,0,16);
opendung;
wait(1000);
radialwalktolerance(662574,150,180,35,0,0,16);
if treeuptext='low' then // for willow tree location
radialwalktolerance(1730613,150,180,35,0,0,16);
end;
begin //main loop
initrun;
if findsymbol(x,y,'bank') then
travelfrombank;
repeat
count:=count+1;
cutting;
if borb=0 then
begin
traveltobank;
travelfrombank;
end else
invburn;
until count=loadcount
end.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.