SRL Archive - OSR Help

Help pls? :(


Sandhu255

2012-12-29 20:39:48

Well im trying to make a simba script for a RSPS, and Im trying to make it mine IronOre. I'm new to this and this is my first script, please help :(
I read the tutorials they don't help solve this problem :/

program RSPS_BOT;

procedure MineIronOre;
var
x, y: integer;
begin
if FindObjCustom(x, y, ['ine', 'ocks'], [1844026, 1976901, 1844026], 7); or
if FindObj(x,y 'ocks' 1844026,10)or
if FindObj(x,y 'ocks' 1976901,10)then
begin
Mouse(x,y,0,0,true);
ChooseOption('ine');
wait(500+random(1000));
until(InvFull);
end;
end;




begin
Repeat MineIronOre until(false);
end.
I get the error

[Error] (8:6): Unknown identifier 'FindObj' at line 7
Compiling failed.
[Error] (8:3): Unknown identifier 'FindObjCustom' at line 7
Compiling failed.
[Error] (8:6): Unknown identifier 'FindObjCustom' at line 7
Compiling failed.

CRASH_OVERRIDE

2012-12-29 20:55:07

You haven't added SRL includes to it, you havent added commas after x,y and after 'ocks' instead of having If (findObj); Or use If (findObj) or <– NO ; and you dont need If statement on the below as they are in the same as the above If.

and instead of Begin SCRIPTHERE Until(false) <— you need a Repeat for an ending of Until EG: Repeat SCRIPTHERE Until(false);

Here i fixed it for you:
program RSPS_BOT;
{$I SRL/SRL.SIMBA}

procedure MineIronOre;
var
x, y: integer;
begin
if FindObjCustom(x, y, ['ine', 'ocks'], [1844026, 1976901, 1844026], 7) or
FindObj(x,y, 'ocks', 1844026,10) or
FindObj(x,y, 'ocks', 1976901,10) then
repeat
Mouse(x,y,0,0,true);
ChooseOption('ine');
wait(500+random(1000));
until(InvFull);
end;




begin
Repeat MineIronOre until(false);
end.

Although this is just going to keep searchign the screen in a sweeping motion until it finds a rock and when it finds a rock it will right click and select mine, but its going to keep searching and rightclicking its not going to wait for you to get the ore. Maybe to fix this add a DTM and use a InvCount. The reason you use a DTM is if you mined and your invent is +1 it would make sure its a ore not a sapphire before moving on. And the failsafe here is if someone else gets the ore before you its going to keep waiting so you also need to use a failsafe such as markfromtime.

Sandhu255

2012-12-29 21:10:55

From: tasmania
You haven't added SRL includes to it, you havent added commas after x,y and after 'ocks' instead of having If (findObj); Or use If (findObj) or <– NO ; and you dont need If statement on the below as they are in the same as the above If.

and instead of Begin SCRIPTHERE Until(false) <— you need a Repeat for an ending of Until EG: Repeat SCRIPTHERE Until(false);

Here i fixed it for you:
program RSPS_BOT;
{$I SRL/SRL.SIMBA}

procedure MineIronOre;
var
x, y: integer;
begin
if FindObjCustom(x, y, ['ine', 'ocks'], [1844026, 1976901, 1844026], 7) or
FindObj(x,y, 'ocks', 1844026,10) or
FindObj(x,y, 'ocks', 1976901,10) then
repeat
Mouse(x,y,0,0,true);
ChooseOption('ine');
wait(500+random(1000));
until(InvFull);
end;




begin
Repeat MineIronOre until(false);
end.

Although this is just going to keep searchign the screen in a sweeping motion until it finds a rock and when it finds a rock it will right click and select mine, but its going to keep searching and rightclicking its not going to wait for you to get the ore. Maybe to fix this add a DTM and use a InvCount. The reason you use a DTM is if you mined and your invent is +1 it would make sure its a ore not a sapphire before moving on. And the failsafe here is if someone else gets the ore before you its going to keep waiting so you also need to use a failsafe such as markfromtime.


Thanks man! But the mouse moves so slow and takes like 1 minute to even
reach the RSPS client, anyway It can move faster? :/

bas

2013-01-21 04:26:22

From: Sandhu255
Thanks man! But the mouse moves so slow and takes like 1 minute to even
reach the RSPS client, anyway It can move faster? :/


program RSPS_BOT;
{$I SRL/SRL.SIMBA}

procedure MineIronOre;
var
x, y: integer;
begin
if FindObjCustom(x, y, ['ine', 'ocks'], [1844026, 1976901, 1844026], 7) or
FindObj(x,y, 'ocks', 1844026,10) or
FindObj(x,y, 'ocks', 1976901,10) then
repeat
Mouse(x,y,0,0,true);
ChooseOption('ine');
wait(500+random(1000));
until(InvFull);
end;




begin
SetupSRL; //Setup the SRL
MouseSpeed := 10; //Mouse speed
Repeat
MineIronOre
until(false);
end.

there u go! :)

xtrapsp

2013-01-29 05:49:34

I think the problem with the mouse is that your not updated or something, the mainthing I do when this happens is forceupdate everything, close and reopen :)