Results 1 to 4 of 4

Thread: If, then and using X and Y

  1. #1
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default If, then and using X and Y

    Ok so now it clicks all over the place please help
    thanks
    SCAR Code:
    Procedure CutWillows;
    Var Failed, Clr: Integer;
      begin
        if not(loggedin) then
          exit;
            if (FindObjTPA(x, y, 1982002, 7, 1, 17, 17, 15, ['illow'])) then
              repeat
                AntiBan;
                AntiRandoms;
                FindObjTPA(x, y, 1982002, 7, 1, 17, 17, 15, ['illow'])
                GetMousePos(x,y);
                Wait(50 + random(150));
                  if (random(20) = 5) then
                    begin
                      mouse(x, y, 6, 6, false);
                      Wait(50 + random(150));
                      ChooseOption('hop');
                    end else
                      begin
                        mouse(x, y, 6, 6, true);
                      end;
                        Clr := GetColor(x, y);
                          while Clr = GetColor(x, y) do
                          Wait(100 + Random(100));
                            if not (FindObjTPA(x, y, 1982002, 7, 1, 17, 17, 15, ['illow'])) then
                              FWillow;
                              AntiBan;
                                if not (FindObjTPA(x, y, 1982002, 7, 1, 17, 17, 15, ['illow'])) then
                                  repeat
                                    Inc(Failed);
                                    AntiBan;
                                    Wait(5000 + random(5000));
                                until (FindObjTPA(x, y, 1982002, 7, 1, 17, 17, 15, ['illow'])) or (Failed = 5);
              until not (LoggedIn) or (InvFull);
      end;
    any idears and help would be great thanks
    I need so much help
    Last edited by rya; 09-02-2009 at 05:32 AM.
    I see Now, says the blind man

  2. #2
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    you look for the tpa, then if you wanna see if it's at a certain point just make a variable be xx, yy, and see if the x and y from the TPA is at x and y, like search the tpa, then do

    if(x<>xx) or (y<>yy) then
    writeln('not at the point anymore');


    so you'd do, until(x<>xx) or (y<>yy);

    a good idea would be to also add a TimeFromMark in the until, so you don't wait forever incase you messed up

  3. #3
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    I would use the wizzy plugin to make boxes and check if a box of a certain size still exists on a certain point. If it doesnt, the tree is gone :'D.

    The functions would be:
    FindColorsTolerance - for finding the tree colors
    SplitTpaex - for making boxes
    yourfunction - for checking if theres a box on your position.

    ~caused

  4. #4
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    SCAR Code:
    if FindObjTPA(x, y, 1982002, 7, 1, 17, 17, 15, ['illow']) then //already sets the x and y values so no need for GetMousePos();
    if (random(20) = 5) then
      begin
         mouse(x, y, 6, 6, false);
         Wait(50 + random(150));
         ChooseOption('hop');
      end else
        Mouse(x, y, 6, 6, true);//begin..end nest is not necessarry here as your only executing 1 line.
    FindObjTPA is probably not your best bet for the next part. Maybe instead try something like:
    SCAR Code:
    Clr := GetColor(x, y);
    while Clr = GetColor(x, y) do
      Wait(100 + Random(100));

    Something like that seems like it should work fine.

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
  •