SRL Archive - Non-RuneScape Scripts

[Eldevin] Working Copper Miner [RELEASE]


Silverdraco

2014-03-07 12:46:53

Hi everyone,

After a bit of work I finished my copper miner for Eldevin.

program copperMiner;
{$I SRL-OSR/SRL.simba}
{$I SRL-OSR/SRL/misc/al_functions.simba}

////////////////////////////////////////
//// by ///
/// Silverdraco ////
////////////////////////////////////////

var
a, CopperColor, foundX, foundY, clientW, clientH: Integer;
foundOre, allGood: Boolean;

procedure initDTMs;
begin
CopperColor := DTMFromString('mGQAAAHicY2RgYPBgZmDQY2RgUHfzZGAF8oFMBgYAEgwBOA==');

end;

procedure LClickXY(x,y: Integer);
begin
MoveMouse(x,y);
ClickMouse(x,y,0);
end;

procedure RClickXY(x,y: Integer;doubleClick: boolean);
begin
MoveMouse(x,y);
ClickMouse(x,y,1);
if doubleClick then
begin
ClickMouse(x,y,1);
end;
end;

procedure compareDTMScreen(DTM: Integer);
begin
foundOre := FindDTM(CopperColor,foundX,foundY,0,0,clientW-1,clientH-1);
end;

begin
writeln('=================================================');
writeln('Initializing...');
GetClientDimensions(clientW,clientH);
initDTMs;
writeln('done');
allGood:= true;
while allGood do
begin
if isKeyDown(112) then
allGood:=false;
compareDTMScreen(CopperColor);
sleep(400);
if foundOre then
begin
writeln('Found ore at ['+toStr(foundX)+','+toStr(foundY)+'] - Mining...');
RClickXY(foundX,foundY,true);
for a := 0 to 3 do
begin
if isKeyDown(112) then
allGood:=false
else
sleep(1000);
end;
sleep(Random(1000))
end
else
allGood:= false;
end;
if foundOre then
writeln('Stopped by user.')
else
writeln('Can not find ore. Stopping...');
writeln('=================================================');
FreeDTM(CopperColor);
end.


[Instructions]
Set up Simba like in this guide: can't post links, will post on first comment (Thanks to HoodZ)
Start this in the mine with the copper ores. Preferably somewhere where at least 3 or 4 copper ores are within sight at all times.
Hold F1 for a sec or so to stop the script. It will stop automatically if it can not find any ores.


Special credits to Wizzup for helping me out with some stuff in IRC!

Edit: yeeeaah I can't post the link in a comment either. Just look for 'Updated SRL-OSR Setup (Jan 4, 2014)' by Turpinator in > HomeForum > Help and Tutorials > Old School Runescape Help and Tutorials > OSR Setup Tutorials

Edit 2: optimized code thanks to Foundry

Foundry

2014-03-07 14:38:56

Grats on the release! I'm gonna take a look at Eldevin later today, seems like quite a few people want scripts for it.

Your script looks pretty good. The only thing I see that could be made neater is this:

if isKeyDown(112) then
allGood:=false
else
sleep(1000); //don't mind this awesome piece of redundancy, please. I didn't want to make the user have to hold the stop button for 4 seconds :)
if isKeyDown(112) then
allGood:=false
else
sleep(1000);
if isKeyDown(112) then
allGood:=false
else
sleep(1000);
if isKeyDown(112) then
allGood:=false
else
sleep(1000);

I know you put the note there and everything and I understand that you don't want to have the user hold it down for four seconds, but you could do this to condense it a bit:

for 0 to 3 do
begin
if isKeyDown(112) then
allGood:=false
else
sleep(randomrange(800, 1200));
end;

Silverdraco

2014-03-07 15:54:46

From: Foundry
Grats on the release! I'm gonna take a look at Eldevin later today, seems like quite a few people want scripts for it.

Your script looks pretty good. The only thing I see that could be made neater is this:

if isKeyDown(112) then
allGood:=false
else
sleep(1000); //don't mind this awesome piece of redundancy, please. I didn't want to make the user have to hold the stop button for 4 seconds :)
if isKeyDown(112) then
allGood:=false
else
sleep(1000);
if isKeyDown(112) then
allGood:=false
else
sleep(1000);
if isKeyDown(112) then
allGood:=false
else
sleep(1000);

