SRL Archive - OSR Help

Lol bout to give up completely on DTM Walking.


imaloser

2012-01-08 15:52:30

Program SnapeGrassColl;
{$i srl/srl.scar}
{$i sps/sps.simba}

Var X, Y, IALBW, B2: Integer;
aFound: Extended;

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
Begin
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
End;
End;

Procedure Antiban;
Begin
Case Random(320) Of
0: HoverSkill('random', False);
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', False);
End;
End;


Procedure SetDTM;
Begin
IALBW := DTMFromString('mwQAAAHic42RgYMgA4gQgbgTiUiCOAuIGIC4C4ilAHAzEIkAcCMSWQGwCxBZAnA3E4UBsBMS+QPz42SeG1IRUhvmLVjFcvHKfYdWiZQx2VvZgsbaOCQwvf3Ez8APVEcKMRGA4AABB5xaJ');
B2 := DTMFromString('m1gAAAHic42JgYMgAYm8grgDiEiCOBOImIA4FYkcg7gLiFCA2BmJnIPYDYn0gLgPiXCAOAmJbqBxI/MmrDwzrtmxnOHr6PMPLX9wMPZOmMHx+/ZJh0/bdDP7BwWA5kDg/UC0xmJFIjAAA+/UcPQ==');
End;


Procedure FrDTM;
Begin
IALBW := DTMFromString('mwQAAAHic42RgYMgA4gQgbgTiUiCOAuIGIC4C4ilAHAzEIkAcCMSWQGwCxBZAnA3E4UBsBMS+QPz42SeG1IRUhvmLVjFcvHKfYdWiZQx2VvZgsbaOCQwvf3Ez8APVEcKMRGA4AABB5xaJ');
B2 := DTMFromString('m1gAAAHic42JgYMgAYm8grgDiEiCOBOImIA4FYkcg7gLiFCA2BmJnIPYDYn0gLgPiXCAOAmJbqBxI/MmrDwzrtmxnOHr6PMPLX9wMPZOmMHx+/ZJh0/bdDP7BwWA5kDg/UC0xmJFIjAAA+/UcPQ==');
End;


Procedure IALBank;
Begin
if FindDTMRotated(IALBW, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/30, aFound) then
Begin
Mouse(X, Y, 4, 4, True);
FFlag(6);
Antiban;
End;
Repeat
Wait(50 + Random(25));
Until FindDTMRotated(B2, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/30, aFound)
If FindDTMRotated(B2, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/30, aFound) Then
begin
Mouse(x, y, 5, 5, True);
FFlag(6);
Wait(500 +Random(250));
end;

End;


procedure Ending;
begin
WriteLn('Loop Ended.');
FrDTM;
WriteLn('Logging Out.');
Logout;
WriteLn('Script Terminated.');
Terminatescript;
end;


Procedure SettingUp;
Begin
MouseSpeed := 18;
SetDTM;
GameTab(tab_Inv);
MakeCompass('N');
SetAngle(True);
End;


Begin
ClearDebug;
SetupSRL;
SettingUp;
Addonterminate('Ending');
Begin
IALBank;
FindNormalRandoms;
End;
Ending;




End.

SRL Compiled in 15 msec
Loop Ended.
Logging Out.
Script Terminated.
Loop Ended.
Logging Out.
Script Terminated.
Successfully executed.
The following DTMs were not freed: [0, 1, 2, 3, 4, 5]

SRL Compiled in 16 msec
Error: Exception: Out of memory at line 136
The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

This shit makes me want to shoot myself. :fiery:

I'm just trying to get it to walk from (random)Ring of Kinship teleport to the bank, just trying to get that simple ass 2 clicks on the MM which would get me there.

Also I'm on simba 980, I guess there's an update for 982 but.. id rather not touch that. so is simba fucked up or something?

x[Warrior]x3500

2012-01-08 16:34:24

simba works fine (dont blame it on the program), u just didnt do a lot right.

1. {$i srl/srl.scar} -> {$i srl/srl.simba} (update your srl)
2. your DTMs dont work, remake them (no this is not simba's fault, i just created my own dtm, put it as your "IALBW" dtm and it worked perfectly).
3. you have infinate loops, which you NEVER do. period.

4. if you would have debugged your program, you would have caught most of waht i said. learn to debug. :) it helps

honestly, if i were to be doing map movement here, i would either use SPS (if it is even working) or Radial walking. dtms are a little tricky when everything is white on the MM.

DemiseScythe

2012-01-08 16:45:09

This looks akwardly familiar, umm… DeJavu?

As for the guy above me, he is right, you need to make them right for them to be picked up, use too few points and it might not find too many, use too many and it will too few.

Try re-doing the points until they work, don't put them too far from eachother, if you need to, make it 3 points instead of two

Oh, also update to .982 and use SRL5, SRL4 is not longer going to receive updates and updates mean bug fixes. Make the switch to SRL5 and you got a better chance at a working script.

imaloser

2012-01-08 17:02:48

From: DemiseScythe
This looks akwardly familiar, umm… DeJavu?

As for the guy above me, he is right, you need to make them right for them to be picked up, use too few points and it might not find too many, use too many and it will too few.

Try re-doing the points until they work, don't put them too far from eachother, if you need to, make it 3 points instead of two

Oh, also update to .982 and use SRL5, SRL4 is not longer going to receive updates and updates mean bug fixes. Make the switch to SRL5 and you got a better chance at a working script.


Well I do have SRL5, Just I started learning EVERYTHING in SRL4 then SRL5 gets released and it just feels pressuring to have to go back and revise what I 'use' to do lol.

Also, Idk if I'm stealing your method or not just I like your tutorial a lot and the way you use DTM's lol.

Also when he said infinite loops, is that aiming towards my main loop or is that in the procedures?

Time to go back to the tutorial section for beginner guides, yayy!

Gu3st...

2012-01-08 17:03:59

Do you include tolerance on the sub points?

DemiseScythe

2012-01-08 17:12:43

All my points in every DTM have 15 Tolerance, and not accusing you of copying, just that feeling when you have read something similar before. If you do not make them all 15 Tolerance, RS color changing technology will break them easily. Make sure you are.

About SRL4 vs SRL5, there is not much difference, you just need to edit your includes and use a different parameter for SetAngle, nothing else has changed that an average scripter woud need to know =) I like it, runs better.


EDIT:

Just noticed, on the FrDTM procedure you should have

FreeDTM(dtm name here);

You are defining them instead of freeing them

mormonman

2012-01-08 17:13:35

You never free your DTMs.

imaloser

2012-01-11 06:36:42

From: mormonman
You never free your DTMs.


Ohhh that makes sense! Thank you so much for your post! really cleared things up for me. :thumbsdown:

mormonman

2012-01-11 10:01:28

From: imaloser
Ohhh that makes sense! Thank you so much for your post! really cleared things up for me. :thumbsdown:


Just letting you know, no reason to be a loser(cwatididthere?)