Jump to content

DirtyDick

Members
  • Posts

    11
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

DirtyDick's Achievements

Newbie

Newbie (1/10)

1

Reputation

  1. Thanks for the reply, I've just set up IntelliJ using this guide. Just to be certain (before I mess something up), are you saying I can just create another class within my template project, call it 'Framework' and paste in all my snippets from Eclipse using /* */ and it won't affect any scripts I export? As you kindly suggested, I'll be initializing this script template project by default, using 'Save As' to give it a custom name and then renaming the jar in Artifacts before writing any code. Thanks for this - I wasn't aware of this split-screen function, it'll prove very handy when copy and pasting snippets instead of switching between the tabs. Many thanks!
  2. I was working with Eclipse whilst I was learning and I managed to open my 'Framework.java' class within my Java Project so that I could copy and paste relevant snippets (see photo). For the most part, it worked really well - I could easily switch between the two tabs and it really sped up my script writing. I can't recall how I set this up but I must've done something wrong because when I export the .jar, it seems to overwrite my previous scripts and all of my scripts are called 'Framework' in OSBot Nevertheless, I'm now switching to IntelliJ because I prefer the UI and I figured I'd ask here for advice on initial setup as hopefully I'm not the only one here that prefers working this way. I've written about 50 very basic scripts now so I'd really like a better, more streamlined way of opening a new project in IntelliJ, having my 'Framework.java' code readily available but in a way that doesn't affect the .jar export process - any advice would be hugely appreciated please..!
  3. Thanks Khal and you're right, I'll read the API ps thank you for your awesome wintertodt script, I got to 200m fm xp on a hcim babysitting it a few years ago without dying or getting banned
  4. Great tip thank you, I'll look into this and search the api + site:osbot.org in future
  5. Just started on a Romeo and Juliet script and I was wondering if there was a more efficient way to write a dialogue handler? When interacting with NPCs, I'm adding each specific dialogue option manually when required and then calling another Method to get through the regular ("Click to continue") dialogue. This is how my script looks so far: @Override public int onLoop() throws InterruptedException { Position julietHouse = new Position(3159, 3425, 1); WebWalkEvent walkToJuliet = new WebWalkEvent(julietHouse); walkToJuliet.setMinDistanceThreshold(1); Area romeo = new Area (3209, 3422, 3215, 3425); if (!romeo.contains(myPlayer())) { log("Walking to Romeo"); getWalking().webWalk(romeo.getRandomPosition()); } log("Starting quest..."); npcs.closest("Romeo").interact("Talk-to"); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return getDialogues().inDialogue(); } }.sleep(); randSleep(); getThroughDialogue(); getDialogues().selectOption(1); randSleep(); getThroughDialogue(); getDialogues().selectOption(1); randSleep(); My getThroughDialogue method: public void getThroughDialogue() throws InterruptedException { for (getDialogues().isPendingContinuation(); getDialogues().clickContinue() ; randSleep()); } Is there a better/cleaner way to navigate dialogue while implementing sleeps? I'm really enjoying writing this quest script and I figured I should learn now as I'm planning to make several more. I saw in the API there is a completeDialogue method but I wasn't confident on how to use it, and wanted to add my own random interval sleeps during the dialogue to simulate a player reading the text. Note: my getThroughDialogue method works fine when I run it but it's my first time using a for loop so it may be incorrect
  6. Tyvm, is there any way to utilize this so that the script stops but the client doesn't automatically log you out?
  7. Tried calling onExit but the bot is still initiating the Auto-Login solver log("No money - logging off in 5 seconds"); sleep(5000); log("logging off"); getLogoutTab().open(); getLogoutTab().logOut(); onExit();
  8. I've managed to log out now using log("No money - logging off in 5 seconds"); sleep(5000); log("logging off"); getLogoutTab().open(); getLogoutTab().logOut(); but the auto-logger just logs me back in repeatedly - how can I terminate the script if I have logged off, without the onLoop continuing to loop?
  9. I'm trying to set up a simple logout function but for some reason it's not working. log("No money - logging off in 5 seconds"); sleep(5000); log("logging off"); getLogoutTab().logOut(); When I run this, the log and sleeps work and then the bot navigates to the logout tab, highlights the 'logout' button and then does nothing
  10. Hi guys - apologies in advance this is my first script but I'm trying to set up a method that locates a safe 5x1 area to firemake. I've declared my current position and the position 5 tiles west of my current position to create a 5x1 area public void tileCheck() { Position myPosition = myPlayer().getPosition(); Position minusFivePosition = new Position((myPosition.getX()-5), myPosition.getY(), myPosition.getZ()); Area safeToFiremake = new Area(minusFivePosition, myPosition); From here, I'm a bit stuck. I want to create an if statement that says "If safeToFiremake does not contain any objects, firemake, else move somewhere else" I've been browsing the api for a while and I couldn't find a way to check a defined area doesn't contain any objects - I would be grateful for any advice please
×
×
  • Create New...