SRL Archive - OSR Help

Climbing?


Brid Mayhem

2013-03-20 03:36:34

Well, I'm making a script which envolves climbing but can't really figure it out. (Other than exact coordinate clicking)

Here's what I have so far;


repeat
// random junk
repeat
FindColor(x, y, 606560, xs, ys, xe, ye);
//FindColorSpiralTolerance(x, y, 603212, MSX1, MSY1, MSX2, MSY2, 5)
MMouse(x, y, 1, 1);
until (P07_IsUpTextMultiCustom(['Cli', 'imb-', 'up', 'Stairc', 'ase']))
wait(RandomRange(600, 900));
ClickMouse2(mouse_right);
wait(randomrange(300, 500));
P07_ChooseOptionMulti(['limb-up'])
until (IsOnTop);


The problem is whenever I try to pickup a color, the mouse will try one then just go inactive.

tealc

2013-03-20 03:45:52

try FindColorsSpiralTolerance(x, y,TPA, 603212, MSX1, MSY1, MSX2, MSY2, 5)
it will make an TPA of points that match the colortolorance

also autocoloraid is very helpful

rj

2013-03-20 05:40:14

function ClickBank: Boolean;
var
tmpCTS, i, L, Counter: Integer;
ObjTPA: TPointArray;
ObjATPA: T2DPointArray;
X, Y, DMCount, Moves: Integer;
begin
Moves := 0;
DMCount := 0;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.14, 0.11); // .06 .90 3029853 6
FindColorsTolerance(ObjTPA, 4613246, MSX1, MSY1, MSX2, MSY2, 3);
SplitTPAWrap(ObjTPA, 10, ObjATPA);
SortATPASize(ObjATPA, True);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
DMCount := RandomRange(3, 5);
L := High(ObjATPA) MarkTime(Counter);
for i := 0 to L do
begin
MiddleTPAEx(ObjATPA[i], X, Y);
repeat
begin
MakeCompass(180 - Random(25));
Moves := Moves + 1;


Wait(RandomRange(100, 200));
MMouse(RandomRange(X - 5, X + 5), RandomRange(y - 5, y + 5), 0, 0);
if (IsUpTextMultiCustom(['Bank', 'Use Bank', 'booth'])) then
begin
clickmouse2(mouse_Left);
Exit;
end;
end;
until (Moves > DMCount) if (TimeFromMark(Counter) > 3000) then
begin
Break;
end;
end;
Result := False;
end;

Ripped from My power chopper, that was ripped from my copper miner which was ripped from DannyRS's sommuner

xtrapsp

2013-03-20 06:04:04

Good to see RJJ explaining stuff.




repeat
// random junk
repeat
FindColor(x, y, 606560, xs, ys, xe, ye);
//FindColorSpiralTolerance(x, y, 603212, MSX1, MSY1, MSX2, MSY2, 5)
MMouse(x, y, 1, 1);
until (P07_IsUpTextMultiCustom(['Cli', 'imb-', 'up', 'Stairc', 'ase']))
wait(RandomRange(600, 900));
ClickMouse2(mouse_right);
wait(randomrange(300, 500));
P07_ChooseOptionMulti(['limb-up'])
until (IsOnTop);


Ok so! Lets start.
First it finds the colour, which to be quite honest, I would used FindColorSpiralTolerance over that.
You're probably going to want to use TPA's.
Check the tutorial here:
http://villavu.com/forum/showthread.php?t=90767

Also try using if statements?

if FindColorSpiralTolerance() then
begin
Mouse();
Writeln('Clicked on color');
end else
Writeln('Could not find color');

Essentially, you have a basic understand but are missing a few bits. I find that writing down what I need to do in a structured list helps.
if you want to learn about programming in general:
http://villavu.com/forum/showthread.php?t=98990&highlight=

Brid Mayhem

2013-03-20 15:52:45

From: xtrapsp
Good to see RJJ explaining stuff.




repeat
// random junk
repeat
FindColor(x, y, 606560, xs, ys, xe, ye);
//FindColorSpiralTolerance(x, y, 603212, MSX1, MSY1, MSX2, MSY2, 5)
MMouse(x, y, 1, 1);
until (P07_IsUpTextMultiCustom(['Cli', 'imb-', 'up', 'Stairc', 'ase']))
wait(RandomRange(600, 900));
ClickMouse2(mouse_right);
wait(randomrange(300, 500));
P07_ChooseOptionMulti(['limb-up'])
until (IsOnTop);


Ok so! Lets start.
First it finds the colour, which to be quite honest, I would used FindColorSpiralTolerance over that.
You're probably going to want to use TPA's.
Check the tutorial here:
http://villavu.com/forum/showthread.php?t=90767

Also try using if statements?

if FindColorSpiralTolerance() then
begin
Mouse();
Writeln('Clicked on color');
end else
Writeln('Could not find color');

Essentially, you have a basic understand but are missing a few bits. I find that writing down what I need to do in a structured list helps.
if you want to learn about programming in general:
http://villavu.com/forum/showthread.php?t=98990&highlight=



Thanks for the help, I'll definitely look into tpa's. As for the find color tolerance; I've tried it but it seems to make the mouse go inactive after finding one color alike.

xtrapsp

2013-03-20 15:53:52

From: Brid Mayhem
Thanks for the help, I'll definitely look into tpa's. As for the find color tolerance; I've tried it but it seems to make the mouse go inactive after finding one color alike.


Try adding some more writeln('');

that way on each line you can tell if it is or has executed that line of code :)

Brid Mayhem

2013-03-20 15:59:51

From: xtrapsp
Try adding some more writeln('');

that way on each line you can tell if it is or has executed that line of code :)


I know which bit has executed or not, with this it's blatienly obvious :)