SRL Archive - First Scripts

PowerMiner


fluffee

2014-01-30 06:57:31

Hey guys!
So i'm pretty much making my first script, and I need some help.
I'm trying to make a script that just mines iron ore till full inv and then drops inventory.

program powerminer;
{$i srl/srl.simba}


Procedure MineRock;
var
x, y : integer;
begin
if FindColorSpiralTolerance(x, y, 2305870, 1, 1, 511, 336, 10) or
FindColorSpiralTolerance(x, y, 1845058, 1, 1, 511, 336, 10) or
FindColorSpiralTolerance(x, y, 2174282, 1, 1, 511, 336, 10) then
begin
MoveMouse (x, y);
if IsUpText('ine Rocks') then
MoveMouse (x, y) ;
ClickMouse(x, y, 1);
wait(4000);
end;
end;

begin
repeat
MineRock;
until(false);
end.
^this is what i have so far.

So, there are still a few problems.
1: When there are ores on the ground it clicks on those aswell, so it doesn't seem to use the uptext.
2: how do you script droping a full inv, since I don't think I can use "DropInv" on a random private server. (2006 based)

Thanks for the help!

Hoodz

2014-01-30 07:26:50

From: fluffee
Hey guys!
So i'm pretty much making my first script, and I need some help.
I'm trying to make a script that just mines iron ore till full inv and then drops inventory.

program powerminer;
{$i srl/srl.simba}


Procedure MineRock;
var
x, y : integer;
begin
if FindColorSpiralTolerance(x, y, 2305870, 1, 1, 511, 336, 10) or
FindColorSpiralTolerance(x, y, 1845058, 1, 1, 511, 336, 10) or
FindColorSpiralTolerance(x, y, 2174282, 1, 1, 511, 336, 10) then
begin
MoveMouse (x, y);
if IsUpText('ine Rocks') then
MoveMouse (x, y) ;
ClickMouse(x, y, 1);
wait(4000);
end;
end;

begin
repeat
MineRock;
until(false);
end.
^this is what i have so far.

So, there are still a few problems.
1: When there are ores on the ground it clicks on those aswell, so it doesn't seem to use the uptext.
2: how do you script droping a full inv, since I don't think I can use "DropInv" on a random private server. (2006 based)

Thanks for the help!

program powerminer;
{$i srl/srl.simba}


Procedure MineRock;
var
x, y : integer;
begin
if FindColorSpiralTolerance(x, y, 2305870, 1, 1, 511, 336, 10) or
FindColorSpiralTolerance(x, y, 1845058, 1, 1, 511, 336, 10) or
FindColorSpiralTolerance(x, y, 2174282, 1, 1, 511, 336, 10) then
begin
MoveMouse (x, y);
if IsUpText('ine Rocks') then
begin {<- add a begin here since if you dont use begin then it will only do the first task instead of them all}
MoveMouse (x, y) ;
ClickMouse(x, y, 1);
wait(4000);
end else
Writeln('no rock found');
end;
end;

begin
repeat
MineRock;
until(false);
end.

fluffee

2014-01-30 08:25:01

I tried adding the "begin" but now it just goes to the iron ore and keeps standing there.
It doesn't click anymore or anything. :p

Kyle

2014-01-30 08:30:34


program powerminer;
{$i srl/srl.simba}


Procedure MineRock;
var
x, y : integer;
begin
if FindColorSpiralTolerance(x, y, 2305870, 1, 1, 511, 336, 10) or
FindColorSpiralTolerance(x, y, 1845058, 1, 1, 511, 336, 10) or
FindColorSpiralTolerance(x, y, 2174282, 1, 1, 511, 336, 10) then
begin
MoveMouse (x, y);
if WaitUpText('ine', 30) then
begin
ClickMouse(x, y, 1);
wait(4000);
end else
Writeln('no rock found');
end;
end;

begin
repeat
MineRock;
until(false);
end.

Try that. I added waituptext. What that does, is when the mouse is over the rock, it will wait the specified time before "failing" the uptext check.

EDIT: You also had an extra movemouse which I removed

fluffee

2014-01-30 09:35:24

It's still doing it. :(
It just hovers above the iron ore and stays there like it's continiously checking something, it doesn't find a rock either.
I'm guessing it doesn't register the uptext as it is a RSPS.
It's a 2006 based private server btw, wasn't really clear on that in my first post.

