me_ntal
04-21-2007, 12:37 PM
{.include SSI2.txt}
{.include BoxBreaker.txt}
Old script
// //
////////////////////////////////////////////////////////////////////////////////
// SET UP //
////////////////////////////////////////////////////////////////////////////////
// //
// SCAR version 2.02 needed //
// V-Bright, developed in high res //
// Take colors in lines 43-46 (not required, leave at 0 to autopick) //
// Set up in lines 59-66 //
// Start in draynor village //
// Start with an axe in first inventory spot //
// DO NOT WIELD THE AXE i am putting in support for this in the next version //
////////////////////////////////////////////////////////////////////////////////
// Versions //
////////////////////////////////////////////////////////////////////////////////
// Version 1.0, First Release, used osi include //
////////////////////////////////////////////////////////////////////////////////
program moparswillowcutterbanker;
{.include SSI2.txt}
{.include BoxBreaker.txt}
const
//=//===============Colors(Leave as 0 to let script find)==============\=\\
WillowColor1=2444649;//Colors of Willow leaves in main screen
WillowColor2=1453629;
WillowColor3=4147264;
MMBankColor= 11186596;//Bank symbol color (SS:3060683)
//=\\=============================================== ==================//=\\
//=\\ Under the varibles there are more setup options. //=\\
//=\\=============================================== ==================//=\\
var
BankColor,Report,Report2,TotalOres,Banks,
IAmLostCount,equipit,DropText,DropTextb:integer;
NoPick,LogsOut,Chats,EquipPick,Rotates:boolean;
procedure Setup;
begin
//=\\============================Setup============== ==================//=\\
Username:= 'timmy 292';//Username.
Password:= 'meonly';//Password.
LogsOut:= false;//If you want to log out every so often for antiban.
Chats:= false;//If you want to randomly chat for anti-ban.
Rotates:= true;//If you want to randomly rotate the screen for anti-ban.
EquipPick:= false;//do not wield axe in this version
//=\\=============================================== ==================//=\\
if(not(EquipPick))then
equipit:=1;
end;
//DO NO TOUCH BELOW
procedure ProgressReport;
var
RHours,Minutes,Seconds,RMinutes,RSeconds,avtime:Lo ngInt;
Time:String;
begin
if(GetSystemTime-report2 > report*60000)then
begin
Seconds:=(GetSystemTime-ST) div 1000;
Minutes:=Seconds div 60;
RHours:=Minutes div 60;
Time:=IntToStr(Seconds)+' Seconds';
avtime:=Seconds/banks;
if Minutes<>0 then
begin
RSeconds:=Seconds Mod (Minutes*60);
Time:=IntToStr(Minutes)+' Minutes and '+IntToStr(RSeconds)+' Seconds';
end;
if RHours<>0 then
begin
RMinutes:=Minutes Mod (RHours*60);
RSeconds:=Seconds Mod (Minutes*60);
Time:=IntToStr(RHours)+' Hours, '+IntToStr(RMinutes)+' Minutes and '
+IntToStr(RSeconds)+' Seconds';
end;
begin
WriteLn(' ');
WriteLn('<=================Progress Report================>');
WriteLn('Worked for '+Time);
WriteLn('Banked '+IntToStr(banks)+' loads[s].');
WriteLn('Banked '+IntToStr(banks*27)+' willow[s].');
WriteLn('Gained '+floattostr(67.5*(banks*27))+'xp.');
WriteLn('Currently Averaging about '+IntToStr(3600/avtime*(banks*27))+
' willow[s] and '+floattostr(3600/avtime*(67.5*(banks*27)))+' xp an hour.');
WriteLn('Random Event Report:');
if(fights>0)then WriteLn(' Fought '+IntToStr(fights)+' time[s].');
if(talks>0)then WriteLn(' Talked to '+IntToStr(talks)+' Random event[s].');
if(lamps>0)then WriteLn(' Used lamps '+IntToStr(lamps)+' time[s].');
if(boxes>0)then WriteLn(' Solved '+IntToStr(boxes)+' box[es].');
if(logs>0)then WriteLn(' Logged in '+IntToStr(logs)+' time[s].');
WriteLn('<================================================>');
Report2:=GetSystemTime;
end;
end;
end;
//===========================Color Finding procedures=========================\\
procedure SetColors;
begin
BankColor:=MMBankColor;
OreColor1:=WillowColor1;
OreColor2:=WillowColor2;
OreColor3:=WillowColor3;
end;
procedure CouldNotFindColors;
begin
WriteLn('ERROR, script could not find colors, please run the script again'
+' or set your own colors.');
TerminateScript;
end;
Function FindTreeColorsifneeded(refrencecol,tol,tol2:intege r):boolean;
var
c,a,b,xm,ym,curcolor:integer;
oc1,oc2,oc3:boolean;
begin
if((OreColor1=0)or(OreColor2=0)or(OreColor3=0))the n
begin
if(FindColorTolerance(x,y,refrencecol,3,3,515,338, tol))then//Find ore close
begin
if(FindObj('Chop',refrencecol,tol))then
begin
a:=1;
GetMousePos(x,y);
xm:=x;
ym:=y;
repeat
xm:=xm+a;
ym:=ym+b;
curcolor:=GetColor(xm,ym);
MoveMouseSmooth(xm,ym);
wait(5+random(5));
if(IsTextAt2(9,9,'Chop',100))then
begin
if(SimilarColors(curcolor,refrencecol,tol2))and(oc 1=false)then
begin
orecolor1:=curcolor;
oc1:=true;
end;
if(SimilarColors(curcolor,refrencecol,tol2))and
(not(curcolor=orecolor1))and(oc2=false)then
begin
orecolor2:=curcolor;
oc2:=true;
end;
if(SimilarColors(curcolor,refrencecol,tol2))and
(not(curcolor=orecolor1))and
(not(curcolor=orecolor2))and(oc3=false)then
begin
orecolor3:=curcolor;
oc3:=true;
end;
end;
if(not(IsTextAt2(9,9,'Chop',100)))then
begin
c:=c+1;
xm:=x;
ym:=y
MMouse(xm,ym,1,1);
wait(200+random(100)+random(100))
if(c=1)then a:=-1;
if(c=2)then begin a:=0;b:=-1;end;
if(c=3)then begin a:=0;b:=2;end;
end;
until((oc1)and(oc2)and(oc3))or(c>=4);
end;
end;
if(orecolor1>0)and(orecolor2>0)and(orecolor3>0)then
begin
result:=true;
writeln('TreeColors... '+inttostr(orecolor1)+' '+inttostr(orecolor2)+' '+inttostr(orecolor3));
end;
end;
end;
procedure FindBankColorIfNeeded;
var
c:integer;
begin
if(BankColor=0)then
begin
WriteLn('Finding bank color please Wait...');
while(BankColor=0)do
begin
c:=c+1;
if(BankColor=0)then
BankColor:=GetSymbolColor('bank');
if(c>20)then
CouldNotFindColors;
Wait(Random(50)+500);
end;
WriteLn('BankColor:'+IntToStr(BankColor))
end;
end;
//========================Map Walking procedures==============================\\
procedure WillowsToBank;
Begin
If FindMMcolor(BankColor) then
begin
Status('Going To Bank');
Mouse(x,y,3,3,true)
flag;
wait(500+random(250));
// Checkrandoms2;
end;
End;
procedure BankToWillows;
Begin
// Checkrandoms2;
If findMMcolor(BankColor) then
begin
Status('Going To Trees');
FindMMcolortol(10320746,30);
Mouse(x+50,y+23,0,0,true)
flag;
wait(500+random(500));
end;
end;
procedure ToBankers;
var
c,ax,ay:integer;
begin
while c<30 do
begin
c:=c+5;
if(FindMMColor(BankColor))then
begin
if(FindColorSpiralTolerance(ax,ay,195836,x-c,y-c,x+c,y+c,10))then
begin
x:=ax;
y:=ay;
MouseFindFlag(x,y-5,0,-2);
FlagAtColor(BankColor);
Wait(1000+Random(100));
Break;
end;
end;
end;
end;
procedure TakeOffaxe;
begin
GameTab(5);
Mouse(600, 315, 5, 5, true);
end;
//=======================procedures taken from squig.txt=======================\\
Function AxeBroken(c : integer) : boolean;
begin
if(c=0)then
begin
if(getcolor(686,173)<>2171233)then
GameTab(5);
if(getcolor(601,297)=5067346)then
result:=true
else
result:=false;
end
else
begin
if(getcolor(635,173)<>2500207)then
GameTab(4);
if(getcolor(594,221)=3885652)then
result:=true
else
result:=false;
end;
end;
procedure MouseC(x1, y1, click : integer);
begin
MoveMouseSmoothEx(x1,y1,1,6,15,20,20);
wait(random(150)+100);
if(click=1)then
begin
holdmouse(x,y,true);
wait(random(20)+15);
releasemouse(x,y,true);
end
else if(click=2)then
begin
holdmouse(x,y,false);
wait(random(20)+15);
releasemouse(x,y,false);
end;
end;
function SlotFilled(row, col : integer) : boolean;
var
a1, b1, a2, b2, c, d, e : integer;
begin
result:=false;
case row of
1 : a1:=215;
2 : a1:=250;
3 : a1:=285;
4 : a1:=325;
5 : a1:=360;
6 : a1:=395;
7 : a1:=430;
end;
case col of
1 : b1:=570;
2 : b1:=610;
3 : b1:=655;
4 : b1:=696;
end;
a2:=a1+30;
b2:=b1+35;
if(getcolor(633,172)<>2500207)and(istextat2(185,36,'The Bank',100)=false)then
GameTab(4);
c:=b1;
d:=a1;
e:=0;
repeat
if(getcolor(c,d)<>3885652)and(getcolor(c,d)<>2370094)
and(getcolor(c,d)<>2699832)and(getcolor(c,d)<>1713453)
and(getcolor(c,d)<>3490379)and(getcolor(c,d)<>3095106)
and(getcolor(c,d)<>5531511)and(getcolor(c,d)<>8167865)
and(getcolor(c,d)<>6917802)and(getcolor(c,d)<>3951188)
and(getcolor(c,d)<>2461584)and(getcolor(c,d)<>2329485)
and(getcolor(c,d)<>2328713)and(getcolor(c,d)<>2109231)
and(getcolor(c,d)<>2327943)and(getcolor(c,d)<>4543586)
and(getcolor(c,d)<>1598565)and(getcolor(c,d)<>6505283)
and(getcolor(c,d)<>1796458)and(getcolor(c,d)<>1085328)
and(getcolor(c,d)<>1929843)and(getcolor(c,d)<>1383200)
and(getcolor(c,d)<>1798257)and(getcolor(c,d)<>1797229)
and(getcolor(c,d)<>1995636)and(getcolor(c,d)<>1997692)
and(getcolor(c,d)<>2130563)and(getcolor(c,d)<>2129535)
and(getcolor(c,d)<>1997692)and(getcolor(c,d)<>1996664)
and(getcolor(c,d)<>1974562)and(getcolor(c,d)<>3094847)
and(getcolor(c,d)<>3687501)and(getcolor(c,d)<>4345174)then
result:=true;
if(d<>a2)and(c>=b2)then
begin
d:=d+random(2)+1;
c:=b1;
end;
if(c<b2)then
c:=c+3;
e:=e+1;
if(e=30)then
begin
wait(1);
e:=0;
end;
until((c>=b2)and(d>=a2))or(result=true);
end;
procedure FindRowCol(var row, col : integer);
var
a, b : integer;
begin
case row of
1 : a:=230;
2 : a:=260;
3 : a:=300;
4 : a:=335;
5 : a:=370;
6 : a:=405;
7 : a:=440;
end;
case col of
1 : b:=580;
2 : b:=625;
3 : b:=665;
4 : b:=710;
end;
row:=a;
col:=b;
end;
procedure DropItem (row, col : integer);
var
b1, a : integer;
begin
if(getcolor(633,172)<>2500207)then
GameTab(4);
if(Slotfilled(row,col)=false)then
exit;
Findrowcol(row,col);
MouseC(col+random(5),row+random(5),2);
wait(random(500)+500);
if(findbitmaptolerancein(DropText,a,b1,545,190,750 ,480,100))or(findbitmaptolerancein(DropTextb,a,b1, 545,190,750,480,100))then
begin
MouseC(random(20)+a,b1+random(3),1);
wait(random(200)+300);
end
else
GameTab(4);
end;
procedure TakeOffSword;
begin
if(getcolor(685,173)<>2434414)then
GameTab(5);
wait(random(300)+300);
MouseC(random(10)+580,random(10)+300,1);
end;
procedure FindHead(var axez : integer; c, e : integer);
var
a, b, d, x1, y1, x2, y2, a1, b1 : integer;
mes : string;
begin
x1:=645;
y1:=75;
x2:=650;
y2:=85;
d:=0;
if(e=0)then
mes:='Take Gl'
else
mes:='Take Gl';
repeat
wait(10);
a:=650;
b:=85;
if(findcolorspiral(a,b,395004,x1,y1,x2,y2))then
begin
x1:=645;
y1:=75;
x2:=650;
y2:=85;
wait(random(200)+300);
Mouse(a,b,2,2,true);
wait(random(200)+300);
Flag;
Flag;
Flag;
Flag;
repeat
d:=d+1;
a1:=230;
b1:=145;
repeat
MoveMouseSmoothEx(a1,b1,1,6,15,20,20);
a1:=a1+random(3);
b1:=b1+random(3);
wait(random(3)+3);
until(b1>195)or(a1>295)or(istextatex(7,7,mes,100,UpChars,False,True,0 ,1,-1));
Mouse(267,179, 1, 1, true);
wait(random(200)+300);
begin
if(c=0)and(slotfilled(1,1))then
DropItem(1,1);
wait(random(300)+300);
if(slotfilled(1,2))then
DropItem(1,2);
wait(random(300)+300);
if(c=0)then
TakeOffSword;
MouseC(a,b,1);
wait(random(300)+400);
Mouse(585,229, 1, 1, true);
wait(random(300)+300);
Mouse(625,229, 1, 1, true);
wait(random(200)+300);
if(c=0)then
Mouse(585,229, 1, 1, true);
exit;
end;
until(d=25);
d:=0;
end;
x1:=x1-2;
y1:=y1-2;
x2:=x2+3;
y2:=y2+3;
if(x1<615)then
begin
axeZ:=0;
exit;
end;
until(findcolor(a,b,241,615,55,675,110)=false);
end;
function AxeFound(c : integer) : boolean;
var
look : boolean;
ab : integer;
begin
look:=false;
ab:=1;
result:=true;
if(c=0)then
begin
if(getcolor(682,173)<>2434414)then
GameTab(5);
if(getcolor(598,295)=5067346)then
look:=true;;
end
else
begin
if(getcolor(630,172)<>2171233)then
GameTab(4);
if(getcolor(591,220)=4345174)then
look:=true;
end;
if(look=true)then
begin
result:=true;
FindHead(ab,c,0);
if(ab=0)then
result:=false;
end;
end;
procedure LoadInventoryPics;
begin
droptext := BitmapFromString(28, 14, 'z78DA7373C30E0C0619C0' +
'74DBE0742D2E570D36D70E5777BA119D9EDD484CF9F8D553E E4EE' +
'AFA9D549F52921E46DD39B4DC4949DAA3241F91EA86C156E6 0CFE' +
'3A71D49DB47627007188F354');
droptextb:= BitmapFromString(28, 7, 'z78DA7373737333307003' +
'93C8C00D87F840013712DD892C8EDF2FC4AB24463DE5EEA4A EDF4' +
'9F5A91B05E961D49D43CB9D94A43D4AF211316E000009B6FC 79');
end;
//=======================procedure taken from rsci.txt=======================\\
function CheckEnt: Boolean;
var
x, y: Integer;
begin
if(istextat2(9,9,'Chop',100))and
((FindColorTolerance(x, y, 57311, 80, 5, 160, 25, 10))or
(FindColorTolerance(x, y, 118478, 80, 5, 160, 25, 10))or
(FindColorTolerance(x, y, 53199, 80, 5, 160, 25, 10)))then
Result := true;
end;
//==========================Random Event procedures===========================\\
procedure RunAway;
begin
SetRun(true);
Mouse(648,35,5,5,true);
Flag;
Wait(5000+Random(2000));
Mouse(648,135,5,5,true);
Flag;
end;
procedure TerminateIfLost;
begin
if(LoggedIn)then
begin
if(not(FindMMColor(BankColor)))then
begin
IAmLostCount:=IAmLostCount+1;
if(IAmLostCount>10)then
begin
WriteLn('Lost!!!');
TerminateScript;
end;
end else
IAmLostCount:=0;
end;
end;
procedure chklvlup;
begin
if(getcolor(285,441)=16711680)then
begin
repeat
mouse(285,441,5,5,true);
wait(400+random(50));
until(not((getcolor(285,441)=16711680)or(getcolor( 285,441)=16777215)))
end;
end;
procedure chkdoctor;
begin
if(getcolor(308,445)=16711680)then
begin
repeat
if((findcolorspiral(x,y,16711680,152,433,406,459)) or(findcolorspiral(x,y,16777215,152,433,406,459))) then
mouse(x,x,3,3,true);
wait(400+random(50));
until(not((findcolorspiral(x,y,16711680,152,433,40 6,459))or(findcolorspiral(x,y,16777215,152,433,406 ,459))))
end;
end;
procedure FindRandoms;
begin
if(LogsOut)then
LogOutEvery(2+Random(2),10+Random(5));
if(Chats)then
RandomChatEvery(5+Random(5));
if(Rotates)then
RotateEvery(20+random(10));
LeaveScreenEvery(5+random(5));
FindNormalRandoms;
chkdoctor;
FindDoctor;
FindBox;
AxeFound(equipit);
chklvlup;
if((FindFight)or(CheckEnt))then
RunAway;
end;
//=========================Main Screen procedures=============================\\
procedure Bank;
begin
FindBox;
TotalOres:=TotalOres+(CountItemBmpTol(Ore,50));
if(NoPick=true)and(EquipPick=true)then
begin
GameTab(5);
Mouse(593,303,r,r,true);
Wait(Random(50)+1000);
GameTab(4);
end;
OpenBank;
if(BankScreen)then
begin
if(NoPick=true)then
begin
ClickAllItemsColorWait('All',65536,1000+Random(100 ));
Withdraw(1,1,1);
end else
begin
if(EquipPick=false)then
Deposit(2,28,2);
if(EquipPick=true)then
ClickAllItemsColorWait('All',65536,1000+Random(100 ));
end;
CloseWindow;
if(NoPick=true)and(EquipPick=true)then
begin
FindPickHeadColor;
ClickItemColor(hc1,true);
end;
Banks:=Banks+1;
ProgressReport;
NoPick:=false
end;
end;
procedure waitwhilecutting;
var SysTime:integer;
begin
MarkTime(SysTime);
repeat
wait(200+random(50));
findrandoms;
if(TimeFromMark(SysTime)>=85000+random(100))then
begin
MarkTime(SysTime);
getmousepos(x,y);
Mouse(x,y,r,r,true);
end;
until((not(istextat2(9,9,'Chop',100)))or(Inventory Full));
end;
procedure Chop;
begin
SetRandomOreColor;
if(FindObj('Chop',OreColor,5))then
begin
if(not(CheckEnt))then
begin
// if(TimeFromMark(choptime)>=500+random(100))then
begin
Mouse(x,y,r,r,true);
flag;
// MarkTime(choptime);
end;
if(FlagPresent)then
begin
Flag;
Wait(500+Random(500));
end;
waitwhilecutting;
end;
end;
end;
//======================================Main Line=============================\\
begin
SetupSSI;
Setup;
SetColors;
LoadInventoryPics;
FindBankColorIfNeeded;
SetRun(true);
if(true)then
begin
repeat
FindRandoms;
BankToWillows;
FindTreeColorsifneeded(3102800,5,45);
repeat
FindRandoms;
Chop;
NoPick:=false;
until(InventoryFull)or(NoPick=true)
WillowsToBank;
TerminateIfLost;
Bank;
until(false)
end;
end.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.