SRL Archive - OSR Help

Script problems


xDutch

2012-07-10 17:08:11

I am tryng to make a script that mines and smites in Al- Kharid but it doenst do anything ;S :

 Program MineAndSmith;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
var IronOre, X , Y:integer;


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Pin := ''; // Bank Pin. Leave it if you don't have one.
Players[0].Active := True;
end;
Procedure TPToFurnance;
begin
If InvFull then
GameTab(Tab_Magic);
MouseBox(562, 217, 585, 240, 1);
wait(1000);
If WaitColor(191, 155, 9515824, 10, 7000) Then
Begin
MMouse(191, 155, 4, 4); // using the same coordinates with a randomness
Clickmouse2(true); // then click
Wait(10000 + Random(200));
end;
GameTab(Tab_Inv);
end;
Procedure DTMSAREPRO;
begin
IronOre := DTMFromString('m6wAAAHic42ZgYBAEYhEg5gJiJgYIYAFiHiCWBGIZIJYFYgkg5mNAAA4gFgJiUSCWhtI8UL2sQGypKAk1kTD+z0A8YCQBIwEAlqICyg==');

end;

Procedure FreeThem;
begin
FreeDTM(IronOre);

end;
Procedure WalkToThaMine;
var ToMine:Tpointarray;
x, y :Integer;
Begin

SPS_Setup(runescape_surface,['12_9', '12_8']);
ToMine := [Point(118, 401), Point(138, 388), Point(144, 371), Point(147, 355), Point(153, 339), Point(162, 324), Point(162, 304), Point(174, 278), Point(179, 252), Point(184, 233), Point(200, 207), Point(221, 179), Point(229, 146), Point(232, 120), Point(232, 92), Point(234, 61), Point(234, 36), Point(234, 18), Point(241, 451), Point(241, 422), Point(250, 389), Point(242, 363), Point(232, 351), Point(231, 333), Point(231, 316), Point(234, 312)];
sps_Walkpath(ToMine);
While sps_Walkpath(ToMine) do DebugLn('Walking to tha Mine');


end;

Procedure Hello;
begin
DebugLn('Thanks for using this script!');
end;
begin
Declareplayers;
Smart_Server := 16;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;

SetupSRL;
Hello;
repeat
WalkToThaMine;
Until(False);
end.

This one actualy do something :

Program SmithAndMine;
//{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
var IronOre, X , Y:integer;


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Pin := ''; // Bank Pin. Leave it if you don't have one.
Players[0].Active := True;
end;
Procedure TPToFurnance;
begin
If not InvEmpty then
GameTab(Tab_Magic);
MouseBox(562, 217, 585, 240, 1);
wait(1000);
If WaitColor(365, 226, 3570850 , 10, 7000) Then
Begin
MMouse(365, 226, 4, 4); // using the same coordinates with a randomness
Clickmouse2(true); // then click
Wait(14000 + Random(200));
if FindSymbol(x, y, 'water source') then
MMouse(X, y, 4 ,4);
Clickmouse2(true);
Wait(500);
While IsMoving do Wait(50);
if FindSymbol(x, y, 'furnace') then
MMouse(X, y, 4 ,4);
Clickmouse2(true);
end;
GameTab(Tab_Inv);
end;
Procedure DTMSAREPRO;
begin
IronOre := DTMFromString('m6wAAAHic42ZgYBAEYhEg5gJiJgYIYAFiHiCWBGIZIJYFYgkg5mNAAA4gFgJiUSCWhtI8UL2sQGypKAk1kTD+z0A8YCQBIwEAlqICyg==');

end;

Procedure FreeThem;
begin
FreeDTM(IronOre);

end;
Procedure WalkToThaMine;
var ToMine:Tpointarray;
x, y :Integer;
Begin

SPS_Setup(runescape_surface,['12_9', '12_8']);
ToMine := [Point(118, 401), Point(138, 388), Point(144, 371), Point(147, 355), Point(153, 339), Point(162, 324), Point(162, 304), Point(174, 278), Point(179, 252), Point(184, 233), Point(200, 207), Point(221, 179), Point(229, 146), Point(232, 120), Point(232, 92), Point(234, 61), Point(234, 36), Point(234, 18), Point(241, 451), Point(241, 422), Point(250, 389), Point(242, 363), Point(232, 351), Point(231, 333), Point(231, 316), Point(234, 312)];
sps_Walkpath(ToMine);
While sps_Walkpath(ToMine) do DebugLn('Walking to tha Mine');


