SRL Archive - Help

Error =\


gaetano

2011-12-21 21:31:16

program SecretForNow;

{$DEFINE SMART}
{$i SRL\SRL.scar}

procedure SetupChar;

begin

SetAngle(True);
MakeCompass('N');
Retaliate(True);
end;


procedure WalkToPad;

Begin

If Not LoggedIn then Exit;
if (Players[CurrentPlayer].Level[SKILL_HITPOINTS] < 990) then
Begin
MoveMouse(651, 37);
Mouse(651, 37, 1, 1, True);

End;
End;



Begin

Smart_Server:=35;
SetupSRL;
Repeat
WalkToPad;
Until (false)
End.

I keep on getting this error with this script

The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

YoHoJo

2011-12-21 21:36:48

Thats not the error, that just happens any time you stop a script prematurely/script stops itself.
What else is in the debug?

gaetano

2011-12-21 21:37:44

Compiled successfully in 593 ms.
SRL Compiled in 16 msec
SMART Initialized.
Loaded: Server 35, Members: False, Signed: False, Super Detail: False.
Error: Out Of Range at line 21
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]


This

Brandon

2011-12-21 21:42:20

Out of range because you didn't Declare Players yet.

You need this procedure before anything else:


Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
BoxRewards := ['XP','xp','lamp'];
LampSkill := 'Runecrafting';
Active := True;
end;
end;

gaetano

2011-12-21 21:45:45

Thanks, but I still get the same error

Griff

2011-12-21 21:55:04

From: gaetano
Thanks, but I still get the same error


Did you call DeclarePlayers in the main loop?

gaetano

2011-12-21 21:59:26

Can you teach me how to do that?

YoHoJo

2011-12-21 22:01:21

Show us entire script you are using please.
Basically after SetupSRL; call your declare players procedure!

Griff

2011-12-21 22:02:11

Right under where you have SetUpSRL, just put DeclarePlayers, so it will look like this:
SetUpSRL;
DeclarePlayers;

Edit: YoHoJo you speedy ninja!

gaetano

2011-12-21 22:04:16

program SecretForNow;

{$DEFINE SMART}
{$i SRL\SRL.scar}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
BoxRewards := ['XP','xp','lamp'];
LampSkill := 'Runecrafting';
Active := True;
end;
end;



procedure SetupChar;

begin

SetAngle(True);
MakeCompass('N');
Retaliate(True);
end;


procedure WalkToPad;

Begin

if (Players[CurrentPlayer].Level[SKILL_HITPOINTS] < 154) then
Players[CurrentPlayer].Level[SKILL_HITPOINTS] := Max(1, GetSkillInfo('hitpoints', False));

Begin
MoveMouse(651, 37);
Mouse(651, 37, 1, 1, True);

End;
End;



Begin

Smart_Server:=35;
SetupSRL;
Repeat
WalkToPad;
Until (false)
End.


THis is the entire script. Its a simple AFK'er (Secret) will release once 100% ready

YoHoJo

2011-12-21 22:05:40

After setupSRL put DeclarePlayers
You never called DeclarePlayers yet!

Griff

2011-12-21 22:07:44

First, check Shuttleu's guide for help on fixing your standards.

Next, Make sure you have DeclarePlayers called in the main loop of your scri[t, followed by LoginPlayer. That should fix the problems you're having now, but post if you need anything else :)

gaetano

2011-12-21 22:07:51

Ok, the script works (kinda) now, the only problem i have now is I try to set the string to run to my co-ords if hp is under ____ The problem is that it is just running even if my hitpoints are over the string, if you get what I mean

Set it to

if (Players[CurrentPlayer].Level[SKILL_HITPOINTS] < 333) then
Players[CurrentPlayer].Level[SKILL_HITPOINTS] := Max(333, GetSkillInfo('hitpoints', False));

Begin
MoveMouse(651, 37);
Mouse(651, 37, 1, 1, True);

It will run if it is at 940 hp (My max hp as of now)

Griff

2011-12-21 22:10:01

You need to put brackets after everything after your then statement, or move your begin.

gaetano

2011-12-21 22:11:36

Do you mind showing me? I don't seem to get it.

Griff

2011-12-21 22:13:17

if (Players[CurrentPlayer].Level[SKILL_HITPOINTS] < 333) then
begin
Players[CurrentPlayer].Level[SKILL_HITPOINTS] := Max(333, GetSkillInfo('hitpoints', False));
MoveMouse(651, 37);
Mouse(651, 37, 1, 1, True);
end;

You could even take out that third line there, unless you need it for later.

gaetano

2011-12-21 22:19:15

Im sorry for being trouble but :P

[Error] (1:1): Unexpected end of file at line 0
Compiling failed.

Griff

2011-12-21 22:28:44

Do you have a "." after your end of the main loop?

gaetano

2011-12-21 22:29:12

Ahh got it to work! thanks guys!

Time to test this method now :P

Griff

2011-12-21 22:30:01

No problemo ;)

gaetano

2011-12-21 22:40:42

And It stops after one run. How would I be able to Main loop ?

procedure WalkToPad;

Begin

if (Players[CurrentPlayer].Level[SKILL_HITPOINTS] < 500) then
begin
Players[CurrentPlayer].Level[SKILL_HITPOINTS] := Max(500, GetSkillInfo('hitpoints', False));
MoveMouse(651, 37);
Mouse(651, 37, 1, 1, True);

Griff

2011-12-21 22:45:28

Don't you already have a repeat in your main loop? I wouldn't recommend until false, maybe just like until(100) or something. Also, your MoveMouse line isn't really needed, because Mouse moves it anyways. And I'd recommend trying to take out those Mouse procedures, and learn some object finding, although I'm not sure what your script does so I can't help too much there.

gaetano

2011-12-21 22:54:25

Instead of the junk I had

I made this instead

 procedure WalkToPad;

Begin

if (HPPercent < 550) then
begin
Mouse(651, 37, 1, 1, True);

End;
End;

But how can I make it from clicking the co-ords even if it is above 550?

Griff

2011-12-21 23:35:03

If you want it to click the co ord every time then just take out your if.. Then statement.

gaetano

2011-12-26 19:35:25

Still needing help with this, even though I have full hp it just keeps on clicking the co-ords.