Results 1 to 2 of 2

Thread: Scripting for Non-RS use

  1. #1
    Join Date
    Oct 2017
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Scripting for Non-RS use

    I used to work with Simba a long time ago for botting. Now I am revisiting for non-rs use and automating a Microsoft Dynamics NAV task that would have to work on multiple different PC's (disregarding resolution, Windows Language, program version, etc).

    I have decided to go with Colors instead of co-ordinates as some users may have moved the windows around.

    My question is (after looking around and not finding a clear solution): How to use FindColor without any tolerances and use MoveMouse/ClickMouse to utilize that color.

    I am assuming Define/Store specific color when declaring variables -> FindColor to get new X,Y coords of saved color -> MoveMouse(x,y)

    If someone could point me in the right direction that would be appreciated. I have most definitely lost my knowledge of Simba since I used it years ago and it appears some of the functions have vastly changed.


    Thank you!

  2. #2
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by Male View Post
    I used to work with Simba a long time ago for botting. Now I am revisiting for non-rs use and automating a Microsoft Dynamics NAV task that would have to work on multiple different PC's (disregarding resolution, Windows Language, program version, etc).

    I have decided to go with Colors instead of co-ordinates as some users may have moved the windows around.

    My question is (after looking around and not finding a clear solution): How to use FindColor without any tolerances and use MoveMouse/ClickMouse to utilize that color.

    I am assuming Define/Store specific color when declaring variables -> FindColor to get new X,Y coords of saved color -> MoveMouse(x,y)

    If someone could point me in the right direction that would be appreciated. I have most definitely lost my knowledge of Simba since I used it years ago and it appears some of the functions have vastly changed.


    Thank you!
    The scripting reference within the Simba documentation is your best friend

    Here is a basic script that will mouse a color if it is found on the desktop:
    Simba Code:
    program new;

    const
      MOUSE_MOVE = 3;

    procedure Mouse(const x, y, Button: Int32);
    begin
      MoveMouse(x, y);
      if (Button = MOUSE_MOVE) then Exit;
      Wait(Random(15, 25));
      HoldMouse(x, y, Button);
      Wait(Random(60, 100));
      ReleaseMouse(x, y, Button);
    end;

    function ClickColor(const Color, Button: Int32): Boolean;
    var
      x, y, w, h: Int32;
    begin
      GetClientDimensions(w, h);
      if FindColor(x, y, Color, 0, 0, w-1, h-1) then
      begin
        Mouse(x, y, Button);
        Result := True;
      end;
    end;

    begin
      ClearDebug();
      SetDesktopAsClient();
      ClickColor($FFFFFF, MOUSE_MOVE);
    end.

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
  •