SRL Archive - General

Help me please :)


Rent

2012-11-18 08:12:27

hey guys, i know i have made several threads asking for help, but thisis because i have been reading tut's and now am trying to make a script, here's my problem:

program Script;
{$DEFINE SMART}
{$i SRL/SRL.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
end;
procedure AntiBan;
begin
if(not(LoggedIn)) then
Exit;
case Random(8) of
0:
begin
HoverSkill('Mining', false);
wait(2155+random(1851));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(201+random(412));
MakeCompass('S');
wait(351+random(251));
MakeCompass('N');
end;
end;
end;

procedure PowerMine;
var
x, y:integer;
begin
If FindObj(x, y, 'oppe', 4621544, 50)then
begin
MMouse(x, y, 5, 5);
Mouse(x, y, 5, 5, true);
Writeln('Mining');
end;
end;


begin
else
Writeln('We could not find, failsafing');
If FindObj(x, y, 'oppe', 5743615, 50) then
begin
MMouse(x, y, 5, 5):
Mouse(x, y, 5, 5, false);
ChooseOption('ine');
end;
end;
end;
end;
end;




begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
PowerMine;
end.


basically inhte debug box it says;
[Error] (53:1): Identifier expected at line 52
Compiling failed.

Rezozo

2012-11-18 08:15:28

From: Rent
hey guys, i know i have made several threads asking for help, but thisis because i have been reading tut's and now am trying to make a script, here's my problem:

program Script;
{$DEFINE SMART}
{$i SRL/SRL.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
end;
procedure AntiBan;
begin
if(not(LoggedIn)) then
Exit;
case Random(8) of
0:
begin
HoverSkill('Mining', false);
wait(2155+random(1851));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(201+random(412));
MakeCompass('S');
wait(351+random(251));
MakeCompass('N');
end;
end;
end;

procedure PowerMine;
var
x, y:integer;
begin
If FindObj(x, y, 'oppe', 4621544, 50)then
begin
MMouse(x, y, 5, 5);
Mouse(x, y, 5, 5, true);
Writeln('Mining');
end;
end;


begin
else
Writeln('We could not find, failsafing');
If FindObj(x, y, 'oppe', 5743615, 50) then
begin
MMouse(x, y, 5, 5):
Mouse(x, y, 5, 5, false);
ChooseOption('ine');
end;
end;
end;
end;
end;




begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
PowerMine;
end.


basically inhte debug box it says;
[Error] (53:1): Identifier expected at line 52
Compiling failed.


Lol, that random:

begin
else
Writeln('We could not find, failsafing');
If FindObj(x, y, 'oppe', 5743615, 50) then
begin
MMouse(x, y, 5, 5):
Mouse(x, y, 5, 5, false);
ChooseOption('ine');
end;
Get rid of the else.

Rent

2012-11-18 08:16:24

what lol.
i'm bad at this, i know, but i'm learning :D

riwu

2012-11-18 08:17:36

Put your code in simba tag next time.
Your PowerMine procedure has some begin and end at the wrong place.
Read up on standards or you'll be confusing yourself too ;)
Also the MMouse has a ':' instead of ';'.

procedure PowerMine;
var
x, y:integer;
begin
If FindObj(x, y, 'oppe', 4621544, 50)then
begin
// MMouse(x, y, 5, 5); Mouse already does this!
Mouse(x, y, 5, 5, true);
Writeln('Mining');
end else
begin
Writeln('We could not find, failsafing');
If FindObj(x, y, 'oppe', 5743615, 50) then
begin
// MMouse(x, y, 5, 5);
Mouse(x, y, 5, 5, false);
ChooseOption('ine'); //WaitOption may be safer
end;
end;
end;

Lord

2012-11-18 08:18:52

When posting a Simba Script/Code, make sure to use
 tags before and after your code. It makes reading it a lot easier.

Rezozo

2012-11-18 08:19:33

From: riwu
Put your code in simba tag next time.
Your PowerMine procedure has some begin and end at the wrong place.
Read up on standards or you'll be confusing yourself too ;)
Also the MMouse has a ':' instead of ';'.

procedure PowerMine;
var
x, y:integer;
begin
If FindObj(x, y, 'oppe', 4621544, 50)then
begin
// MMouse(x, y, 5, 5); Mouse already does this!
Mouse(x, y, 5, 5, true);
Writeln('Mining');
end else
begin
Writeln('We could not find, failsafing');
If FindObj(x, y, 'oppe', 5743615, 50) then
begin
// MMouse(x, y, 5, 5);
Mouse(x, y, 5, 5, false);
ChooseOption('ine'); //WaitOption may be safer
end;
end;
end;


Wordd^^

I just couldn't read the whole thing, soz. But you get it now right Rent?

Rent

2012-11-18 08:21:24

ah okay, i'll check it out - yep it orked, ty
also, i didn't know how to use the tags, will do from now ;)
thanks guys

Rent

2012-11-18 08:27:28

also - another problem, it doesn't do anything lols..
loads smart, logs in, but he can't find any ores…

Rezozo

2012-11-18 08:30:15

Does it look like it is searching for the items? If it does, check your uptext, is it correct. Also the color.

Rent

2012-11-18 09:28:47

procedure PowerMiner;
var
X, Y:integer;
begin
if FindObj(x, y, 'ine', 4753904, 50) then
begin
FindNormalRandoms;
Writeln('Good');
MMouse(x, y, 5, 5)
Mouse(x, y, 5, 5, true)
end else
begin
Writeln('we could not find, failsafing');
if FindObj(x, y, 'copper', 5743615, 50) then
begin
Mouse(x, y, 5, 5, false);
ChooseOption('ine');
end else
if FindObj(x, y, 'copper', 4027338, 50) then
Mouse(x, y, 5, 5, true)
else
Exit;
end;
end;
that's that thing i've got, in the debug box it says 'we could not find, failsafing', so i think it may be a problem with colours.. i'll try setting tolerance to 100.
kk, i got the problem, now the mouse randomly goes from rock to rock lol, it doesn't click, just switches the rocks :/

KeepBotting

2012-11-18 09:36:11

From: Rent
procedure PowerMiner;
var
X, Y:integer;
begin
if FindObj(x, y, 'ine', 4753904, 50) then
begin
FindNormalRandoms;
Writeln('Good');
MMouse(x, y, 5, 5)
Mouse(x, y, 5, 5, true)
end else
begin
Writeln('we could not find, failsafing');
if FindObj(x, y, 'copper', 5743615, 50) then
begin
Mouse(x, y, 5, 5, false);
ChooseOption('ine');
end else
if FindObj(x, y, 'copper', 4027338, 50) then
Mouse(x, y, 5, 5, true)
else
Exit;
end;
end;
that's that thing i've got, in the debug box it says 'we could not find, failsafing', so i think it may be a problem with colours.. i'll try setting tolerance to 100.
kk, i got the problem, now the mouse randomly goes from rock to rock lol, it
doesn't click, just switches the rocks :/
Change all of your
Mouse(x, y, 5, 5, true)
to
Mouse(x, y, 5, 5, mouse_Left)

riwu

2012-11-18 09:37:10

From: KeepBotting
Change all of your
Mouse(x, y, 5, 5, true)
to
Mouse(x, y, 5, 5, mouse_Left)

What difference would that make other than (debatable) slightly better readability?

KeepBotting

2012-11-18 09:38:06

From: riwu
What difference would that make other than (debatable) slightly better readability?
mouse_Left is for left-clicking, I dunno what he was doing with true there.

Rent

2012-11-18 09:40:47

oh…. thought that meant left click, that's what i read in a tut somewhere here, thanks!

KeepBotting

2012-11-18 09:46:06

From: Rent
oh…. thought that meant left click, that's what i read in a tut somewhere here, thanks!
Tut was probably outdated.

Rent

2012-11-18 09:48:39

well, maybe, but if so why wasn't it un-stickeied O.O
thanks for replies anyway :)

riwu

2012-11-18 19:19:48

From: KeepBotting
mouse_Left is for left-clicking, I dunno what he was doing with true there.

True as the argument for the variant parameter does the exact same thing as mouse_Left.
mouse_Left may be easier for novice to understand but using true is completely fine.

Not many tutorials will ever get 'outdated', at the very most there may be some minor name changes etc.