Results 1 to 11 of 11

Thread: Script isn't doing anything :S

  1. #1
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default Script isn't doing anything :S

    when i run the script it won't do anything, i only said succesfully executed:/

    any help?

    Code:
    program MapleSnijder;
    {.include SRL/SRL.scar}
    
    var
     Maple: Integer;
    
    procedure GetMapleFromBank;
    var
     x, y: Integer;
    begin
     Maple := DTMFromString('78DA6394606060E06540012EBA5C0CAC409A1' +
           '188FF0301A32490C1CC800698C0242394C7C80924D808A8610712' +
           '9C04D480EC1120A0460A48881150A308248408A89121EC660019C' +
           '40593');
     if FindDTM(Maple, x, y, MSX1, MSY1, MSX2, MSY2) then
     begin
      Writeln('Found Maple in bank!');
      MMouse(x, y, 2, 2);
      Wait(80 + Random(100));
      Mouse(x, y, 0, 0, False);
      ChooseOption ('Withdraw-27');
      CloseWindow;
      Wait(200 + Random(100));
      if FindDTM(Maple, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
       Writeln('Found Maple in inventory, moving on!');
      end else
       Writeln('Could not find maple in inventory, logging out.');
       Logout;
      end;
     FreeDTM(Maple);
    end;
    
    procedure MainLoop;
    begin
     SetupSRL;
     ActivateClient;
     ClearDebug;
     GetMapleFromBank;
    end;
    
    begin
     MainLoop;
    end.

  2. #2
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    maby it doesnt find the maple?
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  3. #3
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    hmm, might be, maybe i should make bitmaps instead of DTM?
    gona give it a try, thanks for your reply

  4. #4
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    hmm strange, now it logs himself out when he found the maple:/ any help?
    Code:
    program MapleSnijder;
    {.include SRL/SRL.scar}
    
    var
     Maple: Integer;
    
    function GetMapleFromBank: Boolean;
    var
     x, y: Integer;
    begin
     Maple := BitmapFromString(5, 4, 'beNqz5o205g235Aky4wkw5fY24' +
           'oaQngZcLrpcTtqc7npcQDZQxM8YJAVEQJWhFjxALZEAUIYLFg==');
     if FindBitmapToleranceIn(Maple, x, y, MSX1, MSY1, MSX2, MSY2, 5) then
     begin
      Writeln('Found Maple in bank!');
      MMouse(x, y, 2, 2);
      Wait(80 + Random(100));
      Mouse(x, y, 0, 0, False);
      Wait(500 + Random(100));
      ChooseOption('Withdraw-30');
      CloseWindow;
      Wait(200 + Random(100));
      if FindBitmapToleranceIn(Maple, x, y, MIX1, MIY1, MIX2, MIY2, 5) then
      Writeln('Found Maple in inventory, moving on!')
     else
      Writeln('Could not find maple in inventory, logging out.');
      Logout;
     end;
     Result := True;
     FreeBitmap(Maple);
    end;
    
    procedure MainLoop;
    begin
     SetupSRL;
     ActivateClient;
     ClearDebug;
     if GetMapleFromBank then
      Writeln('We have clicked the Maple logs!')
     else
      Writeln('We have not clicked the Maple logs.');
    end;
    
    begin
     MainLoop;
    end.

  5. #5
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    you forgot a begin..end silly!

    SCAR Code:
    if FindBitmapToleranceIn(Maple, x, y, MIX1, MIY1, MIX2, MIY2, 5) then
      Writeln('Found Maple in inventory, moving on!')
     else
     begin
      Writeln('Could not find maple in inventory, logging out.');
      Logout;
     end;
     end;
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  6. #6
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    yay it works thanks
    now i need it to cut the logs when it clicks on the knife and then on the logs i get a box in the mainchat, how can i let it click on Maple LongBow ?

  7. #7
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    mousebox

    incase you dont know,

    SCAR Code:
    mousebox(x1, y1, x2, y2, 2); //cords of the long bow in the chat, keep the 2
      chooseoption('ake X');
      wait(100 + random(200));
      typesend('27');
    Last edited by Awkwardsaw; 11-11-2009 at 07:46 PM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  8. #8
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    thanks, and how can i let the script know if the bows are ready that it can do another function?

  9. #9
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Yush Dragon View Post
    thanks, and how can i let the script know if the bows are ready that it can do another function?
    I'm guessing this is a fletching script? If so, are you asking how would you tell the script to bank the Maple bows (u) when ready?

    I would just make another DTM (the bows are really thin, so I don't know how well bitmaps would work), and use SRL's CountItems function to determine when your inventory contains 27 Maple longbow (u)s.

    Here is the CountItems function from SRL:
    SCAR Code:
    {*******************************************************************************
    function CountItems(ItemType: string; Identifier: Integer; tol: TIntegerArray): Integer;
    By: WT-Fakawi / Sumilion
    Description: Counts Items in the inventory.
      ItemType - 'dtm', 'bitmap', 'bitmap mask', 'color'
      Item - name/value of your dtm/bmp/color/bmpmask.
      Tol - 'dtm' - [] (dtm's can't have tolerance).
            'bmp' - [BMPTol].
            'color' - [COLOUR Tol, Colour Count].
            'bmpmask' - [BMPTol, ContourTol].
    *******************************************************************************}


    function CountItems(ItemType: string; Identifier: Integer; tol: TIntegerArray): Integer;
    begin
      Result := -1;
      GameTab(tab_Inv);
      Result := CountItemsIn('inv', ItemType, Identifier, Tol);
    end;

    I hope that helps,

    Coh3n

  10. #10
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    hmm maybe can u explain me more on msn cohen?

  11. #11
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Yush Dragon View Post
    hmm maybe can u explain me more on msn cohen?
    Sure can.

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
  •