Results 1 to 12 of 12

Thread: Need To Find Amount of Item In Shop

  1. #1
    Join Date
    Sep 2007
    Location
    Behind You
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Need To Find Amount of Item In Shop

    Hello. As you may have guessed, In a new script I am making I need to find the amount of an item. For example, if Item A has more than 10 in stock it will buy all. also i need to see how much of the item is in my inventory (the item is stackable) then log that. should I use a procedure to find a bitmap of the item then try to read the text somehow? I have no idea.

    ~JNCR
    The[Cheese] really puts it perfectly:

    Reflection is win

  2. #2
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Yeah use a text finding function.

    I'll test one out and post it for ya =]

  3. #3
    Join Date
    Sep 2007
    Location
    Behind You
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Derek- View Post
    Yeah use a text finding function.

    I'll test one out and post it for ya =]
    Thanks alot but how would it know where to find the text? it needs to find the text for that item only. should it find the item then create a box around the item then look for text in the box? just a guess.

    ~JNCR
    The[Cheese] really puts it perfectly:

    Reflection is win

  4. #4
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    I was thinking about using a user defined bitmap(one you make)

    or do u think I should use colors and UpText?(finds the color then moves mouse to it to see if its right item)

  5. #5
    Join Date
    Sep 2007
    Location
    Behind You
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeah i would use a bitmap and uptext to check if it is the right item, but that wont give me how much of the item there is. the amount of the item is right to the top-left of the item.

    stuck,
    ~JNCR
    The[Cheese] really puts it perfectly:

    Reflection is win

  6. #6
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    program New;
    {.include srl/srl.scar}
    begin
    setupsrl;
    Writeln(IntToStr(Amount('shop',1)));
    end.

  7. #7
    Join Date
    Sep 2007
    Location
    Behind You
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Boreas!

    So this just writes a line of how much of the item with the text 'shop' in it? Or how do you specify the item? What would the 1 be?

    Sorry, can't check because I'm away from scar right now. Can't look in srl.

    ~JNCR
    The[Cheese] really puts it perfectly:

    Reflection is win

  8. #8
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ermmm, very useful is Srl manual, Scar -> help -> srl manual, and somewhere there is function what returns amount of items in x ,y
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  9. #9
    Join Date
    Sep 2007
    Location
    Behind You
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah but like I said I am away from SCAR for a couple of days. (My laptop is broken, using my dad's computer, and he doesn't want SCAR on it... He thinks it is a virus because there is lines of "viral code" that he can't understand... *sigh*) Oh well.

    Can somebody tell me the function/parameters of Amount()? that would greatly be appreciated.

    Anxious,
    ~JNCR
    The[Cheese] really puts it perfectly:

    Reflection is win

  10. #10
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    look in srl include for you ask question like this ,!!, -_- ,!!, j/k:P
    ~Hermen

  11. #11
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    'shop' means look in shop window. Other args are 'bank', 'inv', but you need shop.

    1 is the slot number. Since as far as I know, items don't change around in shops, except general stores, you can find where the item that interests you is, and put that slot in. Slots are numbered left to right, top to bottom. So top left is 1, and to the right of that is 2.

  12. #12
    Join Date
    Sep 2007
    Location
    Behind You
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Boreas.

    and hermpie... look in the post right above yours. I cannot look in the srl files.

    Quote Originally Posted by JNCR
    Yeah but like I said I am away from SCAR for a couple of days. (My laptop is broken, using my dad's computer, and he doesn't want SCAR on it... He thinks it is a virus because there is lines of "viral code" that he can't understand... *sigh*) Oh well.

    anxious to test,
    ~JNCR
    The[Cheese] really puts it perfectly:

    Reflection is win

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. /~\/Wuffelz Sig Shop\/~\
    By Wuffel in forum Semi Stupid Pictures
    Replies: 6
    Last Post: 03-24-2007, 02:09 PM
  2. count amount of item in shop
    By Killerdou in forum OSR Help
    Replies: 16
    Last Post: 01-02-2007, 07:38 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
  •