Results 1 to 16 of 16

Thread: Custom Find(DTM)Symbol !

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

    Default Custom Find(DTM)Symbol !

    Please rate it 1/10 for 2nd function ever

    This is my 2nd function.
    Its an alternative to FindSymbol.
    Plz dont be too hard on me

    I wont add AntiRandom, seen i'd use it as walking.
    If you want it, just add it urself. Without declareplayers, the randoms wont work, thats why i dont use it atm.


    If you want them, you need multiplayer, cuz u need a Nick for it.
    I commented the randoms.

    If you use it (what i -imo- not think :P) please CREDIT!

    The function:

    UPDATED!

    SCAR Code:
    {*******************************************************************************
    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(Color, Tol, Rand : Integer; Click : Boolean): Boolean;
    var U, X, Y, C, SymbolDTM : Integer;
    begin
     begin
      SymbolDTM := DTMFromString('78DA63EC606260706740012AFE8F18FE03694' +
           '620FE0F048C7D4035CEA86A18191919B8A06AC0FC16A01A47026A' +
           '1A31EDC250D30654E347400DC83DDE04D4F403D5B8E1570300CA5' +
           'E0C6A');
     end;
      MarkTime(U);
      if (DTMRotated(SymbolDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
      begin
       C := GetColor(x, y);
       if (SimilarColors(C, Color, Tol)) then
        begin
        if (Click = True) then
         begin
    //     FindNormalRandoms;
          Mouse(x, y, Rand, Rand, True);
           Writeln('Found Symbol');
           Result := True;
          Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
          Writeln('Symbol is located at : '+IntToStr(X)+', '+IntToStr(Y)+'.');
         end else
          begin
          Writeln('Found Symbol');
           Result := True;
          Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
          Writeln('Symbol is located at : '+IntToStr(X)+', '+IntToStr(Y)+'.');
          end;
        end;
      end;
     FreeDTM(SymbolDTM);
    end;


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


    Here its used: (just made these consts for handy-ness)
    SCAR Code:
    program SymbolCustom;
    {.include srl\srl.scar}

    const
    SColor = 2893864; //Symbol Color
    STol = 25;//Symbol tolerance (15~25 advised)
    Rndm = 5;//Amount of randomness if clicking
    Speed = 16;//Mouse speed
    Yes = False; //Use consts or fill color, tol in at mainloop!

    {*******************************************************************************
    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(Color, Tol, Rand : Integer; Click : Boolean): Boolean;
    var U, X, Y, C, SymbolDTM : Integer;
    begin
     begin
      SymbolDTM := DTMFromString('78DA63EC606260706740012AFE8F18FE03694' +
           '620FE0F048C7D4035CEA86A18191919B8A06AC0FC16A01A47026A' +
           '1A31EDC250D30654E347400DC83DDE04D4F403D5B8E1570300CA5' +
           'E0C6A');
     end;
      MarkTime(U);
      if (DTMRotated(SymbolDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
      begin
       C := GetColor(x, y);
       if (SimilarColors(C, Color, Tol)) then
        begin
        if (Click = True) then
         begin
    //     FindNormalRandoms;
          Mouse(x, y, Rand, Rand, True);
           Writeln('Found Symbol');
           Result := True;
          Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
          Writeln('Symbol is located at : '+IntToStr(X)+', '+IntToStr(Y)+'.');
         end else
          begin
          Writeln('Found Symbol');
           Result := True;
          Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
          Writeln('Symbol is located at : '+IntToStr(X)+', '+IntToStr(Y)+'.');
          end;
        end;
      end;
     FreeDTM(SymbolDTM);
    end;


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


    begin
    SetUpSRL;
     MouseSpeed := Speed;
      ActivateClient;
       if (Yes = True) then
      begin
       FindDTMSymbol(SColor, STol, Rndm, False);
      end else
     FindDTMSymbol(16016699, 25, 5, False);
    end.

    Please give Positive Criticism.
    But not too much .. i am so proud


    --
    Offtopic:

    I wanna learn arrays, like u can put 3 colors, and just 1 var to call em all..
    Ce ne sont que des gueux


  2. #2
    Join Date
    Jun 2007
    Location
    #SRL
    Posts
    200
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    arrays are easy, you just delcare them like
    SCAR Code:
    var
      x: Array [1..3] of Integer; // this will give you 3 varables
    then call it later like
    SCAR Code:
    x[1]:= 5;
      Writeln(IntToStr(x[1]));
    or
    SCAR Code:
    for i:= 1 to 3 do
    begin
      x[i]:= 100;
      Writeln(IntToStr(x[i]));
    end;


    although that's only 1 of the 2 types of arrays, you could also do
    SCAR Code:
    program New;
    var
      x: Array of Integer; // this will give you unlimited varables, as long as you keep adding more to the array
      i: Integer;
    begin
      for i:= 0 to 10 do
      begin
        SetArrayLength(x,Length(x)+1);
        x[i]:= Random(100);
        Writeln(IntToStr(x[i]));
      end;
    end.
    Quote Originally Posted by IRC
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 43
    <Wizzup> shit
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 3
    <Wizzup> 1
    <Wizzup> offblast

  3. #3
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You called your function as "FindDTMSymbol" and your function clicks on it. The name should be "FindAndClickDTMSymbol".


  4. #4
    Join Date
    Jun 2007
    Location
    #SRL
    Posts
    200
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by cazax View Post
    You called your function as "FindDTMSymbol" and your function clicks on it. The name should be "FindAndClickDTMSymbol".
    or have a boolean for clicking on it or not
    Quote Originally Posted by IRC
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 43
    <Wizzup> shit
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 3
    <Wizzup> 1
    <Wizzup> offblast

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

    Default

    You mean this :P :

    SCAR Code:
    {*******************************************************************************
    function FindDTMSymbol(Color, Tol : 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     Tested and Created by ©Floor66
    *******************************************************************************}


    function FindDTMSymbol(Color, Tol : Integer; Click : Boolean): Boolean;
    var U, X, Y, C, SymbolDTM : Integer;
    begin
     begin
      SymbolDTM := DTMFromString('78DA63EC606260706740012AFE8F18FE03694' +
           '620FE0F048C7D4035CEA86A18191919B8A06AC0FC16A01A47026A' +
           '1A31EDC250D30654E347400DC83DDE04D4F403D5B8E1570300CA5' +
           'E0C6A');
     end;
      MarkTime(U);
      if (DTMRotated(SymbolDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
      begin
       C := GetColor(x, y);
       if (SimilarColors(C, Color, Tol)) then
        begin
        if (Click = True) then
         begin
          Mouse(x, y, 5, 5, True);
           Writeln('Found Symbol');
           Result := True;
          Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
         end else
          begin
          Writeln('Found Symbol');
           Result := True;
          Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
          end;
        end;
      end;
     FreeDTM(SymbolDTM);
    end;


    {*******************************************************************************
                                     ^^©Floor 66^^
    *******************************************************************************}
    Ce ne sont que des gueux


  6. #6
    Join Date
    Jun 2007
    Location
    #SRL
    Posts
    200
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    ya or, change the params to "(var x,y: Integer; Color, Tol : Integer; Click : Boolean)"

    then take your x&y out so that if it doesnt' click now, it can click later (because you put the loc of the symbol into x&y)
    Quote Originally Posted by IRC
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 43
    <Wizzup> shit
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 3
    <Wizzup> 1
    <Wizzup> offblast

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

    Default

    If i'd do that i'd get a Variable Expected error

    Idk, this'd work? :

    SCAR Code:
    {*******************************************************************************
    function FindDTMSymbol(Color, Tol : 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     Tested and Created by ©Floor66
    *******************************************************************************}


    function FindDTMSymbol(Color, Tol : Integer; Click : Boolean): Boolean;
    var U, X, Y, C, SymbolDTM, SaveX, SaveY : Integer;
    begin
     begin
      SymbolDTM := DTMFromString('78DA63EC606260706740012AFE8F18FE03694' +
           '620FE0F048C7D4035CEA86A18191919B8A06AC0FC16A01A47026A' +
           '1A31EDC250D30654E347400DC83DDE04D4F403D5B8E1570300CA5' +
           'E0C6A');
     end;
      MarkTime(U);
      if (DTMRotated(SymbolDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
      begin
       C := GetColor(x, y);
       if (SimilarColors(C, Color, Tol)) then
        begin
        if (Click = True) then
         begin
          Mouse(x, y, 5, 5, True);
           Writeln('Found Symbol');
           Result := True;
          Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
         end else
          begin
          Writeln('Found Symbol');
           Result := True;
          Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
          SaveX := X;
          SaveY := Y;
          Writeln('Symbol is located at : '+IntToStr(SaveX)+', '+IntToStr(SaveY)+'.');
          end;
        end;
      end;
     FreeDTM(SymbolDTM);
    end;


    {*******************************************************************************
                                     ^^©Floor 66^^
    *******************************************************************************}
    Ce ne sont que des gueux


  8. #8
    Join Date
    Jun 2007
    Location
    #SRL
    Posts
    200
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    you'd have to enter a variable that you declare before, otherwise you will get that error

    and no, that wouldn't work because all of the var's that you declare get erased after the procedure/function is over

    it'd have to look something like this:

    SCAR Code:
    program Whatever;
    var
      BlahX,BlahY: Integer;// call these what ever you want to

    function FindDTMSymbol(var x,y: Integer; Color, Tol : Integer; Click : Boolean): Boolean;
    var
      U, C, SymbolDTM : Integer;

    begin
       ///blah blah, procedure code here
    end;

    begin
      FindDTMSymbol(BlahX,BlahY,16777215,10,False);
      Wait(2000);
      MMouse(BlahX,BlahY,5,5);
    end.

    or something like that
    Quote Originally Posted by IRC
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 43
    <Wizzup> shit
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 3
    <Wizzup> 1
    <Wizzup> offblast

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

    Default

    This is it atm:

    SCAR Code:
    {*******************************************************************************
    function FindDTMSymbol(Color, Tol : 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     Tested and Created by ©Floor66
    *******************************************************************************}


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


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

    Why'd u actually want to store the x, y.
    U'd have to stand is the exact same spot where you ran the script..
    I think imma keep it like this, unless there is GREAT improvement or so.
    Ce ne sont que des gueux


  10. #10
    Join Date
    Jun 2007
    Location
    #SRL
    Posts
    200
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    you could do a random check between finding and clicking, or make a "mistake" (click away from the symbol) for antiban, things like that

    EDIT:
    SCAR Code:
    begin  // why do you have a begin here? you don't need it
      SymbolDTM := DTMFromString('78DA63EC606260706740012AFE8F18FE03694' +
           '620FE0F048C7D4035CEA86A18191919B8A06AC0FC16A01A47026A' +
           '1A31EDC250D30654E347400DC83DDE04D4F403D5B8E1570300CA5' +
           'E0C6A');
     end;  // same with this end, it's unneeded
    Quote Originally Posted by IRC
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 43
    <Wizzup> shit
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 3
    <Wizzup> 1
    <Wizzup> offblast

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

    Default

    Maybe..
    But just like findsymbol, this is for walking mostly.. so maybe not much randoms occur.. ill see :P
    Maybe i can add a possibilty to set the amount of randomness when clickin?
    Ce ne sont que des gueux


  12. #12
    Join Date
    Jun 2007
    Location
    #SRL
    Posts
    200
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    work on your standers too, it looks kind of... unnatural the way you have it.

    EDIT: here's a fixed up (standerd wise) version

    SCAR Code:
    function FindDTMSymbol(Color, Tol : Integer; Click : Boolean): Boolean;
    var U, X, Y, C, SymbolDTM : Integer;
    begin
      SymbolDTM := DTMFromString('78DA63EC606260706740012AFE8F18FE03694' +
           '620FE0F048C7D4035CEA86A18191919B8A06AC0FC16A01A47026A' +
           '1A31EDC250D30654E347400DC83DDE04D4F403D5B8E1570300CA5' +
           'E0C6A');
      MarkTime(U);
      if (DTMRotated(SymbolDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
      begin
        C := GetColor(x, y);
        if (SimilarColors(C, Color, Tol)) then
        begin
          if (Click = True) then
          begin
            Mouse(x, y, 5, 5, True);
            Writeln('Found Symbol');
            Result := True;
            Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
          end else
          begin
            Writeln('Found Symbol');
            Result := True;
            Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
            Writeln('Symbol is located at : '+IntToStr(X)+', '+IntToStr(Y)+'.');
          end;
        end;
      end;
      FreeDTM(SymbolDTM);
    end;
    Quote Originally Posted by IRC
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 43
    <Wizzup> shit
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 3
    <Wizzup> 1
    <Wizzup> offblast

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

    Default

    Thx, but i like my own standards :P
    Heres a version where you can decide how much randomness you click with:

    SCAR Code:
    {*******************************************************************************
    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(Color, Tol, Rand : Integer; Click : Boolean): Boolean;
    var U, X, Y, C, SymbolDTM : Integer;
    begin
     begin
      SymbolDTM := DTMFromString('78DA63EC606260706740012AFE8F18FE03694' +
           '620FE0F048C7D4035CEA86A18191919B8A06AC0FC16A01A47026A' +
           '1A31EDC250D30654E347400DC83DDE04D4F403D5B8E1570300CA5' +
           'E0C6A');
     end;
      MarkTime(U);
      if (DTMRotated(SymbolDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
      begin
       C := GetColor(x, y);
       if (SimilarColors(C, Color, Tol)) then
        begin
        if (Click = True) then
         begin
    //     FindNormalRandoms;
          Mouse(x, y, Rand, Rand, True);
           Writeln('Found Symbol');
           Result := True;
          Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
          Writeln('Symbol is located at : '+IntToStr(X)+', '+IntToStr(Y)+'.');
         end else
          begin
          Writeln('Found Symbol');
           Result := True;
          Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
          Writeln('Symbol is located at : '+IntToStr(X)+', '+IntToStr(Y)+'.');
          end;
        end;
      end;
     FreeDTM(SymbolDTM);
    end;


    {*******************************************************************************
                                     ^^©Floor 66^^
    *******************************************************************************}
    Ce ne sont que des gueux


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

    Default

    WOw, u made some edits :P
    So sorry for DP, but i just need to reply.

    --
    Imma leave the coord saving.
    --
    extra begin and end kinda make you see that the SymbolDTM is declared there.

    ^^Yeah, kinda also didnt understand what i said there :P
    Ce ne sont que des gueux


  15. #15
    Join Date
    Jun 2007
    Location
    #SRL
    Posts
    200
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    if you have
    SCAR Code:
    begin
    //     FindNormalRandoms;
          Mouse(x, y, Rand, Rand, True);

    let's just say that it did find a random, and it takes some time for it to solve, but in that time the symbol moves, so i think you should have it relocate the symbol if it finds a random, like:

    SCAR Code:
    begin
    {     if(FindNormalRandoms) then
              FindDTMSymbol(Color,Tol,Rand,Click);}
    // neat little trick, you're just using the same var's ;)
    //blah blah, rest of code here
    Mouse(x, y, Rand, Rand, True);
    Quote Originally Posted by IRC
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 43
    <Wizzup> shit
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 3
    <Wizzup> 1
    <Wizzup> offblast

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

    Default

    People who make a script shud input that then, i think.

    If people are able to make a devent script, then they could edit this to their liking a bit, but just credit.
    Ce ne sont que des gueux


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Find specific Symbol?!
    By Hugolord in forum OSR Help
    Replies: 10
    Last Post: 06-19-2007, 06:38 PM
  2. find symbol?
    By jhildy in forum OSR Help
    Replies: 2
    Last Post: 06-01-2007, 02:16 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
  •