Results 1 to 10 of 10

Thread: Counting Kebabs

  1. #1
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default Counting Kebabs

    Need a way to count the number of Kebabs my script buys. When you buy a Kebab it says in the chat box "You buy a kebab." and this is what im currently using to count the kebabs after its bought them:

    SCAR Code:
    if(InChat('ebab')) then
      begin
        KebabCount:=KebabCount+1;
        Writeln('Bought a kebab!');
      end;

    The counter works fine, its just detecting when a kebab has been bought thats messing up, it rarely registers that it has bought one.

    Help appreciated on fixing this

  2. #2
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Use bitmaps. Just do

    SCAR Code:
    Procedure BuyKebabs;
     begin;
      If (FindColorTolerance(x, y, ShopKeeper, 0, 0, 300, 500, 5)) Then //Find Shop keeper.
       begin;
        Mouse(x, y, True);
        Wait(1000+Random(1000));
        repeat;
         ClickToContinue;
        Until(FindBitmapTolerance(YesPleaseText, x, y); //repeat until it finds "Yes please"
        ClickNPCChatText('Yes please.');
        Wait(500+Random(1000));
        KebabCount:= KebabCount+1
        Wait(1000+Random(1000));
       end;
     end;


    that should work. But what are you buying kebabs for?
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  3. #3
    Join Date
    Dec 2006
    Location
    Australia
    Posts
    698
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    How about instead of counting them, wait until the invfull than just have a variable and add 27 to it for each load you do. for example

    SCAR Code:
    repeat
      repeat
        buykebab
      until(invfull)
      kebabs := kebabs + 27
      bank
    until(false)

  4. #4
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default

    its not the buying of the kebabs thats the problem, just the part where it sees that its bought one. and i want to buy the kebabs just for fun i geuss lol, this is my first script and i wanted something relatively easy to do. and yer the code above is just a snippet.

    that variable where it adds 27 looks like a good idea, but if it gets a random such as mysterious box or something and it gets given a gem, that wouldnt work.

    dont think i was clear enough lol:

    SCAR Code:
    if(InChat('ebab')) then
      begin
        KebabCount:=KebabCount+1;
        Writeln('Bought a kebab!');
      end;

    Thats where the problem is, i need a better way of adding a kebab to the counter than that.

    (edited first post with this snippet and removed the rest of it)

  5. #5
    Join Date
    Dec 2006
    Location
    Australia
    Posts
    698
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    ABout doing an inventory count for a certian dtm or color? that way you would have an exact amount of kebabs.

  6. #6
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default

    oo hadn't thought of that.

    I would need to do it every time just before it banks i think. could you tell me how exactly to do an inventory count? ive had a look quickly just then but cant really find anything on it.

    thanks for the help

  7. #7
    Join Date
    Dec 2006
    Location
    Australia
    Posts
    698
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Go to SRL\Misc\ItemList.scar there is a nice list of BMPmasks, including one for kebabs. Then use the following function:

    function CountItemBmpMaskTol(bmp, tol, ctol: Integer): Integer;
    By: Stupid3ooo
    Description:
    Performs a count of inventory items by bmpmasks with tol tolerance,
    and Ctol ContourTolerance.

  8. #8
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default

    you sure theres one for kebabs? i cant find it lol
    could you maybe post the BMPMask and ill add it in myself please?

  9. #9
    Join Date
    Dec 2006
    Location
    Australia
    Posts
    698
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Well there you go, for some reason i thought there was but not to stress
    Using the kebab bitmap found in the randoms folder you should be able to do the following.

    Kebab := BitmapFromString(8, 9, 'z78DA3330200DB88181011D752' +
    '103DAD93BB02A89570F00CD145629');

    function CountItemBmpTol(bmp, tol: Integer): Integer;
    By: Stupid3ooo
    Description:
    Performs a count of inventory items by bmp with tol tolerance.

  10. #10
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default

    Many thanks for the help mate, all working good now

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Counting
    By Smarter Child in forum OSR Help
    Replies: 3
    Last Post: 03-04-2009, 11:14 PM
  2. Counting runes
    By trojan in forum OSR Help
    Replies: 7
    Last Post: 02-10-2009, 10:13 PM
  3. Counting Inv?
    By Prince in forum OSR Help
    Replies: 3
    Last Post: 02-17-2008, 07:46 PM
  4. Counting In Inv
    By [S]paz in forum OSR Help
    Replies: 10
    Last Post: 01-19-2008, 01:12 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
  •