Results 1 to 13 of 13

Thread: First Script: Log Cutter (Fletching)

  1. #1
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    180
    Mentioned
    14 Post(s)
    Quoted
    101 Post(s)

    Talking First Script: Log Cutter (Fletching)

    So I've known of these forums for about 2 years now, some of the scripts on here were the first I ever used to bot in Runescape.
    I took a break from RS for a while and I'm back now and decided to visit this site again and actually contribute this time.
    So I know this script is pretty basic and not too hard to do but im actually decently proud of it, and will be trying to make more complex and walking scripts in the future.

    Thanks to The Mayor, for his amazing guide on the forums and for helping with my question last night as well as everyone else that has contributed awesome guides/help!

    I am definitely open for A LOT of help as I know I need it, and I would not recommend running this for any long period of time.

    Things I want to get done and would appreciate any help in or pointing me in the right direction.
    1.How to implement Antiban ADDED!
    2.How to make it easier for people to set up the script so that it work in different locations/different types
    of items to craft
    3.Pin integration...lol
    4.Making fail safes ex: when you run out of logs to log you out
    5.Profit calculator/exp calc/logs cut(have a basic implementation of this already)
    6.Edit out the debug box so its not so ugly and cluttered with information
    7.Any other ideas people have/are interested in

    Right now its just set up to cut Willow logs into shieldbows(u) at edgeville bank if you have the logs in the 10th slot, they're decent exp/money. You can however just change the script to suit what items you want to craft/locations to craft. But I would love to make it easier.

    Well here it is, please let me know what you think I definitely do not mind criticism
    PHP Code:
    program BitPoorFletcherV01;

    {
    $DEFINE SMART}
    {
    $I SRL-6/SRL.simba}
    {
    $I SPS/lib/SPS-RS3.Simba}

    procedure declarePlayers();
    begin
      setLength
    (players1);
      
    with players[0] do
      
    begin
        loginName 
    := ''//Enter Username here
        
    password := ''//Enter password here
        
    isActive := true;
        
    isMember := true;
      
    end
      currentPlayer 
    := 0;
    end;

    var
      
    depositCountinteger;

    procedure openBank ();
    begin
      
    if isLoggedIn() then
        begin
        bankScreen
    .open(BANK_NPC_BLUE); //Change color or bank location here
        
    _waitBankOrPinscreen(5000);
        
    end;

        if 
    depositCount <1 then
          
    if bankScreen.open(BANK_NPC_BLUEthen //Change color or bank location here
             
    begin
              bankScreen
    .quickDeposit(QUICK_DEPOSIT_INVENTORY);
              
    inc(depositCount) + 1;
             
    end;

      if 
    bankScreen.open(BANK_NPC_BLUEthen //Change color or bank location here
        
    begin
          bankScreen
    .withdraw(10,WITHDRAW_AMOUNT_ALL, ['']); //Change mouseover text for different logs
          
    wait(randomRange(800,1000));
          
    bankScreen.close
        end 
    else
          
    writeLn('Could not find bank screen')
    end;

    procedure antiBan();   //Straight outta includes (imma noob)
    begin
      
    if not isLoggedIn() then
        begin
          writeLn
    ('Not logged in, exiting');
        
    end;

    begin
      
    case random(100of
        1..25
    begin
                writeLn
    ('Performing AntiBan, Hovering Over Skills');
                
    hoverRandomSkill();
               
    end;

        
    26..46begin
                  writeLn
    ('Performing AntiBan, Bored Human');
                  
    BoredHuman;
                  
    wait(randomRange(2000,4000));
                  
    minimap.setAngle(MM_DIRECTION_NORTH);
                  
    mainScreen.setAngle(MS_ANGLE_HIGH);
                
    end;

        
    47..67begin
                  writeLn
    ('Performing AntiBan, Move Mouse Like A Downy');
                  
    smallRandomMouse();
                
    end;

        
    68..88begin
                  writeLn
    ('Performing AntiBan, I Fell Asleep On The Computer Oh No!');
                  
    sleepAndMoveMouse(2000 random(3000));
                
    end;

        
    89..99begin
                  writeLn
    ('Performing AntiBan, Are We 99 Yet');
                  
    pickUpMouse();
                
    end;
        
    end;
      
    end;
    end;

    procedure doWePerformAntiBan();
    begin
      writeLn
    ('AntiBan or nah?');
      case 
    Random(10of
      1..6
    begin
              writeLn
    ('Nah, no AntiBan');
            
    end;

      
    7..9begin
              writeLn
    ('Yah, Performing AntiBan');
              
    antiBan();
            
    end;
      
    end;
    end;

    var
      
    CraftCountinteger;
      
    LogsCut   integer;

    function 
    amountOfLogsCut(): string;
    begin
      result 
    := 'Amount of logs cut =';
    end;

    procedure cutLogs ();
    begin
     
    if bankScreen.close then
      begin
       wait
    (randomRange(1000,2000));
       
    tabBackPack.mouseSlot(randomRange(1,10), MOUSE_LEFT);

     if 
    craftCount <1 then
      
    if toolScreen.isOpen(2000then
        begin
          toolScreen
    .select('Knife');
          
    inc(CraftCount) + 1;
        
    end;
      
    end;

      if 
    productionScreen.isOpen(3000then
        begin
          productionScreen
    .selectBox(3);  //Change to 1 for ShortBows, 2 for stocks and 3 for Shieldbows
          
    wait(randomRange(800,1100));
          
    productionScreen.clickStart();

      if 
    progressScreen.isOpen(2000then
        repeat
          wait
    (randomRange(11000,16000));
          
    doWePerformAntiBan();
        
    until progressScreen.getButton() < 1;
        
    end else
          
    writeLn('Couldnt select item to craft')

     if 
    progressScreen.getButton() < 1 then
      begin
        LogsCut 
    := LogsCut 28;
        
    writeLn('Amount of logs cut:' intToStr(LogsCut));
        
    inc(LogsCut) +1
      end
    ;

     if 
    not isLoggedIn() then
      
    exit;

     if 
    not progressScreen.getButton() < 1 then
      
    exit;

    end;

    procedure depositLogs ();

    const
      
    BACKPACK_SLOT_LOW 0;

    begin
      wait
    (randomRange(1000,2000));
      
    bankScreen.open(BANK_NPC_BLUE); //Change color or bank location here

      
    if bankScreen.open(BANK_NPC_BLUEthen //Change color or bank location here
        
    begin
          wait
    (randomRange(1000,2000));
          
    bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
          
    wait(randomRange(1000,2000));
        
    end;

        if 
    bankScreen.open(BANK_NPC_BLUEthen
          repeat
            openBank
    ();
            
    cutLogs();
            
    depositLogs();
          
    until false;
    end;

    begin
      clearDebug
    ();
      
    smartEnableDrawing := true;
      
    setupSRL();
      
    declarePlayers();

      if 
    not isLoggedIn() then
      begin
        players
    [currentPlayer].login();
        
    exitSquealOfFortune();
        
    minimap.setAngle(MM_DIRECTION_NORTH);
        
    mainScreen.setAngle(MS_ANGLE_HIGH);

      if 
    isLoggedIn() then
        exitSquealOfFortune
    ();
        
    minimap.setAngle(MM_DIRECTION_NORTH);
        
    mainScreen.setAngle(MS_ANGLE_HIGH);

      
    end;
      
    openBank();
      
    cutLogs();
      
    depositLogs();

    end 
    Last edited by Adieux; 08-07-2014 at 03:56 AM.

  2. #2
    Join Date
    Jul 2014
    Posts
    204
    Mentioned
    4 Post(s)
    Quoted
    125 Post(s)

    Default

    bankScreen.open(BANK_NPC_BLUE)

    doesn't work good, I have an script that needs to open the bank at the GE and it doesn't work at all
    as long as there are no people at the bank it should work fine. but when there are more people it stops working.

    colordetection works better.

  3. #3
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    180
    Mentioned
    14 Post(s)
    Quoted
    101 Post(s)

    Default

    Quote Originally Posted by lanadekat View Post
    bankScreen.open(BANK_NPC_BLUE)

    doesn't work good, I have an script that needs to open the bank at the GE and it doesn't work at all
    as long as there are no people at the bank it should work fine. but when there are more people it stops working.

    colordetection works better.
    That's weird, I've only tested at Edgeville bank, it is quite busy their and it works fine never had any issues.

    I dont think the Grand Exchange is the best place to run a script, much more vulnerable to lag.

  4. #4
    Join Date
    Jul 2014
    Posts
    204
    Mentioned
    4 Post(s)
    Quoted
    125 Post(s)

    Default

    Quote Originally Posted by luispadron View Post
    That's weird, I've only tested at Edgeville bank, it is quite busy their and it works fine never had any issues.

    I dont think the Grand Exchange is the best place to run a script, much more vulnerable to lag.
    It's a decent place, after bugfixing my script a long time it finnaly runs at the GE without getting stuck.
    I would have taken another place , but I need the fontain. and I don't want to run everytime to the GE to buy stuff.

  5. #5
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    180
    Mentioned
    14 Post(s)
    Quoted
    101 Post(s)

    Default

    Quote Originally Posted by lanadekat View Post
    It's a decent place, after bugfixing my script a long time it finnaly runs at the GE without getting stuck.
    I would have taken another place , but I need the fontain. and I don't want to run everytime to the GE to buy stuff.

    Well thats good, gratz!

  6. #6
    Join Date
    Jul 2014
    Posts
    204
    Mentioned
    4 Post(s)
    Quoted
    125 Post(s)

    Default

    Quote Originally Posted by luispadron View Post
    Well thats good, gratz!
    maybe an extra antiban function to look at fletching xp, cus now it only looks at a random skill.
    it's just a suggestion.
    You script looks really nice, I hope someone can test it and post a long proggy, I'm not a member ( yet )

  7. #7
    Join Date
    Jul 2014
    Posts
    135
    Mentioned
    0 Post(s)
    Quoted
    55 Post(s)

    Default

    Minor improvements:

    Could declare global variable of what banker you're gonna be using, and then use that global variable for the 5 times you access the bankers, that way people don't have to edit 5 different lines/possibly forget to change one of them.

    Also could declare global variable at the top of the script for the production so you don't have to scroll down all the way to change it for: "Change to 1 for ShortBows, 2 for stocks and 3 for Shieldbows". Then you can have it easily customizable for other optiosn if there are more options for that log.

    For the failsafe of running out of logs, an option would be: Instead of putting them in slot 10, put them in quick withdraw 1 or 2, and then have it do an inventory count before it starts doing the logs, if the inventory count less than 28, quit out, as you have no more logs int the bank. This would make it easier for people to do any type of logs.

    I think some public scripts have bank pin integration, you could just reuse their code for that if you wanted to, or do it yourself. Same with the basic template of the progress report, and then just add some global variables depending on what type of log they use to change the exp gained/value earned. Put a variable to update the total logs processed in the loop right after you process the logs but before you bank them.

    (note: I haven't actually ran the script, the above are just observations from reading through the code)

  8. #8
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    180
    Mentioned
    14 Post(s)
    Quoted
    101 Post(s)

    Default

    Quote Originally Posted by theorange View Post
    Minor improvements:

    Could declare global variable of what banker you're gonna be using, and then use that global variable for the 5 times you access the bankers, that way people don't have to edit 5 different lines/possibly forget to change one of them.

    Also could declare global variable at the top of the script for the production so you don't have to scroll down all the way to change it for: "Change to 1 for ShortBows, 2 for stocks and 3 for Shieldbows". Then you can have it easily customizable for other optiosn if there are more options for that log.

    For the failsafe of running out of logs, an option would be: Instead of putting them in slot 10, put them in quick withdraw 1 or 2, and then have it do an inventory count before it starts doing the logs, if the inventory count less than 28, quit out, as you have no more logs int the bank. This would make it easier for people to do any type of logs.

    I think some public scripts have bank pin integration, you could just reuse their code for that if you wanted to, or do it yourself. Same with the basic template of the progress report, and then just add some global variables depending on what type of log they use to change the exp gained/value earned. Put a variable to update the total logs processed in the loop right after you process the logs but before you bank them.

    (note: I haven't actually ran the script, the above are just observations from reading through the code)
    To declare the global variables, I would just have to put them before any other procedure, but wouldnt this still make it difficult for people to switch the bankers? How would I add that variable and make it work with all the different lines of codes that I have to bank with a certain NPC without having to manually change it. Im using the include to bank so what would I put in for
    bankScreen.open(BANK_NPC_BLUE) < what would I write in here?

    Thank you very much for the suggestions, I will definitely try to implement them soon! (still very noob)

  9. #9
    Join Date
    Jul 2014
    Posts
    135
    Mentioned
    0 Post(s)
    Quoted
    55 Post(s)

    Default

    Quote Originally Posted by luispadron View Post
    To declare the global variables, I would just have to put them before any other procedure, but wouldnt this still make it difficult for people to switch the bankers? How would I add that variable and make it work with all the different lines of codes that I have to bank with a certain NPC without having to manually change it. Im using the include to bank so what would I put in for
    bankScreen.open(BANK_NPC_BLUE) < what would I write in here?

    Thank you very much for the suggestions, I will definitely try to implement them soon! (still very noob)
    Generally you want to avoid global variables unless you're in a situation like this, where your global variables are going to remain constant. So here it would be a nice thing to implement.

    It would make it easier for people to switch bankers, as you'd have your global variable for bankers, at the top of the script, and people would simply edit that variable to be whatever banktype npc's they want. I think you can just do integers for it, look more here: docs.villavu.com/srl-6/bankscreen.html at the bottom. Then you'd use that variable in place of all the spots where you mention the banker in the script. This makes it optimal, as now you keep the same variable name for all spots you mention the banker, and only change the banker type at the top, in your global variable, ensuring that everything matches.

    Definitely a good start! You might want to take a free course on codecademy (http://www.codecademy.com/en/tracks/javascript, doesn't have to be javscript, can be anything) or somewhere else to further improve your thinking on how to build a solution.

    Then you can use your programming knowledge of how to build programs in combination with the simba syntax to make your desired scripts here on runescape. Of course, you can do anything you like, but learning more things never hurts.
    Last edited by theorange; 08-07-2014 at 11:55 PM.

  10. #10
    Join Date
    Oct 2013
    Location
    East Coast USA
    Posts
    770
    Mentioned
    61 Post(s)
    Quoted
    364 Post(s)

    Default

    Quote Originally Posted by luispadron View Post
    To declare the global variables, I would just have to put them before any other procedure, ... what would I put in for
    bankScreen.open(BANK_NPC_BLUE) < what would I write in here?
    Simba Code:
    var bankType: integer = BANK_NPC_BLUE;
    ...
    bankScreen.open(bankType);

  11. #11
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    180
    Mentioned
    14 Post(s)
    Quoted
    101 Post(s)

    Default

    Quote Originally Posted by bonsai View Post
    Simba Code:
    var bankType: integer = BANK_NPC_BLUE;
    ...
    bankScreen.open(bankType);
    Thanks! this works perfectly.

  12. #12
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    180
    Mentioned
    14 Post(s)
    Quoted
    101 Post(s)

    Default

    Quote Originally Posted by theorange View Post
    Generally you want to avoid global variables unless you're in a situation like this, where your global variables are going to remain constant. So here it would be a nice thing to implement.

    It would make it easier for people to switch bankers, as you'd have your global variable for bankers, at the top of the script, and people would simply edit that variable to be whatever banktype npc's they want. I think you can just do integers for it, look more here: docs.villavu.com/srl-6/bankscreen.html at the bottom. Then you'd use that variable in place of all the spots where you mention the banker in the script. This makes it optimal, as now you keep the same variable name for all spots you mention the banker, and only change the banker type at the top, in your global variable, ensuring that everything matches.

    Definitely a good start! You might want to take a free course on codecademy (http://www.codecademy.com/en/tracks/javascript, doesn't have to be javscript, can be anything) or somewhere else to further improve your thinking on how to build a solution.

    Then you can use your programming knowledge of how to build programs in combination with the simba syntax to make your desired scripts here on runescape. Of course, you can do anything you like, but learning more things never hurts.
    Thanks for the help, I am actually starting college in a couple weeks and will be majoring in Computer Science ill definitely check out that website.

  13. #13
    Join Date
    Jul 2014
    Posts
    135
    Mentioned
    0 Post(s)
    Quoted
    55 Post(s)

    Default

    Quote Originally Posted by luispadron View Post
    Thanks for the help, I am actually starting college in a couple weeks and will be majoring in Computer Science ill definitely check out that website.
    Nice! you're gonna be a step ahead of all your classmates, and this is going to be a great platform for you to come up with projects for yourself.

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
  •