Results 1 to 20 of 20

Thread: Scripting Help

  1. #1
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default Scripting Help

    Hello, I need a little help with some stuff I have here. Here is the Procedure I have:

    SCAR Code:
    Procedure Clicking;
    begin
    OpenBankFast('veb'); // Opens Bank
    MouseBox(55, 103, 47, 115, 2); // Clicks Logs
    ChooseOption('All'); // Chooses The 'All' Button
    CloseBank; // Closes Bank
    InvMouse(1,1); // Clicks the first inventory slot '1' and clicks it '1'
    InvMouse(2,2);
    ChooseOption('se Kni');
    MouseBox(264, 408, 274, 419, 2);
    ChooseOption('X');
    GetColor(245,403);
    wait(Random(100));
    TypeSend(ToStr(27 + Random(72)));
    end;

    This goes way to fast! I think I need to add a wait some where. But my friend said not to use wait(2000) but wait(Random(100)); is not working correctly. Can someone hear help me with this procedure. It is for my Fletcher.

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Wait(300+Random(300));

    Like:
    SCAR Code:
    Procedure Clicking;
    begin
      OpenBankFast('veb'); // Opens Bank
      Wait(300+Random(300));
      MouseBox(55, 103, 47, 115, 2); // Clicks Logs
      Wait(300+Random(300));
      ChooseOption('All'); // Chooses The 'All' Button
      Wait(300+Random(300));
      CloseBank; // Closes Bank
      Wait(300+Random(300));
      InvMouse(1,1); // Clicks the first inventory slot '1' and clicks it '1'
      Wait(300+Random(300));
      InvMouse(2,2);
      Wait(300+Random(300));
      ChooseOption('se Kni');
      MouseBox(264, 408, 274, 419, 2);
      Wait(300+Random(300));
      ChooseOption('X');
      GetColor(245,403);
      Wait(300+Random(300));
      TypeSend(ToStr(27 + Random(72)));
    end;
    Last edited by Frement; 07-02-2010 at 08:22 AM.
    There used to be something meaningful here.

  3. #3
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    Wait(300+Random(300));

    Like:
    SCAR Code:
    Procedure Clicking;
    begin
      OpenBankFast('veb'); // Opens Bank
      Wait(300+Random(300));
      MouseBox(55, 103, 47, 115, 2); // Clicks Logs
      Wait(300+Random(300));
      ChooseOption('All'); // Chooses The 'All' Button
      Wait(300+Random(300));
      CloseBank; // Closes Bank
      Wait(300+Random(300));
      InvMouse(1,1); // Clicks the first inventory slot '1' and clicks it '1'
      Wait(300+Random(300));
      InvMouse(2,2);
      Wait(300+Random(300));
      ChooseOption('se Kni');
      MouseBox(264, 408, 274, 419, 2);
      Wait(300+Random(300));
      ChooseOption('X');
      GetColor(245,403);
      Wait(300+Random(300));
      TypeSend(ToStr(27 + Random(72)));
    end;
    Alright thanks. Also I want this to repeat when the inventory is empty. So should I do this:

    SCAR Code:
    Procedure Clicking;
    begin
      Wait(900+Random(900));
      OpenBankFast('veb'); // Opens Bank
      Wait(300+Random(300));
      MouseBox(55, 103, 47, 115, 2); // Clicks Logs
      Wait(300+Random(300));
      ChooseOption('All'); // Chooses The 'All' Button
      Wait(300+Random(300));
      CloseBank; // Closes Bank
      Wait(300+Random(300));
      InvMouse(1,1); // Clicks the first inventory slot '1' and clicks it '1'
      Wait(300+Random(300));
      InvMouse(2,2);
      Wait(300+Random(300));
      ChooseOption('se Kni');
      Wait(300+Random(300));
      MouseBox(264, 408, 274, 419, 2);
      Wait(800+Random(800));
      ChooseOption('X');
      GetColor(245,403);
      Wait(300+Random(300));
      TypeSend(ToStr(27 + Random(72)));
      Wait(700+Random(700));
      InvEmpty;
      Repeat(False);
    end;

  4. #4
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    SCAR Code:
    Procedure Clicking;
    begin
      repeat
        Wait(900+Random(900));
        OpenBankFast('veb'); // Opens Bank
        Wait(300+Random(300));
        MouseBox(55, 103, 47, 115, 2); // Clicks Logs
        Wait(300+Random(300));
        ChooseOption('All'); // Chooses The 'All' Button
        Wait(300+Random(300));
        CloseBank; // Closes Bank
        Wait(300+Random(300));
        InvMouse(1,1); // Clicks the first inventory slot '1' and clicks it '1'
        Wait(300+Random(300));
        InvMouse(2,2);
        Wait(300+Random(300));
        ChooseOption('se Kni');
        Wait(300+Random(300));
        MouseBox(264, 408, 274, 419, 2);
        Wait(800+Random(800));
        ChooseOption('X');
        GetColor(245,403);
        Wait(300+Random(300));
        TypeSend(ToStr(27 + Random(72)));
        Wait(700+Random(700));
      until(InvEmpty);
    end;

    But the knife is still there ?
    There used to be something meaningful here.

  5. #5
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    SCAR Code:
    Procedure Clicking;
    begin
      repeat
        Wait(900+Random(900));
        OpenBankFast('veb'); // Opens Bank
        Wait(300+Random(300));
        MouseBox(55, 103, 47, 115, 2); // Clicks Logs
        Wait(300+Random(300));
        ChooseOption('All'); // Chooses The 'All' Button
        Wait(300+Random(300));
        CloseBank; // Closes Bank
        Wait(300+Random(300));
        InvMouse(1,1); // Clicks the first inventory slot '1' and clicks it '1'
        Wait(300+Random(300));
        InvMouse(2,2);
        Wait(300+Random(300));
        ChooseOption('se Kni');
        Wait(300+Random(300));
        MouseBox(264, 408, 274, 419, 2);
        Wait(800+Random(800));
        ChooseOption('X');
        GetColor(245,403);
        Wait(300+Random(300));
        TypeSend(ToStr(27 + Random(72)));
        Wait(700+Random(700));
      until(InvEmpty);
    end;

    But the knife is still there ?
    Wait Im retarded xD Now I just want this to wait until it is done cutting then add the OpenBank; command.

  6. #6
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Make a DTM of the logs outline, then search that and click it after using knife. Then wait until(not FindDTM(LogDTM,-...));
    There used to be something meaningful here.

  7. #7
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    Make a DTM of the logs outline, then search that and click it after using knife. Then wait until(not FindDTM(LogDTM,-...));
    I'm not really following you. Could you show me? Here is the DTM I did for the logs:
    SCAR Code:
    DTM := DTMFromString('78DA63CC636660C8626440068E56220CFC401' +
           'A26CA580B545382AA86818109220753930C549349404D3A504D0D' +
           '0135E54035A9F8D5000038480519');

  8. #8
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Something like this:
    SCAR Code:
    program new;
    {$I SRL/SRL.scar}

    var LogDTM: Integer;

    procedure LoadDTMs;
    begin
      LogDTM := DTMFromString('78DA63CC636660C8626440068E56220CFC401' +
              'A26CA580B545382AA86818109220753930C549349404D3A504D0D' +
              '0135E54035A9F8D5000038480519');
    end;

    procedure FreeDTMs;
    begin
      FreeDTM(LogDTM);
    end;

    function OutOfLogs: Boolean;
    var x, y: Integer;
    begin
      if (not FindDtm(LogDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then begin
        Result := True;
      end else begin
        Result := False;
      end;
    end;

    procedure Cutting;
    var x, y: Integer;
    begin
      InvMouse(1,1);
      Wait(300+Random(100));
      if (FindDTM(LogDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then begin
        Mouse(x, y, 3, 3, False);
        Wait(300+Random(100));
        ChooseOption('se Kni');
        Wait(300+Random(100));
        MouseBox(264, 408, 274, 419, 2);
        Wait(800+Random(800));
        ChooseOption('X');
        Wait(300+Random(300));
        TypeSend(IntToStr(RandomRange(27, 99)));
        Wait(700+Random(700));
      end;
      repeat
        Wait(300+Random(300));
        FindNormalRandoms;
      until(OutOfLogs);
    end;

    begin
      SetupSRL;
      LoadDTMs;

      //OpenBank functions and withdraw stuff here

      repeat

        Cutting;

        //Deposit old and take new stuff here

      until(False);

      FreeDTMs;
    end.
    There used to be something meaningful here.

  9. #9
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    Something like this:
    SCAR Code:
    program new;
    {$I SRL/SRL.scar}

    var LogDTM: Integer;

    procedure LoadDTMs;
    begin
      LogDTM := DTMFromString('78DA63CC636660C8626440068E56220CFC401' +
              'A26CA580B545382AA86818109220753930C549349404D3A504D0D' +
              '0135E54035A9F8D5000038480519');
    end;

    procedure FreeDTMs;
    begin
      FreeDTM(LogDTM);
    end;

    function OutOfLogs: Boolean;
    var x, y: Integer;
    begin
      if (not FindDtm(LogDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then begin
        Result := True;
      end else begin
        Result := False;
      end;
    end;

    procedure Cutting;
    var x, y: Integer;
    begin
      InvMouse(1,1);
      Wait(300+Random(100));
      if (FindDTM(LogDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then begin
        Mouse(x, y, 3, 3, False);
        Wait(300+Random(100));
        ChooseOption('se Kni');
        Wait(300+Random(100));
        MouseBox(264, 408, 274, 419, 2);
        Wait(800+Random(800));
        ChooseOption('X');
        Wait(300+Random(300));
        TypeSend(IntToStr(RandomRange(27, 99)));
        Wait(700+Random(700));
      end;
      repeat
        Wait(300+Random(300));
        FindNormalRandoms;
      until(OutOfLogs);
    end;

    begin
      SetupSRL;
      LoadDTMs;

      //OpenBank functions and withdraw stuff here

      repeat

        Cutting;

        //Deposit old and take new stuff here

      until(False);

      FreeDTMs;
    end.
    I think I did something wrong :\ Here can you tell me what I did wrong and how I can fix it

    SCAR Code:
    program foozyfletcher;
    {$Define SMART}
    {$i SRL/SRL.scar}

    var LogDTM: Integer;

    const
      SMART_WORLD          = 152;   // World to load
      SMART_MEMBERS_WORLD  = True; // True = Members world

    procedure DeclarePlayers;
    begin
      NumberOfPlayers(1);

      with Players[0] do
      begin
        Name := '';
        Pass := '';
        Nick := '';
        Active := True;
        Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
      end;
    end;

    procedure LoadDTMs;
    begin
      LogDTM := DTMFromString('78DA63CC636660C8626440068E56220CFC401' +
              'A26CA580B545382AA86818109220753930C549349404D3A504D0D' +
              '0135E54035A9F8D5000038480519');
    end;

    procedure FreeDTMs;
    begin
      FreeDTM(LogDTM);
    end;


    function OutOfLogs: Boolean;
    var x, y: Integer;
    begin
      if (not FindDtm(LogDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then begin
        Result := True;
      end else begin
        Result := False;
      end;
    end;

    procedure Cutting;
    var x, y: Integer;
    begin
      InvMouse(1,1);
      Wait(300+Random(100));
      if (FindDTM(LogDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then begin
        Mouse(x, y, 3, 3, False);
        Wait(300+Random(100));
        ChooseOption('se Kni');
        Wait(300+Random(100));
        MouseBox(264, 408, 274, 419, 2);
        Wait(800+Random(800));
        ChooseOption('X');
        Wait(300+Random(300));
        TypeSend(IntToStr(RandomRange(27, 99)));
        Wait(700+Random(700));
      end;
      repeat
        Wait(300+Random(300));
        FindNormalRandoms;
      until(OutOfLogs);
    end;

    procedure Banking;
    begin
    OpenBankFast('veb'); // Opens Bank
     Wait(300+Random(300));
     MouseBox(55, 103, 47, 115, 2); // Clicks Logs
     Wait(300+Random(300));
    CloseBank; // Closes Bank
    end;

    procedure PutInBank;
    begin;
    OpenBankFast('veb'); // Opens Bank
    Wait(300+Random(300));
    MouseBox(816, 468, 822, 462, 1); // Clicks "Deposit All" Button
    Wait(300+Random(300));
    CloseBank; // Closes Bank
    Wait(300+Random(300));
    end;

    begin
      Smart_Server := SMART_WORLD;
      Smart_Members := SMART_MEMBERS_WORLD;
      Smart_Signed := True;
      Smart_SuperDetail := False;
      SetupSRL;
      DeclarePlayers;
      LogInPlayer;
      LoadDTMs;
      Banking;
      repeat
      Cutting;
      PutInBank;
      until(False);
      FreeDTMs;
    end.
    Last edited by ffcfoo; 07-03-2010 at 12:45 AM.

  10. #10
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    NICE PASS, BROTATO CHIP. a



    Pascal Code:
    procedure Banking;
    begin
      OpenBankFast('veb'); // Opens Bank
      Wait(300 + Random(300));
      MouseBox(55, 103, 47, 115, 2); // Clicks Logs
      Wait(300 + Random(300));//You never ChooseOption('All');
      CloseBank; // Closes Bank
    end;

    Also, MouseBox(816, 468, 822, 462, 1);, you forgot about the knife.. You have to right click one of the unstrung bows and ChooseOption('All');.
    Last edited by i luffs yeww; 07-03-2010 at 12:43 AM.

  11. #11
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    NICE PASS, BROTATO CHIP. a



    Pascal Code:
    procedure Banking;
    begin
      OpenBankFast('veb'); // Opens Bank
      Wait(300 + Random(300));
      MouseBox(55, 103, 47, 115, 2); // Clicks Logs
      Wait(300 + Random(300));//You never ChooseOption('All');
      CloseBank; // Closes Bank
    end;

    Also, MouseBox(816, 468, 822, 462, 1);, you forgot about the knife.. You have to right click one of the unstrung bows and ChooseOption('All');.
    Just fixed the script xD Also :O My pass -_- Now I gotta change it for the 3rd time :|

    EDIT: Sometimes when:"TypeSend(IntToStr(RandomRange(27, 99)));" Types in a random number it goes to fast it sometimes going to pick 27 or something like that and it will be 2 because it goes to fast. How do I fix this?
    Last edited by ffcfoo; 07-03-2010 at 01:02 AM.

  12. #12
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    That shouldn't happen, hmmph, I can't think of any reason why that would be happening.
    There used to be something meaningful here.

  13. #13
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    That shouldn't happen, hmmph, I can't think of any reason why that would be happening.
    Me neither. It only happened once so let me run it again. Oh and when smart initializes the mouse comes up when it is loading and trys to login while loading. How do I fix that instead of having to run and stop the script.

  14. #14
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    You sure you have the latest SRL?
    There used to be something meaningful here.

  15. #15
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    You sure you have the latest SRL?
    Simba auto updates SRL so yeh I have the current version. Plus I think it is working now...

  16. #16
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Dude. This is exactly what I was talking about.

    Pascal Code:
    while not(GetColor(x, y) = 1245622) do
      Wait(Random(100));
    TypeSend(ToStr(27 + Random(72)));

    Where x and y are a coordinate of a black pixel of the text when it asks you how many you want to cut (or deposit, etc.; it's all the same idea), and 1245622 is the actual color of that point.

  17. #17
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Dude. This is exactly what I was talking about.

    Pascal Code:
    while not(GetColor(x, y) = 1245622) do
      Wait(Random(100));
    TypeSend(ToStr(27 + Random(72)));

    Where x and y are a coordinate of a black pixel of the text when it asks you how many you want to cut (or deposit, etc.; it's all the same idea), and 1245622 is the actual color of that point.
    This script is pretty hard for me xD Also when it puts my knife in as well as my bows. I only want it to put in bows? But for some reason it puts everything in my inventory in the bank? Here is the full script:

    SCAR Code:
    program foozyfletcher;
    {$Define SMART}
    {$i SRL/SRL.scar}

    var LogDTM, LongBowDTM: Integer;

    const
      SMART_WORLD          = 152;   // World to load
      SMART_MEMBERS_WORLD  = True; // True = Members world

    procedure DeclarePlayers;
    begin
      NumberOfPlayers(1);

      with Players[0] do
      begin
        Name := '';
        Pass := '';
        Nick := '';
        Active := True;
        Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
      end;
    end;

    procedure LoadDTMs;
    begin
      LogDTM := DTMFromString('78DA63CC636660C8626440068E56220CFC401' +
              'A26CA580B545382AA86818109220753930C549349404D3A504D0D' +
              '0135E54035A9F8D5000038480519');

      LongBowDTM := DTMFromString('78DA6394606160C861644006B326E833F0036' +
           '990E87F20605406AAA94655C3C0C0042661A28C5C40358904D488' +
           '01D5A4E157030024440790');
    end;

    procedure FreeDTMs;
    begin
      FreeDTM(LogDTM);
      FreeDTM(LongBowDTM);
    end;


    function OutOfLogs: Boolean;
    var x, y: Integer;
    begin
      if (not FindDtm(LogDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then begin
        Result := True;
      end else begin
        Result := False;
      end;
    end;

    function OutOfLogs2: Boolean;
    var x, y: Integer;
    begin
      if (not FindDtm(LongBowDTM, x, y, MIX1, MIY1, MIX2, MIY2))then begin
        Result := True;
     end else begin
        Result := False;
      end;
    end;

    procedure Banking;
    begin
    OpenBankFast('veb'); // Opens Bank
     Wait(300+Random(300));
     MouseBox(55, 103, 47, 115, 2); // Clicks Logs
     Wait(300+Random(300));
     ChooseOption('All');
     Wait(300+Random(300));
     CloseBank;
    end;

    procedure Cutting;
    var x, y: Integer;
    begin
      InvMouse(1,1);
      Wait(300+Random(100));
      if (FindDTM(LogDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then begin
        Mouse(x, y, 3, 3, False);
        Wait(300+Random(100));
        ChooseOption('se Kni');
        Wait(900+Random(900));
        MouseBox(264, 408, 274, 419, 2);
        Wait(800+Random(800));
        ChooseOption('X');
        Wait(300+Random(300));
        TypeSend(IntToStr(RandomRange(27, 99)));
        Wait(700+Random(700));
      end;
      repeat
        Wait(300+Random(300));
        FindNormalRandoms;
      until(OutOfLogs);
    end;

    procedure PutInBank;
     var x, y: Integer;
    begin
    OpenBankFast('veb');
    Wait(300+Random(300));
    if (FindDTM(LongBowDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
    Mouse(x, y, 3, 3, False);
    ChooseOption('All');
    end;

    begin
      Smart_Server := SMART_WORLD;
      Smart_Members := SMART_MEMBERS_WORLD;
      Smart_Signed := True;
      Smart_SuperDetail := False;
      SetupSRL;
      DeclarePlayers;
      LogInPlayer;
      LoadDTMs;
      repeat
      Banking;
      Cutting;
      PutInBank;
      until(False);
      FreeDTMs;
    end.

  18. #18
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Would deposit(2,28) work?
    Also there should be a wait for about 50-100 ms before the chooseOption('all') function

  19. #19
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    Would deposit(2,28) work?
    Also there should be a wait for about 50-100 ms before the chooseOption('all') function
    Nahh I fixed it.
    Last edited by ffcfoo; 07-03-2010 at 07:09 PM.

  20. #20
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    I posted why by the way.

    "Also, MouseBox(816, 468, 822, 462, 1);, you forgot about the knife.. You have to right click one of the unstrung bows and ChooseOption('All');."

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
  •