Results 1 to 6 of 6

Thread: isuptext ????????????????

  1. #1
    Join Date
    Jul 2007
    Posts
    42
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default isuptext ????????????????

    hey everyone. yeah i know i ask alot of questions but i am learning alot. so here is another one for you guys. ok right now my power cutter uses colors. wich is fine but...it clicks on every tree not the one you want. so can someone tell me how i use the isuptext command so that when it finds the color it checks if it is a oak or whatever other tree?

    thanks alot here is my script.

    SCAR Code:
    {.Script Info:
    # ScriptName  = TREEKILLER V1.4
    # Author      = havoc928
    # Description = Chops trees until full inventory then drops
    # Version     = v1.4
    # Date        =
    # Comments    = Start anywhere where there are trees, with an axe weilded
    # Autocolor   = no

    # Release Comments
    // version 1.0 = very simple woodcutter\\
    // version 1.1 = added autotalker worked-removed\\
    // version 1.2 = added antirandoms untested-removed\\
    // version 1.3 = added anti ban working on-removed\\
    // version 1.4 = added log droping\\
    // version 1.5 = added anti-randoms\\
    // version 1.6 = added simple auto respond\\


    program simplewc;
    {.include SRL/SRL.scar}

    {.include SRL\SRL\skill\WoodCutting.scar}
    var
    c: integer;
    var
    d: integer;
    var
    e: integer;
    // THE SETUP\\
    const tree=5402997; // SET THE TREE COLOR\\// YOU MAY NOT HAVE TO\\
    const tree2=5402997; // SET TREE COLOR AGAIN - BAD FAILSAFE\\
    const tol=5; // SET THE COLOR FINDING TOLERANCE\\// 5-10 IS GOOD\\
    const waiting=5000; // SET TIME TO WAIT BEFORE NEXT CLICK. 1000MS = 1SEC
    const offset=5000; // SET THE RANDOM TIME OFFEST FOR CLICKS - RANDOMNESS
    // END SETUP\\


      procedure treekiller;
     begin
    if (findcolortolerance(x,y,tree,3,3,861, 376,tol))then
     begin
    if (findcolortolerance(x,y,tree2,3,3,861, 376,tol))then
         writeln('FOUND COLOR');
    end;
    // DO NOT TOUCH BELOW\\
      mouse(x,y,0,0,true)
      c:=c+1;
     wait(waiting+random(offset))
    end;

    procedure respond;
    begin
    if (InChat('bot'))Then
       TypeSend('im not a bot');

    if (InChat('macro'))Then
       TypeSend('im not a bot');
    end;

    procedure PrintProgressReport;
    begin
    WriteLn('havoc928 TREEKILLER');
    WriteLn('Cut ' + inttostr(c) + ' Logs.');
    WriteLn('Dropped ' + inttostr(d) + ' Loads.');
    WriteLn('Checked for ' + inttostr(e) + ' Randoms.');
    end;

      procedure credits;
     begin
    writeln('/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\')
    writeln('                 VERSION 1.4                            ')
    writeln('CREDIT GOES TO ME HAVOC928 ...FEEL FREE TO DISTRIBUTE')
    writeln('I THANK KIKWIT, Pancakes, AND n3ss3s FOR ALL THE HELP')
    writeln('SRL FORUMS OWNS ALL THE OTHERS!!!')
    writeln('/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\')
     end;
       procedure drop;
      begin
      typesend('WOOT WOOT FINALLY A FULL LOAD')
    writeln('DROPING LOGS')
     Dropto(2,28)
    d:=d+1
    end;

    procedure randoms;
    begin
    findnormalrandoms;
    e:=e+1;
    end;


    begin
    setupsrl;
    DisguiseScar('iTunes');
    credits;
    activateclient;
    repeat
    repeat
    respond;
     treekiller;
    wait(100)
     randoms;
    wait(100)
     printprogressreport;
    until(InvCount = 28);
     drop;
     until(false)
    end.

  2. #2
    Join Date
    Nov 2006
    Location
    Location, Location
    Posts
    1,126
    Mentioned
    6 Post(s)
    Quoted
    41 Post(s)

    Default

    Alright, just you MMouse to go to where the color was found, then if the UpText is Oak, it writes 'FOUND COLOR'.

    SCAR Code:
    procedure treekiller;
    var
      tries,tries2,tries3:integer;
    begin
      repeat
        repeat
          repeat
            FTWait(1);
            Inc(tries);
          until (findcolortolerance(x,y,tree,3,3,861, 376,tol)) or (tries > 10);
          FTWait(1);
          Inc(tries2);
        until (findcolortolerance(x,y,tree2,3,3,861, 376,tol)) or (tries2 > 10);
        FTWait(1);
        Inc(tries3);
        MMouse(x,y,0,0);
      until (IsUpText('Oak')) or (tries3 > 10);

    // DO NOT TOUCH BELOW\\
      if not(tries3 > 10) then
        begin
          mouse(x,y,0,0,true)
          c:=c+1;
        end;
      wait(waiting+random(offset));
    end;

  3. #3
    Join Date
    Jan 2007
    Location
    Skaville, Jamaica
    Posts
    1,117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You want to use the IsUpText function if you scroll the mouse over the tree and want to look for the text in the top-left corner that says - Cut Down Tree. So this is how you'd use it (basic example, you can get more complicated)

    SCAR Code:
    procedure CutTree;
    begin
      if(FindColor(x, y, TreeColor, MSX1, MSY1, MSX2, MSY2))then
        begin
          MMouse(x, y, 2, 2);
          if(IsUpText('ree'))then
            Mouse(x, y, 2, 2);
        end;
    end;

  4. #4
    Join Date
    Nov 2006
    Location
    Location, Location
    Posts
    1,126
    Mentioned
    6 Post(s)
    Quoted
    41 Post(s)

    Default

    ya mines a little much for his script >.>

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

    Default

    There is also the FindObj function which will continue to search until it finds the correct tree

    SCAR Code:
    {*******************************************************************************
    function FindObj(var cx, cy: Integer; Text: String; color, tolerance: Integer): Boolean;
    By: Stupid3ooo and modified by Ron.
    Description: Finds Object.
    *******************************************************************************}


    function FindObj(var cx, cy: Integer; Text: string; color, tolerance: Integer): Boolean;
    var
      a, c, i, x1, y1, x2, y2: Integer;
    begin
      x1 := 245;
      y1 := 165;
      x2 := 277;
      y2 := 185;
      repeat
        if (not (Loggedin)) then
          Break;
        a := a + 1;
        if (a = 1) or (a = 3) then
          c := c + 1;
        for i := 1 to c do
        begin
          if (a = 1) then
          begin
            x1 := x1 + 30;
            x2 := x2 + 30;
          end else
          if (a = 2) then
          begin
            y1 := y1 - 20;
            y2 := y2 - 20;
          end else
          if (a = 3) then
          begin
            x1 := x1 - 30;
            x2 := x2 - 30;
          end else
          if (a = 4) then
          begin
            y1 := y1 + 20;
            y2 := y2 + 20;
          end;
          if (x1 = 485) and (x2 = 517) then
            x2 := x2 - 2;
          if (y1 = 325) and (y2 = 345) then
            y2 := y2 - 7;
          if (x2 > 515) then
            Break;
          if (FindColorTolerance(cx, cy, color, x1, y1, x2, y2, tolerance)) then
          begin
            MMouse(cx, cy, 0, 0)
            Wait(50+Random(50));
            if (IsUpText(Text)) then
            begin
              Result := True;
              Break;
            end;
          end;
        end;
        if (a = 4) then
          a := 0;
      until (x2 > 515) or (Result = True);
    end;

    SCAR Code:
    FindObj(x, y, 'uptext you want to search for', color, Tol)


  6. #6
    Join Date
    Sep 2007
    Location
    newcastle australia
    Posts
    240
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    from what i see, isuptext doesnt work too well(for me anyways), use isuptextmulti(stringa, stringb, stringc); instead.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. IsUpText Help
    By Electron Man in forum OSR Help
    Replies: 4
    Last Post: 11-15-2007, 11:03 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
  •