Need help writing a script.

Discussion in 'Scar/Simba Help' started by Zeta, Aug 1, 2007.

Need help writing a script.
  1. Unread #1 - Aug 1, 2007 at 2:11 AM
  2. Zeta
    Joined:
    Jan 21, 2007
    Posts:
    1,680
    Referrals:
    3
    Sythe Gold:
    0

    Zeta Guru
    Banned

    Need help writing a script.

    Question: It always clicks my lenderhosen hat instead of maple, sometimes click maple but only like half the time, how do I make it so it only goes to maples?

    Code:
    program ZetasMapleChop;
    
    {.include SRL\SRL.scar}
    {.include SRL\SRL\Skill\Woodcutting.SCAR}
    
    const
      Maple = 19058; //the color of the maple
      Maple2 = 16760;
      Maple3 = 9548;
      Tol = 15;
      RunDirection = 'S'; //the direction to run if in fight
      LogsToChop = 50; //how many logs to chop)
    
    procedure DeclarePlayers;
    begin
    HowManyPlayers := 1; //Number of players to use
     NumberOfPlayers(HowManyPlayers); //Don't Touch
       CurrentPlayer := 0;  //Player to start with
       Players[0].Name := 'Username'; //Players username
         Players[0].Pass := 'Password'; //Players password
           Players[0].Nick := 'Nickname'; //3-4 characters from players username(Lowercase and no spaces)
             Players[0].Active := True;     //Are you using this player?
              end;
    
    
    procedure ChopMaples;
    var
    
      ChopMark: Integer;
    begin
      repeat
        if FindObjMulti('aple tree', Maple, Maple2, Maple3, Tol) then
        begin
          GetMousePos(X, Y);
          Wait(500 + Random(102));
          Mouse(X, Y, 1, 1, True);
           MarkTime(ChopMark);
          repeat
            Wait(500 + Random(250));
            FindNormalRandoms;
          until(TimeFromMark(ChopMark) >= (10000 + Random(5000)));
    
        end;
      until(False);
    end;
    
    
    begin
      ActivateClient;
      SetUpSRL;
      DeclarePlayers;
      NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
      ChopMaples;
    end.
     
  3. Unread #2 - Aug 1, 2007 at 11:28 AM
  4. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    Need help writing a script.

    if (FindColor(x, y, TreeColor, Ax, Ay, Bx, By)) then Mouse(x, y, 2, 2, true);

    Finds a the TreeColor in the box (Ax, Ay), (Bx, By) and saves the coordinates the color was at in x, y. Then, it left clicks on the coordinates (x, y) with a random of two so it could click on (x + 1, y - 1) or (x + 2, y + 2), etc.
     
  5. Unread #3 - Aug 1, 2007 at 2:28 PM
  6. crossback7
    Joined:
    Jun 12, 2007
    Posts:
    202
    Referrals:
    0
    Sythe Gold:
    0

    crossback7 Active Member

    Need help writing a script.

    First thing I would put in would be your Constants. This could be how many loads you want to do and the such. Then I'd put in your DeclarePlayers procedure. You can just copy and paste that from someone else's script and edit it to your liking, as it most likely won't work if you just copy and paste it.

    PM me if you want more detailed help. . .Town's function should work well for you.
     
  7. Unread #4 - Aug 1, 2007 at 2:35 PM
  8. Zeta
    Joined:
    Jan 21, 2007
    Posts:
    1,680
    Referrals:
    3
    Sythe Gold:
    0

    Zeta Guru
    Banned

    Need help writing a script.

    this is it so far.. it chops willows in seers nothing else yet

    program New;
    {.include srl/srl.scar}


    begin
    SetUpSRL;
    repeat
    if FindColorTolerance(x, y, 7249851, MSX1, MSY1, MSX2, MSY2, 20) then;
    MMouse(x, y, 2, 2);
    Mouse(x, y, 2, 2, true);
    wait(10000+random(4001));
    until(false)
    end.
     
  9. Unread #5 - Aug 1, 2007 at 2:37 PM
  10. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    Need help writing a script.

    Good start, FindNormalRandoms; you will need. Don't pt a semi-olon after "then". Mouse moves the mouse and clicks so you don't need MMouse before it.
     
  11. Unread #6 - Aug 1, 2007 at 3:15 PM
  12. Zeta
    Joined:
    Jan 21, 2007
    Posts:
    1,680
    Referrals:
    3
    Sythe Gold:
    0

    Zeta Guru
    Banned

    Need help writing a script.

    okay well em the color clicker sucks it always clicks on the ground or something instead of the tree, and when I try to use DTM(sp?) it'll just compile and sit there.. people say not to use bitmaps cause of all the memory so idk what to do.

    edit: i can put the FindNormalRandoms; anywhere? or do i need something else?
     
  13. Unread #7 - Aug 1, 2007 at 3:17 PM
  14. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    Need help writing a script.

    You can use the function, IsUpText() to see whether or not the mouse is over a tree or not. Like I said, look at other scripts to see what they use.
     
  15. Unread #8 - Aug 1, 2007 at 3:27 PM
  16. Zeta
    Joined:
    Jan 21, 2007
    Posts:
    1,680
    Referrals:
    3
    Sythe Gold:
    0

    Zeta Guru
    Banned

    Need help writing a script.

    Okay, I was looking at a bad script and couldnt find isuptext but i found one that does and now i'm going to cut maples instead.. is this good?

    Code:
    program New;
    {.include srl/srl.scar}
    {.include SRL\SRL\Skill\Woodcutting.SCAR}
    
    const
    Maple = 19058;
    Tol = 20;
    RunDirection = 'W';
    LogsToChop = 50;
    
    
    begin
    SetUpSRL;
    repeat
    if FindColorTolerance(x, y, Maple, MSX1, MSY1, MSX2, MSY2, 20) then
    IsUpText('Maple Tree') then
    Mouse(x, y, 2, 2, true);
    wait(15032+random(4001));
    until(false)
    end.
     
  17. Unread #9 - Aug 1, 2007 at 3:29 PM
  18. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    Need help writing a script.

    Better, yes. Now you can make it cut until the inventory is full, and then until the total logstochop is finished. I'll let you figure it out.
     
  19. Unread #10 - Aug 1, 2007 at 3:32 PM
  20. Zeta
    Joined:
    Jan 21, 2007
    Posts:
    1,680
    Referrals:
    3
    Sythe Gold:
    0

    Zeta Guru
    Banned

    Need help writing a script.

    okay well it was supposed to be if IsUpText('Maple tree') then but i fixed that but it just compiles and doesn't run?

    edit: sorry for so much noobiness
     
  21. Unread #11 - Aug 1, 2007 at 6:32 PM
  22. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    Need help writing a script.

    In between FindColorTolerance and IsUpText you have to move the mouse over the tree.
     
  23. Unread #12 - Aug 1, 2007 at 9:37 PM
  24. crossback7
    Joined:
    Jun 12, 2007
    Posts:
    202
    Referrals:
    0
    Sythe Gold:
    0

    crossback7 Active Member

    Need help writing a script.

    Yeah, that'd be where you would use MMouse. It probably be a good idea to make it wait about half a second before checking for the uptext after that too, just in case of lag or whatnot.

    AH, I just wanna fix your script and post what I can do on it. . .You need to learn this for yourself though.
     
  25. Unread #13 - Aug 3, 2007 at 2:09 AM
  26. Zeta
    Joined:
    Jan 21, 2007
    Posts:
    1,680
    Referrals:
    3
    Sythe Gold:
    0

    Zeta Guru
    Banned

    Need help writing a script.

    yeah my script sucks its so simple.. idk how to change it to make it better
     
  27. Unread #14 - Aug 3, 2007 at 5:54 AM
  28. Zeta
    Joined:
    Jan 21, 2007
    Posts:
    1,680
    Referrals:
    3
    Sythe Gold:
    0

    Zeta Guru
    Banned

    Need help writing a script.

    thanks to tim at srl its alot better now
     
< Duplicate identifier problem | Srl setup >

Users viewing this thread
1 guest


 
 
Adblock breaks this site