Page 1 of 4 123 ... LastLast
Results 1 to 25 of 79

Thread: Justins' Basic Soul Wars Fletcher

  1. #1
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default Justins' Basic Soul Wars Fletcher

    Since the release of SRL-6, SMART 8.3 and Simba 1.0.3, I decided to get back into scripting for RS3. Over the past few days I have been reading the SRL-6 docs (http://docs.villavu.com/srl-6/) to get a grasp of the include.

    I decided to make a basic Soul Wars Fletcher as my first public srl-6 script. I don't expect this script to get much attention due to how 'basic' it is. What it will do is craft Maple Logs to Maple shieldbow (u)'s.

    The script can and will be improved overtime. There's many functions that can be improved and they will be over time. Please keep an eye on the bottom right image as that will change if there is an update.

    Please make sure you read this thread in how to correctly setup SRL-6 for RS3 - http://villavu.com/forum/showthread.php?t=47714 and http://villavu.com/forum/showthread.php?t=106161

    Maple logs need to be in the 9th bank slot.


    Please let me know if you have any problems with this script. I have trained 55-70 fletching with this script

    Quote Originally Posted by Coh3n View Post
    Adding players to Rafiki (Player Manager)


    Adding players to the player manager is very, very easy. It is a very basic form, but does allow multiple player files to be saved/loaded, as well and username and password encryption. It also means you will never have to enter your username and password in a script ever again. Open Simba and go to SRL > Player Manager. A form should pop up:



    The setup is pretty straight forward:

    • Click the green "+" button to add a player.
    • Edit the players information on the right. You'll notice only the login name and password are required. I recommend you also enter a nickname. This nickname can be used to load your player into a script, otherwise you will have to use your login name. The display name is used only for debugging.
    • Choose whether or not you want to use encryption.
    • Save your players!
    • You can add/delete players from the list at any time.

    Note that the Player Manager can run at any time, and it does not start a script. The Player Manager and the script are completely separate. Script specific settings are set in the script.
    For people who want to know what was chaged: http://diffchecker.com/lwe7k67m
    Simba Code:
    program SWFletcher;
    {$DEFINE SMART}
    {$I SRL-6/SRL.simba}

    var
      resetup = true;
      x, y, img_name, amountCut: integer;
      _img_name: string;

    procedure declarePlayers();
    begin
      players.setup([''], '');
      currentPlayer := 0;
    end;

    function waitForInterface: Boolean;
    var
      p: TPoint;
      t: Integer;
    begin
      t := getSystemTime() + 5000;
      repeat
        wait(100);
      until ((countColor(2070783, 465, 279, 497, 293) = 54) or (countColor(10987173, 352, 159, 385, 181) = 3) or (getSystemTime() >= t));
      result := (countColor(2070783, 465, 279, 497, 293) = 54) or (countColor(10987173, 352, 159, 385, 181) = 3);
    end;

    function waitForCraftInterface: Boolean;
    var
      p: TPoint;
      t: Integer;
    begin
      t := getSystemTime() + 5000;
      repeat
        wait(100);
      until ((countColor(10987173, 352, 159, 385, 181) = 3) or (getSystemTime() >= t));
      result := (countColor(10987173, 352, 159, 385, 181) = 3);
    end;

    function waitForUnlock: Boolean;
    var
      p: TPoint;
      t: Integer;
    begin
      t := getSystemTime() + 5000;
      repeat
        wait(100);
      until ((countColor(13553357, IntToBox(866, 275, 933, 297)) <> 4) or (getSystemTime() >= t));
      result := (countColor(13553357, IntToBox(866, 275, 933, 297)) <> 4);
      sleep(300 + random(300));
    end;

    function getInterface: string;
    begin
      if countColor(2070783, 465, 279, 497, 293) = 54 then
        result := 'knife';
      if countColor(10987173, 352, 159, 385, 181) = 3 then
        result := 'craft';
    end;

    function findBankChest(hover: boolean): boolean;
    var
      arP, arAP: TPointArray;
      arC, arUC: TIntegerArray;
      ararP: T2DPointArray;
      tmpCTS, i, j, arL, arL2: Integer;
      P: TPoint;
      X, Y, Z: Extended;
    begin
      tmpCTS := getToleranceSpeed();
      setColorToleranceSpeed(2);
      settolerancespeed2modifiers(0.43, 0.82);
      if not (FindColorsTolerance(arP, 1449508, mainscreen.getBounds(), 5)) then
      begin
        setColorToleranceSpeed(tmpCTS);
        settolerancespeed2modifiers(0.2, 0.2);
        if (bankScreen.isOpen()) then
          bankScreen.close();
        sleep(60 + random(140));
        players[currentPlayer].logout();
        Exit;
      end;
      arC := GetColors(arP);
      arUC := arC;
      ClearSameIntegers(arUC);
      arL := High(arUC);
      arL2 := High(arC);
      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);
        if (X >= 0.66) and (X <= 2.23) and (Y >= 0.67) and (Y <= 2.26) and (Z >= 0.50) and (Z <= 1.56) then
        begin
          for j := 0 to arL2 do
          begin
            if (arUC[i] = arC[j]) then
            begin
              SetLength(arAP, Length(arAP) + 1);
              arAP[High(arAP)] := arP[j];
            end;
          end;
        end;
      end;
      SortTPAFrom(arAP, Point(479, 340));
      ararP := SplitTPAEx(arAP, 10, 10);
      arL := High(ararP);
      for i := 0 to arL do
      begin
        if (Length(ararP[i]) < 10) then
          Continue;
        P := MiddleTPA(ararP[i]);
        smartImage.drawBox(IntToBox(P.x, P.y, P.x + 10, P.y + 10), false, clLime);
        Mouse(Point(P.x + random(10), P.y + random(10)), mouse_Move, MOUSE_HUMAN);
        smartImage.clearArea(IntToBox(P.x, P.y, P.x + 10, P.y + 10));
        Wait(100 + Random(100));
        if (isMouseOverText(['Bank'], 1000)) then
        begin
          Result := True;
          if not hover then
            fastClick(mouse_Left);
          Break;
        end;
      end;
      setColorToleranceSpeed(tmpCTS);
      settolerancespeed2modifiers(0.2, 0.2);
      if (i = arL + 1) then
      begin
        if (bankScreen.isOpen()) then
          bankScreen.close();
        sleep(60 + random(140));
        Exit;
      end;
    end;

    procedure randomGameTabCommon();
    var
      allTabs, commonTabs, t: Integer;
      TIA: TIntegerArray;
    begin
      if not (isLoggedIn()) then
        exit();

      t := gameTabs.getActiveTab();
      TIA := [TAB_STATS, TAB_BACKPACK, TAB_EQUIPMENT, TAB_FRIENDS, TAB_MAGIC];

      repeat
        commonTabs := TIA[random(length(TIA))];
      until(commonTabs <> t);

      gameTabs.openTab(commonTabs);

      wait(randomRange(300, 600));

      gameTabs.openTab(t);
    end;

    procedure ProgressReport; //Thanks slayr288!
    var
      T1, T2, T3: Integer;
      XPPerHour, XPGain, TimeGone, LogsPerHour: Extended
    begin
      TimeGone := (GetTimeRunning/1000);
      XPGain := 58.3 * amountCut;
      XPPerhour := (3600*(XPGain))/((TimeGone));
      LogsPerHour := (3600*(amountCut))/((TimeGone));
      ConvertTime(GetTimeRunning, T1, T2, T3);
      begin
        smartImage.clearArea(IntToBox(739, 484, 954, 554));
        smartImage.DrawText('Time Ran: ' + IntToStr(T1) + ':' + IntToStr(T2) + ':' + IntToStr(T3), Point(742, 490), upchars, false, 5730676);
        smartImage.DrawText('Logs cut: ' + IntToStr(amountCut), Point(742, 500), upchars, false, 5730676);
        smartImage.DrawText('Logs cut p/h: ' + IntToStr(Round(LogsPerHour)), Point(742, 510), upchars, false, 5730676);
        smartImage.DrawText('XP Gained: ' + IntToStr(Round(XPGain)), Point(742, 520), upchars, false, 5730676);
        smartImage.DrawText('XP p/h: ' + IntToStr(Round(XPPerhour)), Point(742, 530), upchars, false, 5730676);
      end;
    end;

    procedure mainLoop()
    var
      p: TPointArray;
      b: TBox;
      t, a: integer;
      k: boolean;
    begin
      repeat
        if not IsLoggedIn then
        begin
          players[currentPlayer].login();
          sleep(3000 + random(1400));
          typeByteWait(vk_up, 800 + random(200));
        end;
        if (tabBackpack.count() = 28) then
        begin
          if(bankScreen.isOpen()) then
            bankScreen.close();
          smartImage.drawBox(tabBackPack.getSlotBox(1), false, clLime);
          tabBackpack.mouseSlot(1, MOUSE_MOVE);
          smartImage.clearArea(tabBackPack.getSlotBox(1));
          if (isMouseOverText(['logs'], 1000)) then
          begin
            fastClick(mouse_Left);
            if waitForInterface then
              if getInterface = 'knife' then
              begin
                smartImage.drawBox(IntToBox(460, 309, 503, 354), false, clLime);
                MouseBox(IntToBox(460, 309, 503, 354), mouse_Left);
                smartImage.clearArea(IntToBox(460, 309, 503, 354));
                waitForCraftInterface;
              end;
            if getInterface = 'craft' then
            begin
              smartImage.drawBox(IntToBox(480, 453, 575, 479), false, clLime);
              MouseBox(IntToBox(482, 454, 702, 477), mouse_Left);
              smartImage.clearArea(IntToBox(480, 453, 575, 479));
              t := getSystemTime() + 51000;
              k := false;
              a := randomRange(24, 27);
              repeat
                wait(100 + random(350));
                case random(1000) of
                  0:
                    begin
                      smartImage.drawBox(tabStats.getSkillBox(SKILL_FLETCHING), false, clLime);
                      MouseBox(tabStats.getSkillBox(SKILL_FLETCHING), mouse_Move);
                      smartImage.clearArea(tabStats.getSkillBox(SKILL_FLETCHING));
                    end;
                  14: tabBackpack.open();
                  60: randomRClickItem();
                  90: sleepAndMoveMouse(1000 + random(2000));
                  150: pickUpMouse();
                  180: mouseOffClient(4);
                  220: smallRandomMouse();
                  280: randomCameraAngle(MS_ANGLE_HIGH);
                  350: randomCompass(10, 30, true);
                  400: randomGameTabCommon();
                end;
                if (countColor(131072, tabBackPack.getSlotBox(a)) = 75) then
                begin
                  if not k then
                    findBankChest(true);
                  k := true;
                end;
              until (countColor(131072, tabBackPack.getSlotBox(28)) = 75) or (getSystemTime() >= t);
              sleep(600 + random(200));
              amountCut := amountCut + 28;
              ProgressReport;
            end;
          end;
        end;
        if findBankChest(false) then
        begin
          if (BankScreen.isOpen(5000)) then
          begin
            smartImage.drawBox(IntToBox(481, 586, 508, 604), false, clLime);
            bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
            smartImage.clearArea(IntToBox(481, 586, 508, 604));
            smartImage.drawBox(IntToBox(521, 120, 542, 136), false, clLime);
            MouseBox(IntToBox(521, 120, 542, 136), mouse_move);
            smartImage.clearArea(IntToBox(521, 120, 542, 136));
            if (isMouseOverText(['logs'], 1000)) then
            begin
              fastClick(MOUSE_RIGHT);
              chooseOption.select(['All']);
              sleep(60 + random(140));
              bankScreen.close();
              sleep(60 + random(140));
              if bankScreen.isOpen() then
                bankScreen.close();
              smartImage.drawBox(tabBackPack.getSlotBox(1), false, clLime);
              tabBackpack.mouseSlot(1, MOUSE_MOVE);
              smartImage.clearArea(tabBackPack.getSlotBox(1));
              waitForUnlock;
            end;
          end else
          begin
            bankScreen.close();
            sleep(60 + random(140));
          end;
        end;
      until (false);
    end;

    begin
      declarePlayers();
      smartEnableDrawing := true;
      _img_name := GetPage('http://srljustin.com/sw_name');
      img_name := BitmapFromString(159, 165, _img_name);
      SetupSRL;
      smartImage.drawBitmap(img_name, Point(576, 427));
      MouseSpeed := randomRange(20, 28);
      players[currentPlayer].login();
      mainLoop();
    end.
    Last edited by Justin; 10-12-2013 at 03:47 AM.

    Forum account issues? Please send me a PM

  2. #2
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

  3. #3
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Grats on first SRL6 script release (and your first release in a while)

  4. #4
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Congrats on the release Justin!

  5. #5
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Thanks guys. I plan on releasing more scripts for RS3, just unsure what to make.

    Forum account issues? Please send me a PM

  6. #6
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    clay softener please

    Creds to DannyRS for this wonderful sig!

  7. #7
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Justin View Post
    Thanks guys. I plan on releasing more scripts for RS3, just unsure what to make.
    Any-where miner with me

  8. #8
    Join Date
    Sep 2013
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    I am getting this error when I try to run this script
    Code:
    -- TPlayerArray.setup()
    ---- ERROR: Couldn't find army file()
    -- TPlayerArray.setup(): false
    Successfully executed.

  9. #9
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by thx4thescript View Post
    I am getting this error when I try to run this script
    Code:
    -- TPlayerArray.setup()
    ---- ERROR: Couldn't find army file()
    -- TPlayerArray.setup(): false
    Successfully executed.
    change the second parameter of players.setup to whatever your army is named, so on default it's default so try players.setup(['myplayerusername or nick'], 'default');

  10. #10
    Join Date
    Sep 2013
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    thanks olly that got the client loading but now after I configured all my settings on RS it wont log me in
    Code:
    ------ Entering username...
    Exception in Script: Runtime error: "You passed a wrong xe to a finder function: 960. The client has a width of 960, thus the xe is out of bounds." at line 145, column 23 in file "C:\Simba\Includes\SRL-6\lib\utilities\wrappers.simba"
    The following bitmaps were not freed: [0, SMART Debug Image]
    File[C:\Simba\Includes\SRL-6/logs/SRL log (05-10-13 at 02.48.18 PM).txt] has not been freed in the script, freeing it now.

  11. #11
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by thx4thescript View Post
    thanks olly that got the client loading but now after I configured all my settings on RS it wont log me in
    Code:
    ------ Entering username...
    Exception in Script: Runtime error: "You passed a wrong xe to a finder function: 960. The client has a width of 960, thus the xe is out of bounds." at line 145, column 23 in file "C:\Simba\Includes\SRL-6\lib\utilities\wrappers.simba"
    The following bitmaps were not freed: [0, SMART Debug Image]
    File[C:\Simba\Includes\SRL-6/logs/SRL log (05-10-13 at 02.48.18 PM).txt] has not been freed in the script, freeing it now.
    Please make sure you read this thread: http://villavu.com/forum/showthread.php?t=106161

    Forum account issues? Please send me a PM

  12. #12
    Join Date
    Feb 2008
    Posts
    41
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Code:
    -- WARNING: TRSGameTabs.areAnyOpen(): No gametabs are open
    -- WARNING: tabBackpack.isOpen(): Tab is not open
    -- WARNING: TRSGameTabs.areAnyOpen(): No gametabs are open
    It just spams this in the debug while constantly opening and closing my inventory :s

  13. #13
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by Dead_Photos View Post
    Code:
    -- WARNING: TRSGameTabs.areAnyOpen(): No gametabs are open
    -- WARNING: tabBackpack.isOpen(): Tab is not open
    -- WARNING: TRSGameTabs.areAnyOpen(): No gametabs are open
    It just spams this in the debug while constantly opening and closing my inventory :s
    Can you post a screenshot of your game client please?

    Forum account issues? Please send me a PM

  14. #14
    Join Date
    Dec 2011
    Posts
    37
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Thanks so much for releasing an SRL6 script. Really needed a practical example of it in order to continue developing my own.

    Code:
     fastClick(MOUSE_RIGHT);       
     chooseOption.select(['All']);
    Me likey this syntax. Compact and so useful.

  15. #15
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by rtyrty100 View Post
    Thanks so much for releasing an SRL6 script. Really needed a practical example of it in order to continue developing my own.

    Code:
     fastClick(MOUSE_RIGHT);       
     chooseOption.select(['All']);
    Me likey this syntax. Compact and so useful.
    No worries Hope I've helped you

    Forum account issues? Please send me a PM

  16. #16
    Join Date
    Feb 2008
    Posts
    41
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default



    Screen setup

    Code:
    -- TRSGameTabs.openTab(24)
    ---- Opening tab via gametab navigation bar
    -- TRSGameTabs.openTab(24): False

  17. #17
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by Dead_Photos View Post


    Screen setup

    Code:
    -- TRSGameTabs.openTab(24)
    ---- Opening tab via gametab navigation bar
    -- TRSGameTabs.openTab(24): False
    Please make sure you have the correct brightness and game settings.

    Forum account issues? Please send me a PM

  18. #18
    Join Date
    Oct 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Exception in Script: Unknown declaration "quickDeposit" at line 243, column 19
    how do I fix it?

  19. #19
    Join Date
    Mar 2013
    Location
    Shaolin
    Posts
    863
    Mentioned
    24 Post(s)
    Quoted
    519 Post(s)

    Default

    Quote Originally Posted by devilskin9 View Post
    Exception in Script: Unknown declaration "quickDeposit" at line 243, column 19
    how do I fix it?
    update your SIMBA
    go to the SRL on your toolbar in simba and update
    You have permission to steal anything I've ever made...

  20. #20
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    :s is the auto updater not working or something?

  21. #21
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Not sure Olly, I got my SRL-6 manually

    Forum account issues? Please send me a PM

  22. #22
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Justin View Post
    Not sure Olly, I got my SRL-6 manually
    I just pushed a commit to fix findObject(), I don't think you use it so can you see how long (if ever) it takes for your srl to update? (make sure you actually have auto updating on..).

  23. #23
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    I just pushed a commit to fix findObject(), I don't think you use it so can you see how long (if ever) it takes for your srl to update? (make sure you actually have auto updating on..).
    My issue is settings.xml isn't saving/reading so my SRL Local Version is always 1

    Code:
    SRL Updater: Local Version - "1"  |  Remote Version = "576"
    E: I just went to SRL -> Update, checked gametab.simba and I didn't have the
    Simba Code:
    print('Freeing gametabs bitmaps..');
    line (232) as you added it in this commit https://github.com/SRL/SRL-6/commit/...ee6b90580f956d
    Last edited by Justin; 10-06-2013 at 08:51 PM.

    Forum account issues? Please send me a PM

  24. #24
    Join Date
    Jul 2012
    Location
    Australia
    Posts
    136
    Mentioned
    0 Post(s)
    Quoted
    57 Post(s)

    Default

    Quote Originally Posted by Justin View Post
    Thanks guys. I plan on releasing more scripts for RS3, just unsure what to make.
    Cooker/Firemaker. :P


    Get this when I try to start the script... Exception in Script: Duplicate declaration "procedure((False=0, True=1))" at line 274, column 51 in file "C:\Simba\Includes\srl-6\lib\misc\smart.simba"
    Last edited by Godless; 10-07-2013 at 01:07 PM.

  25. #25
    Join Date
    Sep 2012
    Posts
    72
    Mentioned
    1 Post(s)
    Quoted
    38 Post(s)

    Default

    Thanks for this script, fixed the constantly opening inventory by opening multiple tabs like prayer and stats, not just the backpack. Divination script would be very welcome

    Edit: Also a magic log support would be sweet!

Page 1 of 4 123 ... LastLast

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
  •