Results 1 to 5 of 5

Thread: [HELP] Monster Warlord Roulette Script - Colour Scanning

  1. #1
    Join Date
    Mar 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default [HELP] Monster Warlord Roulette Script - Colour Scanning

    Hey there!

    I just created an account here, so this is my first post ^^

    I use Bluestacks (Android Simulator) on my laptop, running an app called Monster Warlord.
    So I wrote some scripts (very basic) for some ingame content and I want to optimize one particular script, cuz it isnt working as good as I want it to.

    Here are the screens from the content:

    1.
    Screenshot_2016-02-16-00-26-21_1.jpg

    2.
    Screenshot_2016-02-16-00-26-28_1.jpg

    3.
    Screenshot_2016-02-16-00-26-42_2.jpg

    Here is my script:

    Simba Code:
    program DoRoulette;

    procedure Start;
    var
      x, y:Integer;
    begin
      MoveMouse(156+random(100), 315+random(50));
      Wait(150);
      ClickMouse(x, y, 1);
    end;

    procedure Proceed;
      var
        x, y:Integer;
    begin
      Wait(35000);
      MoveMouse(160+random(100), 422+random(20));
      Wait(500);
      ClickMouse(x, y, 1);
      Wait(1000);
    end;


    begin

    repeat
      Start;
      Proceed;
    until(false);

    end.

    Procedure Start is basically clicking the Start button on the first screenshot at a random position on the start button
    Procedure Proceed is basically waiting 35 seconds till the Animation on the 2nd screenshot ends, then it clicks the Close Button which is on the third screenshot.

    The part I want to optimize is the "Wait(35000)" part. The duration of the animation varies between 15 and 35 seconds.. thats why the script is set the 35 seconds so it doesnt click too early on the close button.
    What sucks tho is the script doing nothing when the animation lasts only 15 seconds.. its just doing nothing 20 seconds long and thats a lot of time.
    I now want to change that part.
    I want the script to start scanning for the green colour of the Close Button the moment the Start button is being clicked. I want it to scan/search for that particular color in a defined area (the close button) as long until it finds the colour, then it should move the mouse to that area and click randomly in that area (where the close button is)
    I know that I need to use FindColor(Tolerance), but I need it as Loop, cuz it shouldnt just search for the color once after the start button got clicked, but actually till it really finds the color.. therefore looping it, right?

    Now I wanted to ask you guys how you would rewrite that script to make it run more optimized and without wasting waiting time.

    cheers Ardwen

    (sorry for the wall of text) xD

  2. #2
    Join Date
    Mar 2013
    Location
    Argentina
    Posts
    758
    Mentioned
    27 Post(s)
    Quoted
    365 Post(s)

    Default

    you should make a loop that looks for the "close" button, something like:

    Code:
      repeat
      wait(1000)
        if finddtm(......) then
        begin
         proceed;
         break;
        end;
      end;
    Formerly known as Undorak7

  3. #3
    Join Date
    Mar 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Lipcot View Post
    you should make a loop that looks for the "close" button, something like:

    Code:
      repeat
      wait(1000)
        if finddtm(......) then
        begin
         proceed;
         break;
        end;
      end;
    but where should i put that? I mean, I cant write "proceed" seperately and then put it in loop additionally in the end

    EDIT:

    Nvm got it all done.
    This is the final result.
    Should I change something?

    Simba Code:
    program DoRoulette;

    procedure Start;
    var
    x, y:Integer;

    begin
      MoveMouse(158+random(100), 315+random(50));
      Wait(150);
      ClickMouse(x, y, 1);
    end;

    procedure SearchColor;
    var
    x, y:Integer;

    begin
      repeat
      if FindColorSpiralTolerance(x, y, 5798664, 187, 420, 254, 432, 10) Then
      begin
        MoveMouse(x, y);
        Wait(150);
        ClickMouse(x, y, 1);
        Wait(150);
        Break;
      end;
      until(false);
    end;


    begin

    repeat
    Start;
    SearchColor;
    until(false);

    end.
    Last edited by Ardwen; 03-23-2016 at 08:17 PM.

  4. #4
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    I had made a script for this game lol.

    https://www.youtube.com/watch?v=cVfhYSajLgU

    All those updates haha.

  5. #5
    Join Date
    Mar 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    BUMP

    My Script somehow doesnt work anymore as before.....

    Simba Code:
    program DoRoulette;

    procedure Start;
    var
    x, y:Integer;

    begin
      Wait(200);
      MoveMouse(158+random(100), 315+random(50));
      Wait(900);
      ClickMouse(x, y, 1);
    end;

    procedure SearchColor;
    var
    x, y:Integer;

    begin
      repeat
      if FindColorSpiralTolerance(x, y, 7378205, 187, 420, 254, 432, 10) Then
        begin
          Wait(500);
          MoveMouse(x, y);
          Wait(150);
          ClickMouse(x, y, 1);
          Wait(150);
          Break;
        end;
      until(false);
    end;


    begin

    repeat
      Start;
      SearchColor;
    until(false);

    end.

    So when it still worked, the coordinates of the color found with FindColorSpiralTolerance was written into x, y, and also written into the x, y from MoveMouse and ClickMouse, which follow after FindColorSpiralTolerance.
    Now instead of moving and clicking on the exact coordinate, my cursor is clicking in the left upper corner of my program, eventhough the right Client is selected with the crosshair.
    What can be the problem?

    EDIT: It seems like x, y are not being returned in FindColorSpiralTolelance, and therefore the coordinates where the color SHOULD be are not written into x, y from MoveMouse and ClickMouse... the mouse is moving to and clicking at (0/0) thats the left upper corner.
    The thing is that some weeks ago it was able to just find the color and return the coordinates.. Nothing changed from that time on.

    EDIT2: If I try the same script on another application (Desktop, Mozilla Firefox, Photoshop) then it DOES find the color, regardless of the square having a size of 1 pixel or 20 by 20 pixels, 0 tolerance or even 200. It does find the color.
    Is the error in the application I am using (Bluestacks)
    Last edited by Ardwen; 05-17-2016 at 08:03 PM.

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
  •