PDA

View Full Version : [Eldevin] Working Copper Miner [RELEASE]



Silverdraco
03-07-2014, 05:46 PM
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('mGQAAAHicY2RgYPBgZmDQY2RgUHfzZGAF8o FMBgYAEgwBOA==');

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.



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 [I]Foundry

Foundry
03-07-2014, 07:38 PM
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
03-07-2014, 08:54 PM
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
03-09-2014, 12:19 AM
Farming script is almost done!

rj
03-09-2014, 05:03 PM
Gratz on release, not too many non RS scripters around these parts

Mythos
03-14-2014, 10:20 PM
Looking forward to your farming script and good work with this one :)

maverik709
03-15-2014, 03:39 AM
Awesome script. Works perfectly. Good job, all. Anyone thought about a coal miner or the other ore miners?

Silverdraco
03-15-2014, 10:04 PM
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
03-16-2014, 01:52 AM
That's still majorly useful, anything that can farm 1 plot automatically is awesome, especially if it adds compost and a scarecrow.

Silverdraco
03-16-2014, 12:31 PM
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
03-16-2014, 02:04 PM
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
03-16-2014, 07:06 PM
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
03-16-2014, 08:36 PM
If the game hits steam, Which I think it will thousands will play.

casfreak
04-10-2014, 03:06 AM
Tnx.

raitr
04-10-2014, 08:23 PM
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('mQwAAAHicY2ZgYBBiYmAQA2JeIH7EyMBwC4 hfAHF/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
05-09-2014, 04:32 PM
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
08-06-2014, 06:20 AM
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,clien tW-1,clientH-1,3);

Crystal color: 10240845

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

henryuscola
09-28-2014, 04:27 PM
script works fine great job

nuby
10-11-2014, 02:25 AM
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
10-23-2014, 01:17 AM
Doesnt work for me either. Can't even find the ore

thebillyman
11-10-2014, 01:49 AM
Can someone post some updated versions of these scripts?

Incurable
11-10-2014, 01:56 AM
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
11-18-2014, 09:38 PM
work ?

alski6969
11-21-2014, 05:06 PM
any update?

ndsxftw
11-22-2014, 03:37 AM
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 :/