I know you put the note there and everything and I understand that you don't want to have the user hold it down for four seconds, but you could do this to condense it a bit:

for 0 to 3 do
begin
if isKeyDown(112) then
allGood:=false
else
sleep(randomrange(800, 1200));
end;



Cheers! I'll add that to the code, haha :) this is my first time working in pascal ever, so I'm doing a lot of things wrong…

If you like the game and feel like trying something together I have some (potentially) neat ideas, already got a prototype for wool collecting and coal mining, PM me your skype! ;)

Silverdraco

2014-03-08 19:19:03

Farming script is almost done!

rj

2014-03-09 13:03:53

Gratz on release, not too many non RS scripters around these parts

Mythos

2014-03-14 18:20:26

Looking forward to your farming script and good work with this one :)

maverik709

2014-03-14 23:39:14

Awesome script. Works perfectly. Good job, all. Anyone thought about a coal miner or the other ore miners?

Silverdraco

2014-03-15 18:04:52

From: Mythos
Looking forward to your farming script and good work with this one :)


Couldn't reply to your message due to low post count…

Farming script is pretty much finished, it only supports 1 plot so I'm not sure how useful it really is…

Mythos

2014-03-15 21:52:43

That's still majorly useful, anything that can farm 1 plot automatically is awesome, especially if it adds compost and a scarecrow.

Silverdraco

2014-03-16 08:31:33

From: Mythos
That's still majorly useful, anything that can farm 1 plot automatically is awesome, especially if it adds compost and a scarecrow.


It doesnt do that, but I can implement it. PM me your skype or something I'll send you the 'beta' version :)

Mythos

2014-03-16 10:04:59

From: Silverdraco
It doesnt do that, but I can implement it. PM me your skype or something I'll send you the 'beta' version :)


Awesome, ive sent you a message with my skype.

Silverdraco

2014-03-16 15:06:15

From: Officer Barbrady
Gratz on release, not too many non RS scripters around these parts


Thanks! Just wish more people played this game. I guess me making scripts for it isn't helping :blushing:

Mythos

2014-03-16 16:36:51

If the game hits steam, Which I think it will thousands will play.

casfreak

2014-04-09 23:06:28

Tnx.

raitr

2014-04-10 16:23:59

Found out about this game today, was googling for some guides and found this :)
Gotta push out some scripts too :) ty for this example.

Edit:

Rough edit for coal

program copperMiner;
{$I SRL-OSR/SRL.simba}
{$I SRL-OSR/SRL/misc/al_functions.simba}

var
a, CopperColor, foundX, foundY, clientW, clientH: Integer;
foundOre, allGood: Boolean;

procedure initDTMs;
begin
CopperColor := DTMFromString('mWAAAAHicXchBCsAgEEPRP0Oggrry/tdzV9AbGJdt4EESAW/ANCV0G7a9lzX38hQkkRn02vD1ET83BynpBE0=');

end;

procedure LClickXY(x,y: Integer);
begin
MoveMouse(x,y);
ClickMouse(x,y,0);
end;

procedure RClickXY(x,y: Integer;doubleClick: boolean);
begin
MoveMouse(x,y);
ClickMouse(x,y,1);
if doubleClick then
begin
ClickMouse(x,y,1);
end;
end;

procedure compareDTMScreen(DTM: Integer);
begin
foundOre := FindDTM(CopperColor,foundX,foundY,0,0,clientW-1,clientH-1);
end;

begin
writeln('=================================================');
writeln('Initializing…');
GetClientDimensions(clientW,clientH);
initDTMs;
writeln('done');
allGood:= true;
while allGood do
begin
if isKeyDown(112) then
allGood:=false;
compareDTMScreen(CopperColor);
sleep(400);
if foundOre then
begin
writeln('Found ore at ['+toStr(foundX)+','+toStr(foundY)+'] - Mining…');
RClickXY(foundX,foundY,true);
for a := 0 to 3 do
sleep(Random(1000));
begin
if isKeyDown(112) then
allGood:=false
else
sleep(1000);
end;
sleep(Random(1000))
end
else
allGood:= true;
end;
if foundOre then
writeln('Stopped by user.')
else
writeln('Can not find ore. Stopping…');
writeln('=================================================');
FreeDTM(CopperColor);
end.


