SRL Archive - OSR Help

Trying to understand movement a little more...


Roflme

2012-09-18 15:48:00

Procedure Walk;
var
myPath: TPointArray;
begin
myPath := [Insert Points Here];

SPS_WalkPath(myPath);

end;

Now if I wanted to add say..

repeat
Wait(100+random(10));
Antiban;
FindNormalRandoms;
until not isMoving;

Where would that go? Can that go after SPS_WalkPath or before? Does it even do anything? Or will the script walk the path and then begin repeating that repeat (and end up being a useless addition to the script since after the path has been completed it won't be moving…)?

Tried reading
function SPS_WalkPath(Path: TPointArray): boolean;
var
I, H, T, D: integer;
P, MM: TPoint;
begin
H := High(Path);
T := GetSystemTime + 20000 + Random(5000);

while (not Result) and (GetSystemTime < T) do
begin
RunEnergy(20);

P := SPS_GetMyPos;
for I := H downto 0 do
begin
MM.X := MMCX + Path[I].X - P.X;
MM.Y := MMCY + Path[I].Y - P.Y;

D := Distance(MM.X, MM.Y, MMCX, MMCY);

if (D < 10) then
break
else
if (D < 70) then
begin
if (SPS_MultiMouse) then
MultiMouse(MM.X, MM.Y, 25, 3, false)
else
Mouse(MM.X, MM.Y, 5, 5, mouse_Left);

FFlag(Integer(I <> H) * 15);

T := getSystemTime + 20000 + Random(1000);
Break;
end;
end;

Result := (I = H);
end;
end;

but I didn't really understand. I could just edit the actual SPS function to do antibans and findnormalrandoms but don't want to do it JUST IN CASE it could ruin another script (probably wouldn't). But even then I'd be somewhat lost in finding where to add it. Would just add it in quite a few spots I guess.

Just need to add this into my walking procedures and don't know where to put it :p


And on a side note, is there any difference between these three?

While isMoving do
Antiban;
FindNormalRandoms;
//etc. etc. etc.

While isMoving do
repeat
Antiban;
FindNormalRandoms;
//etc. etc. etc.
until not IsMoving

repeat
Antiban;
FindNormalRandoms;
//etc. etc. etc.
until not IsMoving

Is the while do statement and repeat until statement just redundant? Does any of those three work better? (Goal: While walking script will be checking for randoms/antiban/etc. etc.

Footy

2012-09-18 18:38:19

You'd have to edit the walkpath function with you're own antiban to do that I believe. Just save an unchanged version and use that when using other scripts. I've made many changes to the SRL include, you should be fine.

CephaXz

2012-09-18 18:48:47

SRL_Procs[srl_OnFindRandom] := @Dorandoms;

SRL_Procs[srl_AntiBan] := @Antiban;

Roflme

2012-09-18 21:12:07

From: Footy
You'd have to edit the walkpath function with you're own antiban to do that I believe. Just save an unchanged version and use that when using other scripts. I've made many changes to the SRL include, you should be fine.


Hmm…

So like, SPS_WalkPathCustom(myPath); would just require me to copy and paste the current walk path but add some of my own stuff there? And just save it where the other SPS functions are?


From: CephaXz
SRL_Procs[srl_OnFindRandom] := @Dorandoms;

SRL_Procs[srl_AntiBan] := @Antiban;


??? SRL_Procs? Never heard of them :(

CephaXz

2012-09-19 00:23:51

I think you just have to use the second one.

srl_AntiBan = 0; // Your AntiBan procedure to be called during various SRL functions and procedures. (Flag, FFlag)


Almost every walking method uses Flag or FFlag. That means while walking, it will do the antiban procedure which you specified behind @. Inside your antiban procedure, you can put in FindNormalRandoms. And you only need to call it once in your script, something like this.


begin
SetupLogin;
SRL_Procs[srl_OnFindRandom] := @Dorandoms;
AddOnTerminate('FreeAllDTM');
AddOnTerminate('TakePhoto');
StartAllDTM;

repeat
MainLoop;
until not LoggedIn;
end.

Roflme

2012-09-19 15:53:00

From: CephaXz
I think you just have to use the second one.



Almost every walking method uses Flag or FFlag. That means while walking, it will do the antiban procedure which you specified behind @. Inside your antiban procedure, you can put in FindNormalRandoms. And you only need to call it once in your script, something like this.


begin
SetupLogin;
SRL_Procs[srl_OnFindRandom] := @Dorandoms;
AddOnTerminate('FreeAllDTM');
AddOnTerminate('TakePhoto');
StartAllDTM;

repeat
MainLoop;
until not LoggedIn;
end.

WHAT? By just adding SRL_Procs[srl_OnFindRandom] or [SRL_Procs[srl_AntiBan] will do functions whenever an SRL function is called??

:surprised:

Mat

2012-09-20 02:39:59


SRL_Procs[SRL_Antiban] := @WhileWalking;
This basically says When your walking, it does that.
Mat
(I think when it see's the flag)

Roflme

2012-09-26 17:45:23

Week old bump but just didn't want to make a new thread :p

FindNormalRandoms will…
1) Search for Random Event
a) If found, it'll solve
b) If not found, just continues whatever procedure/function FindNormalRandoms is in

2) If found random event
a) Will solve if it can
b) If it can't it'll log you out?

3) After solving random event, FindNormalRandoms comes back as true? And then the script continues?

Ian

2012-09-26 17:53:06

Honestly I wouldn't worry about it seeing that they are removing random events :D.

Roflme

2012-09-26 18:10:52

From: BMWxi
Honestly I wouldn't worry about it seeing that they are removing random events :D.


Well I'd like to know just incase

1) They aren't actually/fully removed yet
2) They are ever implemented again
3) Educational purposes :p

Roflme

2012-09-27 16:24:40

Just as I predicted…

Was caught in a random event today :p

J J

2012-09-27 16:52:40

From: Roflme
And on a side note, is there any difference between these three?


While isMoving is true it will do the antiban procedure. It will only execute the next line so this would only check for randoms while the player has stopped moving thus ending the loop. You could add begin/end to do antiban AND findnormalrandoms.
While isMoving do
Antiban;
FindNormalRandoms;
//etc. etc. etc.

While the player is moving it repeats antiban/findnormalrandoms until not moving. Then when the player isn't moving anymore it breaks out of loop 1. Then it checks if the player is moving again -> unnecessary checking two times.
While isMoving do
repeat
Antiban;
FindNormalRandoms;
//etc. etc. etc.
until not IsMoving

This one would actually do what you want. Repeats antiban and findnormalrandoms until the player isn't moving anymore.
repeat
Antiban;
FindNormalRandoms;
//etc. etc. etc.
until not IsMoving