Results 1 to 7 of 7

Thread: Jim's Simple Lumby Flax Spinner

  1. #1
    Join Date
    Dec 2009
    Posts
    146
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Jim's Simple Lumby Flax Spinner

    Here is a quick'n'dirty script that spins flax in Lumbridge.

    No DTM's or BMP's, and only one minor color check to see if your inventory is full.

    Since it is not very complicated, and there aren't many failsafes, I highly recommend you don't leave this unattended.

    However it works fine and I have spun over 20K flax with it while testing over the past couple days.

    Any constructive comments, questions, or suggestions are welcomed.

    JIM

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

    Default

    Ok, i did a quick sweep through the script, and i noticed you are clicking the option blindly, shouldnt you use like ChooseOption('');?

    Else it looked good.
    There used to be something meaningful here.

  3. #3
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    The Man's Report:

    You have:

    SCAR Code:
    runs:=100;     //How many runs to the wheel?
    and
    SCAR Code:
    Players[0].Integers[1] := 0;     //Amount of Loads you want Banked, Change to zero if
                                       //you want to stop once gained a certain amount of 'levels'.
    You only need 1

    Also you have:

    SCAR Code:
    PinNumber:=1234;  //Replace these numbers with your pin number
    and
    SCAR Code:
    Players[0].Pin := '';            //Leave blank if you dont have one.
    Again you only need one.
    For both of the above, I suggest keeping the Players[Blah] one, for ease of use.

    SCAR Code:
    procedure Banking;
    begin
    ClickNorth(true);
    repeat
      if not OpenBankNPC then
      if not OpenBank('lb',false,false) then
      if not FindBank('lb') then
      if not OpenBankGlass('lb', false, false) then
      OpenBankFast('lb');
      if PinScreen then InPin(IntToStr(PinNumber));
    until BankScreen;
    FindNormalRandoms;
    //if InvCount>0 then       //this is temporarily broken, using substitute below
    //begin
      //DepositAll;
      //wait(1000+random(1000));
    //end;
       mouse(397,307,10,10,true); //Substitute for InvCount and DepositAll
       wait(1000+random(1000));
       //end;
      mouse(53,107,10,10,false); //Rightclick on flax
      getmousepos(xx,yy);
      wait(500+random(500));
      mouse(xx,yy+103+random(2),30,0,true); //Left click on withdraw all
      wait(500+random(500));
      CloseBank;
    end;
    Here is my version of yours:
    SCAR Code:
    procedure Banking;
    begin
    ClickNorth(true);
    repeat
      OpenBankFast('lb');
      if PinScreen then InPin(IntToStr(PinNumber));
    until BankScreen;
    FindNormalRandoms;
       if FindDTM(StringDTM, x, y, MIX1, MIY1, MIX2, MIY2) then    // make a string DTM
        if IsUpText('tring') then
        begin
          Mouse(x, y, 0, 0, False);
          WaitOption('it-All', 250));
        end;
      if FindDTM(FlaxDTM, x, y, MBX1, MBY1, MBX2, MBY2) then
      begin
         Mouse(x, y, 0, 0, False);
         WaitOption('aw-All', 250));
      end;
     CloseBank;
    end;
    Make the DTM's and it should be good.
    I didn't make the failsafes for you though.

    For
    SCAR Code:
    Procedure RunToStairs;
    Use RadialWalk.

    Again, for
    SCAR Code:
    procedure ClickOnWheel;
    Use a DTM.

    Your version of Spin
    SCAR Code:
    procedure Spin;
    begin
    mouse(265,125,28,34,false); //rightclick bowstring
    getmousepos(xx,yy);
    mouse(xx,yy+60,5,2,true); //click on "make all"
    wait(4000+random(20000));
    makecompass('S');
    repeat
          wait (1000+random(100));
    until not findcolortolerance(x,y,11710030,560,210,725,460,10);  //until no flax left in inventory
    end;

    My version of Spin
    SCAR Code:
    procedure Spin;
    begin
    if FindDTM(MSStringDTM, x, y, MSX1, MSY1, MSX2, MSY2) then  //New String DTM for MainScreen?
     begin
       Mouse(x,y,0,0,False);
       WaitOption('ke-All', 250));
     end;
    makecompass('S');
    repeat
          wait (1000+random(100));
    until not FindDTM(FlaxDTM, x, y, MIX1, MIY1, MIX2, MIY2);  //Using DTM instead of color.
    end;

    Again for
    SCAR Code:
    procedure GoBackUpstairs;
    Use RadialWalk.
    Also a DTM or BMP or TPA for stairs.

    Use RadialWalk for:
    SCAR Code:
    procedure RunToBank;

    Apart from that nice script

    Scripting Notes:
    Learn DTMs (If you haven't already)
    Also, if you have the patience learn TPAs (Probably most important and useful thing in scripting )
    Get used to RadialWalk

    If you have any questions or dont understand something, just shoot me a PM.

    T~M

  4. #4
    Join Date
    Dec 2009
    Posts
    146
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    But my point is... why go to the bother of DTM's and TPA's when they aren't needed? People tend to make scripts too complex for no reason.

    There are two points in this script when you are in a guaranteed spot:
    1) When you are at the bank window.
    2) When you are at the wheel.

    When you ascend and decend the stairs you are not always in the same spot, but you are pretty close every time to the same spot, so why go to all the trouble of finding out where you are, when you pretty much know where you are at all three spots? It's a waste of code.

    So, since at all three of those spots you can "see" your next destination, isn't it simpler just to click on that next destination instead of walking towards it and THEN trying to find where it is? It just doesn't make sense to do it the hard way when this is the easy way. Less code and less chance for mistakes it seems to me.

    The only drawback in my way of doing things is that when you do setcompass, we all know that it doesn't come out the exact direction you want. Jagex makes the "south" compass vary between 175 and 185 degrees to throw off our scripts, so if there was a way to set the compass exactly south I would be guaranteed this script would never fail.

    So if anyone can tell me why making a simple thing more complex makes it better, I'm glad to listen. I think we all should be working towards making simpler and more effective scripts, as that way there are fewer ways they can break in the future when Jagex does updates and such.

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

    Default

    Well it's not always because it's the best for THIS script, but why not learn them? Even if you made a script that will click one time and that's it, if you can implement some extremely well working TPA's and such, then eventually you can turn that one blind click into a check to see where you are. And you can use that to help the script fix itself, or take a screen shot of it to show errors. Hope that made sense.

  6. #6
    Join Date
    Dec 2009
    Posts
    146
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, I agree that when one has a complicated problem in a script it takes complicated techniques to overcome them. But there is no sense in killing a fly with a sledgehammer.
    Simple scripts break less often, but you are correct, there is a sacrifice and that sacrifice is error correction. So it's a tradeoff, I guess.

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

    Default

    x] Haha I agree with you, I'm just saying that it's always good to learn some of these things. Efficiency is my biggest problem in botting, since I can usually be just as efficient or (usually) more efficient than a script, even if I hardly pay attention. So I don't really auto.. But when I do, I make sure it's as efficient as it can be, which sometimes means I take the risk of the script failing, which is where I often use TPAs and what not to see if I can fix it. If fixing it takes 20 minutes for the script, and 30 seconds for a real person, then it's fine by me as long as the script is generally just as efficient (sometimes more, since humans get side tracked quite often). :>

    But, again, I agree with you that if it works, why change it? ^^

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
  •