Results 1 to 12 of 12

Thread: 2 things, questions

  1. #1
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Scripting help, what wrong.

    1. whats the best way to move the character , like telling it to move.
    2. if its a function, do i do it like this?>

    function blank;
    begin
    the function

    ????

    thanks for the replys ,no stupid posts please.

    EDIT: i dont want to be like a spammers so im editing my post and please read this edit
    SCAR Code:
    program PropperChopper;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\woodcutting.scar}
    {.includes\SRL\SRL\skill}
    const
    IsAxeWeilded = false; // Change to True If Axe Is Weilded
    RunDirection= 'NW';
    Tree = 4026472;//Colour of tree.
    Treename = 'Willow';
    Loads=20

    procedure CuttingTree;
     begin
      if FindColorSpiral(x, y, Tree, 0, 0, 517, 339) then
      MMouse(x, y, 1, 1);
      if FindObj(x,y,'ill',Tree,10) then
      Mouse(x, y, 1, 1, true);
      Writeln('Cutting a tree ');
         case random(10)of
        0 : wait (1000);
        1 : wait (2068);
        2 : wait (3102);
        3 : wait (1000);
        4 : wait (2500);
        5 : wait (1674);
        6 : wait (6453);
        7 : wait (1343);
        8 : wait (1232);
        9 : wait (2743);
        10 : wait (2342);
        end
      FindHead;
      AttachHead;
      end;
        procedure DropAllLogs;
     begin
      wait(500);
      DropAllLogs;
       end;
       begin
    CuttingTree;
    DropAllLogs;
          repeat
          CuttingTree;
          repeat
          DropAllLogs;
          until(InventoryFull)

    until(loads=20)
    end;
    end.

    It says theres an error
    Line12: semicolon expected in my script, anyideas?

  2. #2
    Join Date
    Mar 2007
    Posts
    3,681
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by cnr sport View Post
    1. whats the best way to move the character , like telling it to move.
    2. if its a function, do i do it like this?>

    function blank;
    begin
    the function

    ????

    thanks for the replys ,no stupid posts please.
    procedure move;

    begin

    MMouse (x,y,randomx,randomy);

    end;

    something like that not sure what you mean...

  3. #3
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by hugolord View Post
    procedure move;

    begin

    MMouse (x,y,randomx,randomy);

    end;

    something like that not sure what you mean...
    im not sure what the cordinets are, how do i find them out.

    If your making a woodcutter and u want him to go to the trees how do u tell him to do it?

  4. #4
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    if(FindColorTolerance(x,y,whatever ur color # is,MMX1,MMY1,MMX2,MMY2,5))then
    Mouse(x,y,2,2,true);
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  5. #5
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    if (FindColorTolerance(x,y,ColorHere,MSX1,MSY1,MSX2,MSY2,Tolerance)) then
      Mouse(x,y,4,4,True);


    Also for the semicolan error you just need to add one after loads in your constants.


  6. #6
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by bobarkinator View Post
    SCAR Code:
    if (FindColorTolerance(x,y,ColorHere,MSX1,MSY1,MSX2,MSY2,Tolerance)) then
      Mouse(x,y,4,4,True);


    Also for the semicolan error you just need to add one after loads in your constants.
    SCAR Code:
    program PropperChopper;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\woodcutting.scar}
    {.includes\SRL\SRL\skill}
    const
    IsAxeWeilded = true; // Change to True If Axe Is Weilded
    RunDirection= 'NW';
    Tree = 4026472;//Colour of tree.
    Treename = 'Willow';
    Loads=20;

    procedure CuttingTree;
     begin
      if (FindColorTolerance(x,y,4026472,MSX1,MSY1,MSX2,MSY2,Tolerance)) then
      Mouse(x,y,4,4,True);
      if FindObj(x,y,'ill',Tree,10) then
      Mouse(x, y, 1, 1, true);
      Writeln('Cutting a tree ');
         case random(10)of
        0 : wait (1000);
        1 : wait (2068);
        2 : wait (3102);
        3 : wait (1000);
        4 : wait (2500);
        5 : wait (1674);
        6 : wait (6453);
        7 : wait (1343);
        8 : wait (1232);
        9 : wait (2743);
        10 : wait (2342);
        end
      FindHead;
      AttachHead;
      end;
        procedure DropAllLogs;
     begin
      wait(500);
      DropAllLogs;
       end;
       begin
    CuttingTree;
    DropAllLogs;
          repeat
          CuttingTree;
          repeat
          DropAllLogs;
          until(InventoryFull)

    until(loads=20)
    end.
    It says unnknown identifer(tolerance) in line 14 in my script

  7. #7
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by cnr sport View Post
    SCAR Code:
    program PropperChopper;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\woodcutting.scar}
    {.includes\SRL\SRL\skill}
    const
    IsAxeWeilded = true; // Change to True If Axe Is Weilded
    RunDirection= 'NW';
    Tree = 4026472;//Colour of tree.
    Treename = 'Willow';
    Loads=20;

    procedure CuttingTree;
     begin
      if (FindColorTolerance(x,y,4026472,MSX1,MSY1,MSX2,MSY2,Tolerance)) then
      Mouse(x,y,4,4,True);
      if FindObj(x,y,'ill',Tree,10) then
      Mouse(x, y, 1, 1, true);
      Writeln('Cutting a tree ');
         case random(10)of
        0 : wait (1000);
        1 : wait (2068);
        2 : wait (3102);
        3 : wait (1000);
        4 : wait (2500);
        5 : wait (1674);
        6 : wait (6453);
        7 : wait (1343);
        8 : wait (1232);
        9 : wait (2743);
        10 : wait (2342);
        end
      FindHead;
      AttachHead;
      end;
        procedure DropAllLogs;
     begin
      wait(500);
      DropAllLogs;
       end;
       begin
    CuttingTree;
    DropAllLogs;
          repeat
          CuttingTree;
          repeat
          DropAllLogs;
          until(InventoryFull)

    until(loads=20)
    end.
    It says unnknown identifer(tolerance) in line 14 in my script
    It's the
    SCAR Code:
    if (FindColorTolerance(x,y,4026472,MSX1,MSY1,MSX2,MSY2,Tolerance))
    Tolerance there, add it to the constants
    SCAR Code:
    program PropperChopper;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\woodcutting.scar}
    {.includes\SRL\SRL\skill}
    const
    IsAxeWeilded = true; // Change to True If Axe Is Weilded
    RunDirection= 'NW';
    Tree = 4026472;//Colour of tree.
    Treename = 'Willow';
    Loads=20;
    Tolerance=10;

    procedure CuttingTree;
     begin
      if (FindColorTolerance(x,y,4026472,MSX1,MSY1,MSX2,MSY2,Tolerance)) then
      Mouse(x,y,4,4,True);
      if FindObj(x,y,'ill',Tree,10) then
      Mouse(x, y, 1, 1, true);
      Writeln('Cutting a tree ');
         case random(10)of
        0 : wait (1000);
        1 : wait (2068);
        2 : wait (3102);
        3 : wait (1000);
        4 : wait (2500);
        5 : wait (1674);
        6 : wait (6453);
        7 : wait (1343);
        8 : wait (1232);
        9 : wait (2743);
        10 : wait (2342);
        end
      FindHead;
      AttachHead;
      end;
        procedure DropAllLogs;
     begin
      wait(500);
      DropAllLogs;
       end;
       begin
    CuttingTree;
    DropAllLogs;
          repeat
          CuttingTree;
          repeat
          DropAllLogs;
          until(InventoryFull)

    until(loads=20)
    end.

    And change the 'ill' to Treename perhaps?

    SCAR Code:
    program PropperChopper;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\woodcutting.scar}
    {.includes\SRL\SRL\skill}
    const
    IsAxeWeilded = true; // Change to True If Axe Is Weilded
    RunDirection= 'NW';
    Tree = 4026472;//Colour of tree.
    Treename = 'Willow';
    Loads=20;
    Tolerance=10;

    procedure CuttingTree;
     begin
      if (FindColorTolerance(x,y,4026472,MSX1,MSY1,MSX2,MSY2,Tolerance)) then
      Mouse(x,y,4,4,True);
      if FindObj(x,y,Treename,Tree,10) then
      Mouse(x, y, 1, 1, true);
      Writeln('Cutting a tree ');
         case random(10)of
        0 : wait (1000);
        1 : wait (2068);
        2 : wait (3102);
        3 : wait (1000);
        4 : wait (2500);
        5 : wait (1674);
        6 : wait (6453);
        7 : wait (1343);
        8 : wait (1232);
        9 : wait (2743);
        10 : wait (2342);
        end
      FindHead;
      AttachHead;
      end;
        procedure DropAllLogs;
     begin
      wait(500);
      DropAllLogs;
       end;
       begin
    CuttingTree;
    DropAllLogs;
          repeat
          CuttingTree;
          repeat
          DropAllLogs;
          until(InventoryFull)

    until(loads=20)
    end.

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

    Default

    And get rid of the random waits. Just put

    SCAR Code:
    wait(1000+random(3000));

    Easier to read and more effective than 10 waits. It'll pick any amount of wait time from 1001-4000.

  9. #9
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by PwNZoRNooB View Post
    It's the
    SCAR Code:
    if (FindColorTolerance(x,y,4026472,MSX1,MSY1,MSX2,MSY2,Tolerance))
    Tolerance there, add it to the constants
    SCAR Code:
    program PropperChopper;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\woodcutting.scar}
    {.includes\SRL\SRL\skill}
    const
    IsAxeWeilded = true; // Change to True If Axe Is Weilded
    RunDirection= 'NW';
    Tree = 4026472;//Colour of tree.
    Treename = 'Willow';
    Loads=20;
    Tolerance=10;

    procedure CuttingTree;
     begin
      if (FindColorTolerance(x,y,4026472,MSX1,MSY1,MSX2,MSY2,Tolerance)) then
      Mouse(x,y,4,4,True);
      if FindObj(x,y,'ill',Tree,10) then
      Mouse(x, y, 1, 1, true);
      Writeln('Cutting a tree ');
         case random(10)of
        0 : wait (1000);
        1 : wait (2068);
        2 : wait (3102);
        3 : wait (1000);
        4 : wait (2500);
        5 : wait (1674);
        6 : wait (6453);
        7 : wait (1343);
        8 : wait (1232);
        9 : wait (2743);
        10 : wait (2342);
        end
      FindHead;
      AttachHead;
      end;
        procedure DropAllLogs;
     begin
      wait(500);
      DropAllLogs;
       end;
       begin
    CuttingTree;
    DropAllLogs;
          repeat
          CuttingTree;
          repeat
          DropAllLogs;
          until(InventoryFull)

    until(loads=20)
    end.

    And change the 'ill' to Treename perhaps?

    SCAR Code:
    program PropperChopper;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\woodcutting.scar}
    {.includes\SRL\SRL\skill}
    const
    IsAxeWeilded = true; // Change to True If Axe Is Weilded
    RunDirection= 'NW';
    Tree = 4026472;//Colour of tree.
    Treename = 'Willow';
    Loads=20;
    Tolerance=10;

    procedure CuttingTree;
     begin
      if (FindColorTolerance(x,y,4026472,MSX1,MSY1,MSX2,MSY2,Tolerance)) then
      Mouse(x,y,4,4,True);
      if FindObj(x,y,Treename,Tree,10) then
      Mouse(x, y, 1, 1, true);
      Writeln('Cutting a tree ');
         case random(10)of
        0 : wait (1000);
        1 : wait (2068);
        2 : wait (3102);
        3 : wait (1000);
        4 : wait (2500);
        5 : wait (1674);
        6 : wait (6453);
        7 : wait (1343);
        8 : wait (1232);
        9 : wait (2743);
        10 : wait (2342);
        end
      FindHead;
      AttachHead;
      end;
        procedure DropAllLogs;
     begin
      wait(500);
      DropAllLogs;
       end;
       begin
    CuttingTree;
    DropAllLogs;
          repeat
          CuttingTree;
          repeat
          DropAllLogs;
          until(InventoryFull)

    until(loads=20)
    end.
    Thanks, im gunna try it on rs. it was succusfully compiled

    this is what i got....

    Line 175: [Hint] (183:43): Variable 'NEWLINE' never used in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Globals.scar
    Cutting a tree
    [Runtime Error] : Exception: Access violation at address 0064FEA2 in module 'scar.exe'. Read of address 00000000 in line 182 in script C:\Program Files\SCAR 2.03\includes\SRL\SRL\skill\woodcutting.scar

  10. #10
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    It's probably this section:
    SCAR Code:
    repeat
          DropAllLogs;
          until(InventoryFull)

    DropAllLogs empty's your inventory so that won't work and are you using SRL 3.7?


  11. #11
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    here i fixed it:

    SCAR Code:
    program PropperChopper;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\woodcutting.scar}
    {.includes\SRL\SRL\skill}
    const
    IsAxeWeilded = false; // Change to True If Axe Is Weilded
    RunDirection= 'NW';
    Tree = 4026472;//Colour of tree.
    Treename = 'Willow';
    Loads=20;

    procedure CuttingTree;
    begin
      if FindColorSpiral(x, y, Tree, 0, 0, 517, 339)then
        begin
          MMouse(x, y, 1, 1);
          Wait(10);
          if(IsUpText('ill'))then
            begin
              Mouse(x, y, 1, 1, true);
              Writeln('Cutting a tree ');
              Wait(1000+random(2500));
              FindHead;
              AttachHead;
            end;
        end;
    end;

    procedure DropLogs;
    begin
      wait(500);
      DropAllLogs;
    end;

    begin
      Setupsrl;
      CuttingTree;
      DropAllLogs;
        repeat
          CuttingTree;
            repeat
              DropLogs;
            until(not invfull)
        until(loads=20)
    end.

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  12. #12
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by bobarkinator View Post
    It's probably this section:
    SCAR Code:
    repeat
          DropAllLogs;
          until(InventoryFull)

    DropAllLogs empty's your inventory so that won't work and are you using SRL 3.7?
    Yea im using scar 2.03 and srl 3.70 and i found the mistake and it succusufly compiled, im gonnma try and play it.

    i played it and it chops down a tree then it stops and doesnt do anything? any ideas?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Several things I need help on.
    By Torrent of Flame in forum OSR Help
    Replies: 4
    Last Post: 03-03-2008, 09:29 PM
  2. Random Questions and Things
    By Here in forum News and General
    Replies: 20
    Last Post: 07-20-2007, 05:16 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
  •