Results 1 to 2 of 2

Thread: Worldswitcher.scar fix..

  1. #1
    Join Date
    Mar 2007
    Location
    <3
    Posts
    2,683
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Worldswitcher.scar fix..

    Fixed the OpenWorldScreen.

    I shorten, made it faster and more basic.
    No need to over do something that FindColors can handle..

    New OpenWorldScreen
    SCAR Code:
    Function OpenWorldScreen: Boolean;
    var
      X, Y, iTime: Integer;
    begin
      Result := WorldScreen;
      if Result then
        Exit;
      if not RSReady then
      begin
        srl_Warn('OpenWorldScreen', 'not start screen', -2);
        exit;
      end;
      If FindColor(x, y, 13158, 342, 235, 425, 262) or
         FindColor(x, y, 16777215, 342, 235, 425, 262)then
      begin
        MouseBox(348, 239, 415, 245, 1);
        iTime := GetTimeRunning + 10000;
        while (not Result) do
        begin
          if GetTimeRunning > iTime then Exit;
          Wait(RandomRange(75, 300));
          Result := WorldScreen;
        end;
      end;
    end;

    Old one
    SCAR Code:
    {*******************************************************************************
    function OpenWorldScreen: Boolean;
    by: Nava2
    Description: Opens the world screen. Returns true if world screen is opened.
    *******************************************************************************}

    function OpenWorldScreen: Boolean;
    var
      TPA: array [0..1] of TPointArray;
      W, TheDC, iTime: Integer;
      Box: TBox;
    begin
      Result := WorldScreen;
      if Result then Exit;
      if not RSReady then
      begin
        srl_Warn('OpenWorldScreen', 'not start screen', -2);
        exit;
      end;
     
      W := BitmapFromString(17, 13, 'beNpjYKAb+I8ESBXBNAfTcDwK' +
           'CGrBVIPmDEz15GlB1oWVgSfokBUQ1EKM8whqwRV0eIIRv5OIBQByA' +
           'K1T');
      TheDC := GetTargetDC;
      SetTargetDC(GetBitmapDc(w));
      FindColorsTolerance(TPA[0], clWhite, 0, 0, 17, 13, 0);
      SetTargetDC(TheDC);
      FindColorsTolerance(TPA[1], 13158, 305, 239, 368, 272, 3);
      if FindTPAinTPA(TPA[0], TPA[1], TPA[0]) then
      begin
        Box := GetTPABounds(TPA[0]);
        Box := IntToBox(Box.x1, Box.y1, Box.x1 + 82, Box.y2);
        MouseBox(Box.x1, Box.y1, Box.x2, Box.y2, 1);
        iTime := GetTimeRunning + 10000;
        while not Result do
        begin
          if GetTimeRunning > iTime then Exit;
          Wait(RandomRange(40, 80));
          Result := WorldScreen;
        end;
      end;
    end;

  2. #2
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    /thread. Thanks Nike for pointing this out
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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
  •