Results 1 to 6 of 6

Thread: Invalid Parameters

  1. #1
    Join Date
    Dec 2011
    Posts
    257
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Invalid Parameters

    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:

    Simba Code:
    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:

    Code:
    [Error] (18:20): Invalid number of parameters at line 17
    Compiling failed.
    What do I do?

  2. #2
    Join Date
    Dec 2011
    Posts
    273
    Mentioned
    0 Post(s)
    Quoted
    39 Post(s)

    Default

    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
    Last edited by VillaVuFTW; 03-04-2012 at 07:24 PM.
    "What can't hurt you, try it. What can kill you, do it!"

    Scripts Completed: 3
    Amount Released : 2

  3. #3
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Simba Code:
    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

  4. #4
    Join Date
    Dec 2011
    Posts
    257
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Home View Post
    Simba Code:
    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?

  5. #5
    Join Date
    Dec 2011
    Posts
    273
    Mentioned
    0 Post(s)
    Quoted
    39 Post(s)

    Default

    Quote Originally Posted by sm321 View Post
    Oh yeah. You can use "True" aswell can't you?
    Yes you can.
    "What can't hurt you, try it. What can kill you, do it!"

    Scripts Completed: 3
    Amount Released : 2

  6. #6
    Join Date
    Dec 2011
    Posts
    257
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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:

    Simba Code:
    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);

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •