SRL Archive - First Scripts

Mika'sMithMiner (unfinished)


mika

2011-02-22 19:55:10

This is my first script. It is currently NOT finished. I quit making it because i have the mining lv i needed for the quest and the script is stuck on walking which im having trouble with. Anyone can do whatever they want with it. Credits to me and Coh3n who helped me alot and i copied alot of his stuff from his tutorials. He also tough me how to script.

Start the script in the dwarven mine resource dungeon with the mith,silver and coal rocks. Start standing by the mith rocks.

SCRIPT UPDATED IT CAN WALK BACK TO MITH ROCKS IN THEORY
SCRIPT NOT WORKING DUE TO HUGE MESS IN THE ORDER OF PROCEDURES/FUNCTIONS

What is done:
The script does mine mith rocks
it will deposit all ore if invy full
it might mine coal but not likely
the script is slow
will not deposit coal though

What needs to be done:
alot of stuuf
antibans
antirandoms


Just take a look at it will go back to it someday maybe for now im working on earth rune crafter

Here is my first script:
[ATTACH]10692[/ATTACH]

Flight

2011-02-22 20:03:02

Mate I noticed you didn't remove your Name/Pass, might wanna do that ASAP!

rogeruk

2011-02-22 20:12:02

Your request has been accepted.


mika, I have changed your password, but have NOT logged into your account.

When you login to your account, please take special note of the "last logged in from". If this does not appear your normal information or you are not sure. Make sure you take a screenshot, paste it into paint and upload it somewhere. (imageshack, photobucket etc)

If someone has accessed the account and stolen stuff, then post the screenshot and the moderators/admins can find out who it was via IP check.

Please check PM for password.
(Make sure you read the above!)

Flight

2011-02-22 20:34:54

I'm still very new to Simba myself, but let me throw a suggestion your way, atm this is your MineCoal procedure:
procedure MineCoal;
var
x, y : Integer;
begin
if not LoggedIn then Exit;
if FindObjCustom(x, y, ['ine', 'ocks'], [1910054], 5) then // If the color (2042153) is found, the coordinates of where it was found is stored in the variables (x, y).
Mouse(x, y, 4, 4, True) // This moves and clicks the mouse to x, y; 4, 4 is the randomness on x, y
else

begin
Wait(800); // Remember 1000ms = 1s
MakeCompass('w');
Writeln('First FindColor failed coal, trying second...');
if FindColorTolerance(x, y, 1778467, MSX1, MSY1, MSX2, MSY2, 20) then
Mouse(x, y, 4, 2, True) // This moves AND left clicks the mouse with randomness 4, 4; 'True' = Left click; 'False' = Right click
else

begin
Wait(755);
Writeln('Second FindColor failed coal, trying third...');
if FindColorTolerance(x, y, 1910310, MSX1, MSY1, MSX2, MSY2, 15) then
Mouse(x, y, 4, 4, True)
else

begin
Wait(900);
MakeCompass('w');
Writeln('Third FindColor failed coal, trying forth...');
if FindColorTolerance(x, y, 2239532, MSX1, MSY1, MSX2, MSY2, 15) then
Mouse(x, y, 4, 4, True)
else

begin
Wait(1560);
Writeln('Forth FindColors failed coal, logging out');
Writeln('Script Failure'); // Walk to mith needed
end;
end;
end;
end;
end; // There are so many 'end's because each begin has to have an end, otherwise you will get an "Identifier expected..." error
I'd think of an easier way to do this would be first to declare this under "{$i srl/srl.scar}" at the very top of your script:
Var
I: integer;
CoalRockColor,MithRockColor: Array [0..3] Of Integer;
Second, replace your MineCoal procedure, which I posted earlier, to this:
procedure MineCoal;
var
x, y : Integer;
begin
if not LoggedIn then Exit;
CoalRockColor[0] := 1910054
CoalRockColor[1] := 1778467;
CoalRockColor[2] := 1910310;
CoalRockColor[3] := 2239532;
For I := 0 To 3 Do
if FindObj(x,y,'ine',CoalRockColor[I],10) then
begin
Mouse(x,y,4,4,True);
MakeCompass('n');
end else
begin
Wait(1560);
Writeln('Forth FindColors failed coal, logging out');
Writeln('Script Failure'); // Walk to mith needed
end;
end; // There are so many 'end's because each begin has to have an end, otherwise you will get an "Identifier expected..." error
And now, replace your MineMith procedure with this one:
procedure MineMith;
var
x, y : Integer;
begin
if not LoggedIn then Exit;
MithRockColor[0] := 7425099;
MithRockColor[1] := 7819343;
MithRockColor[2] := 6505026;
MithRockColor[3] := 6636611;
For I := 0 To 3 Do
if FindObj(x,y,'ine',MithRockColor[I],10) then
begin
Mouse(x,y,4,4,True);
MakeCompass('n');
end else
begin
Wait(560);
WalkToCoal;
Writeln('Forth FindColors failed Mith, walk to coal');
Writeln('walk to coal'); //
RepeatMineCoal;
end;
end; // There are so many 'end's because each begin has to have an end, otherwise you will get an "Identifier expected..." error
This is in essence what you had before, but it uses arrays to search through your 4 separate rock colors, rather than having a block of code to perform for each rock color.
Compiles fine, I'm not gonna test it but be sure to give it a go, unless I missed something critical it should work fine. :)

mika

2011-02-22 22:59:40

Thank you so much i remembered right before i went to sleep! Thank you again.that was my main!thank you!

Flight

2011-02-22 23:50:50

Ha yeah, I guess you're lucky you posted it in this community rather than another, as I'm sure anyone else wouldn't have told you.

doublex8

2011-02-24 14:17:08

thanks, I need to get some mithril! I'll try it out.