SRL Archive - Help

Invalid Parameters


sm321

2012-03-04 14:19:27

I've made a script that uses DTMs to click a wizard robe top, and then a blue skirt. This is the script I have at the moment:

program RobeWithdrawer;

{.include SRL\SRL.simba}

var
Top, Bottom, X, Y:integer;

begin

SetupSRL;

Top:= DTMFromString('mbQAAAHicY2VgYOABYm4gloCyGZBoLiAWhdJyZklAkgkFGzFgAkYsGAwAYPUBaw==');
If FindDTM(Top, X, Y, MSX1, MSY1, MSX2, MSY2) then
WriteLn('We found the top!');
MMouse(X, Y, 7, 7);
If IsUpText('top') then
Mouse(x, y, 0, 0);
Wait(100);
Mouse(x, y, 0, 0);

end;

Begin

Bottom:= DTMFromString('mbQAAAHicY2VgYGAHYh4g5mCAAEYg5gViNiCWgMqBgLpbHZBkQsFGDJiAEQsGAwBjlQGD');
If FindDTM(Bottom, X, Y, MSX1, MSY1, MSX2, MSY2) then
WriteLn('We found the bottom!');
MMouse(X, Y, 7, 7);
If IsUpText('tom') then
Mouse(x, y, 0, 0);
Wait(100);
Mouse(x, y, 0, 0);
end.

I compile it and get this error:

[Error] (18:20): Invalid number of parameters at line 17
Compiling failed.

What do I do?

VillaVuFTW

2012-03-04 14:21:50

Change Line 17
"Mouse(x, y, 0, 0);"
to
"MMouse(X, Y, 0, 0);"

or..
If you want it bot like

Mouse(X, y, 0, 0, true); // Left Click
Mouse(X, Y, 0, 0, false); // Right click

Parameters for Mouse is.. (X, Y, rX, r,Y, Button); Button = False(Right click) or True(Left Click)
I Normally do True/False much faster imo ;)

Home

2012-03-04 14:22:31

program RobeWithdrawer;

{.include SRL\SRL.simba}

var
Top, Bottom, X, Y:integer;

begin

SetupSRL;

Top:= DTMFromString('mbQAAAHicY2VgYOABYm4gloCyGZBoLiAWhdJyZklAkgkFGzFgAkYsGAwAYPUBaw==');
If FindDTM(Top, X, Y, MSX1, MSY1, MSX2, MSY2) then
WriteLn('We found the top!');
MMouse(X, Y, 7, 7);
If IsUpText('top') then
Mouse(x, y, 0, 0, mouse_Left);
Wait(100);
Mouse(x, y, 0, 0, mouse_Left);


Bottom:= DTMFromString('mbQAAAHicY2VgYGAHYh4g5mCAAEYg5gViNiCWgMqBgLpbHZBkQsFGDJiAEQsGAwBjlQGD');
If FindDTM(Bottom, X, Y, MSX1, MSY1, MSX2, MSY2) then
WriteLn('We found the bottom!');
MMouse(X, Y, 7, 7);
If IsUpText('tom') then
Mouse(x, y, 0, 0, mouse_Left);
Wait(100);
Mouse(x, y, 0, 0, mouse_Left);
end.


You were missing mouse_Left or mouse_Left in your Mouse(). (If you were going to use Mouse)
I just added mouse_Left in there for example.

Second. You had 2 mainloops. Check the difference.

~Home

sm321

2012-03-04 14:24:04

From: Home
program RobeWithdrawer;

{.include SRL\SRL.simba}

var
Top, Bottom, X, Y:integer;

begin

SetupSRL;

Top:= DTMFromString('mbQAAAHicY2VgYOABYm4gloCyGZBoLiAWhdJyZklAkgkFGzFgAkYsGAwAYPUBaw==');
If FindDTM(Top, X, Y, MSX1, MSY1, MSX2, MSY2) then
WriteLn('We found the top!');
MMouse(X, Y, 7, 7);
If IsUpText('top') then
Mouse(x, y, 0, 0, mouse_Left);
Wait(100);
Mouse(x, y, 0, 0, mouse_Left);


Bottom:= DTMFromString('mbQAAAHicY2VgYGAHYh4g5mCAAEYg5gViNiCWgMqBgLpbHZBkQsFGDJiAEQsGAwBjlQGD');
If FindDTM(Bottom, X, Y, MSX1, MSY1, MSX2, MSY2) then
WriteLn('We found the bottom!');
MMouse(X, Y, 7, 7);
If IsUpText('tom') then
Mouse(x, y, 0, 0, mouse_Left);
Wait(100);
Mouse(x, y, 0, 0, mouse_Left);
end.


You were missing mouse_Left or mouse_Left in your Mouse(). (If you were going to use Mouse)
I just added mouse_Left in there for example.

Second. You had 2 mainloops. Check the difference.

~Home


Oh yeah. You can use "True" aswell can't you?

VillaVuFTW

2012-03-04 14:24:24

From: sm321
Oh yeah. You can use "True" aswell can't you?


Yes you can.

sm321

2012-03-04 14:33:07

Update: It clicked the top, but stopped when it had to click the bottom. It says I haven't freed the DTM. Script for that part:

Bottom:= DTMFromString('mbQAAAHicY2VgYGAHYh4g5mCAAEYg5gViNiCWgMqBgLpbHZBkQsFGDJiAEQsGAwBjlQGD');
If FindDTM(Bottom, X, Y, MIX1, MIY1, MIX2, MIY2) then
WriteLn('We found the bottom!');
MMouse(X, Y, 7, 7);
If IsUpText('tom') then
Mouse(x, y, 0, 0, mouse_left);
Wait(100);
Mouse(x, y, 0, 0, mouse_left);
FreeDTM(Bottom);