dstone09
07-07-2007, 09:03 AM
I have never made a serious script before just small things so I decided to make a Powerminer. I have been working for about 4 1/2 - 5 hrs to get this far on this script that includes a lot of reading on the forums. Any criticism or suggestions is welcomed, for the script I want to add anti-randoms, anti-ban, multi-character support. I also need to find a way for the miner to mine all the rocks not just the ones in the upper left. If you have any advice/links or anything thing that can help it would be very much appreciated.
//ScriptName = First Powerminer
//Author = dstone09
//Description = Mines ore then drops it.
//Version = 0.1
//Date = Fri. July 06, 2007.
//Comments = Thanks to WhiteShadow, The_Rs_Monkey and WhoCares357 for the Tutorials!
program FirstPowerminer;
{.include SRL\SRL.scar}
var
Loads: Integer;
r: integer;
const
EquipedPick = True; //Is your pick axe equiped?
OreColor = 4681883; //Put the ore color here!
NumberofLoads = 1; // The number of loads you want to do.
WaitTime = 2000; //Time to wait before next click +Random 1000.
procedure MineOre;
begin
repeat
if(FindColorTolerance(x,y,OreColor,MSX1,MSY1,MSX2, MSY2,4))then
begin
MMouse(x,y,4,4);
if(IsUpText('ine'))then
begin
GetMousePos(x,y);
Mouse(x,y,0,0,true);
end;
end;
wait(WaitTime+random(1000));
until(InvFull);
end;
procedure DropOre;
begin
KeyDown(27);
Wait(Random(100));
KeyUp(27);
if(EquipedPick)then
DropAll;
if(not(EquipedPick))then
DropTo(2,28);
end;
procedure Report;
begin
Writeln('////////////////////////////////////////////////');
Writeln('Dropped '+ IntToStr(Loads) + ' Loads of Ore');
Writeln('\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\');
end;
procedure Sig;
begin
ClearDebug;
writeln(' __ __');
writeln('.--| |.-----.| |_.-----.-----.-----.-----.');
writeln('| _ ||__ --|| _| _ | | -__|__ --|');
writeln('|_____||_____||____|_____|__|__|_____|___ __|');
writeln(' ______ _______ __');
writeln('| __ \.-----.--.--.--.-----.----.| | |__|.-----.-----.----.');
writeln('| __/| _ | | | | -__| _|| | || | -__| _|');
writeln('|___| |_____|________|_____|__| |__|_|__|__||__|__|_____|__|');
end;
begin
ActivateClient;
Wait(700+Random(1000))
Sig;
HighestAngle;
repeat
MineOre;
DropOre;
Loads:=Loads+1;
r:=r+1;
until(r=NumberofLoads);
Report;
end.
//ScriptName = First Powerminer
//Author = dstone09
//Description = Mines ore then drops it.
//Version = 0.1
//Date = Fri. July 06, 2007.
//Comments = Thanks to WhiteShadow, The_Rs_Monkey and WhoCares357 for the Tutorials!
program FirstPowerminer;
{.include SRL\SRL.scar}
var
Loads: Integer;
r: integer;
const
EquipedPick = True; //Is your pick axe equiped?
OreColor = 4681883; //Put the ore color here!
NumberofLoads = 1; // The number of loads you want to do.
WaitTime = 2000; //Time to wait before next click +Random 1000.
procedure MineOre;
begin
repeat
if(FindColorTolerance(x,y,OreColor,MSX1,MSY1,MSX2, MSY2,4))then
begin
MMouse(x,y,4,4);
if(IsUpText('ine'))then
begin
GetMousePos(x,y);
Mouse(x,y,0,0,true);
end;
end;
wait(WaitTime+random(1000));
until(InvFull);
end;
procedure DropOre;
begin
KeyDown(27);
Wait(Random(100));
KeyUp(27);
if(EquipedPick)then
DropAll;
if(not(EquipedPick))then
DropTo(2,28);
end;
procedure Report;
begin
Writeln('////////////////////////////////////////////////');
Writeln('Dropped '+ IntToStr(Loads) + ' Loads of Ore');
Writeln('\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\');
end;
procedure Sig;
begin
ClearDebug;
writeln(' __ __');
writeln('.--| |.-----.| |_.-----.-----.-----.-----.');
writeln('| _ ||__ --|| _| _ | | -__|__ --|');
writeln('|_____||_____||____|_____|__|__|_____|___ __|');
writeln(' ______ _______ __');
writeln('| __ \.-----.--.--.--.-----.----.| | |__|.-----.-----.----.');
writeln('| __/| _ | | | | -__| _|| | || | -__| _|');
writeln('|___| |_____|________|_____|__| |__|_|__|__||__|__|_____|__|');
end;
begin
ActivateClient;
Wait(700+Random(1000))
Sig;
HighestAngle;
repeat
MineOre;
DropOre;
Loads:=Loads+1;
r:=r+1;
until(r=NumberofLoads);
Report;
end.