Results 1 to 19 of 19

Thread: Problem with desert color

  1. #1
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Problem with desert color

    I have noticed in al kharid that each time you get a 'loading please wait',the sand changes of color(on minimap) ,so when the sand change of color,radial walk isn't able to work because it's set on one color.

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    const
    Sandcolor = 6006210; //Put al kharid regular sand color here
    Rcolor = 0; //Put al kharid regular road color here

    Procedure Compass;
    Begin
    Makecompass('E');
    Makecompass('N');
    end;

    begin
      SetupSRL;
      ActivateClient;
      GameTab(2);
      GameTab(4);
      wait(1000+random(300));
      Compass;
      RadialWalk( Sandcolor , 29, 40, 65, 0, 1);
      Flag;
      RadialWalk( Sandcolor , 30, 41, 69, 0, 1);
      Flag;
      RadialWalk(Sandcolor, 14, 24, 69, 0, 1);
      Flag;
      RadialWalk( Sandcolor , 58, 68, 68, 0, 1);
    end.

    Is there anything i could do?
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  2. #2
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    You could try to use some autocolor mechanism, and then create a function that'll update the sand color everyti,e.
    I made a new script, check it out!.

  3. #3
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    function AutoColorThis(Bitmap, MaxTol, X1, Y1, X2, Y2: Integer): Integer;
    By: Sumilion
    Description: Resturns exact color of a bmp with tol found on the screen.
    *******************************************************************************}


    function AutoColorThis(Bitmap, MaxTol, X1, Y1, X2, Y2: Integer): Integer;
    var
      lTol, Ax, Ay: Integer;
    begin
      repeat;
        if (FindBitmapToleranceIn(Bitmap, Ax, Ay, X1, Y1, X2, Y2, lTol)) then
        begin
          Result := GetColor(Ax, Ay);
          Exit;
        end;
        lTol := lTol + 5;
      until (lTol >= MaxTol);
      WriteLn('Color NOT found.');
    end;

    That is a very good function

    Just get a bitmap of the sand color, and up the tolerance up to about 50.

    The coords for the MiniMap are as follows:

    MMX1, MMY1, MMX2, MMY2

    Just fill those in, and make yourself a nice (small) bitmap of the sand.

  4. #4
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    And what will be the constant for the color after?Now it seems all fucked up and i think it means i gotta restart making a script again(argh),i understand how to make a bitmap but i don't understand what exactly your script does...And how do i implement it into a script?
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  5. #5
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    First off, it's not my script

    You say you know how to make a bitmap? Kk. Make a bitmap, and put the bitmap name in the function up there.

    Let's say this is your end function: (It's not, we're just pretending )

    SCAR Code:
    AutoColorThis(BitmapName, 50, MMX1, MMY1, MMX2, MMY2);

    We would need another variable. (Set as an integer.)

    SCAR Code:
    SandColor := AutoColorThis(BitmapName, 50, MMX1, MMY1, MMX2, MMY2);

    Then you can use "SandColor" in things like this:

    SCAR Code:
    if(FindMMColorTol(x, y, SandColor, 10))then



    It's really very simple.

    BTW:

    Don't be talking like that, dude. If your script messed up, just say that it messed up, or that it screwed up. Don't talk like that, K? It's not needed.

  6. #6
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    if(FindMMColorTol(x, y, SandColor, 10))then

    Cool but where do i put MMX and MMY in your function?

    For you it may seem simple because you've already mastered it
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  7. #7
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    In the coords area.

    And it's not my function

  8. #8
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    X1, Y1, X2, Y2

    Those are the coords right?
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  9. #9
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default



    That's right.

    MMX1, MMY1, MMX2, MMY2

  10. #10
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    And how do i trigger that function?It work automaticly?

    SCAR Code:
    function AutoColorThis(Bitmap, MaxTol, MMX1, MMY1, MMX2, MMY2: Integer): Integer;
    var
      lTol, Ax, Ay: Integer;
    begin
      repeat;
        if (FindBitmapToleranceIn(Bitmap, Ax, Ay, MMX1, MMY1, MMX2, MMY2, lTol)) then
        begin
          Result := GetColor(Ax, Ay);
          Exit;
        end;
        lTol := lTol + 5;
      until (lTol >= MaxTol);
      WriteLn('Color NOT found.');
    end;

    Should it look like this.
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  11. #11
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    No, the only part you need is:

    SCAR Code:
    AutoColorThis(BitmapName, 50, MMX1, MMY1, MMX2, MMY2);

  12. #12
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    That function is already in SRL. Forget he posted it, and just do what he just said.

  13. #13
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Whoa,so how would i do to implement that function in this script?

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    const
    Sand := BitmapFromString(8, 10, 'z78DA733172313477721925872' +
           '909008DC86F41');

    var SandColor:Integer

    Procedure Compass;
    Begin
    Makecompass('E');
    Makecompass('N');
    end;

    begin
      SetupSRL;
      ActivateClient;
      GameTab(2);
      GameTab(4);
      wait(1000+random(300));
      Compass;
      RadialWalk( Sandcolor , 29, 40, 65, 0, 1);
      Flag;
      RadialWalk( Sandcolor , 30, 41, 69, 0, 1);
      Flag;
      RadialWalk(Sandcolor, 14, 24, 69, 0, 1);
      Flag;
      RadialWalk( Sandcolor , 58, 68, 68, 0, 1);
    end.

    This is just a test,it's why lots of actions are in the main loop
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  14. #14
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    No, as this won't solve the problem with the loading screen you currently have.
    I would recommend you using this function Sandcolor
    SCAR Code:
    function SandColor : integer;
    var bmpSand : integer;
    begin
    bmpsand :=  BitmapFromString(4, 4, 'z78DA73B67036303770A61909' +
           '000DEC1551');
    result := AutoColorThis(bmpsand, 50, mmx1, mmy1, mmx2, mmy2);
    Writeln('Sandcolor is ' + inttostr(result));
    end;
    You can now delete the constant sandcolor. Everytime you need to use the sandcolor, you can call this function. You don't need to change anything else in your script.
    I made a new script, check it out!.

  15. #15
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    You would use the function I gave you.

    It's just like using Wait(x) or RadialWalk. It's a proceudre/function.

    If you use AutoColorThis in your script, it'll pull it out of the SRL include file.

  16. #16
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So instead of using sandcolor i use autocolorthis?
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  17. #17
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Couldn't i just use a color tolerance instead of a bitmap because i'm really getting stuck with this function above
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  18. #18
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Bump

    I want to know which one is right...
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  19. #19
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Okay...Pretty much, markus's and jason's ways are exactly the same. Markus's just takes less setting up.

    Take the below function, put it in at the top of your script, and, put SandColor:=GetSandColor in your main loop. The sand color should now be stored in SandColor.

    SCAR Code:
    function GetSandColor : integer;
    var bmpSand : integer;
    begin
    bmpsand :=  BitmapFromString(4, 4, 'z78DA73B67036303770A61909' +
           '000DEC1551');
    result := AutoColorThis(bmpsand, 50, mmx1, mmy1, mmx2, mmy2);
    //Writeln('Sandcolor is ' + inttostr(result));
    end;

    Oh, and did I mention, no bumping please?
    Interested in C# and Electrical Engineering? This might interest you.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Forms problem!! (color pciker involved)
    By sink998 in forum OSR Help
    Replies: 2
    Last Post: 09-17-2008, 09:30 PM
  2. Color finding problem
    By topiser in forum OSR Help
    Replies: 8
    Last Post: 05-09-2008, 06:44 AM
  3. problem with color tool
    By hoo in forum News and General
    Replies: 0
    Last Post: 11-08-2007, 12:02 PM
  4. I need help with a color problem
    By syther fox in forum OSR Help
    Replies: 3
    Last Post: 07-19-2007, 04:40 PM

Posting Permissions

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