Results 1 to 4 of 4

Thread: Help with a few problems in my script

  1. #1
    Join Date
    Jan 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help with a few problems in my script

    Hello SRL community, I have created a basic wc and bank script for draynor
    and here it is below:

    program New;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\Woodcutting.scar}
    var
    x,y,i,fx,fy:integer;
    const
    tree1= 6193772; //leave this alone
    tree2= 2570032; //leave this alone
    tree3= 4087118; //leave this alone
    bankfloor= 3158068; //select the color of the floor of the bank on the minimap
    Amountofloads= 10; //change to your desired number of loads you want the cutter to preform.


    procedure findtree;
    begin
    if findcolor(x,y,tree1,0,0,600,600) then
    wait(200+random(300));
    solvenontalkingrandoms;
    findent(fx,fy,true);
    mmouse(x,y,10,10);
    end;
    procedure confirmtree;

    begin
    if isuptextmulticustom(['chop','hop','down']) then
    begin
    wait(200+random(300));
    mouse(x,y,0,0,true);
    flag;
    end else
    wait(2000+random(1000));
    end;
    procedure tobank;
    begin
    if findsymbol(x,y,'bank') then
    begin
    wait(100+random(100));
    mmouse(x,y,10,10);
    wait(100+random(100));
    mouse(x,y,0,0,true);
    end else
    findcolor(x,y,bankfloor,0,0,600,600);
    mmouse(x,y,10,10);
    wait(100+random(100));
    mouse(x,y,0,0,true);
    flag;
    end;

    procedure usebank;
    begin
    wait(100+random(100));
    openbankfast('db');
    wait(100+random(100));
    depositall;
    wait(100+random(100));
    closebank;
    end;
    procedure towillows1;
    begin
    if findsymbol(x,y,'fish') then
    begin
    wait(100+random(100));
    mmouse(x,y,10,10);
    wait(100+random(150));
    mouse(x,y,0,0,true);
    end else
    findsymbol(x,y,'bank');
    mouse(x,y,10,10,true);
    flag;
    repeat
    findsymbol(x,y,'fish');
    until(findsymbol(x,y,'fish'));
    mouse(x,y,10,10,true);
    end;
    procedure chop;
    begin
    repeat
    findtree;
    confirmtree;
    until(invfull);
    end;

    begin
    setupsrl;
    i:= 1;
    repeat
    chop;
    tobank;
    usebank;
    towillows1;
    i:= i+1;
    until(i>=amountofloads);
    end.
    This is a fine script, and seems to work ok with finding the trees, banking, and getting back to the trees after banking, but there are a few little things wrong with it that I hope I can resolve by getting your help.
    1. The mouse movement is erratic (I attribute this to my use of the avoid ent coding, but I am not sure why it does what it does.)
    2. I cant figure out how to insert anti randoms in my script.

    Thank you for your help,
    Warflight

  2. #2
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    SCAR Code:
    program New;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\Woodcutting.scar}
    var
      x,y,i,fx,fy:integer;
    const
      tree1= 6193772; //leave this alone
      tree2= 2570032; //leave this alone
      tree3= 4087118; //leave this alone
      bankfloor= 3158068; //select the color of the floor of the bank on the minimap
      Amountofloads= 10; //change to your desired number of loads you want the cutter to preform.


    procedure findtree;
    begin
      if findcolor(x,y,tree1,0,0,600,600) then wait(200+random(300));
      solvenontalkingrandoms;
      findent(fx,fy,true);
      mmouse(x,y,10,10);
    end;


    procedure confirmtree;
    begin
      if isuptextmulticustom(['chop','hop','down']) then
      begin
        wait(200+random(300));
        mouse(x,y,0,0,true);
        flag;
      end else
      wait(2000+random(1000));
    end;

    procedure tobank;
    begin
      if findsymbol(x,y,'bank') then
      begin
        wait(100+random(100));
        mmouse(x,y,10,10);
        wait(100+random(100));
        mouse(x,y,0,0,true);
      end else
      findcolor(x,y,bankfloor,0,0,600,600);
      mmouse(x,y,10,10);
      wait(100+random(100));
      mouse(x,y,0,0,true);
      flag;
    end;

    procedure usebank;
    begin
      wait(100+random(100));
      openbankfast('db');
      wait(100+random(100));
      depositall;
      wait(100+random(100));
      closebank;
    end;

    procedure towillows1;
    begin
      if findsymbol(x,y,'fish') then
      begin
        wait(100+random(100));
        mmouse(x,y,10,10);
        wait(100+random(150));
        mouse(x,y,0,0,true);
      end else
      findsymbol(x,y,'bank');
      mouse(x,y,10,10,true);
      flag;
      repeat
        findsymbol(x,y,'fish');
      until(findsymbol(x,y,'fish'));
      mouse(x,y,10,10,true);
    end;


    procedure chop;
    begin
      repeat
        findtree;
        confirmtree;
      until(invfull);
    end;

    begin
      setupsrl;
      i:= 1;
      repeat
        chop;
        tobank;
        usebank;
        towillows1;
        i:= i+1;
      until(i>=amountofloads);
    end.

    try on scar tabs next time

    EDIT: i fixed your standarts

    the anti-random :
    SCAR Code:
    Procedure RandomCheck;
    begin
      FindNormalRandoms;
      if FindFight then
      begin
        // do something
      end;
    end;
    Hi

  3. #3
    Join Date
    Jan 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for fixing my standards, and as for the random help, thank you for that as well. Glad it doesn't call me a leecher anymore

  4. #4
    Join Date
    Jul 2008
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i know there arent any other trees around but illow would go in the uptext to also if it doesnt find tree terminate the script for it doesnt keep trying i think would be a good idea and you have confirmtree in findtree and again in the cut loop and also you dont use tree2 tree3 there useless and you pick a color for the trees they wont always be that color use a autocolor or sumthing
    im back again .!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. First Script(Problems)
    By earthgas in forum First Scripts
    Replies: 7
    Last Post: 12-12-2008, 10:33 PM
  2. Problems with a script.:(
    By h4lofr3ak in forum OSR Help
    Replies: 19
    Last Post: 02-09-2008, 10:59 AM
  3. Having problems with my first script
    By darkfire355 in forum OSR Help
    Replies: 2
    Last Post: 01-27-2008, 12:23 PM
  4. script problems
    By knassyl in forum OSR Help
    Replies: 5
    Last Post: 07-01-2007, 04:53 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
  •