SRL Archive - OSR Help

How do I tell my script to pick a random FindColorSpiralTolerance


rsbots2013

2013-05-25 06:31:12

How do I tell my Script to pick a random if FindColorSpiralTolerance then from a list

I got a feeling adding Random or RandomRange somewhere would do the trick.

Example:

procedure Help;

var
x, y : integer;

Color1, Color2, Color3, Color4, Color5, Color6 : integer;

begin

if FindColorSpiralTolerance( x, y, Color1, 359, 172, 408, 254, 10) or
FindColorSpiralTolerance( x, y, Color2, 359, 172, 408, 254, 10) or
FindColorSpiralTolerance( x, y, Color3, 359, 172, 408, 254, 10) or
FindColorSpiralTolerance( x, y, Color4, 359, 172, 408, 254, 10) or
FindColorSpiralTolerance( x, y, Color5, 359, 172, 408, 254, 10) or
FindColorSpiralTolerance( x, y, Color6, 359, 172, 408, 254, 10) then
begin
MoveMouse( x, y);
end;
end;

The Mayor

2013-05-25 07:17:18

From: rsbots2013
How do I tell my Script to pick a random if FindColorSpiralTolerance then from a list


Could use something like:


procedure Help;

var
x, y : integer;

r, Colour, Color1, Color2, Color3, Color4, Color5, Color6 : integer;

begin
r := random(5);

case r of
0: Colour := Color1;
1: Colour := Color2;
2: Colour := Color3;
3: Colour := Color4;
4: Colour := Color5;
5: Colour := Color6;
end;

If FindColorSpiralTolerance(x, y, Colour, 359, 172, 408, 254, 10) then
MoveMouse( x, y);
end;

rsbots2013

2013-05-25 08:28:36

Thank you. Just to update you Mayor on what I been up to. From what I've learnt from you and some others like Sjoe and YOHOJO. I have finally made myself my very own working Gnome Agility bot! It's really newby at how it flows tho. It gets stuck a lot and I got to constantly stop script and start it again. But it's now actually done 3 loops in a row without stopping the script! This is really great for me. MANY MANY thanks! :)

From: The Mayor
Could use something like:


procedure Help;

var
x, y : integer;

r, Colour, Color1, Color2, Color3, Color4, Color5, Color6 : integer;

begin
r := random(5);

case r of
0: Colour := Color1;
1: Colour := Color2;
2: Colour := Color3;
3: Colour := Color4;
4: Colour := Color5;
5: Colour := Color6;
end;

If FindColorSpiralTolerance(x, y, Colour, 359, 172, 408, 254, 10) then
MoveMouse( x, y);
end;

Sjoe

2013-05-25 08:47:09

From: rsbots2013
Thank you. Just to update you Mayor on what I been up to. From what I've learnt from you and some others like Sjoe and YOHOJO. I have finally made myself my very own working Gnome Agility bot! It's really newby at how it flows tho. It gets stuck a lot and I got to constantly stop script and start it again. But it's now actually done 3 loops in a row without stopping the script! This is really great for me. MANY MANY thanks! :)


nice job :) Scripting takes practice! You pick up new stuff here and there from tutorials/people's script and suggestions.