Results 1 to 9 of 9

Thread: For To Do Statements

  1. #1
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default For To Do Statements

    I am working on a enchanter for rings of dueling (only really profitable one right now) I am wondering how I would create a For To Do Statement to enchant all of the inventory.

    This is what I have so far

    Simba Code:
    Function Enchant:Boolean;
      begin
        if InvFull then
          begin
            for i:= 0 to 27 do
              begin
                SendKeys('1', 5, 5);
                InvMouse(2,1);
                GetXPBarTotal
                repeat
                  wait(50);
                until(GetXPBarTotal-GetXPBarTotal=37);
              end;
          end;
      end;

    I want it to Send the key '1' to activate my spell on the action bar, then I want it to click the Inventory slots in order and then wait until the XP total is 37 more than it was before (how much exp is given from the spell). Is this right? Any ideas on a better way to do this?

  2. #2
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Take a look at my eoc superheater over in my requests thread, cant link atm on phone, but you can probably use my procedure to do what you want with the action bar atleast, as for all the inv slots, you'll have to make a loop,

    If i remember the horizontal inv slots are 42 pixels apart, vertical i cant recall however,

    You want a for loop inside a for loop, to repeat the first loop 4 times then again on the next row etc etc, i cant write it for you as i have no idea of the syntax for pascal, i only know it in C# and simular

    Code:
    for (int y = NumberOfRow; y < NumOfInvRows; y++;)
    {
         for (int x = NumberOfCol; x < NumOfInvCols; x++;)
         {
         ActionBarThing;
         Click inv spot(x,y);
         x++;
         }
    y++;
    }
    Last edited by DannyRS; 12-06-2012 at 01:48 AM.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  3. #3
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    If you have to click each one, change the invMouse to: InvMouse(i+1, 1);

    This would follow the for loop in clicking each inventory spot after the first one.
    ~Rez

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  4. #4
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

  5. #5
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by Shay View Post
    I must have skimmed over that! Dang Shay, thankyou!

  6. #6
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

  7. #7
    Join Date
    Dec 2009
    Posts
    380
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    And for your xp detection, I'd suggest declaring something as GetXpBarTotal

    Simba Code:
    XpFirst := GetXPBarTotal;

    Since GetXPBarTotal - GetXPBarTotal will = 0. You need to GetXPBarTotal from an earlier XP amount and set that to a variable. Then you can continue to call GetXPBarTotal until it has increased


    And personally, I'd declare that before you click on your Inv.

    Simba Code:
    Function Enchant:Boolean;
    var
      XPFirst, i: Integer;
    begin
      if InvFull then
      begin
        for i:= 1 to 28 do
          if ExistsItem(i) then
          begin
            SendKeys('1', 5, 5);
            XPFirst := GetXPBarTotal;
            InvMouse(i,1);
            while (XPFirst = GetXPBarTotal) do
              Wait(50);
          end;
      end;
    end;

    Try that out I haven't tested that.

    If that doesn't work just play around with it
    Currently: Playing OSRS legit until I get bored

  8. #8
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    For Learning To Your Brain Do Read Tutorials <3

  9. #9
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    I read some more, and that's funny YoHoJo XD script has been released, it is in the money money making section with minor anti-leech. I'll be gone until Friday, so I'll add anti-ban and multiplayer when I get back! Thanks for all th e help guys!

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •