SRL Archive - Help and Support

Need a modified version of RadialWalk


King of Knives

2007-10-16 21:04:27

Ok, I need a function that is almost like RadialWalk. I tried to do it myself, but each time I touched at Sine and Cose, it gave me errors.

My best explanation to what I need is this:
Normal RadialWalk searches from Startradial to Endradial, and then goes down in radius

What I need is one that will search in a 1-3 degree width and all the radius down (perhaps even a parameter for choosing minimum-radius), until it has searched from Startradial to Endradial.

I'm lost in the jungle of math, and I don't get anything of Cose and Sine :S
So if anybody could help me with making that (Or simply make it for me :P), my MindCrafter would be that step closer to working perfectly :D

Thanks in advance,

-Knives

R0b0t1

2007-10-16 21:38:46

I think calculus uses sine and cosine.

Might wanna look it up sometime ^.^

n3ss3s

2007-10-17 07:43:41

When you first look at it, and dont
have even idea of trying it, it looks just sexy and complex.

But, it is just plain easy.

You can do a)
"X := Round(Radius * Sine(i)) + MidPoint;"
"Y := Round(-Radius * Cose(i)) + MidPoint;" i is the for loop thing.

b) You replace sine and cose with "Sin(Radians(i))" and "Cos(Radians(i))" that would require no SRL ;)

EDIT: Hold on I whip one for ya ;)

EDIT EDIT: Magic is easy, try this:


Function WideRRW(Color, StartRadial, EndRadial, Radius, Step, Ax, Ay: Integer): Boolean;
Var
X, Y, I, C, R, L: Integer;
Var
TPA: TPointArray;
Var
IA: TIntegerArray;
Begin
If(Not(LoggedIn))Then Exit;
SetArrayLength(TPA, Step + 1);
If(StartRadial < EndRadial)Then
Begin
For R := Radius DownTo 1 Do
Begin
For I := StartRadial To EndRadial Do
Begin
For C := 0 To Step Do
Begin
TPA[c].X := Round(R * Sine(I + C)) + MMCX;
TPA[c].Y := Round(-R * Cose(I + C)) + MMCY;
End;
IA := GetColors(TPA);
If(InIntArrayEx(IA, L, Color))Then
Begin
MouseFindFlag(TPA[l].x, TPA[l].y, Ax, Ay);
Wait(500 + Random(250));
Flag;
Wait(200 + Random(25));
Result := True;
Exit;
End;
End;
End;
End Else
Begin
For R := Radius DownTo 1 Do
Begin
For I := StartRadial DownTo EndRadial Do
Begin
For C := 0 To Step Do
Begin
TPA[c].X := Round(R * Sine(I + C)) + MMCX;
TPA[c].Y := Round(-R * Cose(I + C)) + MMCY;
End;
IA := GetColors(TPA);
If(InIntArrayEx(IA, L, Color))Then
Begin
MouseFindFlag(TPA[l].x, TPA[l].y, Ax, Ay);
Wait(500 + Random(250));
Flag;
Wait(200 + Random(25));
Result := True;
Exit;
End;
End;
End;
End;
End;

Btw nice style, but I wonder why do you want to search multiple points because it takes muuch less than 0 ms to move on to next point?

King of Knives

2007-10-17 08:42:55

Thanks :D But:

Eh. *Weird Noices*
From: n3ss3s
Btw nice style, but I wonder why do you want to search multiple points because it takes muuch less than 0 ms to move on to next point?

^Eh ?

I'll take your procedure n3s, but I'll tweak it a little (If I can).
Don't worry, you'll get your credits :P

What I want the procedure to do is search in a 1-3 degree on the minimap, and then go down in radius until it's around 40. And then continue searching like this in the next 1-3 degrees. I'll try and tweak it myself.

EDIT: I tried to make my own function, but it kept telling me: "Canvas does not allow drawing on line…", perhaps it's because I forgot the midpoint.

Thanks a lot though :D
-Knives

n3ss3s

2007-10-17 09:24:02

Hehe, no problem.

Umm at the moment it does
What I want the procedure to do is search in a 1-3 degree on the minimap, and then go down in radius until it's around 40. And then continue searching like this in the next 1-3 degrees. I'll try and tweak it myself.
except the 1-3 is the "Step".

King of Knives

2007-10-17 12:00:21

I just made my own, by taking a little from yours, modding here and there and such. Now it works :D

-Knives