Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Buy OSRS Gold

Sell OSRS Gold
Ulsting

Would Like Feedback On My Script

Recommended Posts

Greetings all,

I have just created my first script! I am making this post primarily to have other scripters give me feedback on my code in general. Specifically, I am looking for comments about my ABC2 implementation as well as my TRiBot API usage, and whether I could be doing things better with regards to either. But any advice is welcome.

One thing in particular I am not quite proud of is how I determined what is "open ground". I have looked at other firemaker scripts that I could find and they seemed to be doing it in much the same way. I tried to come up with a more elegant, robust, and all together decent solution but after a while I just wanted to get a working script and start getting feedback.

For those of you who aren't scripters and would just like to try the firemaker in order to help me bug test, YOU HAVE BEEN WARNED, it has NOT been tested very thoroughly nor am I at all an experienced scripter and as such, I can not speak as to how well I have implemented anti ban techniques.

That being said, if anyone would like to test my script and find bugs or behavior that should be changed, you are more than welcome to. Please include the client log along with your bug report, as I have made the script quite verbose intentionally, at least for now.

Firemaker.java See Firemaker2.java below for most recent version

 

AntiBanExtenderUtil.java

 

EDIT: I have taken the advice of some of the comments below, namely @warfront1 advice regarding making the script more state oriented. Below is a pastebin link for my second iteration of my firemaker script.

Firemaker2.java

 

Edited by Ulsting

Share this post


Link to post
Share on other sites
Array

 emptyInventoryAndGetTinderboxAndLogsAndWalkBackToOpenGround() never seen a method this long. Keep it simple man, make more methods if one gets too big and you do different things within the method. Easier to manage if the script gets bigger :)

  • Like 1

Share this post


Link to post
Share on other sites

fxdfStJ.png

I’m glad you went with a firemaking script as I suggested on your last thread. I was going to go through a few methods pointing out issues within each. The largest issue is the orchestration of the script caused by the poor definition of state of the application. I have charted out ONLY (yes you read that correctly) only the onstart function in the above diagram.

The method starts off setting a user’s preferences (determined by player position), and a few other questionably appropriate things. Where it goes south fast is where we begin to execute logic in the onstart that has nothing to do with starting the application. The logic I have posted above SHOULD be one in the same with your “main loop” as you denoted it. The two locations for the logic one in the main loop and one in the on start is surely going to cause pain in understanding why things aren’t operating properly. Now let’s dig in to the onstart function.

If we fail to open the bank should the script stop…. No, it was most likely a miss click and should be executed again. Why are we sleeping a blanket second, there should be a dynamic sleep waiting for whatever we want to occur to occur. (this is found throughout the script). We already checked for a tinderbox, yet we check for it again(not a huge deal), but when we attempt to withdraw we fail the script. Potentially again a miss click, 100% a miss click if it is within the bank. Same with the logs. Then we start the “””main loop””””. Which I explained above is nothing more than 50-75% duplication of the onstart.

My recommendation would be to entirely remove ABCl. It isn’t implemented even semi-correctly, and only convolutes the application. Focus on core structure and state logic. Separate what should be executed, from at what time something should be executed. The node framework or an enum state script should help with this. The most important aspect of the application is understanding the state (what I should be doing). The execution, or carrying out what should be done under a certain state is easy. Everyone is so hung up on execution because it is what actually causes in game changes (clicks, key presses, clicking objects, interacting with npcs etc). Take a step back and think about the logic and states. A well-defined state machine will perform much more accurately, be less error prone, and easier to maintain and iterate on.

Warfront1

 

  • Like 5

Share this post


Link to post
Share on other sites

 

2 hours ago, Ulsting said:

One thing in particular I am not quite proud of is how I determined what is "open ground".

You could probably check this using the tile's collision flags. Tiles that are occupied are probably flagged with 0x100.

Share this post


Link to post
Share on other sites
19 minutes ago, Encoded said:

Doesn't work for fires.

Ah, then i'd probably opt for doing it by checking if any RSobjects on the tile are RSObject.TYPES.INTERACTIVE  + Pathfinding#isTileWalkable

Edited by laniax
  • Like 1

Share this post


Link to post
Share on other sites

@warfront1 Thanks for taking the time to help, I really appreciate it. I have edited in a pastebin for Firemaker2.java. I took your advice regarding the state machine. I think the reason I didn't do this initially was because when I started the script I assumed it would be quite small. It is pretty small, I imagine, compared to some of the more involved/premium scripts, but still bigger than I expected and big enough that without decent coding techniques it was quite ugly.

