SRL Archive - OSR Help

Powerminer only mines one ore


Austintheman

2011-12-19 03:07:25

Hello, after following YoHoJo's tutorial on making a RS script, I've attempted to make one, after many problems I've got the script to run.

However, after I run the script, it only mines one iron ore, and then immediately clicks on the iron ore that I just mined again. I've tried changing the tolerance, I've included many different colors and I've even tried including few colors, however it doesn't seem to work :(. After it clicks on the ore again, it just sits there and stays at the stage "We are mining!"

Any help would be greatly appreciated.

This is my first script, so it may be a bit messy ;)

program LeggoMine;

{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i SRL\SRL\Misc\Stats.simba}


Const
SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)
BreakEvery = 855; //How Many Minutes To Break After
BreakFor = 5; //How Long To Break For
Version = '1.0';

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ' '; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
//Integers[1] := 4;
//Integers[2] := 3;
end;

end;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Function CheckAndClick(Uptext, Option:String; X, Y:Integer; RClick:Boolean):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(Uptext, 100+Random(50)) Then
Begin
Result:=True;
GetMousePos(x, y);
If RClick Then
Mouse(x, y, 0, 0, False);
Result:= WaitOption(Option, 2000);
If Result Then FFlag(0);
End Else
Begin
Mouse(x, y, 0, 0, True);
Wait(100+Random(50));
FFlag(0);
End;
End;
Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;
Function MineOre:Boolean;
Var
X, Y, PlusOne, OreCounter: Integer;
Begin
PlusOne:= InvCount + 1;
If FindObjCustom(x, y, ['Mine', 'ocks'], [3096426, 3162220, 2569561, 3030632], 5) Then

Begin
StatsGuise('Yay, we mining');
GetMousePos(x, y);
Case Random(1) Of
0: Mouse(x, y, 2, 3, true);
1: Begin
Mouse(x, y, 2, 3, false);
WaitOption('Mine', 500);
End;

End;

Repeat
MarkTime(OreCounter);
//Antiban;
Wait(100);
If InvCount=Plusone Then
writeln('Woot we got some oar! +1');
Until (InvCount=Plusone) Or (TimeFromMark(OreCounter) > 10000)

End;
End;
Procedure DropDemOre;
var
X, Y, OreDTM, I:Integer;
SlotBox:TBox;
DemOrePattern:TIntegerArray;



Begin


OreDTM:= DTMFromString('mPwEAAHic42dgYGhmYWBoB+JuIO4D4i4g7gXiJiCugeJWKL8BiDug8hOA+CMjA8NLIH4GxM8ZIfwvQPwDyn4NlQPhV0D8FopBbBN5cQYrJUkGQ1kxBis9BQZzBQkwP97HjCEtyJIh3NWQQVVMAOhCJgYDBQWwukh3I4accFsGcsEJIGakAKMBAA5fHy0=');
DemOrePattern:=[5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28];
For I:=0 To 27 Do
Begin
SlotBox:=InvBox(DemOrePattern[I]);
If FindDTm(OreDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(DemOrePattern[I],False);
ChooseOption('Dro');
End;
End;
End;

Begin
SetupSRL;
DeclarePlayers;
SetAngle(True);
Repeat
MineOre;
Until(false);
End.

PS: Does anyone know how to make it not drop my pickaxe without removing '1' in my ore pattern.

Dynamite

2011-12-19 05:07:20

Try using TPA'S on the main screen.

KingKong

2011-12-19 05:14:50

If you don't want it to drop pickaxe, change the ChooseOption('Dro') to ChooseOption('Drop I'). The 'I' is to check for drop iron ore. If mining multiple ores then use ChooseOptionMulti.

Austintheman

2011-12-19 14:06:34

Well, I did use FindObjTPA, however I get this stupid error! :@

It takes me to an inventory tab on my simba and highlights this:
Result := FindColor(x, y, srl_outline_black, TB.x1, TB.y1, TB.x2, TB.y2);


Could anyone help? Here's my current script :confused:

program LeggoMine;

//{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i SRL\SRL\Misc\Stats.simba}


Const
SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)
BreakEvery = 855; //How Many Minutes To Break After
BreakFor = 5; //How Long To Break For
Version = '1.0b';

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ' '; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
//Integers[1] := 4;
//Integers[2] := 3;
end;

end;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Function CheckAndClick(Uptext, Option:String; X, Y:Integer; RClick:Boolean):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(Uptext, 100+Random(50)) Then
Begin
Result:=True;
GetMousePos(x, y);
If RClick Then
Mouse(x, y, 0, 0, False);
Result:= WaitOption(Option, 2000);
If Result Then FFlag(0);
End Else
Begin
Mouse(x, y, 0, 0, True);
Wait(100+Random(50));
FFlag(0);
End;
End;
Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;
Function MineOre:Boolean;
Var
X, Y, PlusOne, OreCounter: Integer;
Begin
PlusOne:= InvCount + 1;
//If FindObjCustom(x, y, ['Mine', 'ocks'], [3096426, 3162220, 2569561, 3030632], 10) Then
x:=MSCX
y:=MSCX
If FindObjTPA(X, Y, 3030632, 10, 1, 5, 5, 15, ['ine']) or
FindObjTPA(X, Y, 2635097, 10, 1, 5, 5, 15, ['ine']) or
FindObjTPA(X, Y, 2963024, 10, 1, 5, 5, 15, ['ine']) Then
Begin
StatsGuise('Yay, we mining');
GetMousePos(x, y);
Case Random(1) Of
0: Mouse(x, y, 2, 3, true);
1: Begin
Mouse(x, y, 2, 3, false);
WaitOption('Mine', 500);
End;

End;

Repeat
MarkTime(OreCounter);
//Antiban;
Wait(100);
If InvCount=Plusone Then
writeln('Woot we got some oar! +1');
Until (InvCount=Plusone) Or (TimeFromMark(OreCounter) > 6000)

End;
End;
Procedure DropDemOre;
var
X, Y, OreDTM, I:Integer;
SlotBox:TBox;
DemOrePattern:TIntegerArray;



Begin


OreDTM:= DTMFromString('mPwEAAHic42dgYGhmYWBoB+JuIO4D4i4g7gXiJiCugeJWKL8BiDug8hOA+CMjA8NLIH4GxM8ZIfwvQPwDyn4NlQPhV0D8FopBbBN5cQYrJUkGQ1kxBis9BQZzBQkwP97HjCEtyJIh3NWQQVVMAOhCJgYDBQWwukh3I4accFsGcsEJIGakAKMBAA5fHy0=');
DemOrePattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28];
For I:=0 To 27 Do
Begin
SlotBox:=InvBox(DemOrePattern[I]);
If FindDTm(OreDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(DemOrePattern[I],False);
ChooseOption('Drop I');
End;
End;
End;

Begin
SetupSRL;
DeclarePlayers;
SetAngle(True);
Repeat
MineOre;
Until(false);
End.

Austintheman

2011-12-19 21:59:28

I know I'm not supposed to triple post or whatever, but can anyone help? I'm still stuck :(