nght spud
05-18-2007, 03:43 PM
Ok its my first script, you have to set up the colours of the rock to mine, the tolerance and how many loads.
I spent quite a while making the antiban and all that stuff, so the actual mining part is a bit rushed. It doesnt have a progress report yet. The anti randoms arent tested, and the gas detection and pick head finder may not work either, so please test it and dont blame me if anything goes wrong.
Please post improvements
Feel free to edit it or use parts of it in your own scripts just please gimme credit.
It works with Scar 2.03 and SRL 3.6 , not sure if it works with anything else.
V 1.1 ---Ok added a small progress report, and changed it so it definately wont pick up ores. Also It has mangaged to solve old man random three times.
V 1.2 ---Made the antirandom better but its still not tested, added more failssafes, and I finally managed to figure out how to make it only mine when its finished mining the last ore thanks to pwntby ownt for help with that
{My first script
Credits to
JAD for his amazing tutorials
WT-Fakawi for his also amazing anti random
Pwnt by Pwnt for helping with orefinding and only mining when neccessary
Anyone else who posted on the thread in a useful way
And of course kaitnieks the creator of scar and the SRL manual
edit lines 17-20 to set script up
The anti random/gas/pick head finder isn't tested
Please post improvements on forums
Feel free to edit anythin in this, or use anything but gimme credit please}
program PowerMiner;
{.include SRL\SRL.Scar}
{.include SRL\SRL/skill/Mining.scar}
var
loadsdone, k, l,ttlloads,progreps,mine,InvNo1,InvNo2,minedtimes2 : integer;
const
loadswanted = 5; //how many loads per player
minecolor = 5541861; //color of rock to mine
tol = 5; //what tolerance to use
minedtimes = 50; //how many times for it to try to mine unsuccesfully
procedure DeclarePlayers;
begin
HowManyPlayers := 8;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '-------';
Players[0].Pass := '-------';
Players[0].Nick := '-------';
Players[0].Active := True;
Players[1].Name := '-------';
Players[1].Pass := '-------';
Players[1].Nick := '-------';
Players[1].Active := false;
Players[2].Name := '-------';
Players[2].Pass := '-------';
Players[2].Nick := '-------';
Players[2].Active := True;
Players[3].Name := '-------';
Players[3].Pass := '-------';
Players[3].Nick := '-------';
Players[3].Active := True;
Players[4].Name := '-------';
Players[4].Pass := '-------';
Players[4].Nick := '-------';
Players[4].Active := True;
Players[5].Name := '-------';
Players[5].Pass := '-------';
Players[5].Nick := '-------';
Players[5].Active := True;
Players[6].Name := '-------';
Players[6].Pass := '-------';
Players[6].Nick := '-------';
Players[6].Active := True;
Players[7].Name := '-------';
Players[7].Pass := '-------';
Players[7].Nick := '-------';
Players[7].Active := True;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
procedure switchplayer;
begin
if (Loadsdone = Loadswanted) then
begin
NextPlayer(True);
Loadsdone := 0; //change this variable
HighestAngle;
MakeCompass('N');
Writeln('Players have been switched');
end;
end;
function FindFastRandoms: Boolean; //By 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 FindRandoms;
begin
FindFastRandoms;
FindNormalRandoms;
FindPick;
if (FindFight = true) then
begin
RunAwayDirection('N');
Wait(10000 + random(2000));
RunBack;
end;
end;
procedure Makemereal;
begin
if (not (LoggedIn)) then
Exit;
case Random(14) of
0: Antiban;
1: RandomRClickEvery(5 + random(5));
2: LeaveScreenEvery(16 + random(5));
3: PickupMouseEvery(10 + random(3));
4: BoredEvery(3 + random(3));
5: begin
case Random(18) of
0: begin
HoverSkill('attack', false);
wait(1000 + random(1000));
GameTab(4);
end;
1: begin
HoverSkill('strength', false);
wait(1000 + random(1000));
GameTab(4);
end;
2: begin
HoverSkill('Defence', false);
wait(1000 + random(1000));
GameTab(4);
end;
3: begin
HoverSkill('Range', false);
wait(1000 + random(1000));
GameTab(4);
end;
4: begin
HoverSkill('Prayer', false);
wait(1000 + random(1000));
GameTab(4);
end;
5: begin
HoverSkill('Mage', false);
wait(1000 + random(1000));
GameTab(4);
end;
6: begin
HoverSkill('RuneCrafting', false);
wait(1000 + random(1000));
GameTab(4);
end;
7: begin
HoverSkill('HP', false);
wait(1000 + random(1000));
GameTab(4);
end;
8: begin
HoverSkill('Crafting', false);
wait(1000 + random(1000));
GameTab(4);
end;
9: begin
HoverSkill('Mining', false);
wait(1000 + random(1000));
GameTab(4);
end;
10: begin
HoverSkill('Smithing', false);
wait(1000 + random(1000));
GameTab(4);
end;
11: begin
HoverSkill('Cooking', false);
wait(1000 + random(1000));
GameTab(4);
end;
12: begin
HoverSkill('Fishing', false);
wait(1000 + random(1000));
GameTab(4);
end;
13: begin
HoverSkill('Firemaking', false);
wait(1000 + random(1000));
GameTab(4);
end;
14: begin
HoverSkill('Woodcutting', false);
wait(1000 + random(1000));
GameTab(4);
end;
15: begin
HoverSkill('Slayer', false);
wait(1000 + random(1000));
GameTab(4);
end;
16: begin
HoverSkill('Mining', false);
wait(1000 + random(1000));
GameTab(4);
end;
17: begin
HoverSkill('Mining', false);
wait(1000 + random(1000));
GameTab(4);
end;
end;
end;
6: RotateEvery(3 + random(3));
7: MouseBox(0, 0, 765, 500, 3);
8: MouseBox(MSX1, MSY1, MSX2, MSY2, 3);
9: MouseBox(MIX1, MIY1, MIX2, MIY2, 3);
10: SleepAndMoveMouse(5000 + random(5000));
11: begin
GameTab(1);
wait(2000 + random(1000));
SetFightMode(random(4));
end;
12: begin
case random(10) of
0: begin
TypeSend('Mining lvls');
wait(5000 + random(1000));
Gametab(2);
SayCurrentLevels('mining');
wait(1000 + random(1000));
GameTab(4);
end;
1: TypeSend('Booooringgg');
2: TypeSend('Gotta love mining');
3: TypeSend('I got 99 mining');
4: TypeSend('Why cant mining be more fun');
5: TypeSend('If your happy and you know it clap your hands');
6: TypeSend('Someone think of something more fun to do');
7: TypeSend('whats everyones highest lvl?');
8: TypeSend('My fave skill is smithing but i need ores');
9: TypeSend('how much are rune picks worth?');
end;
end;
13: begin
HighestAngle;
MakeCompass('N');
wait(100 + random(100));
LowestAngle
MakeCompass('E');
wait(100 + random(100));
HighestAngle;
MakeCompass('S');
wait(100 + random(100));
LowestAngle;
MakeCompass('W');
wait(100 + random(100));
HighestAngle;
MakeCompass('N');
wait(1000 + random(500));
end;
14: RandomChatEvery(14 + Random(4));
end;
end;
procedure Mining;
begin
if FindObj(k,l,'Rocks',minecolor,tol)
then begin
minedtimes2 :=0;
InvNo1 := 0;
InvNo2 := 0;
InvNo1 := InvCount;
FindGas(k,l);
FindPick;
Mouse(k, l, 0, 0, true);
wait(100 + random(100));
mine := mine + 1;
FindRandoms;
InvNo2 := InvCount;
end;
if (InvNo2=InvNo1)
then begin
repeat
minedtimes2 := minedtimes2 + 1;
if (minedtimes2 = 60)
then begin
repeat
Mining;
until (mine = minedtimes);
end;
FindRandoms;
FindGas(k,l);
FindPick;
InvNo2 := 0;
InvNo2 := InvCount;
wait (100+random(100));
until (InvNo2=(InvNo1+1)) ;
end;
if (InvFull)
then begin
mine := 0;
DropAll;
Loadsdone := Loadsdone + 1;
TtlLoads := TtlLoads + 1;
FindRandoms;
end;
if (mine = minedtimes)
then begin
Writeln('somethings not right')
NextPlayer(False);
Loadsdone := 0;
HighestAngle;
MakeCompass('N');
Writeln('Players have been switched');
end;
end;
procedure login;
begin
if (not (loggedin))
then begin
writeln('logging in');
Loginplayer;
HighestAngle;
wait(1000 + random(5000))
FindPickHeadColor
wait(1000 + random(1000))
end;
end;
procedure proggy;
begin
if (TtlLoads>progreps)
then begin
ClearDebug;
Writeln('----------------------------------------');
Writeln('--------NGHT SPUD`s Power Miner!--------');
Writeln('----------------------------------------');
Writeln('Total Time Running: ' + TimeRunning);
Writeln('Total Loads: ' + inttostr(TtlLoads));
SRLRandomsReport;
progreps := progreps + 1;
end;
end;
begin
ClearDebug;
ActivateClient;
SetUpSRL;
SetupSRLMining
DeclarePlayers;
Equippick := false;
repeat
switchplayer;
login;
FindRandoms;
case Random(4) of
0: wait(1);
1: Makemereal;
2: wait(1);
3: wait(1);
end;
Mining;
proggy;
until (false);
end.
Thanks for your comments
I spent quite a while making the antiban and all that stuff, so the actual mining part is a bit rushed. It doesnt have a progress report yet. The anti randoms arent tested, and the gas detection and pick head finder may not work either, so please test it and dont blame me if anything goes wrong.
Please post improvements
Feel free to edit it or use parts of it in your own scripts just please gimme credit.
It works with Scar 2.03 and SRL 3.6 , not sure if it works with anything else.
V 1.1 ---Ok added a small progress report, and changed it so it definately wont pick up ores. Also It has mangaged to solve old man random three times.
V 1.2 ---Made the antirandom better but its still not tested, added more failssafes, and I finally managed to figure out how to make it only mine when its finished mining the last ore thanks to pwntby ownt for help with that
{My first script
Credits to
JAD for his amazing tutorials
WT-Fakawi for his also amazing anti random
Pwnt by Pwnt for helping with orefinding and only mining when neccessary
Anyone else who posted on the thread in a useful way
And of course kaitnieks the creator of scar and the SRL manual
edit lines 17-20 to set script up
The anti random/gas/pick head finder isn't tested
Please post improvements on forums
Feel free to edit anythin in this, or use anything but gimme credit please}
program PowerMiner;
{.include SRL\SRL.Scar}
{.include SRL\SRL/skill/Mining.scar}
var
loadsdone, k, l,ttlloads,progreps,mine,InvNo1,InvNo2,minedtimes2 : integer;
const
loadswanted = 5; //how many loads per player
minecolor = 5541861; //color of rock to mine
tol = 5; //what tolerance to use
minedtimes = 50; //how many times for it to try to mine unsuccesfully
procedure DeclarePlayers;
begin
HowManyPlayers := 8;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '-------';
Players[0].Pass := '-------';
Players[0].Nick := '-------';
Players[0].Active := True;
Players[1].Name := '-------';
Players[1].Pass := '-------';
Players[1].Nick := '-------';
Players[1].Active := false;
Players[2].Name := '-------';
Players[2].Pass := '-------';
Players[2].Nick := '-------';
Players[2].Active := True;
Players[3].Name := '-------';
Players[3].Pass := '-------';
Players[3].Nick := '-------';
Players[3].Active := True;
Players[4].Name := '-------';
Players[4].Pass := '-------';
Players[4].Nick := '-------';
Players[4].Active := True;
Players[5].Name := '-------';
Players[5].Pass := '-------';
Players[5].Nick := '-------';
Players[5].Active := True;
Players[6].Name := '-------';
Players[6].Pass := '-------';
Players[6].Nick := '-------';
Players[6].Active := True;
Players[7].Name := '-------';
Players[7].Pass := '-------';
Players[7].Nick := '-------';
Players[7].Active := True;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
procedure switchplayer;
begin
if (Loadsdone = Loadswanted) then
begin
NextPlayer(True);
Loadsdone := 0; //change this variable
HighestAngle;
MakeCompass('N');
Writeln('Players have been switched');
end;
end;
function FindFastRandoms: Boolean; //By 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 FindRandoms;
begin
FindFastRandoms;
FindNormalRandoms;
FindPick;
if (FindFight = true) then
begin
RunAwayDirection('N');
Wait(10000 + random(2000));
RunBack;
end;
end;
procedure Makemereal;
begin
if (not (LoggedIn)) then
Exit;
case Random(14) of
0: Antiban;
1: RandomRClickEvery(5 + random(5));
2: LeaveScreenEvery(16 + random(5));
3: PickupMouseEvery(10 + random(3));
4: BoredEvery(3 + random(3));
5: begin
case Random(18) of
0: begin
HoverSkill('attack', false);
wait(1000 + random(1000));
GameTab(4);
end;
1: begin
HoverSkill('strength', false);
wait(1000 + random(1000));
GameTab(4);
end;
2: begin
HoverSkill('Defence', false);
wait(1000 + random(1000));
GameTab(4);
end;
3: begin
HoverSkill('Range', false);
wait(1000 + random(1000));
GameTab(4);
end;
4: begin
HoverSkill('Prayer', false);
wait(1000 + random(1000));
GameTab(4);
end;
5: begin
HoverSkill('Mage', false);
wait(1000 + random(1000));
GameTab(4);
end;
6: begin
HoverSkill('RuneCrafting', false);
wait(1000 + random(1000));
GameTab(4);
end;
7: begin
HoverSkill('HP', false);
wait(1000 + random(1000));
GameTab(4);
end;
8: begin
HoverSkill('Crafting', false);
wait(1000 + random(1000));
GameTab(4);
end;
9: begin
HoverSkill('Mining', false);
wait(1000 + random(1000));
GameTab(4);
end;
10: begin
HoverSkill('Smithing', false);
wait(1000 + random(1000));
GameTab(4);
end;
11: begin
HoverSkill('Cooking', false);
wait(1000 + random(1000));
GameTab(4);
end;
12: begin
HoverSkill('Fishing', false);
wait(1000 + random(1000));
GameTab(4);
end;
13: begin
HoverSkill('Firemaking', false);
wait(1000 + random(1000));
GameTab(4);
end;
14: begin
HoverSkill('Woodcutting', false);
wait(1000 + random(1000));
GameTab(4);
end;
15: begin
HoverSkill('Slayer', false);
wait(1000 + random(1000));
GameTab(4);
end;
16: begin
HoverSkill('Mining', false);
wait(1000 + random(1000));
GameTab(4);
end;
17: begin
HoverSkill('Mining', false);
wait(1000 + random(1000));
GameTab(4);
end;
end;
end;
6: RotateEvery(3 + random(3));
7: MouseBox(0, 0, 765, 500, 3);
8: MouseBox(MSX1, MSY1, MSX2, MSY2, 3);
9: MouseBox(MIX1, MIY1, MIX2, MIY2, 3);
10: SleepAndMoveMouse(5000 + random(5000));
11: begin
GameTab(1);
wait(2000 + random(1000));
SetFightMode(random(4));
end;
12: begin
case random(10) of
0: begin
TypeSend('Mining lvls');
wait(5000 + random(1000));
Gametab(2);
SayCurrentLevels('mining');
wait(1000 + random(1000));
GameTab(4);
end;
1: TypeSend('Booooringgg');
2: TypeSend('Gotta love mining');
3: TypeSend('I got 99 mining');
4: TypeSend('Why cant mining be more fun');
5: TypeSend('If your happy and you know it clap your hands');
6: TypeSend('Someone think of something more fun to do');
7: TypeSend('whats everyones highest lvl?');
8: TypeSend('My fave skill is smithing but i need ores');
9: TypeSend('how much are rune picks worth?');
end;
end;
13: begin
HighestAngle;
MakeCompass('N');
wait(100 + random(100));
LowestAngle
MakeCompass('E');
wait(100 + random(100));
HighestAngle;
MakeCompass('S');
wait(100 + random(100));
LowestAngle;
MakeCompass('W');
wait(100 + random(100));
HighestAngle;
MakeCompass('N');
wait(1000 + random(500));
end;
14: RandomChatEvery(14 + Random(4));
end;
end;
procedure Mining;
begin
if FindObj(k,l,'Rocks',minecolor,tol)
then begin
minedtimes2 :=0;
InvNo1 := 0;
InvNo2 := 0;
InvNo1 := InvCount;
FindGas(k,l);
FindPick;
Mouse(k, l, 0, 0, true);
wait(100 + random(100));
mine := mine + 1;
FindRandoms;
InvNo2 := InvCount;
end;
if (InvNo2=InvNo1)
then begin
repeat
minedtimes2 := minedtimes2 + 1;
if (minedtimes2 = 60)
then begin
repeat
Mining;
until (mine = minedtimes);
end;
FindRandoms;
FindGas(k,l);
FindPick;
InvNo2 := 0;
InvNo2 := InvCount;
wait (100+random(100));
until (InvNo2=(InvNo1+1)) ;
end;
if (InvFull)
then begin
mine := 0;
DropAll;
Loadsdone := Loadsdone + 1;
TtlLoads := TtlLoads + 1;
FindRandoms;
end;
if (mine = minedtimes)
then begin
Writeln('somethings not right')
NextPlayer(False);
Loadsdone := 0;
HighestAngle;
MakeCompass('N');
Writeln('Players have been switched');
end;
end;
procedure login;
begin
if (not (loggedin))
then begin
writeln('logging in');
Loginplayer;
HighestAngle;
wait(1000 + random(5000))
FindPickHeadColor
wait(1000 + random(1000))
end;
end;
procedure proggy;
begin
if (TtlLoads>progreps)
then begin
ClearDebug;
Writeln('----------------------------------------');
Writeln('--------NGHT SPUD`s Power Miner!--------');
Writeln('----------------------------------------');
Writeln('Total Time Running: ' + TimeRunning);
Writeln('Total Loads: ' + inttostr(TtlLoads));
SRLRandomsReport;
progreps := progreps + 1;
end;
end;
begin
ClearDebug;
ActivateClient;
SetUpSRL;
SetupSRLMining
DeclarePlayers;
Equippick := false;
repeat
switchplayer;
login;
FindRandoms;
case Random(4) of
0: wait(1);
1: Makemereal;
2: wait(1);
3: wait(1);
end;
Mining;
proggy;
until (false);
end.
Thanks for your comments