SRL Archive - Suggestions

Spiral Searching


HyperSecret

2010-05-18 14:02:00

Could it possibly search randomly, clockwise or counterclockwise? The way it seems now is that is always start searching from the right side then goes around counterclockwise to the left.

Could it switch to randomly start on either the left or right side and go either clockwise or counterclockwise? It occurred to me because when chopping ivy my guy always is going to the right ivy before going to the left, so if he is on a far left ivy, it will go to the right all the way until it gets the the farthest right one.

mastaraymond

2010-05-18 15:07:08

With the current implementation of the spiral functionality this is not really possible.. So I guess we must revise the current system to make it more flexible :).

Blumblebee

2010-05-18 16:54:48

why not do FindColorsTolerance(TPA, etc); sortTPAFrom(MScx+randomRange(-10, 10), MScy); ?

wouldn't that do sort of what your looking for?

Sex

2010-05-18 19:39:33

Can't you just invert the TPA or something?

Smartzkid

2010-05-18 21:28:26

Why would you want it to be random?

Wanted

2010-05-18 22:07:01

Afraid InvertTPA would not work, and running your own script side alg would be massive slow.

I don't see why you would need this tbh, perhaps tell us what you are doing?

YoHoJo

2010-05-18 22:20:00


X:=Random(MSX2)
Y:=Random(MSY2)
If FindColorSpiralTolerance(x,y,234,MSX1,MSY1,MSX2,MSY2,10) Then
Begin
GetMousePos(x,y);
Mouse(x,y,3,3,True);

Would make the spiral start at a random place on the mainscreen.
You can even just set the X:= and Y:= to integers to start spiraling from a specific location/area/corner of the screen. That kinda helps with what you are asking for?

Blumblebee

2010-05-18 22:40:18

From: IceFire908

I don't see why you would need this tbh, perhaps tell us what you are doing?


he stated why he needs it. Because of Ivy's and always going to the right instead of the left.

HyperSecret

2010-05-18 23:44:11

From: Smartzkid
Why would you want it to be random?


From: IceFire908
Afraid InvertTPA would not work, and running your own script side alg would be massive slow.

I don't see why you would need this tbh, perhaps tell us what you are doing?



When I get to the farthest right ivy and that one disappears, then it goes to the one to the left (obviously) since it is the closest one. Then when that one is gone, the ivy to my right is back (the previous ivy) and it goes back to that one.

It keeps going back and forth between just those two ivy instead of going to the left or to the right ivy when it has the option, it always chooses the option of the right ivy.

I could make it random variable and have it search the left or right half depending on that variable, but I thought it would be good to have inside of the searching function.

If not, then I will just suffice.



From: YoHoJo

X:=Random(MSX2)
Y:=Random(MSY2)
If FindColorSpiralTolerance(x,y,234,MSX1,MSY1,MSX2,MSY2,10) Then
Begin
GetMousePos(x,y);
Mouse(x,y,3,3,True);

Would make the spiral start at a random place on the mainscreen.
You can even just set the X:= and Y:= to integers to start spiraling from a specific location/area/corner of the screen. That kinda helps with what you are asking for?


I don't want it to start searching from a random point. I like searching closest to my character :).

YoHoJo

2010-05-18 23:51:07

X:=MSCX
Y:=MSCY
If FindColorSpiralTolerance(x,y,234,MSX1,MSY1,MSX2,MSY2,10) Then
Begin
GetMousePos(x,y);
Mouse(x,y,3,3,True);


Searches from center of mainscreen (your character) outwards. :D!?

HyperSecret

2010-05-19 02:02:17

From: YoHoJo
X:=MSCX
Y:=MSCY
If FindColorSpiralTolerance(x,y,234,MSX1,MSY1,MSX2,MSY2,10) Then
Begin
GetMousePos(x,y);
Mouse(x,y,3,3,True);


Searches from center of mainscreen (your character) outwards. :D!?


Haha, I know :p. But what I am saying is that FindColorsSpiralTolerance always starts searching on the right side of my character first, then goes counterclockwise around him, exactly like it is suppose to.

But in my ivy cutter, when I get to the far right ivy its only goes back and forth between two ivy, right, left, right left, right, left, etc… when it could have the option of right or left, it always chooses the right ivy over the left (because it spirals that way).

Spiraling has to start somewhere, and they way it is now it goes out a 'X' amount of pixels to the right and searches around, then adds another 'X' amounts of pixels and searches around, and continues until it is out of the targeted window. Going in a counterclockwise motion.

I am saying to possibly start searching 'X' amount of pixels to the left or right and search around counterclockwise or clockwise. So that if I have a ivy to my left and my right, it will randomly start searching to either side from the center , so I could possibly go to either ivy, the way it is now, I ALWAYS go to the right ivy.

Narcle

2010-05-19 02:02:24

I'd just do something like this:

x := RandomRange(MSCX/3, 2*MSCX/3);
y := MSCY;