Results 1 to 2 of 2

Thread: Need help w/ function

  1. #1
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default Need help w/ function

    I have this function:

    SCAR Code:
    program SymbolCustom;
    {.include srl\srl.scar}

    var X, Y : Integer;

    const
    Speed = 16;//Mouse speed

    {*******************************************************************************
    function FindDTMSymbol(Color, Tol, Rand : Integer; Click : Boolean): Boolean;

    Author : Floor66
    Description : Custom Symbol finder, uses DTMs and toleranced colors.
    HowTo : Set color and tol. True for click, False for no click.
            You can also set the amount of randomness when clicking.
                                                         ___________________________
            ------------------------------------>>>>>>>  Created & Tested by Floor66
    *******************************************************************************}


    function FindDTMSymbol(var cx, cy : Integer; Color, Tol, Rand : Integer; Click : Boolean): Boolean;
    var U, C, SymbolDTM : Integer;
    begin
     begin
      SymbolDTM := DTMFromString('78DA63EC606260706740012AFE8F18FE03694' +
           '620FE0F048C7D4035CEA86A18191919B8A06AC0FC16A01A47026A' +
           '1A31EDC250D30654E347400DC83DDE04D4F403D5B8E1570300CA5' +
           'E0C6A');
     end;
      MarkTime(U);
      if (DTMRotated(SymbolDTM, cx, cy, MMX1, MMY1, MMX2, MMY2)) then
      begin
       C := GetColor(cx, cy)
       if (SimilarColors(C, Color, Tol)) then
        begin
        if (Click = True) then
         begin
    //     FindNormalRandoms;
          Mouse(cx, cy, Rand, Rand, True);
           Writeln('Found Symbol');
           Result := True;
          Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
          Writeln('Symbol is located at : '+IntToStr(cX)+', '+IntToStr(cY)+'.');
         end else
          begin
          Writeln('Found Symbol');
           Result := True;
          Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
          Writeln('Symbol is located at : '+IntToStr(cX)+', '+IntToStr(cY)+'.');
          end;
        end;
      end;
     FreeDTM(SymbolDTM);
    end;


    {*******************************************************************************
                                     ^^©Floor 66^^
    *******************************************************************************}


    begin
    SetUpSRL;
     MouseSpeed := Speed;
      ActivateClient;
     FindDTMSymbol(x, y, 16741963, 25, 5, False);
     Mouse(x, y, 5, 5, True);
    end.

    It's set like this:

    It goes and look for the symbol, without clicking IN the function, but when the function is done, it'll click it at x, y.

    But it doesnt work...
    It clicks somewhere on the edge of the minimap (in the decoration).
    I'm sure its not the color.
    Ce ne sont que des gueux


  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Double, closed.
    Administrator's Warning:


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 02-27-2008, 05:20 PM
  2. Replies: 2
    Last Post: 02-26-2008, 08:26 PM
  3. Any function that does this?
    By shadowpwner in forum OSR Help
    Replies: 2
    Last Post: 08-14-2007, 03:15 AM
  4. [FUNCTION] FindDoorColour: integer; By ZephyrsFury [FUNCTION]
    By ZephyrsFury in forum Research & Development Lounge
    Replies: 10
    Last Post: 07-27-2007, 08:45 AM

Posting Permissions

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