Jump to content

HeyImJamie

Lifetime Sponsor
  • Posts

    1096
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by HeyImJamie

  1. Does f not have a getName option? !f.equals("name")
  2. I'm not quite sure what your question is haha. Assuming you want it to be neater? The reason your else if's weren't working is likely due to how you had your code ordered. In regards to neatening it, why not simplify it a little? if (Inventory.isFull()){ // we can't mine, so bank bank(); } else { // all good, we can mine mine(); } private void bank() { // bank code } private void mine() { if !area.contains(player) { walk to the area! } else { we can mine, put mine code here } } There's obviously much nicer ways than this, but this would be a good starting point for you
  3. I haven't read all of the above comments, but the reason why your script wouldn't load is because you were trying to create your RSObject variable outside of the loop, where the script wouldn't have loaded properly. This was causing it to 'crash'.
  4. I haven't scripted for a while, but I believe it's GAME. You don't need to do getChatbox().getMessages() either.
  5. First suggestion would be to look at Enums for storing all your variables related to Trees. Next would just be improving code readability. Good start for 3 days though!
  6. Yes, but when do you set the state back to FISHING once you've set it to DROPPING? You don't, so it will get stuck.
  7. Like I stated, it will work once. Let it fish a full inventory, drop it, and get back to me.
  8. It's a learning lesson for all. No hatred, just discussing.
  9. You do not set your states anywhere, so the script you have posted will not work. ? Edit: Upon re-reading it, I've spotted where you set your state, but I still can't see it working. The script will inevitably get stuck dropping forever, as the state is never set back to fishing.
  10. Where are you setting your states? Also this may be preference, but wouldn't it be easier just to make use of a switch statement. Something like this perhaps. private int onLoop() [ switch (getBotState()) { case WALK_TO_AREA: // walk code break; case DROP: // dropping code break; case FISH: // fishing code break; } return 50; } private enum BotState { WALK_TO_AREA, DROP, FISH } private BotState getBotState() { if (!area.contains(Player)) { return BotState.WALK_TO_AREA; return Inventory.isFull ? BotState.DROP : BotState.FISH; }
  11. Looks good, but I'd spell check it. I looked at it for about 10 seconds and found 4 mistakes. Can't see that coming off as very professional ?
  12. Looks good, but may I suggest making it a more 'universal' method? I've edited slightly on here so there may be a few errors etc, but this gives you an idea. This way instead of editing the method everytime to edit it to your combat style, you can just select which style you want. You could even make an AttackStyle enum for readability, rather than using ints. public boolean switchCombatStyle(int combatStyle) { int style = getConfigs().get(43); if (combatStyle == style) { return true; } switch (combatStyle) { case 0: RS2Widget attButton = getWidgets().get(593, 3); if (attButton != null && getTabs().open(Tab.ATTACK)) { if (attButton.interact()) { // sleep until style equals desired. } } break; case 1: RS2Widget strButton = getWidgets().get(593, 7); etc break; case 2: break; case 3: RS2Widget defButton = getWidgets().get(593, 15); etc break; } return combatStyle == getConfgs().get(43); }
  13. Why claim you've written the sleep class when you clearly haven't.
  14. Don't copy paste other peoples code and you won't get cucked like this.
  15. I wouldn't put that code in onMessage if I were you. Use it to set a boolean and hop based on that.
  16. If you let me know what quest it is I can see if I have the Varbits.
  17. I'd still add a sleep. It's iterating far too fast for what it should, surprised it's even running tbh.
  18. HeyImJamie

    ???

    As opposed to promoting someone else's stuff?
  19. It won't on one client. Multiple clients however and it becomes a nuisance. Cool idea though, will be nice to see how it develops.
  20. Why would you not just make this into an AIO Combat?
×
×
  • Create New...