SRL Archive - Help and Support

Help with my script


Brown

2006-03-15 22:02:03

Ive been working on a simple auto fletcher. Im not near done on anything, but when I try and get it to click an option, I get an error saying "Type Mismatch" or Invalid # of parameters when im following the exact things the Manual says to say.

And ive looked in bank.scar at the withdraw option to see if im typing the command in wrong, but I typed it in the way it is in functions that choose options.

Heres my script so far, it says the error is on line 44 (choose option). Ive tried all the choose option functions there are, none work.

program AutoFletcher;
{.include SRL\SRL.scar}

var
longbow:boolean;
procedure FindRandoms;
begin
FindNormalRandoms;
FindDoctor;
TalkToRand;
end;
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
begin
longbow:=true;//True = make longbow, false = make shortbow.

begin
SetUpSRL;
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FindRandoms;
OpenBank3;
wait(100+random(1000));
FixBank;
wait(2000+random(2000));
Withdraw(1, 1, 0);
wait(100+random(1000));
CloseWindow;
wait(100+random(1000));
MouseItem(1,true);
wait(100+random(1000));
MouseItem(2,true);
wait(100+random(1000));
//^*^*^*^*^*^*^*^*^*^*^*^*^*^*
if (longbow=true)then
begin
MMouse (382,404,10,10);
Mouse (382,404,10,10,false);
end;
if (longbow=false) then
begin
MMouse (141,404,10,10);
Mouse (141,404,10,10,false);
end;
//********^^^^^^^^^^^*************
ChooseOption('Make X');
wait(100+random(1000));
Typesend ('27');
end;
end.

maxzzz

2006-03-16 11:22:54

A tip: make procedures and call them in your main loop.

BRB with some help, got to take the manual with me.

EDIT:* Why do you use ChooseOption? If you want to make 27 bows use
ClickTextArea(x1,y1,x2,y2:Integer; text:string; font:Integer):boolean; (made by Mutant Squirle -> my favorite scripter btw). It will find the text and then click at it. Simple and easy.
That's a good function and much better than what you try to do becuase that's for the main screen I think.

Spky

2006-03-16 11:32:26

You haven’t entered the right number of parameters, try ChooseOption(x, y, 'Make X');

maxzzz

2006-03-16 11:36:23

ClickTextArea is still usefuller I think. My opinion.

Brown

2006-03-16 16:02:45

^^^ Thanks SPKY, it didnt point those out in the manual.