And Shearing Sheep


program sheepShearer;
{$I SRL-OSR/SRL.simba}
{$I SRL-OSR/SRL/misc/al_functions.simba}

var
a, SheepColor, foundX, foundY, clientW, clientH: Integer;
foundSheep, allGood: Boolean;

procedure initDTMs;
begin
SheepColor := DTMFromString('mQwAAAHicY2ZgYBBiYmAQA2JeIH7EyMBwC4hfAHF/fx1DhL8bQ6iPCwMrUB0MMyJhIAAABHYGZg==');

end;

procedure LClickXY(x,y: Integer);
begin
MoveMouse(x,y);
ClickMouse(x,y,0);
end;

procedure RClickXY(x,y: Integer;doubleClick: boolean);
begin
MoveMouse(x,y);
ClickMouse(x,y,1);
if doubleClick then
begin
ClickMouse(x,y,1);
end;
end;

procedure compareDTMScreen(DTM: Integer);
begin
foundSheep := FindDTM(SheepColor,foundX,foundY,0,0,clientW-1,clientH-1);
end;

begin
writeln('=================================================');
writeln('Initializing…');
GetClientDimensions(clientW,clientH);
initDTMs;
writeln('done');
allGood:= true;
while allGood do
begin
if isKeyDown(112) then
allGood:=false;
compareDTMScreen(SheepColor);
sleep(100);
if foundSheep then
begin
writeln('Found sheep at ['+toStr(foundX)+','+toStr(foundY)+'] - Shearing…');
RClickXY(foundX,foundY,true);
for a := 0 to 3 do
sleep(2500);
sleep(Random(1000))
begin
if isKeyDown(112) then
allGood:=false
else
sleep(1000);
end;
sleep(Random(1000))
end
else
allGood:= false;
end;
if foundSheep then
writeln('Stopped by user.')
else
writeln('Can not find sheep. Stopping…');
writeln('=================================================');
FreeDTM(SheepColor);
end.

DiShanTheRage

2014-05-09 12:32:58

I have this error :
Exception in Script: Don't know which overloaded method to call with params (Extended) at line 362, column 27 in file "C:\Simba\Includes\SRL-OSR\SRL\misc\al_functions.simba"
How to fix it?


Ah okay, just need switch to pascal.

But there is another problem, when i run script, character just run anywhere, not to the ore.
Now it works well, just need to run in full screen.
Can anyone do script for Amethyst Deposits?

MaxGreden

2014-08-06 02:20:07

Hi! :)

Nice release!

A couple things:

procedure compareDTMScreen(DTM: Integer);
begin
foundOre := FindDTM(CopperOre,foundX,foundY,0,0,clientW-1,clientH-1);
end;
On the FindDTM, you don't need to have CopperOre. You can just have it as DTM as currectly you're not using the parameter.

compareDTMScreen(CopperColor);

For the script, it clicked randomly on the ground sometimes, also on my level bubble. For me, it worked best with tolerance of 3. Instead of 5.
I noticed your DTM had only 1 point. You're basically just checking the color. Which FindColorTolerance does just fine.

This worked for me:
foundOre := FindColorTolerance(foundX,foundY,4276791,0,0,clientW-1,clientH-1,3);

Crystal color: 10240845

For coal, either bitmap or DTM would be neccecary, I think.

henryuscola

2014-09-28 12:27:57

script works fine great job

nuby

2014-10-10 22:25:50

I can't seem to get this to work, it just clicks near a node, not on the actual node. What resolution/ settings are you running on? browser/client?

b1058

2014-10-22 21:17:58

Doesnt work for me either. Can't even find the ore

thebillyman

2014-11-09 20:49:38

Can someone post some updated versions of these scripts?

Incurable

2014-11-09 20:56:46

From: thebillyman
Can someone post some updated versions of these scripts?


I don't think anyone here even plays Eldevin, it's not very likely to happen.

bulbacz

2014-11-18 16:38:49

work ?

alski6969

2014-11-21 12:06:56

any update?

ndsxftw

2014-11-21 22:37:39

Damn I don;t know how to get this to work, I'm having issues with
{$I SRL-OSR/SRL.simba}
{$I C:\Simba\Scripts\al_functions.simba}

I don't know what to do :/