I have also added Timing.waitCondition() to the banking withdrawls as you suggested. I used a random time between 2 and 3 seconds. If you have times for this, or any other waiting time in the script that I use, that you have found to work well, I'd love to know what you use.

As for my ABC2 usage, I'm sure you will elaborate more on that once the rest of the script is in a decent place. But I left it in since I think with the new state based progression of the script it doesn't muck up the flow too badly.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By sea bisquit
      Hello community , 
      I was looking for a scripter who would be interested in writing a private script. If you want to discuss please comment or message me ! 
      Thank you 
    • By ELON
      ELON AIO COMBAT
      abc2 lvl 8
      + Custom antiban
      gui support
      save/load
      SOURCE:https://github.com/Elon333/ELON-Combat-Aio
      LINK TO SCRIPT: https://tribot.org/repository/script/id/3411
       

      Bug Report info:
      bot debug copy paste in pastebin
      client debug copy paste in pastebin
      explanation on bug
      screenshot/video if applicable
      MY DISCORD INFO: Elon#6697
      message my discord for faster reply

      ELON FREE SCRIPTS:
      RESTLESS GHOST: https://tribot.org/repository/script/id/3416
      PRIEST IN PERIL: https://tribot.org/repository/script/id/3407
      COMBAT AIO: https://tribot.org/repository/script/id/3411
       
    • By whyareyoudoingthis
      Hello, I would really appreciate some advice since it's lookin kinda hopeless.
      I'm getting consistent bans on p2p accounts with nFletcher, within 24-48 hours, even though I am botting with randomized breaks, doing some manual selling/restocking every 1-2 hours. I did not bot during the night, maybe 3 sessions for 3-4 hours per day TOPS.
      I even did some slayer in between every 1-2 hours on my semi-main and it just got banned for 2 days regardless (ty god no perma, obviously not gonna bot on a valuable account ever again, that was dumdum)
      Am I doing something wrong or what? This seems completely unprofitable and unsustainable. I am not into this as much as to create a bot farm, but I wanted to do a total of 10ish m/day on 1-2 accounts and this seems impossible. 
      Any advice? Thank you so much in advance
    • By DizFunk
      Hi guys, I just started attempting to script. I bought VIP so I could write my own scripts. I've been having the hardest time setting up my eclipse to work with TRIBot. So far I have set up my eclipse to compile with JDK/JRE 8, TRIBot is being launched with JDK 8. Everything seems to be setup correctly, however I get this odd error message in my bot debug logs. I've attached a photo of the logs. 
      Here is what my class file looks like: 
      package scripts;
      import org.tribot.script.Script;
      import org.tribot.script.ScriptManifest;
      @ScriptManifest (authors = { "DizFunk" }, category = "Test", name = "Test")
      public class Test extends Script {
          @Override
          public void run() {
              println("Hello World!1");
          }
      }
       If anyone knows whats going on here it would be a big help

    • By will6100
      I really love the process of developing a script, testing it, debugging it, etc.. So after writing my first really simple script that would tan hides, I got my first botting account banned, which is something I knew was gonna happen since my lack of scripting knowledge. Im ready to get a new one up and going and continue to develop more basic scripts to sharpen my scripting skills. Im sharing my first script here and looking to hear what I should do and should not do. Also get some tips on what to look for to reduce the banning rates of my testing accounts. The account I was using was only combat lvl 5 and didnt have any quests done, I guess that didnt help too? I was also about to introduce ABC2 into the script and learn how to use it but my account got banned right before I could implement it. So looking forward to hear your criticisms about my script and tips to not get the script bannable. Also have in mind I didnt really refactor anything, some parts may look ugly, beware!
      package scripts; import org.tribot.api.DynamicClicking; import org.tribot.api.General; import org.tribot.api.Timing; import org.tribot.api.input.Mouse; import org.tribot.api2007.*; import org.tribot.api2007.types.RSNPC; import org.tribot.api2007.types.RSObject; import org.tribot.api2007.types.RSTile; import org.tribot.api2007.util.ThreadSettings; import org.tribot.script.Script; import org.tribot.script.ScriptManifest; import java.awt.*; import java.util.function.BooleanSupplier; @ScriptManifest(category = "Moneymaking", authors = "will6100" , name = "Tanner") public class Tanner extends Script { private final static int BLACK_DHIDE_ID = 1747; private final static int TANNED_LEATHER_ID = 2509; private final static int ELLIS_ID = 3231; private final static int BANK_BOOTH_ID = 10355; private final static int COINS_ID = 995; private boolean isBankable() { RSObject[] booths = Objects.findNearest(100, BANK_BOOTH_ID); if (booths.length > 1) { return booths[0].isOnScreen(); } return false; } private boolean coinsCheck() { if (Inventory.find(COINS_ID).length < 1) { if (Banking.find(COINS_ID).length > 0) { if (!Inventory.isFull()) { return Banking.withdraw(0, COINS_ID); } else { if (Inventory.find(BLACK_DHIDE_ID).length > 0) { return Banking.deposit(1, BLACK_DHIDE_ID); } else if (Inventory.find(TANNED_LEATHER_ID).length > 0){ return Banking.depositAll() > 0; } } } } else { return true; } return false; } private boolean bank() { if (!openBank()) { General.println("Couldnt open bank"); return false; } if (!coinsCheck()) { General.println("No more gold"); return false; } if (!setupInventory()) { General.println("No more hides"); return false; } sleep(100,1000); return true; } private boolean setupInventory() { if (Inventory.find(TANNED_LEATHER_ID).length > 0) { sleep(50,1000); if (Banking.deposit(0,TANNED_LEATHER_ID)) { if (Banking.find(BLACK_DHIDE_ID).length > 0){ sleep(50,1000); Banking.withdraw(0, BLACK_DHIDE_ID); return Timing.waitCondition(this::readyToTan, General.random(3000,5000)); } } } else if (Inventory.find(TANNED_LEATHER_ID).length < 1) { sleep(50,1000); if (Banking.find(BLACK_DHIDE_ID).length > 0){ Banking.withdraw(0, BLACK_DHIDE_ID); return Timing.waitCondition(this::readyToTan, General.random(3000,5000)); } } return false; } private boolean openBank() { if (!Banking.isBankScreenOpen()) { if (!isBankable()){ if(!walkToDestCondition(this::isBankable)) { return false; } } return clickBankBooth(); } return true; } private boolean clickBankBooth() { RSObject[] bankBooths = Objects.findNearest(40, BANK_BOOTH_ID); RSObject booth; if(bankBooths.length > 1) { do { sleep(50); booth = bankBooths[General.random(0, bankBooths.length - 2)]; } while (!booth.isOnScreen() && !booth.isClickable()); booth.hover(); if (isHoverRendered(Mouse.getPos())){ Mouse.click(1); }else { clickBankBooth(); } return Timing.waitCondition(Banking::isBankScreenOpen, General.random(25000,27000)); } return false; } private boolean isHoverRendered (Point toHover) { return !Screen.getColorAt(Mouse.getPos()).equals(new Color(0, 0, 0)); } private boolean isTannable() { RSNPC[] ellis = NPCs.find(ELLIS_ID); if (ellis.length < 1) { return false; } else if (isTanningWindowOpen()){ return true; } return ellis[0].isOnScreen(); } private boolean tanLeather() { RSNPC ellis; if (isTannable()) { sleep(100,200); ellis = NPCs.find(ELLIS_ID)[0]; while (!isTanningWindowOpen()) { Mouse.setSpeed(190); sleep(300,500); if (DynamicClicking.clickRSNPC(ellis,"Trade " + ellis.getName())){ Mouse.setSpeed(115); Timing.waitCondition(this::isTanningWindowOpen, General.random(15000, 17000)); sleep(200,500); Interfaces.get(324,107).click("Tan all"); return Timing.waitCondition(() -> !isTanningWindowOpen(), General.random(3000,5000)); } } } else { return walkToDestCondition(this::isTannable); } return false; } private boolean walkToDestCondition(BooleanSupplier waitCondition) { Walking.blindWalkTo(new RSTile(3278 + General.random(-2,2), 3180 + General.random(-1, 1))); return Timing.waitCondition(waitCondition, General.random(11000,12000)); } private boolean isTanningWindowOpen() { return Interfaces.isInterfaceValid(324); } private boolean readyToTan() { return Inventory.find(BLACK_DHIDE_ID).length > 0 && Inventory.find(COINS_ID).length > 0 ; } @Override public void run() { Mouse.setSpeed(115); ThreadSettings ts = new ThreadSettings(); ts.setClickingAPIUseDynamic(true); while (true) { sleep(50); if (isTannable()) { if (readyToTan()) { if(!tanLeather()){ General.println("1"); break; } } else { if(!bank()) { General.println("2"); break; } } } else if (isBankable()) { if (readyToTan()) { if(!tanLeather()){ General.println("3"); break; } } else { if(!bank()) { General.println("4"); break; } } } else if (readyToTan()) { if(!tanLeather()){ General.println("5"); break; } } else { if(!bank()) { General.println("6"); break; } } } } }  
    • By ilysmd
      Need a private scripter for an zeah rune crafting bot (bloods or souls). 
    • By ilysmd
      Looking to buy a cox scouting bot, that will keep scouting until it finds a raid within the desired parameters.
    • By ilysmd
      Why hasn't anyone made a blood/soul rune crafting bot? and if someone is willing to make it i can pay good price!
    • By rs06botHein
      Dear scripters,
      Is there any good discord (or other centralised community) dedicated to scripting? (Other than forums ofcourse)
      I' am looking for tribot scripters eager to learn and help each other out.
       
      Grtz
    • By Optimus
      Hey guys, Optimus here
        I noticed that TRiBot was lacking a good FREE auto fighter, so I decided to release a Lite Version of Optimus Combat & Magic for free!
      This version of the script has had certain features disabled, but is still very rich in features, so enjoy   To activate the script on the repository, please use the following links:
        https://tribot.org/repository/script/id/3097-optimus-combat-magic/ - Lite Version

      https://tribot.org/repository/script/id/651-optimus-combat-magic/ - Premium Version
      Note: There is a 10 hour FREE TRIAL for anybody who wants to try out the PREMIUM VERSION of the script on the repository
        Preview:   Features Overview:   AIO Combat Features: Green features: FREE            Blue features: PREMIUM
        Start the script from absolutely anywhere in RS and it will navigate to your saved location. Complete all in one combat system that can fight every single monster in Runescape including but not limited too: -Brutal dragons
      -Wyverns
      -Everything in the stronghold of security -Slayer dungeons -Sand crabs -Rock crabs -Dragons -Giants -Goblins -Ghouls -Dagganoths -Chaos Druids
      -And hundreds more different monsters! (Anything you can think of).   Can use all types of food Supports all weapons and special attacks (Full list of spec weapons here: https://pastebin.com/raw/bf56k5Bg) Customisable looting by Item Name, Item ID, or items worth more than x price (Automatic price lookup). Re-equips ammo that you loot ABC2 antiban with a 10/10 rating Can bury bones Load & save GUI settings Profit calculations and xp tracking Customisable mouse speeds Easy to use banking system that works at every bank in RS Can drink every potion in the game Progressive training (Upgrade gear, switch training spots & more) Full worldhopping system that can worldhop when many different conditions are met Full prayer support Superior antiban Slayer task support Safe spotting support Telekinetic grab support Supports all teleport items and spells Guthans healing Dwarf multicannon support Bones to peaches support Automatically uses the Looting bag and Herb sack Automatically resets Rock crabs and Sand crabs aggro (Including 10k island). Keeps a safe distance while using ranged/magic on Brutal dragons Herb cleaning and dropping   AND MORE!   AIO Magic Features: (Premium only) This script can reliably and safely train magic using the following methods:   Every single combat spell available, from air strike to ice barrage; It's all supported Every single curse spell available Stun/combo alching!
      This is the best magic xp in the game, you cast a regular combat spell or curse, quickly followed by a high level alchemy spell.
      This can earn you up to 180k magic xp/hour! Splashing! All alchemy spells All enchantment spells Superheat item All teleport spells The script can also train with the following lunar spells! Humidify Plank make Superglass make Tan leather Spin Flax String Jewellery and More!   To activate the script on the repository, please use the following links:
        https://tribot.org/repository/script/id/3097-optimus-combat-magic/ - Lite Version

      https://tribot.org/repository/script/id/651-optimus-combat-magic/ - Premium Version
      Note: There is a 10 hour FREE TRIAL for anybody who wants to try out the PREMIUM VERSION of the script on the repository   Gallery:    

       
                     
  • Our picks

    • [CONTEST ANNOUNCEMENT] 2019 Botter's Choice Awards
      2019 Botter’s Choice Awards

      To celebrate the launch of our TRiBot Official RuneScape Bot Blog,

      we’re doing a giveaway! 

      The TRiBot Official RuneScape Bot Blog: 

      Teaching you how to do more advanced botting, faster.
      Contest Details

      Prize: 3 winners will be selected to win 25 TRiBot credits.

      How to enter:

      Respond to this forum post by November 12th tagging the thread for: 

      Your favorite script

      Provide a brief explanation (1-2 sentences) why you think that script should be put in the top 5. 

      Who can enter?

      Botter’s who are not currently scripters. Sorry scripters, the people are going to vote. Your contest is here.

      The top 5 in each category will be showcased on our TRiBot Official RuneScape Bot Blog in a “People’s Choice” section and promoted across the TRiBot website. 

      -- Credits will be awarded based on thoughtfulness and humor -- 

      Bonus points

      Use a meme in your explanation. Because we all love memes.

      *no purchase necessary. Winners will be announced on Friday, November 15, 2019 at 4:00 p.m. on our News and Announcements forum. 

      -- Vote Below -- 
      • 28 replies
    • [READ TO THE END FOR A TEASER]

      I've noticed some new TRiBotters have had some troubles finding out sources of how to do certain things, such as using advanced scripts and often get lost in the forums.

      We are still getting posts asking where to start, what to do, recommended scripts, etc. 

      As many of you know, I am new to the team, and had troubles myself learning how to bot, let alone script. 

      So, what our team decided to do was make it easier to learn how to bot, how to script, and just become an overall better botter and scripter faster. 

      As some of you might have seen, I've posted 3 new blogs, you can check it out by clicking on the following picture or here.


      These first 3 blogs are the first of many blogs that will be TRiBot official. They are encouraged to be challenged, improved upon and act as A Best Practices Guide for Botters.

      What information would you like to see in the blogs?

      👇 [TEASER] 👇

      .

      .

      .

      We are going to be hosting a  CONTEST  this  OCTOBER.

      Its scary to think how soon you'll find out.👻

      Stay tuned.


      - RileyZ
      • 8 replies
    • Today marks a big day for TRiBot! To make it easier for users to use TRiBot, we've created installers available for every platform! These installers are all bundled with the latest version of OpenJDK 1.8 (Java 😎, which is LG compatible.

      Using TRiBot is now easy. Simply download the installer for your platform, install TRiBot, and run it. The TRiBot Loader will correctly identify the bundled JDK so there's no need to change the Java selection.

      Windows

      EXE installer: TRiBot-windows-x64-4.0.3.exe


      MSI installer: TRiBot-windows-x64-4.0.3.msi


      Portable version: TRiBot-windows-x64-4.0.3.zip


      Mac OS

      Installer: TRiBot-macos-4.0.3.dmg


      Portable version: TRiBot-macos-4.0.3.tgz


      Unix/Linux

      Installer: TRiBot-unix-4.0.3.sh


      RPM installer (CentOS/Fedora): TRiBot-linux-4.0.3.rpm


      DEB installer (Debian): TRiBot-linux-4.0.3.deb


      Portable version: TRiBot-unix-4.0.3.tar.gz


      Platform Independent

      JAR file: tribot-loader-4.0.3.jar


      Note that this jar file does not include the bundled JDK.



      Windows and Mac OS users may notice a warning message stating that the installer/application is un-recognized or un-trusted. Please ignore this message and proceed with running the installer/application. We need to acquire a code signing certificate so that we can sign the installers letting the operating system know that these files can be trusted. It will take a week or more to acquire one, so please hold tight.

      Other notable changes to the TRiBot Loader:

      Support getting the version from OpenJDK distributions


      Add check for bundled JDK


      Copy OpenJDK tools.jar to the bundled JDK if not present


      Set the current java as the first available list entry


      Ignore Java versions which are symbolic links


      Make the bundled JDK the preferred Java version


      Update icon images


      Reduce the number of HTTP calls
      • 32 replies
    • TRiBot is looking to improve a lot of its customer relationship management, customer on boarding process, customer experience, design elements, community engagement and pretty much everything else you can imagine when it comes to marketing.

      Our goal: To ensure that the marketing done TRULY reflects the experience and does not shine an inaccurate light on what TRiBot is lacking in.

      So I ask, what do you love about TRiBot and what do you hate about TRiBot? What does O S Bot, Rune M8, PowR Bot and Dre amBot do better? (yes I purposely didn't spell it right 😂).

      Love, 

      RileyZ
      • 18 replies
    • Hello TRiBot,

      Today we have a significant release that has been in the works for the last month addressing several key issues, features and bugs in the backlog.

      With these changes, we are also including a new TRiBot Loader which will allow you to select any version that is released. This adds the flexibility of allowing you to revert to a previous version should an issue arise, run development only builds, view an accurate change log between versions etc. we are very proud to offer this feature and think it will add a lot more functionality down the road as we continue to release new versions.

      These changes include 80+ commits by our development team, a list of them is summarized below and also available for your viewing pleasure in the new TRiBot Loader.

      In addition, we have taken additional steps to improve as a development team by adding continuous integration and deployment into our workflow to assist in delivering timely releases such as bug fixes as well as new features on a weekly basis depending on our development cycle.
      • 39 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...