*cough*it the autoupdater might not work because of the old script*cough* so i may just post it here.
SCAR Code:
program XcanSmelterCannonBallMaker;
{.include SRL/SRL.Scar}
{.include SRL/SRL/Misc/Trade.Scar}
{
__
__ __ (_ \
\ \/ /___ __ _ _ __ \/ ___
\ // __/ _` | `_ \ / __|
/ \ (_| (_| | | | | \__ \
/_/\_\___\__,_|_| |_| |___/
__ _ _
/ _\_ __ ___ ___| | |_ ___ _ __
\ \| '_ ` _ \ / _ \ | __/ _ \ '__|
_\ \ | | | | | __/ | || __/ |
\__/_| |_| |_|\___|_|\__\___|_|
____ _ ___
/\ /\___ \ / |/ _ \
\ \ / / __) | | | (_) |
\ V / / __/ _| |\__, |
\_/ |_____(_)_| /_/
NAME : Xcan's Smelter V2.19
WRITER : XcanadamanX (Xcan)
CATEGORY : Smelter
AUTOCOLOR : No need
CONTACT : [email]rstevenson23@gmail.com[/email]
SRL REV. : 4
Scar REV. : 3.11
==========================================================================
Smelts And Banks All Bars In Al Kharid.
==========================================================================
Instructions.
==========================================================================
1. USE Runescape with Low Detail, Very Bright.
2. Set your Screen to 32 bit TRUE color.
3. Set Playernames and Passwords in DeclarePlayers.
4. Set NumberOfPlayers.
5. Position your chars at Al Kharid bank RIGHT bankslot.
6. Make sure your Players have ores/bars.
==========================================================================
Use anything you want in this script in your own personal scripts.
please credit me if you do this so no one thinks your stealing ;)
Valid Bars-> bronze,iron,steel,silver,gold,mith,addy,rune.
Valid Cannonball options-> or-ball smelts ores then makes cannonballs.
-> st-ball makes cannonballs from steel bars. }
Var
DTM,x,y,CactusColor,OreAmount,sbar,load,loads:integer;
rock1,rock2,mould,levels,DoorColor,TotalCballs,TotalBars:integer;
NoMould:boolean;
Const StartPlayer = 0; // Determines who will play first
MSpeed = 13; //speed of the mouse...higher number slower speed, lower number higher speed
BMouse = true; //BenMouse...true or false
MySRLID = ''; // Must be a string!
MySRLPassword = ''; // Must be a string!
RunDir = 's'; // RunDirection when you find a fight.
RunFar = True; //just leave this
{
====================================================================== }
VersionNumber = '2.19'; {
====================================================================== }
Procedure DeclarePlayers;
begin
HowManyPlayers:= 2; // Set Number of Players here.
NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
CurrentPlayer:= StartPlayer; // CurrentPlayer = Array Index
HowManyBooleans := 0;
Players[0].Name :=''; //username
Players[0].Pass :=''; //password
Players[0].Nick :=''; //3-4 consecutive letters of your user name(NOT First letter)
Players[0].Loc :='Bank'; //keep at bank
Players[0].Strings[0] :=''; //type of bar bronze,iron,steel,mith,addy,rune,gold,silver,or-ball(ore ot cball),st-ball(steel to cball)
Players[0].Pin :=; //Pin number(not a string!!)
Players[0].integers[0]:=10; //how many loads
Players[0].integers[1]:=0; //LEAVE THESE
Players[0].integers[2]:=0; //LEAVE THESE
Players[0].Active :=True; //are you going to use this player
{ Players[1].Name :=''; //username
Players[1].Pass :=''; //password
Players[1].Nick :=''; //3-4 consecutive letters of your user name(NOT First letter)
Players[1].Loc :='Bank'; //keep at bank
Players[1].String1 :=''; //type of bar bronze,iron,steel,mith,addy,rune,gold,silver,or-ball(ore ot cball),st-ball(steel to cball)
Players[1].Skill :='smithing'; //skill to choose when you get a genie
Players[1].Pin :=0; //Pin number(not a string!!)
Players[1].integer1:=0; //how many loads
Players[1].Active :=True;}
LoadPlayerArray;
end;
Procedure LoadDtms;
Begin
DTM := DTMFromString('78DA63EC67626008624001EDEDD10C2250F67' +
'F2060EC06AAF14655F3E70F13580D2394CFD80E54E345404D3F61' +
'7300DB730F15');
case Lowercase(Players[CurrentPlayer].Strings[0]) of
'bronze':
begin
rock1 := DTMFromString('78DA639CC0C0C0C0C3C8800C7A9B9B1944803' +
'448F43F10304E063118D000231209A4E700090E46FC6ABA808424' +
'01357540828F809AA9404204BF1A0097F90A64');
rock2 := DTMFromString('78DA634C64606038C080021E345A328800694' +
'620FE0F048CB940C60E0634C0884402E954207182809A68207196' +
'801A7F207118BF1A00ACC90B66');
OreAmount:=28;
end;
'iron':
begin
rock1 := DTMFromString('78DA63DCCFC0C0E0CB80027CF59519B880342' +
'310FF0702C60D404618031A60442281F40E20114D40CD3120114A' +
'40CD6920E1855F0D00E4FC0A09');
rock2:=0
OreAmount:=28;
end;
'steel','or-ball':
begin
rock1 := DTMFromString('78DA63DCCFC0C0E0CB80027CF59519B880342' +
'310FF0702C60D404618031A60442281F40E20114D40CD3120114A' +
'40CD6920E1855F0D00E4FC0A09');
rock2 := DTMFromString('78DA63EC676060F06140012626CA0C5C409A1' +
'188FF0301E374202394010D30229140BA11488411503307487811' +
'50D30D24A2F1AB0100797E090A');
sbar := DTMFromString('78DA63946660601062400113DBDB19B880342' +
'310FF0702460520839B010D302291401A648E0C01353C40429880' +
'1A652021825F0D00B24D0699');
mould := DTMFromString('78DA63E4656060E066400139A9A90C5C409A1' +
'188FF0301A3389021C58006189148202D0B24D809A8E144E2E052' +
'036288E057030053D005D7');
OreAmount:=27;
end;
'st-ball':
begin
sbar := DTMFromString('78DA63946660601062400113DBDB19B880342' +
'310FF0702460520839B010D302291401A648E0C01353C40429880' +
'1A652021825F0D00B24D0699');
rock1 := DTMFromString('78DA63946660601062400113DBDB19B880342' +
'310FF0702460520839B010D302291401A648E0C01353C40429880' +
'1A652021825F0D00B24D0699');
rock2 := 0
mould := DTMFromString('78DA63E4656060E066400139A9A90C5C409A1' +
'188FF0301A3389021C58006189148202D0B24D809A8E144E2E052' +
'036288E057030053D005D7');
end;
'silver':
begin
rock1 := DTMFromString('78DA6314636060106140011B36EC62E002D28' +
'C40FC1F0818F9810C050634C0884402690E202145408D0C116A14' +
'8184007E3500FB290711');
rock2:=0
OreAmount:=28;
end;
'gold':
begin
rock1 := DTMFromString('78DA631463606010614001F7B749317001694' +
'620FE0F048CFC408602031A604422813407909022A04686083520' +
'7B84F0AB0100B99E06A7');
rock2:=0
OreAmount:=28;
end;
'mith':
begin
rock1 := DTMFromString('78DA631462606010644001BEFEC50C5C409A1' +
'188FF0301A33C90C1CD8006189148202D0924C408A8E103123204' +
'D4B0030951FC6A004D1805E6');
rock2 := DTMFromString('78DA63EC676060F06140012626CA0C5C409A1' +
'188FF0301E374202394010D30229140BA11488411503307487811' +
'50D30D24A2F1AB0100797E090A');
OreAmount:=25;
end;
'addy':
begin
rock1 := DTMFromString('78DA634C646060F06340013E09BE0C22409A1' +
'188FF0301632E90E1CE8006189148201D0324A209A8F1C7B40B43' +
'4D3A9008C5AF06005E91088B');
rock2 := DTMFromString('78DA63EC676060F06140012626CA0C5C409A1' +
'188FF0301E374202394010D30229140BA11488411503307487811' +
'50D30D24A2F1AB0100797E090A');
OreAmount:=28;
end;
'rune':
begin
rock1 := DTMFromString('78DA631463606010624001FE19250C5C409A1' +
'188FF0301A32090A1C08006189148200DD22049408D0C909022A0' +
'46114808E057030066CC0623');
rock2 := DTMFromString('78DA63EC676060F06140012626CA0C5C409A1' +
'188FF0301E374202394010D30229140BA11488411503307487811' +
'50D30D24A2F1AB0100797E090A');
OreAmount:=27;
end;
end;
end;
Procedure CheckVersion;
var version,version1,script:string;
Afile:integer;
begin
Writeln('Checking Version...')
Version1:=GetPage('http://www.xcanadamanx.phpnet.us/Version.txt')
Version:=Left(version1,4)
if not(VersionNumber=Version) then
begin
Writeln('You Do Not Have the Latest Version...Updating')
Script:=GetPage('http://www.xcanadamanx.phpnet.us/Smelter'+version+'.txt')
AFile:=RewriteFile(AppPath+'\Scripts\Xcan''s Smelter'+version+'-Pub.scar',false)
if WriteFileString(AFile,Script) then
begin
Writeln('V'+version+' is Saved in Scar''s Scripts Folder')
Writeln('Terminating Script')
TerminateScript;
end else
writeln('Couldn''t save script...Go to WWW.SRL-Forums.com')
end else
writeln('You Have The Latest Version')
end;
function FindCactusColor: Integer;
var
GenericColor, a, b, TestColor, Red, Green, Blue : integer;
begin
GenericColor := 3698770;
Flag;
a := MMX1;
b := MMY1;
repeat
b := b + 1;
repeat;
a := a + 1;
if FindColorTolerance(x, y, GenericColor, a, b, MMX2, MMY2, 50) then
begin
if a = MMX1 + 1 then b := y;
a := x;
TestColor := GetColor(x, y);
red := (TestColor mod 256);
green := ((TestColor / 256) mod 256);
blue := ((TestColor / 256) / 256);
if Green - Red >= 24 then if Green - Red <= 60 then
if Red - Blue >= 1 then if Red - Blue <= 33 then
if Green - Blue >= 40 then if Green - Blue <= 78 then
begin
Result := TestColor;
CactusColor := TestColor;
WriteLn('Cactus Color = ' +
IntToStr(TestColor));
Exit;
end;
end else a := MMX2;
until a >= MMX2;
a := MMX1;
until b >= MMY2;
WriteLn('Could not find Cactus Color!');
Result := 0;
end;
Function InPin2(pin:integer):Boolean;
var pinstr:string;
star,i,x,y:integer;
tpt1,tpt2:array[0..3] of tpoint;
begin
if (PinScreen) then
begin
star := BitmapFromString2(False, 'a81C2B78DA4D8B3912C0200C0' +
'3BF247C01A5C984FF3F29166970B1A359C90090A3007F0A61493A' +
'8DDBCBACF4328CE66C7C07BDF0A9A7928B6DF4C63C4FA15E684B6' +
'C1AD47EEE3AE036373F9CC');
tpt1[0].x:=428; tpt1[0].y:=31;
tpt2[0].x:=442; tpt2[0].y:=48;
tpt1[1].x:=444; tpt1[1].y:=31;
tpt2[1].x:=458; tpt2[1].y:=48;
tpt1[2].x:=460; tpt1[2].y:=31;
tpt2[2].x:=474; tpt2[2].y:=48;
tpt1[3].x:=476; tpt1[3].y:=31;
tpt2[3].x:=490; tpt2[3].y:=48;
PinStr:=(inttostr(pin))
mmouse(322,203,20,20);
for i:=1 to 4 do
begin
wait(100+random(100));
ClickText(pinstr[i], upchars, 1, 1, 512, 336, True);
wait(100+random(100))
mmouse(322,203,20,20);
repeat
wait(20)
if i=4 then
begin
repeat
wait(20)
until bankscreen
break;
end;
until FindBitmaptoleranceIn(star,x,y,tpt1[i-1].x,tpt1[i-1].y,tpt2[i-1].x,tpt2[i-1].y,20)
end;
end;
if (bankscreen) then result:=true;
freebitmap(star)
end;
function XRadialWalk(TheColor: Integer; StartRadial, EndRadial: Integer; Radius:
Integer; Xmod, Ymod, Xoff, Yoff: Integer): Boolean;
var
mx, my: Integer;
begin
if (StartRadial = EndRadial) then
begin
WriteLn('WARNING: Using LinearRalk, StarRadial, and EndRadial are the same');
if LinearRoadWalk(TheColor, StartRadial, Radius, XMod, YMod) then
Result := True;
end else
if (radialwalkex(mx, my, 648, 83, thecolor, 0, startradial, endradial, radius))
then
begin
MouseFindFlag(MX+Xoff, MY+Yoff, Xmod, Ymod);
Result := True;
end;
end;
function XRadialFindObj(var Wx,Wy:integer; TheColor: Integer; StartRadial, EndRadial: Integer; Radius:
Integer; Xoff, Yoff: Integer): Boolean;
var
mx, my: Integer;
begin
if (radialwalkex(mx, my, 648, 83, thecolor, 0, startradial, endradial, radius))
then
begin
WX:= (Mx + Xoff)
WY:= (My + Yoff)
Result := True;
end;
end;
Function Level:boolean;
begin
Result:=(GetColor(213, 386)=8388608)
if (result) then
begin
clicktocontinue;
wait(2000)
clicktocontinue;
WriteLn('******** LEVEL UP ********');
WriteFileString(TheFile, '******** LEVEL UP ********' + Chr(13))
levels:=levels+1;
ReportVars[4]:=ReportVars[4]+1;
end;
end;
Procedure FindMould;
Begin
if FindDtm(Mould,x,y,MIX1,MIY1,MIX2,MIY2) then
NoMould:=False
end;
Function FindT:boolean;
Begin
repeat
if not Loggedin then Exit;
wait(100+random(200));
Until (FindText(x, y, 'Enter amount:', UpChars, MCX1, MCY1, MCX2, MCY2));
result:=true
End;
Procedure Logout2;
var i:integer;
text:string;
Begin
GameTab(10)
i:=random(4)
case i of
0:text:='lick'
1:text:='ere'
2:text:='to'
3:text:='ogo'
end;
ClickText(text,upchars,MiX1,MIY1,MIX2,MIY2,true)
repeat
wait(500)
until not(Loggedin)
end;
Procedure WithdrawOres(option1,option2:string;amount1,amount2,rock1,rock2:integer);
Begin
if (not(Loggedin)) then exit;
if rock2=0 then
begin
if FindDTM(rock1,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
Mouse(x,y,3,3,false)
repeat
wait(10)
Until(ChooseOption('All'))
end else
Begin
Writeln('Didnt Find Ores...Logging Out')
closebank;
closebank;
Logout2;
exit;
end;
end else
begin
if FindDTM(rock1,x,y,MSX1,MSY1,MSX2,MSY2) then
Begin
repeat
Mouse(x,y,3,3,false)
wait(10)
Until(ChooseOption(option1))
if option1='X' then
begin
if FindT then
TypeSend(inttostr(amount1))
end;
If FindDTM(Rock2,x,y,MSX1,MSY1,MSX2,MSY2) then
Begin
repeat
Mouse(x,y,3,3,false)
wait(10)
Until(ChooseOption(option2))
if option2='X' then
begin
if FindT then
TypeSend(inttostr(amount2))
end;
end else
Begin
Writeln('Didnt Find Ores...Logging Out')
closebank;
closebank;
Logout2;
NextPlayer(false)
exit;
end;
end else
Begin
Writeln('Didnt Find Ores...Logging Out')
closebank;
closebank;
Logout2;
NextPlayer(false)
exit;
end;
if (NoMould) and ((Players[CurrentPlayer].strings[0]='or-ball') or
(Players[CurrentPlayer].strings[0]='st-ball')) then
if FindDtm(mould,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
Mouse(x,y,4,4,true)
NoMould:=False;
end else
begin
Writeln('Didnt Find Mould...Logging Out')
closebank;
closebank;
Logout2;
NextPlayer(false)
exit;
end;
end;
end;
Procedure InBank;
Begin
if (not(Loggedin)) then exit;
if (not(bankscreen)) then exit;
Case lowercase(Players[CurrentPlayer].Strings[0]) of
'bronze':WithdrawOres('X','All',14,14,rock1,rock2)
'iron','silver','gold':WithdrawOres('All','',0,0,rock1,rock2)
'steel','or-ball':WithdrawOres('X','X',9,18,rock1,rock2)
'st-ball':WithdrawOres('All','',0,0,rock1,rock2)
'mith':WithdrawOres('X','X',5,20,rock1,rock2)
'addy':WithdrawOres('X','All',4,0,rock1,rock2)
'rune':WithdrawOres('X','X',3,24,rock1,rock2)
End;
End;
Function Amount1:boolean;
begin
if (FindText(x,y,'Enter amount:',UpChars,MCX1,MCY1,MCX2,MCY2)=true) then
result:=true
end;
function CountItemDtm(dtm: Integer): Integer;
var
i, x, y: Integer;
TB: Tbox;
begin
GameTab(4);
for i := 1 to 28 do
begin
TB := InvBox(i);
if ExistsItem(i) then
if FindDtm(DTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
Inc(Result);
end;
end;
Function OreCount:integer;
Begin
result:=CountItemDtm(rock1)
end;
Function BarCount:integer;
Begin
result:=CountItemDtm(Dtm)
end;
{Function Door(var x,y:integer):boolean;
begin
if (FindObjMultiDistTime(x,y,'se D','e Doo','Clo',1659242,1261909,538442,20,45,2))then
Result := True;
end;}
Function Door(colors:array of integer):boolean;
var i:integer;
Begin
For i:=0 to (length(colors)-1) do
begin
if FindColoredAreaTolerance(x,y,colors[i], 175, 43, 379, 252, 20, 10) then
begin
MMouse(x,y,0,0)
wait(10)
If IsUpTextMulti('Door','oor','Doo') then
begin
result:=True
break;
end;
end;
end;
end;
procedure OpenDoor;
var mark:integer;
begin
if (not(Loggedin)) then exit;
Status('finding door...');
writeln('finding door');
fflag(0)
wait(100)
MarkTime(mark);
Mousespeed:=25+random(10)
if (Door([1659242,1261909,538442])) then
begin
wait(100)
If IsUpTextMulti('C','los','ose') then
writeln('door is open')
else
begin
if IsUpTextMulti('O','pen','Open') then
begin
getmousepos(x,y)
Mouse(x,y,0,0,true)
end;
end;
Mousespeed:=MSpeed;
end else
writeln('couldn''t find door')
end;
Procedure FindBank2;
var
bx, by: Integer;
WhichAngle: Extended;
Begin
wait(250)
if FindDtmRotated(DTM, bx, by, MMX1, MMY1, MMX2, MMY2, -2.0, 2.0, 0.5,
WhichAngle) then
Begin
Mouse(bx, by, 0, 0, True);
WriteLn('Found DTM');
Flag;
end else
begin
WriteLn('Didnt Find DTM...looking for symbol');
FindSymbol(x, y, 'bank');
Mouse(x, y, 2, 2, true);
Flag;
wait(500);
FindDtmRotated(DTM, x, y, MMX1, MMY1, MMX2, MMY2, -1.0, 2.0, 0.1,
WhichAngle)
Mouse(x, y, 0, 0, true);
Flag;
end;
end;
Function FindBankBooth(Colors:array of integer):boolean;
var i:integer;
Begin
For i:=0 to (length(colors)-1) do
begin
if FindColoredAreaTolerance(x,y,colors[i], 240, 76, 340, 221, 40, 10) then
begin
MMouse(x,y,0,0)
wait(10)
If IsUpTextMulti('ank','booth','ooth') then
begin
result:=True
break;
end;
end;
end;
end;
procedure MyOpenBank;
begin
If (not(Loggedin)) then exit;
Status('Opening bank...');
Flag;
wait(500)
if not (BankScreen) then
//Lowestangle;
repeat
// if (FindObjMultiDist(x,y,'ank','Bank','Ban',5988448,3618620,2114903,15,60)) then
if FindBankBooth([605778,5988448,604492,12097,7763321]) then
begin
getmousepos(x,y)
Wait(250);
Mouse(x,y,0,0,false);
if (ChooseOption('quickly')) then
begin
Flag;
repeat
Wait(1000);
InPin2(Players[CurrentPlayer].Pin);
until (BankScreen);
end;
end;
until (BankScreen)
end;
Function BarScreen:boolean;
begin
result:=(GetColor(37, 373)=10264383)
end;
Procedure SortTPAFrom(Var a: Array Of TPoint; From: TPoint); //creds to Wizzup?
{ Sort's all points in a TPointArray.
First Value will be closest to From, Last Value most far away.}
Var
I, C: Integer;
Begin
For I := 0 To Length(a) - 2 Do
Begin
If Distance(a[i].x, a[i].y, from.x, from.y) > Distance(a[i + 1].x, a[i + 1].y, from.x, from.y) Then
Begin
C := I;
Repeat
{WriteLn(IntToStr(c) + ' (' + IntToStr(a[c].x) + ', ' + IntToStr(a[c].y) + ') <-> ' +
' (' + IntToStr(a[c + 1].x) + ', ' + IntToStr(a[c + 1].y) + ')');}
tSwap(a[c], a[c + 1]);
if c < 1 then
break;
c := c - 1;
Until Distance(a[c].x, a[c].y, from.x, from.y) < Distance(a[c + 1].x, a[c + 1].y, from.x, from.y)
//writeln('next');
End;
End
End;
Function FindFurnace2:boolean;
var i,x,y,tempmousespeed:integer;
points:array of tpoint;
point:tpoint;
Begin
wait(250);
point.x:=MSCX;
point.y:=MSCY
colortolerancespeed(2)
FindColorsTolerance(Points,1913771,MSx1,MSy1,MSx2,MSY2,10)
writeln(inttostr(length(points)))
SortTPAFrom(points,point)
Mousespeed:=25+random(10)
wait(250)
For i:=0 to (length(Points)-1) do
begin
wait(2)
If FindColoredAreaTolerance(x,y,1913771,points[i].x-30,points[1].y-30,points[i].x+30,
points[1].y+30,80,10) then
begin
MMouse(x,y,4,4)
wait(100+random(100))
If IsUpTextMulti('melt','urn','ace') then
Begin
GetMousePos(x,y)
Mouse(x,y,0,0,true)
writeln('found furn')
result:=True
break;
end;
end;
end;
Mousespeed:=MSpeed;
colortolerancespeed(1)
end;
Function FindFurnace(colors:array of integer):boolean;
var i:integer;
Begin
wait(250);
for i:=0 to (length(colors)-1) do
begin
if FindColoredAreaTolerance(x,y,colors[i], 136, 0, MMX2, MMY2, 2000, 20) then
begin
MMouse(x,y,0,0)
wait(250)
If IsUpTextMulti('melt','urn','ace') then
begin
mouse(x,y,0,0,true)
writeln('found furn')
result:=True
break;
end;
end;
end;
end;
Procedure PickBar(spot,amount:integer);
var a,b,mymark:integer;
Begin
if (not(Loggedin)) then exit;
fflag(0)
marktime(mymark)
Repeat
if (not(Loggedin)) then Break;
wait(10)
until (FindFurnace2)
repeat
if (not(Loggedin)) then Break;
wait(10)
until (BarScreen)
if (not(Loggedin)) then exit;
if barscreen then writeln('found bar screen')
a:=((spot*50)+5)
b:=405
MMouse(a,b,4,4)
wait(100)
getmousepos(x,y)
Mouse(x,y,0,0,false)
if (amount = 5) then
begin
ChooseOption('5')
exit;
end;
if (amount = 10) then
begin
ChooseOption('10')
exit;
end;
ChooseOption('X')
FindT;
SendText(inttostr(amount)+Chr(13))
end;
Function FindFastRandoms: Boolean; // By WT-Fakawi.
Var
i: Integer;
Begin
For I := 1 To 14 Do
Begin
Case I Of
1: If FindDead Then
Result := True;
2: If FindMod Then
Result := True;
3: If FindMime Then
Result := True;
4: If FindMaze Then
Result := True;
5: If FindQuiz Then
Result := True;
6: If FindDemon Then
Result := True;
7: Begin
If NoGameTab Then
Begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
End;
End;
8: Begin
If InBlack Then
Begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
End;
End;
9 : If RC Then
Result := True;
10 : If FindFight Then
Begin
Result := True;
RunTo(RunDir, RunFar);
End;
11: If FindTalk Then
Result := True;
12: If HandleTrade Then
Result := True;
13: If Level then
Result := True;
//14: SaveToLog; next version probably if i get it working
// will save proggys and chat text
14: If FindDemon Then
Begin
result:=True;
SolveDemon;
End;
End;
Wait(1);
End;
End;
Function FindAll(num:integer):boolean;
var i:integer;
Begin
if (not(Loggedin)) then exit;
writeln('waiting to be done')
While (OreCount > num) do
begin
case i+1 of
1: begin
If FindFastRandoms then
begin
Result:=True;
break;
end;
end;
2: Begin
If FindNormalRandoms then
begin
Result:= True;
break;
end;
end;
end;
wait(1)
//SaveToLog;
i:=i+1;
if i>2 then i:=0
end;
end;
Function FindAll2(num:integer):boolean;
var i:integer;
Begin
if (not(Loggedin)) then exit;
writeln('waiting to be done')
While (BarCount > num) do
begin
case i+1 of
1: begin
If FindFastRandoms then
begin
Result:=True;
break;
end;
end;
2: Begin
If FindNormalRandoms then
begin
Result:= True;
break;
end;
end;
end;
if (not(loggedin)) then exit;
wait(1)
//SaveToLog;
i:=i+1;
if i>2 then i:=0
end;
end;
Function FindAll3:boolean;
var i,mymark:integer;
Begin
if (not(Loggedin)) then exit;
writeln('waiting for flag to disappear')
MarkTime(mymark)
While (FlagDistance>8) do
begin
case i+1 of
1: begin
If FindFastRandoms then
begin
Result:=True;
exit;
end;
end;
2: Begin
If FindNormalRandoms then
begin
Result:= True;
exit;
end;
end;
3: If TimeFromMark(MyMark)>=8000 then exit;
end;
if (not(loggedin)) then exit;
wait(5)
//SaveToLog;
i:=i+1;
if i>3 then i:=0
end;
end;
Procedure InFurnace;
Begin
if (not(loggedin)) then exit;
Case Lowercase(Players[currentplayer].strings[0]) of
'bronze':PickBar(1,14);
'iron':PickBar(3,28);
'silver':PickBar(4,28)
'gold':PickBar(6,28)
'steel':PickBar(5,10)
'mith':PickBar(7,5);
'addy':PickBar(8,5);
'rune':PickBar(9,5);
End;
if (FindAll(0)) then
begin
Infurnace;
end;
wait(250)
Players[currentplayer].integers[1]:=Players[currentplayer].integers[1]+BarCount
ReportVars[1]:=ReportVars[1]+Barcount;
TotalBars:=TotalBars+Barcount;
Case lowercase(Players[currentplayer].strings[0]) of
'bronze':ReportVars[10]:=ReportVars[10]+14;
'iron':ReportVars[11]:=ReportVars[11]+BarCount;
'silver':ReportVars[12]:=ReportVars[12]+28;
'steel':ReportVars[13]:=ReportVars[13]+9;
'gold':ReportVars[14]:=ReportVars[14]+28;
'mith':ReportVars[15]:=ReportVars[15]+5;
'addy':ReportVars[16]:=ReportVars[16]+4;
'rune':ReportVars[17]:=ReportVars[17]+3;
end;
end;
Procedure InFurnaceCannon;
Begin
if (not(loggedin)) then exit;
Case Lowercase(Players[currentplayer].strings[0]) of
'or-ball':Pickbar(5,9)
End;
if (FindAll(0)) then
begin
InFurnaceCannon;
end;
ReportVars[1]:=ReportVars[1]+Barcount;
TotalBars:=TotalBars+Barcount;
Players[currentplayer].integers[1]:=Players[currentplayer].integers[1]+BarCount
ReportVars[13]:=ReportVars[13]+Barcount;
end;
Procedure MakeCannonBalls;
Begin
if (not(loggedin)) then exit;
if FindDtm(mould,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
if FindDtm(sbar,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
flag;
Mouse(x,y,4,4,true)
repeat
FindFurnace2;
repeat
wait(10)
until (barscreen)
until (barscreen)
repeat
Mouse(254,395,4,4,false)
wait(100)
until ChooseOption('All')
if (FindAll2(1)) then
begin
MakeCannonBalls;
end;
end else
begin
Writeln('Didnt Find Steel Bars...Logging Out')
logout2
nextplayer(false)
end;
end else
begin
Writeln('Didnt Find Mould...Logging Out')
NoMould:=True;
exit;
end;
end;
function FindDoorColor:integer; //creds to boreas!
var Color,tmpx,tmpy,MinOfRange:integer;
Length206,Length217,Length233,Length241:integer;
Array206,Array217,Array233,Array241:array of tpoint;
RangeOfOthers206,RangeOfOthers217,RangeOfOthers233,RangeOfOthers241:integer;
tmpbool:boolean;
begin
for Color:=200 to 254 do
begin
if not(((Color=206)or(Color=217)or(Color=233)or(Color=241))) then
begin
if FindColor(tmpx,tmpy,Color,mmx1,mmy1,mmx2,mmy2) then
begin
result:=Color;
tmpbool:=true;
end;
end;
if tmpbool then break;
end;
if not(tmpbool) then
begin
//writeln('its a drop dot color');
FindColorsTolerance(Array206,206,mmx1,mmy1,mmx2,mmy2,0);
Length206:=getarraylength(Array206);
FindColorsTolerance(Array217,217,mmx1,mmy1,mmx2,mmy2,0);
Length217:=getarraylength(Array217);
FindColorsTolerance(Array233,233,mmx1,mmy1,mmx2,mmy2,0);
Length233:=getarraylength(Array233);
FindColorsTolerance(Array241,241,mmx1,mmy1,mmx2,mmy2,0);
Length241:=getarraylength(Array241);
RangeOfOthers206:=max(Length233,max(Length217,Length241))-min(Length233,min(Length217,Length241));
RangeOfOthers217:=max(Length233,max(Length206,Length241))-min(Length233,min(Length206,Length241));
RangeOfOthers233:=max(Length206,max(Length217,Length241))-min(Length206,min(Length217,Length241));
RangeOfOthers241:=max(Length233,max(Length217,Length206))-min(Length233,min(Length217,Length206));
MinOfRange:=min(RangeOfOthers206,min(RangeOfOthers217,min(RangeOfOthers233,RangeOfOthers241)));
case MinOfRange of
RangeOfOthers206: result:=206;
RangeOfOthers217: result:=217;
RangeOfOthers233: result:=233;
RangeOfOthers241: result:=241;
end;
end;
end;
Function FindMMFurnaceDoor:Boolean;
var mymark,doorcolor,x1,y1:integer;
found:boolean;
begin
DoorColor:=FindDoorColor;
writeln(inttostr(doorcolor))
writeln('Doing New Proc')
if doorcolor=0 then
begin
result:=false
end;
if XRadialFindObj(x,y,CactusColor,60,210,75,2,-20) then
begin
writeln('found cactus')
marktime(mymark)
X1:=X;
Y1:=Y;
repeat
Y1:=Y1-1;
wait(5)
if FindColor(x,y,doorcolor,X1,Y1,MMX2-20,y) then
begin
found:=true;
break;
end;
until (timefrommark(mymark)>3000)
if found then
begin
mouse(x-2,y+2,1,1,true)
result:=true
end else
result:=false;
end;
end;
Procedure ToFurn;
begin
if (not(loggedin)) then exit;
wait(500)
if (invcount < oreamount) then
begin
writeln('not enough ores...logging out')
logout2;
nextplayer(false);
exit;
end;
if XRadialWalk(CactusColor,90,180,60,1,-2,6,-2) then writeln('walking to cactus')
wait(10)
FFlag(0);
FindFastRandoms;
wait(500)
if (not(FindMMFurnaceDoor)) then
begin
writeln('couldn''t find with Xcan''s Proc')
if (XRadialWalk(CactusColor,60,210,75,1,-1,2,-20)) then
begin
end
else
begin
writeln('couldn''t find with RW')
if FindColor(x,y,cactuscolor,MMCX, MMCY, 722, 127) then
mouse(x,y,2,2,true)
else
begin
writeln('couldn''t find with FindColor...blind clicking')
mouse(698, 99,4,4,true)
end;
end;
end;
FindAll3;
fflag(0)
OpenDoor;
Mouse(648, 83-20, 2, 2, true)
Players[currentplayer].Loc:='Furnace'
end;
Procedure ToBank;
begin
if (not(loggedin)) then exit;
DoorColor:=FindDoorColor;
if RadialWalk(Doorcolor,200,170,40,0,0) then
begin
findall3;
fflag(0)
opendoor;
end;
if not(XRadialWalk(CactusColor,255,290,75,1,-1,4,0)) then
begin
writeln('couldn''t find with RW')
if FindColor(x,y,cactuscolor,572, 60,616, 137) then
mouse(x,y,4,4,true)
else
begin
writeln('couldn''t find with FindColor...blind clicking')
mouse(597, 87,4,4,true)
end;
end;
FindAll3;
FFlag(0);
wait(200);
FindBank2;
Players[currentplayer].Loc:='Bank'
end;
Procedure Bank;
Begin
if (not(loggedin)) then exit;
if (InvCount = OreAmount) then exit;
if (lowercase(players[currentplayer].strings[0])='st-ball') or
(lowercase(players[currentplayer].strings[0])='or-ball') then
begin
Players[currentplayer].integers[2]:=Players[currentplayer].integers[2]+Amount('inv',1)
ReportVars[18]:=ReportVars[18]+Amount('inv',1)
TotalCballs:=TotalCballs+amount('inv',1)
end;
DwarfItem;
MyopenBank;
fixbank;
if (lowercase(players[currentplayer].strings[0])='st-ball') or
(lowercase(players[currentplayer].strings[0])='or-ball') then
Deposit(1,27,2) else
depositall;
Banks:=Banks+1
end;
function AdvProg(num : integer; maxlength : integer) : string;
begin
result := Replicate(' ',maxlength-length(inttostr(num)));
end;
function AdvProgEx(num : extended; maxlength : integer) : string;
begin
result := Replicate(' ',maxlength-length(floattostr(num)));
end;
Function xp:extended;
Begin
Case lowercase(Players[currentplayer].strings[0]) of
'bronze':Result:=TotalBars*6.2
'iron':Result:=TotalBars*12.5
'silver':Result:=TotalBars*13.7
'steel':Result:= TotalBars*17.5
'gold':Result:=TotalBars*22.5
'mith':Result:=TotalBars*30
'addy':Result:=TotalBars*37.5
'rune':Result:=TotalBars*50
'st-ball':Result:=TotalCBalls*25.5
'or-ball':Result:=((TotalBars*17.5)+(TotalCBalls*(25.5 div 4)))
end;
end;
Procedure Report;
Begin
ChangeReportWidth(280);
ClearReport;
writeln(' ____________________________________ ');
writeln('/ Xcan''s Smelter/CannonballMaker \');
writeln('| V2.19 |')
writeln('|------------------------------------|');
writeln('|Ran For: '+TimeRunning);
writeln('|Finished: '+inttostr(load)+' load(s).'+AdvProg(load,17)+'|');
If totalbars > 0 then
writeln('|Made: '+inttostr(totalbars)+' bars.'+
advprog(totalbars,23)+'|')
If TotalCballs > 0 then
writeln('|Made: '+inttostr(TotalCballs)+' cannonballs.'+
advprog(TotalCballs,16)+'|')
If Xp > 0 then
writeln('|Gained: '+FloatToStr(xp)+' exp.'+AdvProgEx(xp,22)+'|')
If Levels > 0 then
writeln('|Gained: '+inttostr(levels)+' level(s).'+ AdvProg(levels,18)+'|')
writeln('\____________________________________/');
SRLRandomsReport;
end;
Procedure Intro;
begin
ChangeReportWidth(280);
ClearReport;
AddToReport(' __ ');
AddToReport(' __ __ (_ \');
AddToReport(' \ \/ /___ __ _ _ __ \/ ___ ');
AddToReport(' \ // __/ _` | `_ \ / __| ');
AddToReport(' / \ (_| (_| | | | | \__ \');
AddToReport(' /_/\_\___\__,_|_| |_| |___/');
wait(1000)
ClearReport;
AddToReport(' __ _ _ ');
AddToReport(' / _\ ___ _ __(_)_ __ | |_ ___ ');
AddToReport(' \ \ / __| ''__| | ''_ \| __/ __|');
AddToReport(' _\ \ (__| | | | |_) | |_\__ \ ');
AddToReport(' \__/\___|_| |_| .__/ \__|___/');
AddToReport(' |_| ');
wait(1000);
ClearReport;
AddToReport(' Brings You:');
Wait(1000);
ClearReport;
AddToReport(' Xcan''s Smelter/CannonballMaker');
AddToReport(' V'+Versionnumber)
Wait(1000);
AddToReport('');
AddToReport('');
AddToReport('');
AddToReport('Please POST All Progress Reports');
end;
Procedure Chats;
Begin
SetChat('on',1)
SetChat('friends',2)
SetChat('on',3)
SetChat('on',1) //double just to make sure
SetChat('friends',2)
SetChat('on',3)
end;
Procedure Main;
Begin
repeat
repeat
if Players[currentplayer].Loc='Bank' then
begin
Bank;
InBank;
Report;
ToFurn;
end;
if Players[currentplayer].Loc='Furnace' then
begin
Case lowercase(Players[CurrentPlayer].Strings[0]) of
'bronze','iron','silver','gold','steel','mith','addy','rune':
begin
InFurnace;
end;
'st-ball':
Begin
MakeCannonBalls;
end;
'or-ball':
Begin
InFurnaceCannon;
MakeCannonBalls;
end;
end;
ToBank;
Load:=Load+1
Loads:=Loads+1
ReportVars[0]:=ReportVars[0]+1
end;
if (not(loggedin)) then
begin
writeln('not logged in')
nextplayer(False)
end;
until (Loads=Players[currentplayer].integers[0])
Logout2;
FreeDtm(rock1)
Loads:=0;
if Rock2 > 0 then FreeDtm(rock2)
LoadDtms;
if howmanyplayers=1 then wait(300000)
Nextplayer(true);
MakeCompass('w');
FindMould;
MakeCompass('w');
Chats;
MakeCompass('w');
until(false)
end;
begin
Intro;
CheckVersion;
SetupSrl;
Mousespeed:=Mspeed;
SRLID:=MySRLID;
SRLPassword:=MYSRLPASSWORD;
ScriptID:='30'
ReportVars[2]:=ReportVars[2]+1
DeclarePlayers;
LoadDtms;
SetupDemon;
LoginPlayer;
MakeCompass('w')
FindCactusColor;
MakeCompass('w')
FindMould;
Chats;
Main;
end.
there just in case the updater doesnt work. anyway im off to work. leave bugs and such.