Log in

View Full Version : Invalid Parameters



sm321
03-04-2012, 07:19 PM
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('mbQAAAHicY2VgYOABYm4gloCyGZBoLiAWhd JyZklAkgkFGzFgAkYsGAwAYPUBaw==');
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('mbQAAAHicY2VgYGAHYh4g5mCAAEYg5gViNi CWgMqBgLpbHZBkQsFGDJiAEQsGAwBjlQGD');
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
03-04-2012, 07:21 PM
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
03-04-2012, 07:22 PM
program RobeWithdrawer;

{.include SRL\SRL.simba}

var
Top, Bottom, X, Y:integer;

begin

SetupSRL;

Top:= DTMFromString('mbQAAAHicY2VgYOABYm4gloCyGZBoLiAWhd JyZklAkgkFGzFgAkYsGAwAYPUBaw==');
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('mbQAAAHicY2VgYGAHYh4g5mCAAEYg5gViNi CWgMqBgLpbHZBkQsFGDJiAEQsGAwBjlQGD');
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
03-04-2012, 07:24 PM
program RobeWithdrawer;

{.include SRL\SRL.simba}

var
Top, Bottom, X, Y:integer;

begin

SetupSRL;

Top:= DTMFromString('mbQAAAHicY2VgYOABYm4gloCyGZBoLiAWhd JyZklAkgkFGzFgAkYsGAwAYPUBaw==');
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('mbQAAAHicY2VgYGAHYh4g5mCAAEYg5gViNi CWgMqBgLpbHZBkQsFGDJiAEQsGAwBjlQGD');
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
03-04-2012, 07:24 PM
Oh yeah. You can use "True" aswell can't you?

Yes you can.

sm321
03-04-2012, 07:33 PM
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('mbQAAAHicY2VgYGAHYh4g5mCAAEYg5gViNi CWgMqBgLpbHZBkQsFGDJiAEQsGAwBjlQGD');
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);