Results 1 to 7 of 7

Thread: GetXPBar Help

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

    Default GetXPBar Help

    Im working on a private butter churner, I have it all working except using the churn. I need to have a static wait time for the butter churning, it takes approx 2.3 minutes to do a full inventory of wheels.

    This is what I have for my churn function

    Simba Code:
    Procedure UseChurn;
    Begin
      repeat
      If FindDTMRotated(Churn, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) Then
      Begin
        CheckXP; <-- finds initial exp
        WriteLn('We found the churn');
        MMouse(X, Y, 3, 3);
        ClickMouse2(False);
        WaitOption('hurn',250);
        IncEx(Wheels, 28);
        wait(1200+random(50))
         While IsMoving Do Wait(RandomRange(50,100));
        Mouse(322,427,5,5,True);
        Wait(250+random(50));
       repeat
       CheckXP2; <--- checks the amount again
       if (XP-XP2<1792) then <-- subtracts them and checks difference, if not
       begin <----- specified difference then it waits half a second and checks
       wait(500); <--- again until it is the specified difference
       end;
       until(XP-XP2>=1792);
       wait(500+random(250));
       exit;
      End Else
        WriteLn('We could not find the churn');
        Inc(Fail);
    until(FindDTMRotated(Churn, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) or (Fail=10))
    End;

    Simba Code:
    procedure CheckXP;
      begin
        XP:=GetXPBar(1);
      end;

    procedure CheckXP2;
      begin
        XP2:=GetXPBar(1);
      end;

    ^ These are my checking procedures that are called in the script. It does not stop after it reaches the full exp, can anybody see why? Also I know my standards are horrible XD Thanks for any help. Any ohter suggestions as to how to know when it is out of cheese wheels?

  2. #2
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Why not make a dtm for the cheese wheels and have it wait for no more cheese wheels found in inventory? I'm not sure how the churning works though

  3. #3
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    U are repeatedly calling CheckXp2 by using it in a repeat loop (this means the value of the recorded xp will change each time u go around the loop. U should just call CheckXp2 ONCE before the repeat loop.

    Also you are using "else" rather than "if not" in ur actual script right?

  4. #4
    Join Date
    Jul 2010
    Posts
    1,115
    Mentioned
    1 Post(s)
    Quoted
    10 Post(s)

    Default

    i feel like it should be xp2-xp instead of xp-xp2.
    say i had 10xp for xp, then i have 2000 for xp2, with yours, it would be 10 -2000= -1990
    which is less than 1792, whereas xp2-xp would get me 2000 -10= 1990 which is greater than 1792 so it would move on.

  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 bolshak25 View Post
    i feel like it should be xp2-xp instead of xp-xp2.
    say i had 10xp for xp, then i have 2000 for xp2, with yours, it would be 10 -2000= -1990
    which is less than 1792, whereas xp2-xp would get me 2000 -10= 1990 which is greater than 1792 so it would move on.
    This, Thankyou(: Also I tried the DTM and it sometimes would not find it, if I use exp it will be exact(I may suck at making DTMs as well :P

  6. #6
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    You should try checking these:
    http://villavu.com/forum/showthread.php?t=77691
    http://villavu.com/forum/showthread.php?t=564

    great DTM tutorials out, and for any points (usually only the mainpoint) that you dont place along the black outline make sure you have some tolerance as their colours WILL change.
    Also in the DTM editor you are able to test and see where on the screen it is resulting positive for the DTM you made and you'll know if you need to add more points or edit it in some way to make it more accurate.

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

    Default

    Quote Originally Posted by p1ng View Post
    You should try checking these:
    http://villavu.com/forum/showthread.php?t=77691
    http://villavu.com/forum/showthread.php?t=564

    great DTM tutorials out, and for any points (usually only the mainpoint) that you dont place along the black outline make sure you have some tolerance as their colours WILL change.
    Also in the DTM editor you are able to test and see where on the screen it is resulting positive for the DTM you made and you'll know if you need to add more points or edit it in some way to make it more accurate.
    I appreciate it(: Thankyou!

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
  •