Results 1 to 21 of 21

Thread: what am i doing wrong

  1. #1
    Join Date
    Jul 2007
    Posts
    238
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default what am i doing wrong

    once again i need help...
    PLZ dont tell me to use something els like DTM's or radialwalking
    cause i tried to learn both of them and DTM's isnt working for me and i can work a bit with radialwalking...but now im trying to learn/understand them one by one...and im strarting with BITMAPS and YES i ive read TUT's
    like:
    http://www.villavu.com/forum/showthread.php?t=4625
    http://www.villavu.com/forum/showthr...son+RadialWalk <<<<isnt telling much about bitmaps
    http://www.villavu.com/forum/showthr...?t=1116?t=1283

    oke here is my problem
    ive made a script just to 'play' with bitmaps till i fully understand how to use/work it

    it suppose to find the questsign in the minimap and move the mouse and click on it BUT IT WONT FIND IT!!!!! then
    i made a screeny with a quest sign in it pasted it in paint and made scar look for it and it found it i know rs colors changes all the time but i got colorTolerance so it should find it right ?

    srry for my standards if its a mass

    SCAR Code:
    program test;
    {.include SRL\SRL.scar}
    var
     questsign: integer;

    procedure LoadBitmap;
    begin
      questsign := BitmapFromString2(False, 'a9270278DA95945B0EC3' +
           '200C04AF64C2339F86C2FD8F54369622B7D449CAC7C8E231AC808' +
           '4889C73345B1B1369EB604A93B180293018CB59C78A399137F450' +
           '98DC0A186303C7B10A83940BCCB945F45430B3076B38EB3476F09' +
           '5D11360F6AE821B3CDFCDD13EF73C58B995162CEA993F2C8BD3F2' +
           'A4BA536F37BB1839AD552531F52E66A9FFF02F6631686AB3D0E37' +
           '26CB39176756AB338A5DE990B9BE77FEDD4B5766A5E9B75368BBE' +
           'A7D187C5E7993F4E550C4766A9F5A89C89F0FADD9A66E55F9D4FE' +
           'ED132AF6FC3745EBE1059B59A75CE1BF383EF45CCABEDC6F9F8BF' +
           'F123A1E17C03242');
    end;

    procedure FBitmap;
    var
     x, y :integer;
    begin
    if FindBitmapToleranceIn(questsign, x, y, 520, 0, 734, 170, 25) then
      begin
        MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
        Wait(1000+random(100))
        ClickMouse(x,y,true) end;
       begin
            if FindBitmapToleranceIn(questsign, x, y, 520, 0, 734, 170, 25) then
            begin
            writeln(found quest sign);
            end;
       end;

    end;

    procedure freeBmps;
    begin
         freebitmap(questsign);
    end;

    begin
      setupsrl;
      ActivateClient;
      loadbitmap;
      fbitmap;
      freebmps;
    end.
    ....

  2. #2
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Try this, if it doesnt work then you maybe didnt do the bitmap right.

    SCAR Code:
    program test;
    {.include SRL\SRL.scar}
    var
     questsign: integer;
     x, y :integer;

    procedure FBitmap;
    begin
      questsign := BitmapFromString(31, 30, 'a9270278DA95945B0EC3' +
           '200C04AF64C2339F86C2FD8F54369622B7D449CAC7C8E231AC808' +
           '4889C73345B1B1369EB604A93B180293018CB59C78A399137F450' +
           '98DC0A186303C7B10A83940BCCB945F45430B3076B38EB3476F09' +
           '5D11360F6AE821B3CDFCDD13EF73C58B995162CEA993F2C8BD3F2' +
           'A4BA536F37BB1839AD552531F52E66A9FFF02F6631686AB3D0E37' +
           '26CB39176756AB338A5DE990B9BE77FEDD4B5766A5E9B75368BBE' +
           'A7D187C5E7993F4E550C4766A9F5A89C89F0FADD9A66E55F9D4FE' +
           'ED132AF6FC3745EBE1059B59A75CE1BF383EF45CCABEDC6F9F8BF' +
           'F123A1E17C03242');
     if(FindBitmapToleranceIn(questsign, x, y, MMX1, MMY1,MMX2, MMY2, 50)) then
      begin
        WriteLn('Bitmap found. Attempting to click');
        Mouse(x, y, 1, 1, true);
      end else
        WriteLn('Bitmap not found.');
    end;

    procedure freeBmps;
    begin
         freebitmap(questsign);
    end;

    begin
      SetupSRL;
      ActivateClient;
      repeat
      fbitmap;
      freebmps;
      Until(false);
    end.

  3. #3
    Join Date
    Jul 2007
    Posts
    238
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nope still not working
    i made another bitmap and it still doesnt work
    ....

  4. #4
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    This one works for me:
    SCAR Code:
    Program Lets_Find_That_Quest_Sign;
    {.include SRL/SRL.scar}

    var
     A,b,Quest: Integer;

    begin
      SetupSRL;
      Quest := BitmapFromString2(False, 'aDF64A78DAA5955BAEC3200C' +
           '44B7C49BF08909EC7F49854CAEE4C8178A9A7C8C1072E63036699' +
           '5522AD92E2A0E0D2E77F5AE0E8D475773B8B1F665680BA3C68C72' +
           '1FF478A9F8B14343631E0E9146BDADADAB4BC3EDEB139CB7E796B' +
           'E79B84F8BCD17BBA3BFD1BF50744D253A0AAED51DFA2B16D31DE2' +
           '9AFB0FCB3673D6875EFB4967D51C8858FFC63D4CD4F5E4355449D' +
           '7004FA92146FA2372D5D9C65AF02E7783FF974E5EB966CE721F2C' +
           'ECE74894F32CA94CC7156E47FF3E5BE00A67AC398BD79321455A2' +
           '67D10AF7BC859B35C5883057F5EB94FC47DE00A67A9E8396A6CF0' +
           'BA9D6B9D11CB71F6B163EEDC5F76152C6484A73C55CAC91443965' +
           '42ED3AE4EE628A7C9CF0FAEACD99AE392C8F3CA5C7CA660F174F2' +
           '1B9971F9CDE47410792ECE5DB3D6BF00B75E67965D953DBC67B7F' +
           'C0558731F6740AF2E0591EFC85C6BD63E177A1327947D96E4EED0' +
           '67B7F1CDBF33F759EB8EDB076BB');
      if(FindBitmapToleranceIn(Quest,a,b,0,0,750,500,5))then
      begin
        Writeln('Bitmap found!')
        Mouse(a,b,5,5,True)
      end else
      begin
        Writeln('Did not find bitmap :(')
      end;
      FreeBitmap(Quest)
    end.

    A good tip about bitmaps: Places where the color changes, paint that black in paint
    In this case you just have to paint everything but the questsign itself, black.

    -Knives

  5. #5
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    MoveMouseSmoothEx(a,b,20,25,40,45,20)
    Wait(100+random(100))
    HoldMouse(a,b,true)
    Wait(50+random(100))
    ReleaseMouse(a,b,true)
    = BAN! never use MoveMouseSmoothEx, HoldMouse, ReleaseMouse. USE Mouse(x,y,RandomX,RandomY,True); (Means that it will move to a position and left click.

    Also use MMouse(x,y,1,1); for just hovering over.

  6. #6
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I know that Bobbo :P I just didn't include SRL because I don't like the long Setup-time. I can be impatient sometimes :P

    I've used SmoothEx and Hold-/releasemouse for an eternity, with not even a black mark.

    Anyway, I edited my first post to satisfy you :P It's now Mouse instead.

    EDIT: I might be a "Registered user", but I still know a lot about SCAR and SRL

    -Knives

  7. #7
    Join Date
    Jul 2007
    Posts
    238
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks king for the tip ill try it out right away
    ill try urs but with out
    SCAR Code:
    MoveMouseSmoothEx(a,b,20,25,40,45,20)
    Wait(100+random(100))
    HoldMouse(a,b,true)
    Wait(50+random(100))
    ReleaseMouse(a,b,true)
    ....

  8. #8
    Join Date
    Apr 2007
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    keep trying and once u will become a great scripter

  9. #9
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice post, marre... Containing a lot of Dr. Phil psychology.
    Dr. Phil = Spammer

    Dushii, let me know how it went.
    I also edited my first post to use SRL instead of nothing,

    -Knives

  10. #10
    Join Date
    Jul 2007
    Posts
    238
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by marre View Post
    keep trying and once u will become a great scripter
    ty

    and knives it finds the wrong quest sign :P it suppose to find the one on the mini map not the one for quest list
    so i tried to edit it so it will look on the mini map
    but it didnt find it then i tried to make another bitmap and painted few things black :P idk which color changes of the quest sign and it still didnt work
    man...me is bad scripter...but me wont GIVE UP :Ph):


    SCAR Code:
    Program Lets_Find_That_Quest_Sign;
    {.include SRL/SRL.scar}

    var
     A,b,Quest: Integer;

    begin
      SetupSRL;
      Quest := BitmapFromString2(False, 'aDF64A78DAA5955BAEC3200C' +
           '44B7C49BF08909EC7F49854CAEE4C8178A9A7C8C1072E63036699' +
           '5522AD92E2A0E0D2E77F5AE0E8D475773B8B1F665680BA3C68C72' +
           '1FF478A9F8B14343631E0E9146BDADADAB4BC3EDEB139CB7E796B' +
           'E79B84F8BCD17BBA3BFD1BF50744D253A0AAED51DFA2B16D31DE2' +
           '9AFB0FCB3673D6875EFB4967D51C8858FFC63D4CD4F5E4355449D' +
           '7004FA92146FA2372D5D9C65AF02E7783FF974E5EB966CE721F2C' +
           'ECE74894F32CA94CC7156E47FF3E5BE00A67AC398BD79321455A2' +
           '67D10AF7BC859B35C5883057F5EB94FC47DE00A67A9E8396A6CF0' +
           'BA9D6B9D11CB71F6B163EEDC5F76152C6484A73C55CAC91443965' +
           '42ED3AE4EE628A7C9CF0FAEACD99AE392C8F3CA5C7CA660F174F2' +
           '1B9971F9CDE47410792ECE5DB3D6BF00B75E67965D953DBC67B7F' +
           'C0558731F6740AF2E0591EFC85C6BD63E177A1327947D96E4EED0' +
           '67B7F1CDBF33F759EB8EDB076BB');
      if(FindBitmapToleranceIn(Quest,a,b,520,0,750,150,5))then
      begin
        Writeln('Bitmap found!')
        Mouse(a,b,5,5,True)
      end else
      begin
        Writeln('Did not find bitmap :(')
      end;
      FreeBitmap(Quest)
    end.
    ....

  11. #11
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I made a new one, for the minimap
    SCAR Code:
    Program Lets_Find_That_Quest_Sign;
    {.include SRL/SRL.scar}

    var
     A,b,Quest: Integer;

    begin
      SetupSRL;
      Quest := BitmapFromString2(False, 'aBFC3578DA8D91410E80200C' +
           '04BF542B053C1694FF3F499BBD34C112384C1A59270B10115DE70' +
           '72AC69CF4A3A4C758EA47AEC966E9C6912DC316977CD84F5DEC4B' +
           '331635436996E766BB275BFE77B5DEB54B44DA58D1BFF9BEF8B9F' +
           '7CD51B256E567C08679C7391B3CBD0D3C59CA9F2DEAE33DDE060F' +
           'E6ABABAAACCF35F7C1EC3D9ED13DAF99A81C8322AEBB79228F6E9' +
           '8FD2ECE1B9D3AB27967E4D979D3B90F9CB3277A5924679BEF13D9' +
           'D666D8A2FBA1ED35B75D1B5EF11');
      if(FindBitmapToleranceIn(Quest,a,b,520,0,750,150,5))then
      begin
        Writeln('Bitmap found!')
        Mouse(a,b,10,10,True)
      end else
      begin
        Writeln('Did not find bitmap :(')
      end;
      FreeBitmap(Quest)
    end.

    A tip: You paint everything but the sign itself, black. For example; I took a screenshot of a quest-sign in Al-Kharid, where you may have to find the sign in Falador. And the area around the quest-sign aren't the same in 2 places, see ?

    -Knives

  12. #12
    Join Date
    Jul 2007
    Posts
    238
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nope cant find it =/
    btw did u tested your if so did it work for you ?
    ....

  13. #13
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, it worked for me. Let me try again, and see if the colors have changed TOO much.

    EDIT: I didn't get a result with 5 tolerance. It found the bitmap with tolerance 10. Try that.
    EDIT2: Make sure nobody is standing on the sign, including yourself :P

    -Knives

  14. #14
    Join Date
    Jul 2007
    Posts
    238
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oke ill try that

    EDIT: still not working..man something must be wrong with my comp
    ....

  15. #15
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Not necessarily... Try and use a bigger tolerance...

    -Knives

  16. #16
    Join Date
    Jul 2007
    Posts
    238
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oke it worked with color tol 40 :P
    but could u tell me what color/part of the sign u painted black ?
    ....

  17. #17
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I basically painted everything black, except the blue and half-grey part. Check the picture below,



    The leftmost water-sign is raw. Just a screenshot from RS. The one to the right, is where I've blackened some parts out. A black color in a bitmap means every color. So those parts don't matter - They're universal.

    -Knives

  18. #18
    Join Date
    Jul 2007
    Posts
    238
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by King of Knives View Post
    I basically painted everything black, except the blue and half-grey part. Check the picture below,



    The leftmost water-sign is raw. Just a screenshot from RS. The one to the right, is where I've blackened some parts out. A black color in a bitmap means every color. So those parts don't matter - They're universal.

    -Knives
    ohh i knew and did that but i thought u painted some blue colors black :P
    ....

  19. #19
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Never! :P That would ruin the great bitmap :P

    -Knives

  20. #20
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    use a smaller bitmap look at the ones in srl's symbol section in the include they are like 2x6

  21. #21
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Mine are magnified :P They wouldn't be usable if they really were that huge.

    -Knives

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. what am i doing wrong ?:P
    By sjlou in forum OSR Help
    Replies: 2
    Last Post: 10-01-2007, 01:52 PM
  2. What am i doing wrong?
    By One Leeter in forum OSR Help
    Replies: 7
    Last Post: 06-15-2007, 10:33 PM
  3. Replies: 8
    Last Post: 03-23-2007, 04:20 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
  •