Results 1 to 5 of 5

Thread: Help, Needed Thinking!

  1. #1
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help, Needed Thinking!

    Hello, me and my fellow buddy Cnr sport are making a script which uses grand exchange.

    You see, we want the script to buy the max equal amount of two different items thats possible to buy with the money our charecter has.

    Lets say our charecter has 500000 coins(500k).
    And the script gets the price of both items from GE automatically

    So...
    var
    Money
    Item1Price
    Item2Price
    Item1AmountToBuy
    Item2AmountToBuy

    Item1AmountToBuy and Item2AmountToBuy MUST BE EQUAL NUMBERS!

    So somone pl0x help us :P. We need the script to calculate how much of each items we need to buy.
    Woot woot.

  2. #2
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Somone help plz!
    Woot woot.

  3. #3
    Join Date
    May 2007
    Location
    Seattle
    Posts
    1,069
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Wouldn't you just divide how much cash u have by the cost?
    FORMERLY BORN2CODE | Play Internet Games
    http://img147.imageshack.us/img147/2084/sigg.png

  4. #4
    Join Date
    Mar 2008
    Location
    ::1
    Posts
    915
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Here's what I would do...
    SCAR Code:
    procedure GetAmounts;
      Money:= Money/2; // You could also use Money shr 1;
      AmountItem1ToBuy:= Money/Item1Price;
      AmountItem2ToBuy:= Money/Item2Price;
      if(AmountItem1ToBuy > AmountItem2ToBuy)then
      begin
        AmountItem1ToBuy:= AmountItem2ToBuy;
      end else
      begin
        AmountItem2ToBuy:= AmountItem1ToBuy;
      end;
    end;

    procedure GetFinalAmounts;
    begin
      repeat
        GetAmounts;
        Cost:= AmountItem1ToBuy*Item1Price;
        Cost:= Cost+(AmountItem2ToBuy*Item2Price);
        Money:= Money*2;
        Money:= Money-Cost;
      until((Item1Cost+Item2Cost) >= Money);
    end;

    begin
      GetFinalAmounts;
    end.

    Post if you have questions! Rep+

    Records and Types Save Code (and make you look better)
    Quote Originally Posted by Wizzup? View Post
    Is it possible to make Runescape a 2D game with this?... That would greatly simplify... Just about anything.

  5. #5
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ty, me and my buddy would try that!
    Woot woot.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Ok, I'm thinking of starting to script again!
    By Sandstorm in forum OSR Help
    Replies: 4
    Last Post: 10-15-2008, 02:27 AM
  2. Thinking About Quitting...
    By TViYH in forum News and General
    Replies: 36
    Last Post: 08-19-2008, 05:15 PM
  3. so ive been thinking....... ( involes update )
    By oliver1205 in forum News and General
    Replies: 11
    Last Post: 12-12-2007, 02:17 AM
  4. Need Thinking Help...
    By alach11 in forum OSR Help
    Replies: 16
    Last Post: 06-03-2007, 03:04 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
  •