Kyle

2014-01-30 10:01:05

From: fluffee
It's still doing it. :(
It just hovers above the iron ore and stays there like it's continiously checking something, it doesn't find a rock either.
Maybe it doesn't register the uptext which is weird, cause I thought it did in another script.
It's a 2006 based private server btw, wasn't really clear on that in my first post.


Oh… Well yeah, the uptext isn't going to work on a private server….

fluffee

2014-01-30 10:47:29

Do you know how it would?
or any other options?

rj

2014-01-30 11:28:57

From: fluffee
Do you know how it would?
or any other options?


You can download my rsps include from: https://github.com/officerBarbrady/srlRSPS
Extract it to C:/simba/includes and rename to 'srlRSPS'
Change interpreter to lape:

this should work:
program powerminer;
{$I RSPS/srlRSPS.Simba}

var
_myServer:_rsps_server;

Procedure MineRock;
var
x, y : integer;
begin
if FindColorSpiralTolerance(x, y, 2305870, 1, 1, 511, 336, 10) or
FindColorSpiralTolerance(x, y, 1845058, 1, 1, 511, 336, 10) or
FindColorSpiralTolerance(x, y, 2174282, 1, 1, 511, 336, 10) then
begin
moveMouse(x, y);
if _myServer.WaitUpText('ine', 200) then
begin
Mouse(x, y);
wait(4000);
end else
Writeln('no rock found');
end;
end;

begin
_myServer.init(317, '317 server');
repeat
MineRock;
until(false);
end.


Guide on how to use it: http://villavu.com/forum/showthread.php?t=107755&highlight=

fluffee

2014-01-30 12:12:17

thanks for the reply. :)
I did what you said and I still get the following error:
"Exception in Script: File "RSPS/srlRSPS.Simba" not found at line 2, column 5"

King

2014-01-30 14:56:43

To drop the ore use a for…do to loop through all inventory slots. Unless Rjj has a drop function in his include.

fluffee

2014-01-30 15:19:54

a what? :P
and does someone have an idea how to solve the error?
thanks.

The Mayor

2014-01-30 15:28:20

From: fluffee
a what? :P
and does someone have an idea how to solve the error?
thanks.


by the looks of things it can't find the srlRSPS.simba file.

Make sure it is in C:/Simba/includes/RSPS/srlSRPS.simba

fluffee

2014-01-30 15:31:49

Yeah but the thing is, i don't have a map "RSPS" in includes.
I just made one and put it in but that didn't work either.

King

2014-01-30 17:55:03

I would PM Rjj as it is his include.

fluffee

2014-01-30 18:10:41

Rjj is officer barbrady right?

rj

2014-01-31 17:42:37

From: fluffee
Rjj is officer barbrady right?


You can download my rsps include from: https://github.com/officerBarbrady/srlRSPS

Extract it to C:/simba/includes and rename to 'RSPS'

My bad told you to name it 'srlRSPS' instead of just 'RSPS'

From: king
To drop the ore use a for…do to loop through all inventory slots. Unless Rjj has a drop function in his include.


as long as he sets up the include right he can just use this function:

function _rsps_server.dropAll:boolean;
var
i, c, k:integer;
begin
result := false;
c := inventory.count();
if (c = 0) then
exit(true);
for i := 0 to 27 do
if inventory.slotFull(i) then
begin
inventory.interactItem(i, mouse_right);
if self.waitOption('rop', 200) then
k := k + 1;
end;
exit(k = c);
end;

King

2014-02-02 16:33:28

From: Officer Barbrady
You can download my rsps include from: https://github.com/officerBarbrady/srlRSPS

Extract it to C:/simba/includes and rename to 'RSPS'

My bad told you to name it 'srlRSPS' instead of just 'RSPS'



as long as he sets up the include right he can just use this function:

function _rsps_server.dropAll:boolean;
var
i, c, k:integer;
begin
result := false;
c := inventory.count();
if (c = 0) then
exit(true);
for i := 0 to 27 do
if inventory.slotFull(i) then
begin
inventory.interactItem(i, mouse_right);
if self.waitOption('rop', 200) then
k := k + 1;
end;
exit(k = c);
end;


Exactly as he posted!