rkroxpunk
2007-04-26 08:04:08
Ok I am new to SRL members and while I know how to script there are still a TONNE! of things I need to learn.
My main script release atm is my varrock east miner but is very buggy and needs improvement on the walking. I know I need more failsafes but as there isn't much else apart from road between the mine and bank I really need suggestions on how I can improve it…
thx
-RK
P.S. soz it's a bit messy :D
My main script release atm is my varrock east miner but is very buggy and needs improvement on the walking. I know I need more failsafes but as there isn't much else apart from road between the mine and bank I really need suggestions on how I can improve it…
thx
-RK
P.S. soz it's a bit messy :D
program VEMRKSTYLE;
{.include SRL/SRL.scar}
{.include srl\srl\skill\Mining.scar}
{.include SRL\SRL\Misc\Trade.scar}
////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// LOGIN AND SETUP //
/////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
var
Loads: Integer;
Loads2: Integer;
PickEquip: Boolean;
OreMined: Integer;
OreDTM: integer;
GasAvoided: Integer;
Stuff: Integer;
Talked: Integer;
MineMax: Integer;
Ax, Ay: Integer;
RockBMP: Integer;
GemDTM: Integer;
BankerBMP: Integer;
GBankColor: Integer;
const
VersionNumber = '2'; //Leave this
Loadz = 6; //How Many Loads.
UseAntiBan = True; //AntiBan will be used if set to true.
AntiBanAmount = 3; //0 is lots of antiban, 1 less, 2 even more less, etc.
WaitTime = 20000; //How long before it clicks again
RunDirec = 'N'; //Direction you want to run in if find smoking rock
SetChatz = False; //If set to True it will put pub chat on Hide. This will mean it will know if it's mined the ore better(continued next line)
//but it won't respond if someone asks mineing lvl etc. I suggest set this to true if you're in a crowded world with lots of talking.
//If the mouse does nothing when it gets up to Mining set these manually
const
CopperColor = 3231083;
TinColor = 6776687;
ClayColor = 4553880;
IronColor = 9013652;
SilverColor = 12434885;
CoalColor = 2834753;
GoldColor = 1881051;
MithrilColor = 7359564;
AdamantColor = 6322272;
RuniteColor = 0;
//Names of Ores you can use in String1:
//copper
//tin
//clay
//iron
//silver
//coal
//gold
//mithril
//adamant
//runite
procedure DeclarePlayers;
begin
HowManyPlayers := 5; // Set Number of Players here.
NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
CurrentPlayer := 0;
EquipPick := Players[CurrentPlayer].Boolean1;
Players[0].Name := ''; //Username
Players[0].Pass := ''; //Password
Players[0].Nick := ''; //3 letters of your user name. e.g. udhskjs could be hsk or kjs. If the letter is the first letter of a word or after a space make it capital.
Players[0].String1 := 'Tin'; //What ore you want to mine. there is a list of names above. starting from about line 44
Players[0].Loc := 'Loc1';
Players[0].Skill := 'Mining'; //What skill you want the genie to give you xp on if you get a lamp
Players[0].Boolean1 := False; // Is your pick equipped. true = yes, false = no
Players[0].Active := True;
Players[1].Name := ''; //Username
Players[1].Pass := ''; //Password
Players[1].Nick := ''; //3 letters of your user name. e.g. udhskjs could be hsk or kjs. If the letter is the first letter of a word or after a space make it capital.
Players[1].String1 := 'Tin'; //What ore you want to mine. there is a list of names above. starting from about line 44
Players[1].Loc := 'Loc1';
Players[1].Skill := 'Mining'; //What skill you want the genie to give you xp on if you get a lamp
Players[1].Boolean1 := False; // Is your pick equipped. true = yes, false = no
Players[1].Active := True;
Players[2].Name := ''; //Username
Players[2].Pass := ''; //Password
Players[2].Nick := ''; //3 letters of your user name. e.g. udhskjs could be hsk or kjs. If the letter is the first letter of a word or after a space make it capital.
Players[2].String1 := 'Copper'; //What ore you want to mine. there is a list of names above. starting from about line 44
Players[2].Loc := 'Loc1';
Players[2].Skill := 'Mining'; //What skill you want the genie to give you xp on if you get a lamp
Players[2].Boolean1 := False; // Is your pick equipped. true = yes, false = no
Players[2].Active := True;
Players[3].Name := ''; //Username
Players[3].Pass := ''; //Password
Players[3].Nick := ''; //3 letters of your user name. e.g. udhskjs could be hsk or kjs. If the letter is the first letter of a word or after a space make it capital.
Players[3].String1 := 'Copper'; //What ore you want to mine. there is a list of names above. starting from about line 44
Players[3].Loc := 'Loc1';
Players[3].Skill := 'Mining'; //What skill you want the genie to give you xp on if you get a lamp
Players[3].Boolean1 := False; // Is your pick equipped. true = yes, false = no
Players[3].Active := True;
Players[3].Name := ''; //Username
Players[3].Pass := ''; //Password
Players[3].Nick := ''; //3 letters of your user name. e.g. udhskjs could be hsk or kjs. If the letter is the first letter of a word or after a space make it capital.
Players[3].String1 := 'Copper'; //What ore you want to mine. there is a list of names above. starting from about line 44
Players[3].Loc := 'Loc1';
Players[3].Skill := 'Mining'; //What skill you want the genie to give you xp on if you get a lamp
Players[3].Boolean1 := False; // Is your pick equipped. true = yes, false = no
Players[3].Active := True;
writeln(inttostr(HowManyPlayers) + ' Players');
end;
////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// SIG! //
/////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
procedure Sig;
begin
Writeln('[]----------M-I-N-I-N-G P-O-W-E-R!----------[]');
Writeln('[]------------------BY----------------------[]');
Writeln('[]------------------RK----------------------[]');
Writeln(' ___ ___ ');
Writeln(' / /\ /__/| ');
Writeln(' / /::\ | |:| ');
Writeln(' / /:/\:\ | |:| ');
Writeln(' / /:/~/:/ __| |:| ');
Writeln(' /__/:/ /:/___ /__/\_|:|____ ');
Writeln(' \ \:\/:::::/ \ \:\/:::::/ ');
Writeln(' \ \::/~~~~ \ \::/~~~~ ');
Writeln(' \ \:\ \ \:\ ');
Writeln(' \ \:\ \ \:\ ');
Writeln(' \__\/ \__\/ ');
Writeln('[]----------M-I-N-I-N-G P-O-W-E-R!----------[]');
Writeln('[]------------------BY----------------------[]');
Writeln('[]------------------RK----------------------[]');
end;
////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// PROGGY! //
/////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
procedure Report;
begin
ClearDebug;
Writeln('[]----------THE NOOBIEST PROGGY!----------[]');
Writeln('[]------------------By RK-----------------[]');
Writeln(' Worked For : ' + ScriptTime2(2))
Writeln(' Banked:' + IntToStr(Loads2) + ' Loads');
WriteLn(' Ores Mined: ' + IntToStr(OreMined));
WriteLn(' Gasses Avoided : ' + IntToStr(GasAvoided));
WriteLn(' Talked : ' + IntToStr(talked));
Writeln('[]------------------By RK-----------------[]');
Writeln('[]----------THE NOOBIEST PROGGY!----------[]');
end;
/////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// //
// RANDOMS AND ANTIBAN //
// //
////////////////////////////////////////////////////////
///////////////////////////////////////////////////////
procedure AntiRandoms;
begin
FindTalk;
UseBoxSolver := True
UseCerterSolver := True
UseSandwichSolver :=True
DwarfItem;
Solvepinball;
FindScapeRune;
begin
if (not (LoggedIn)) then Exit;
RC;
if (not (UseBoxSolver)) then
if FindNewBox and
not (GambleNewBox) then
begin
Players[CurrentPlayer].loc := 'NewBox';
Logout;
Exit;
end;
if InBlack then
begin
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
Wait(1);
if NoGameTab then
begin
Players[CurrentPlayer].loc := 'GameTab';
Logout;
Exit;
end;
FindNormalRandoms;
Wait(1);
end;
if (FindFight = true) then
begin
RunAwayDirection(RunDirec);
Wait(10000 + random(2000));
RunBack;
end;
SRLRandomsReport;
end;
function FindFastRandoms: Boolean; //WT-FAKAWI
var
i: Integer;
begin
for i := 1 to 9 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: RC;
end;
wait(1);
end;
end;
procedure HandleGas; //thx Sumillion
var
TempMouseSpeed, GasTime: Integer;
begin
Writeln('OMFG Gas found! Run to the hillz!');
TempMouseSpeed := MouseSpeed;
MouseSpeed := 5;
Mouse(MMCX, MMCY, 5, 5, true);
MarkTime(GasTime);
MouseSpeed := TempMouseSpeed;
while (TimeFromMark(GasTime) < 35000) do
if (Random(20) > 15) then
IdleTime(500, 500, 0.4)
else
Wait(1000);
MarkTime(MineMax);
GasAvoided := GasAvoided + 1;
ReportVars[3] := ReportVars[3] + 1;
end;
procedure MouseAntiBan; //From Yakman.
begin
if not (LoggedIn) then Exit;
case Random(6) of
0: IdleTime(1000 + Random(350), 500, 1.0);
1: IdleTime(1000 + Random(350), 1000, 1.0);
2: IdleTime(1000 + Random(350), 750, 0.5);
3: SleepAndMoveMouse(2500 + Random(2500));
4: SleepAndMoveMouse(1500 + Random(1500));
5: SleepAndMoveMouse(500 + Random(500));
end
end;
procedure MyAntiBan; //From Yakman
var
DItem, DBanMe, AntiBanRatio: Integer;
begin
if not (LoggedIn) then Exit;
AntiBanRatio := 25 + (25 * AntiBanAmount);
DBanMe := Random(AntiBanRatio);
case DBanMe of
0: MMouse(Random(MSX2), Random(MSY2), 0, 0);
1: RandomRClickEvery(2 + Random(13));
2: HoverSkill('mining', False);
3: HoverSkill('smithing', False);
4: RotateEvery(20 + random(10));
5: LeaveScreenEvery(5 + random(5));
6: HoverEvery(15 + random(5), 'random');
7: HoverEvery(15 + random(5), players[currentplayer].skill);
8: MouseAntiBan;
9: begin
DItem := 1 + random(14);
if (ExistsItem(DItem)) then
DragItem(DItem, 15 + random(10));
end
10: begin
GameTab(1 + random(12));
wait(1500 + random(500));
GameTab(4);
end;
end;
end;
procedure Reply;
begin
if (InChat('ning lv')) or
(inChat('ning lev')) or
(InChat('ine lv')) or
(InChat('ine lev')) or
(InChat('M lv')) or
(InChat('M lev')) then
begin
TypeSend(IntToStr(GetSkillLevel('mining')))
Talked := Talked + 1;
end;
if (InChat('elt lv') or
InChat('elt lev') or
InChat('lting lv') or
InChat('lting lev')) then
begin
TypeSend(IntToStr(GetSkillLevel('Smelting')))
Talked := Talked + 1;
end;
end;
/////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// //
// BMP+DTM //
// //
////////////////////////////////////////////////////////
///////////////////////////////////////////////////////
procedure LoadBMPDTM;
begin
RockBMP := BitmapFromString(3, 2, '3A48413A48413A4841243229' +
'243229243229');
OreDTM := DTMFromString('78DA634C636060706740038C48249006A9F12' +
'3A0261F487813A12688809A1C201141847BA209A84902123104D4' +
'C4028944026AA2893007E4DE28026A828930071436A104D484128' +
'E0B0047CA0967');
GemDTM := DTMFromString('78DA63BCCFC4C0B0989101190889CD03D3305' +
'1C6CB40358B50D5C064E16AEE02D5CC20A0E60150CD5A026A9E01' +
'D52C20A0E63950CD72026AAE02D5AC24A006E4AFB904D43C26EC6' +
'60067070E87');
BankerBMP := BitmapFromString(6, 1, 'z78DA3375363131B034C5' +
'4B02008F3A07B7');
end;
/////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// //
// BANK FINDING //
// //
////////////////////////////////////////////////////////
///////////////////////////////////////////////////////
procedure FindDummy;
begin
if not (LoggedIn) then Exit;
if findsymbol(x, y, 'Training Dummy') then
begin
Writeln('Oooh cool I found some dummies')
mouse(x, y, 2, 2, true);
fflag(0);
FindSymbol(x, y, 'Bank')
Writeln('w00t I found the bank')
Mouse(x, y, 5, 5, true)
FFlag(0);
Exit;
end;
if (not findsymbol(x, y, 'Bank')) then
begin
Writeln('Wtf is the bank. Time to log out')
Logout;
Exit;
end;
if (not findsymbol(x, y, 'Training Dummy')) then
begin
Writeln('Cant find the dumhead dummies so I guess Im gonna have to walk')
if not (FindMMColor(x, y, RoadColor)) then RoadColor := FindRoadColor;
RadialRoadWalk(RoadColor, 405, 336, 20, 0, 0);
end;
if FindSymbol(x, y, 'bank')then
begin
Writeln('w00t I found the bank this time!')
Mouse(x, y, 2, 2, true)
FFlag(0);
Exit;
end;
if (not findsymbol(x, y, 'bank')) then
begin
Writeln('zomg still cant find the dang bank O.o')
if findsymbol(x, y, 'Training Dummy') then
Writeln('Found dem dummies')
Mouse(x, y, 2, 2, true)
fflag(0);
end;
if (not findsymbol(x, y, 'Training Dummy')) then
begin
Writeln('Huston we have a problem. Time to log')
Logout;
Exit;
end;
if FindSymbol(x, y, 'bank') then
begin
Writeln('Yay the bank!')
Mouse(x, y, 5, 5, true)
FFlag(0);
Exit;
end;
if (not findsymbol(x, y, 'bank')) then
begin
Writeln('I am lost...cya')
Logout;
Exit;
end;
end;
function SymbolFinder(var gx, gy: integer; symbol: string): boolean;
var bankfindtries, logouttries: integer;
begin
if not (LoggedIn) then Exit;
if (FindSymbol(gx, gy, symbol)) then result := true;
Mouse(gx, gy, 0, 0, true)
FFlag(0);
logouttries := 0;
Exit;
if not (FindSymbol(gx, gy, symbol)) then
begin
repeat
bankfindtries := 0;
repeat
if (not (FindSymbol(gx, gy, symbol))) then
begin
KeyDown(VK_Left)
Wait(100 + Random(50));
KeyUp(VK_Left)
bankfindtries := bankfindtries + 1;
wait(10);
end;
until ((FindSymbol(gx, gy, symbol)) or (bankfindtries > 10));
if bankfindtries > 10 then
begin
logout;
wait(1000 + random(1000));
loginplayer;
logouttries := logouttries + 1;
repeat
wait(10);
until (loggedin);
mouse(519 + random(31), 214 + random(40), 0, 0, true);
end;
FindSymbol(gx, gy, symbol);
if (logouttries > 3) then
begin
FindDummy;
Exit;
end;
until (FindSymbol(gx, gy, symbol));
if (FindSymbol(gx, gy, symbol)) then result := true;
Mouse(gx, gy, 1, 1, true)
FFlag(0);
Exit;
end;
end;
/////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// //
// WALKING //
// //
////////////////////////////////////////////////////////
///////////////////////////////////////////////////////
procedure BankToMine;
var TempMouse: integer;
begin
activateclient;
wait(1000 + random(300));
if not (LoggedIn) then Exit;
TempMouse := MouseSpeed
mousespeed := 7 + random(3)
makecompass('N');
HighestAngle;
wait(500 + random(750))
Setrun(false);
gametab(4);
MouseSpeed := TempMouse;
Roadcolor := FindRoadColor;
wait(500 + random(200));
if not (FindMMColor(x, y, RoadColor)) then RoadColor := FindRoadColor;
Roadcolor := FindRoadColor;
if not (FindMMColor(x, y, RoadColor)) then RoadColor := FindRoadColor;
RadialRoadWalk(RoadColor, 39, 72, 70, -1, 0);
fflag(0);
if not (FindMMColor(x, y, RoadColor)) then RoadColor := FindRoadColor;
RadialRoadWalk(RoadColor, 78, 100, 66, -1, 0);
fflag(0);
if not (FindMMColor(x, y, RoadColor)) then RoadColor := FindRoadColor;
RadialRoadWalk(RoadColor, 168, 131, 62, -1, 0);
if not (FindMMColor(x, y, RoadColor)) then RoadColor := FindRoadColor;
RadialRoadWalk(RoadColor, 195, 145, 58, -1, 0);
if not (FindMMColor(x, y, RoadColor)) then RoadColor := FindRoadColor;
RadialRoadWalk(RoadColor, 191, 157, 62,-1, 0);
if not (FindMMColor(x, y, RoadColor)) then RoadColor := FindRoadColor;
RadialRoadWalk(RoadColor, 189, 153, 58, -1, 0);
if not (FindMMColor(x, y, RoadColor)) then RoadColor := FindRoadColor;
RadialRoadWalk(RoadColor, 188, 139, 60, -1, 0);
if not (FindMMColor(x, y, RoadColor)) then RoadColor := FindRoadColor;
RadialRoadWalk(RoadColor, 195, 148, 60, -1, 0);
if FindBitmapSpiralTolerance(RockBMP, x, y, 595, 76, 640, 111, 200) then
begin
Mouse(x, y, -1, 0, true)
FFlag(0)
SetRun(true)
Exit;
end;
if (not FindBitmapSpiralTolerance(RockBMP, x, y, 595, 76, 640, 111, 200)) then
begin
RadialRoadWalk(RoadColor, 196, 148, 50, -1, 0);
if FindBitmapSpiralTolerance(RockBMP, x, y, 595, 76, 640, 111, 200) then
begin
Mouse(x, y, -1, 0, true)
FFlag(0)
SetRun(true)
Exit;
end;
if (not FindBitmapSpiralTolerance(RockBMP, x, y, 595, 76, 640, 111, 200)) then
begin
RadialRoadWalk(RoadColor, 196, 130, 40, -1, 0);
if FindBitmapSpiralTolerance(RockBMP, x, y, 595, 76, 640, 111, 200) then
begin
Mouse(x, y, -1, 0, true)
FFlag(0)
SetRun(true)
Gametab(4)
AntiRandoms;
FindFastRandoms;
Exit;
if (not FindBitmapSpiralTolerance(RockBMP, x, y, 595, 76, 640, 111, 100)) then
begin
Logout;
Exit;
end;
end;
end;
end;
end;
procedure MineToBank;
begin
if not (LoggedIn) then Exit;
if (invfull) then
activateclient;
wait(3000 + random(300));
makecompass('N');
HighestAngle;
Setrun(false);
gametab(4);
Roadcolor := FindRoadColor;
wait(500 + random(200));
if not (FindMMColor(x, y, RoadColor)) then RoadColor := FindRoadColor;
RadialRoadWalk(RoadColor, 64, 76, 67, -1, 0);
wait(3000);
RadialRoadWalk(RoadColor, 337, 377, 58, -1, 0);
RadialRoadWalk(RoadColor, 337, 377, 58, -1, 0);
if (findsymbol(x, y, 'Quest')) then
begin
RadialRoadWalk(RoadColor, 332, 370, 51, -1, 0);
RadialRoadWalk(RoadColor, 336, 366, 50, -1, 0);
RadialRoadWalk(RoadColor, 321, 346, 30, -1, 0);
MakeCompass('W')
RadialRoadWalk(RoadColor, 405, 336, 58, -1, 0);
RadialRoadWalk(RoadColor, 405, 336, 35, -1, 0);
Exit;
end;
if (not findsymbol(x, y, 'Quest')) then
begin
RadialRoadWalk(RoadColor, 337, 377, 37, -1, 0);
Flag;
if (findsymbol(x, y, 'Quest')) then
begin
RadialRoadWalk(RoadColor, 332, 370, 51, -1, 0);
RadialRoadWalk(RoadColor, 336, 366, 50, -1, 0);
RadialRoadWalk(RoadColor, 321, 346, 30, -1, 0);
MakeCompass('W')
RadialRoadWalk(RoadColor, 405, 336, 58, -1, 0);
RadialRoadWalk(RoadColor, 405, 336, 35, -1, 0);
Exit;
end;
end;
if (not findsymbol(x, y, 'Quest')) then
begin
RadialRoadWalk(RoadColor, 337, 377, 37,-1, 0);
Flag;
if (findsymbol(x, y, 'Quest')) then
begin
RadialRoadWalk(RoadColor, 332, 370, 51,-1, 0);
RadialRoadWalk(RoadColor, 336, 366, 50, -1, 0);
RadialRoadWalk(RoadColor, 321, 346, 30, -1, 0);
MakeCompass('W')
RadialRoadWalk(RoadColor, 405, 336, 58, -1, 0);
RadialRoadWalk(RoadColor, 405, 336, 35, -1, 0);
Exit;
end;
end;
if (not findsymbol(x, y, 'Quest')) then
Logout;
if not (LoggedIn) then Exit;
end;
///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
// BANKING //
// NOTE: //
//EasyBank is from Wizzup? and yes I understand it fully //
//////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
function EasyBank: Boolean; //wizzup?'s
begin
if not (LoggedIn) then Exit;
Makecompass('N')
LowestAngle;
AntiRandoms;
FindFastRandoms;
OpenBankGlass('veb', False, False);
FFlag(0);
Wait(1000);
if BankScreen then
begin
Result := True;
Exit;
end;
if OpenBankQuiet('veb') then Result := True;
end;
Function FindBankBooth:Boolean;
begin
if not (LoggedIn) then Exit;
MakeCompass('N')
wait(1500+random(500))
GBankColor := AutoColorThis(BankerBMP, 50, MSX1, MSY1, MSX2, MSY2);
if FindObj(x,y,'nk boo',GBankColor,0) And (IsUpText('nk boo')) then
Mouse(x,y,0,0,False)
Chooseoption(x,y,'se-quic')
FFlag(0)
wait(2500+random(400))
if BankScreen then Result := True;
Exit;
if (not FindObj(x,y,'nk boo',GBankColor,0)) then
EasyBank;
end;
procedure BankOres;
var
TempMouse: integer;
begin
if not (LoggedIn) then Exit;
wait(1300+random(700))
if not(bankscreen) then
begin
Logout;
Exit;
end;
if (Bankscreen) then
begin
wait(1300+random(500))
FindDTM(OreDTM, x, y, MIx1, MIY1, MIx2, MIY2)
begin
repeat
wait(1500+random(750))
TempMouse := MouseSpeed;
mousespeed := 5 + random(3)
mouse(x, y, 2, 2, False)
if not ChooseOption(x, y, 'Store All') then
Logout;
Exit;
if ChooseOption(x, y, 'Store All') then
FFlag(5);
wait(500 + random(250));
until not (FindDTM(OreDTM, x, y, MIx1, MIY1, MIx2, MIY2));
if (not FindDTM(OreDTM, x, y, MIx1, MIY1, MIx2, MIY2)) then
Loads := Loads + 1;
Loads2 := Loads2 + 1;
if FindDTM(GemDTM, x, y, MIx1, MIY1, MIx2, MIY2) then
begin
repeat
mouse(x, y, 2, 2, False)
ChooseOption(x, y, 'Store All');
FFlag(5);
wait(500 + random(250));
until not (FindDTM(GemDTM, x, y, MIx1, MIY1, MIx2, MIY2));
MouseSpeed := TempMouse
Report;
FreeDTM(OreDTM);
FreeDTM(GemDTM);
end;
end;
end;
end;
/////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// //
// MINEING AND DROPPING(FOR POWERMINER) //
// //
////////////////////////////////////////////////////////
///////////////////////////////////////////////////////
procedure SetOreColor;
begin
case LowerCase(Players[CurrentPlayer].String1) of
'copper': OreColor1 := CopperColor;
'tin': OreColor1 := TinColor;
'clay': OreColor1 := ClayColor;
'iron': OreColor1 := IronColor;
'silver': OreColor1 := SilverColor;
'coal': OreColor1 := CoalColor;
'gold': OreColor1 := GoldColor;
'mithril': OreColor1 := MithrilColor;
'adamant': OreColor1 := AdamantColor;
'runite': OreColor1 := RuniteColor;
end;
end;
function Mine: Boolean;
begin
if not (LoggedIn) then Exit;
HighestAngle;
MakeCompass('N')
repeat
if not (LoggedIn) then Exit;
wait(5 + random(5));
if(FindObj(x, y, 'Mine', OreColor1, 15))then
begin
Wait(50);
if IsUpText('Mine') then
begin
if (GasCheck(Ax, Ay)) then
HandleGas;
wait(50 + random(5));
Mouse(x, y, 2, 2, true);
OreMined := OreMined + 1;
end;
if FindText(x, y, 'is no or', smallchars, 18, 415, 477, 433) then
begin
OreMined := OreMined - 1;
end;
wait(300);
Stuff := Stuff + 1
Break;
end;
until (false)
end;
procedure UntilMined(Time: Integer);
var
timer: integer;
begin
if not (LoggedIn) then Exit;
Status('waiting for pick swing')
if (GasCheck(Ax, Ay)) then
HandleGas;
FindFastRandoms;
AntiRandoms;
Reply;
wait(700 + random(200));
if FindText(x, y, 'wing you', smallchars, 18, 415, 477, 433) then
begin
marktime(Timer);
repeat
if not (LoggedIn) then Exit;
wait(700 + random(900));
if (GasCheck(Ax, Ay)) then
HandleGas;
FindFastRandoms;
AntiRandoms;
FindPick;
Reply;
until FindText(x, y, 'anage', smallchars, 20, 401, 477, 433) or
(timefrommark(Timer) > WaitTime);
end;
end;
function CoordsToInvSpot(gx, gy: integer): integer; //Help here from Boreas
var col, row: integer;
begin
if ((gx > 569) and (gx < 600)) then col := 1;
wait(20 + random(7));
if ((gx > 611) and (gx < 642)) then col := 2;
wait(20 + random(7));
if ((gx > 653) and (gx < 684)) then col := 3;
wait(20 + random(7));
if ((gx > 695) and (gx < 723)) then col := 4;
wait(20 + random(7));
if ((gy > 213) and (gy < 244)) then row := 1;
wait(20 + random(7));
if ((gy > 249) and (gy < 280)) then row := 2;
wait(20 + random(7));
if ((gy > 285) and (gy < 316)) then row := 3;
wait(20 + random(7));
if ((gy > 322) and (gy < 352)) then row := 4;
wait(20 + random(7));
if ((gy > 357) and (gy < 387)) then row := 5;
wait(20 + random(7));
if ((gy > 393) and (gy < 424)) then row := 6;
wait(20 + random(7));
if ((gy > 429) and (gy < 459)) then row := 7;
result := ((row - 1) * 4) + col;
end;
procedure Drop; //Help here from Boreas
begin
if not (LoggedIn) then Exit;
if (invfull) then
begin
GameTab(4);
repeat
if FindDTM(OreDTM, x, y, MIx1, MIY1, MIx2, MIY2) then
DropItem(coordstoinvspot(x, y));
FindFastRandoms;
AntiRandoms;
Reply;
wait(200 + random(200));
until not (FindDTM(OreDTM, x, y, MIx1, MIY1, MIx2, MIY2));
freedtm(OreDTM);
Report;
end;
end;
/////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// //
// Chats //
// //
////////////////////////////////////////////////////////
///////////////////////////////////////////////////////
procedure SetChats;
var
TempMouse: integer;
begin
if not (LoggedIn) then Exit;
TempMouse := MouseSpeed
MouseSpeed := 7 + random(3)
if SetChatz = True then
SetChat('hide', 1);
SetChat('friends', 2);
SetChat('on', 3);
if SetChatz = False then
SetChat('on', 1);
SetChat('friends', 2);
SetChat('on', 3);
Exit;
MouseSpeed := TempMouse;
end;
/////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// //
// If Not Logged In Failsafe //
// //
////////////////////////////////////////////////////////
///////////////////////////////////////////////////////
procedure IfNotLogged;
begin
if (LoggedIn) then
Exit;
if not (LoggedIn) then
Nextplayer(false);
loginplayer;
Loads := 0
MakeCompass('N');
HighestAngle;
FindPickHeadColor;
SetChats;
end;
/////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// //
// MAIN LOOP //
// //
////////////////////////////////////////////////////////
///////////////////////////////////////////////////////
begin
ClearDebug;
SetupSRL;
SetupSRLMining;
DeclarePlayers;
Sig;
wait(3000)
Activateclient;
wait(1000);
LoginPlayer;
wait(1000);
FindPickHeadColor;
SetChats;
repeat
repeat
IfNotLogged;
LoadBMPDTM;
SetOreColor;
Gametab(4);
BankToMine;
FreeBitmap(RockBMP)
wait(2000 + random(1500))
repeat
Mine;
FindPick;
if (GasCheck(Ax, Ay)) then
HandleGas;
FindFastRandoms;
Reply;
UntilMined(WaitTime);
if (Stuff >= 5 + random(7)) then
begin
MyAntiBan;
MouseAntiBan;
Reply;
Stuff := 0;
Report;
end;
until (InvFull)
if (InvFull) then
begin
MineToBank;
wait(500 + random(300))
SymbolFinder(x, y, 'Bank')
wait(5500 + random(2000));
FindBankBooth;
FreeBitmap(BankerBMP)
Wait(10 + random(500))
BankOres;
Wait(10 + random(500))
CloseBank;
HighestAngle;
end;
until (Loads = Loadz);
if (Loads = Loadz) then
begin
Logout;
Nextplayer(true);
LoginPlayer;
Loads := 0
MakeCompass('N');
HighestAngle;
FindPickHeadColor;
SetChats;
end;
until (false);
end.