end;

Procedure Hello;
begin
DebugLn('Thanks for using this script!');
end;
begin
DeclarePlayers;
{Smart_Server := 16;
Smart_Members := False;
Smart_Signed := False;
Smart_SuperDetail := False; }
SetUpSRL;
repeat //Does the same thing as up above
TPToFurnance;
Hello;
until(AllPlayersInactive);
end.

Runaway

2012-07-10 17:11:30

You can't call DeclarePlayers before SetupSRL.

xDutch

2012-07-10 17:28:00

I do in both?

Le Jingle

2012-07-10 17:30:53

gotta love that parser

program SmithAndMine;
{$i srl/srl.simba}
{$i sps/sps.simba}

var
IronOre, X, Y: integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Pin := '';
Players[0].Active := True;
end;

procedure TPToFurnance;
begin
if not InvEmpty then
GameTab(Tab_Magic);
MouseBox(562, 217, 585, 240, 1);
wait(1000);
if WaitColor(365, 226, 3570850, 10, 7000) then
begin
MMouse(365, 226, 4, 4);
Clickmouse2(true);
Wait(14000 + Random(200));
if FindSymbol(x, y, 'water source') then
MMouse(X, y, 4, 4);
Clickmouse2(true);
Wait(500);
while IsMoving do
Wait(50);
if FindSymbol(x, y, 'furnace') then
MMouse(X, y, 4, 4);
Clickmouse2(true);
end;
GameTab(Tab_Inv);
end;

procedure DTMSAREPRO;
begin
IronOre := DTMFromString('m6wAAAHic42ZgYBAEYhEg5gJiJgYIYAFiHiCWBGIZIJYFYgkg5mNAAA4gFgJiUSCWhtI8UL2sQGypKAk1kTD+z0A8YCQBIwEAlqICyg==');
end;

procedure FreeThem;
begin
FreeDTM(IronOre);
end;

procedure WalkToThaMine;
var
ToMine: Tpointarray;
begin
SPS_Setup(runescape_surface, ['12_9', '12_8']);
ToMine := [Point(118, 401), Point(138, 388), Point(144, 371), Point(147, 355), Point(153, 339), Point(162, 324), Point(162, 304), Point(174, 278), Point(179, 252), Point(184, 233), Point(200, 207), Point(221, 179), Point(229, 146), Point(232, 120), Point(232, 92), Point(234, 61), Point(234, 36), Point(234, 18), Point(241, 451), Point(241, 422), Point(250, 389), Point(242, 363), Point(232, 351), Point(231, 333), Point(231, 316), Point(234, 312)];
sps_Walkpath(ToMine);
while sps_Walkpath(ToMine) do
DebugLn('Walking to tha Mine');
end;

procedure Hello;
begin
DebugLn('Thanks for using this script!');
end;

begin
SetUpSRL;
DeclarePlayers;
repeat
TPToFurnance;
Hello;
until (AllPlayersInactive);
end.

all i did is reformat, and switch setupsrl. the post above doesn't use smart, so your computers mouse will be used and you'll have to select the already opened rs window as the main client. + Idk if you shortened your script or not, but there's several places I think I could tip for improvements

xDutch

2012-07-10 17:42:18

Tip me please ;D

@RunAway see you're thing now to :D Over looked it

Le Jingle

2012-07-10 17:58:49

Well, if you are trying to mine and superheat-smelt? (smite is a prayer..) then;
* I'd remove the SPS walking / symbol finding for AK furnace.. (but if you are AK furn smelting, keep it for now)
* Add in what to do after you have a full inventory, such as drop the ore/superheat/tele or walk to the furnace south of the AK mine
* I don't see anything that actually mines the ore in your script.. this is well obv hazardous to your intentions
(I'll stop short here to say)
It might be easier to setup MSI's AK miner and just bank the ore & smelt it at the furnace with Narcle's AK smelter later.

xDutch

2012-07-10 18:01:17

Im just started first wanted to let it walk :D
And I will just use furnanace instead of Superheat.

And I am just doing to practise my scripting skills.

xDutch

2012-07-10 18:05:03

My Script doenst walk to the mine :S ?
It's just waitintg doing nothing :S?

xDutch

2012-07-11 13:37:33

bump

NKN

2012-07-11 13:42:06

Don't bump, it's double posting. :(