Jump to content

shaba123

Members
  • Posts

    105
  • Joined

  • Last visited

  • Feedback

    100%

Posts posted by shaba123

  1. The Callisto bots and revenant bots i see can instantly teleport and switch prayers, 1 tick removing armour to entangle pkers etc but I can seem to replicate that at all. Is osbot just not capable like poopbot? That's where I see all the Callisto / venabstis scripts that have anti PK.

  2. On 1/20/2021 at 4:30 AM, Camaro said:

    Here's a custom webwalk event class that I use to perform actions while walking without delays

    import org.osbot.rs07.api.map.Position;
    import org.osbot.rs07.event.WebWalkEvent;
    import org.osbot.rs07.utility.ConditionalSleep2;
    
    public class CustomWebWalk extends WebWalkEvent {
    
        private AsyncWalkEvent asyncWalkEvent;
    
        public CustomWebWalk(Position position) {
            super(position);
        }
    
        @Override
        public void onStart() {
            asyncWalkEvent = new AsyncWalkEvent();
            execute(asyncWalkEvent);
        }
    
        @Override
        public int execute() throws InterruptedException {
            if (asyncWalkEvent.isLooping()) {
                // Async is still looping, dont let the web walker execute
                return 600;
            }
            return super.execute();
        }
    
        @Override
        public void onEnd() throws InterruptedException {
            // End the async event and wait for it to finish
            asyncWalkEvent.setFinished();
            ConditionalSleep2.sleep(5000, asyncWalkEvent::hasCompleted);
        }
    
    }

    And the action that executes in a separate thread

    import org.osbot.rs07.api.map.Position;
    import org.osbot.rs07.event.Event;
    
    public class AsyncWalkEvent extends Event {
    
        private volatile boolean finished = false;
    
        private volatile boolean isLooping = false;
    
        public AsyncWalkEvent() {
            setAsync();
        }
    
        @Override
        public int execute() throws InterruptedException {
            if (canPerformAction()) {
                // Map destination is far enough away, we can perform some actions
                isLooping = true;
                if (shouldDoAction()) {
                    // do action
                } else {
                    // any other necessary action
                }
                isLooping = false;
            }
            return 600;
        }
    
        @Override
        public void onEnd() throws InterruptedException {
            finished = true;
        }
    
        public boolean isLooping() {
            return isLooping;
        }
    
        public boolean hasCompleted() {
            return finished;
        }
    
        private boolean canPerformAction() {
            // Only allow the actions to start if the map destination is far enough away
            Position dest = getMap().getDestination();
            if (dest == null) return false;
            int dist = getMap().distance(dest);
            return dist < 20 && dist > 7;
        }
    
    }

     

    hey this looks great how would i execute the customwebwalk in my script?

  3. On 4/19/2023 at 2:29 PM, FushigiBot said:

    Found something you might be able to use. Someone posted this snippet a while back and I had it saved on my PC. If this snippet is yours, lmk so that I can credit you.

    Custom class

    Then just set the action here

     

    How can i execute the customwebwalk from my main class?

     

    
    import org.osbot.rs07.api.map.Position;
    import org.osbot.rs07.script.Script;
    
    import org.osbot.rs07.script.ScriptManifest;
    
    
    
    @ScriptManifest(name = "Skeleton", author = "Alek", version = 1.0, info = "", logo = "")
    
    public class Main extends Script {
    
        CustomWebWalk customWebWalk;
        @Override
        public void onStart() {
            //Code here will execute before the loop is started
            Position destination = new Position(3144, 3485, 0); // Replace with desired destination coordinates
            customWebWalk = new CustomWebWalk(destination);
            customWebWalk.exchangeContext(getBot());
            customWebWalk.onStart();
        }
    
        @Override
        public int onLoop() throws InterruptedException {
            if (customWebWalk != null) {
                execute(customWebWalk);
            } else {
                log("Web walk null");
            }
            return 100; //The amount of time in milliseconds before the loop starts over
    
        }
    
    }

    Something like this?

     

    edit: i got it to execute but in asyncwalkevent class canperformaction is false.

     

        private boolean canPerformAction() {
            // Only allow the actions to start if the map destination is far enough away
            Position dest = getMap().getDestination();
            if (dest == null) return false;
            int dist = getMap().distance(dest);
            return dist < 20 && dist > 7;
        }

    Im trying to walk to edgeville from grand exchange.

    Final edit: got it to work :)

  4. 19 hours ago, Czar said:

    I personally make a hash of inventory before looting and after looting, and if the two values are different then it means you picked up an item, ofc this doesn't apply to looting bag so you may want to check if grounditem disappeared (still can be looted by someone else tho) so it's never 100% accurate :feels: 

    I would definitely give this one a read though, it's an inventory listener that keeps track of items gained: 

     

     

    12 hours ago, Gunman said:

    You will probably have to make your own exist method. And best way to track loot for looting bag would be when you bank update it, otherwise check for inventory changes then update etc

    Thank you !

  5. I find walkEvent to be quite slow, don't know if im doing something wrong but everytime my character gets to the next position it waits a second before moving to the following position. Not ideal when running from pkers.

    I need to be able to break form the walk to eat and change prayers etc. I can do this with walkEvent just wondering if possible with walkPath.

  6.                     if (itemToPickUp.interact("Take")) {
                                lootValue = lootValue + itemValues.get(itemToPickUp.getName());
                                Sleep.sleepUntil(() -> !itemToPickUp.exists() , 5000); 
                                log(lootValue);

    As you can see after i click take on the grounditem i add the value of the item to my lootvalue integer. The problem is if it clicks the item more than once it will add the value of the item twice. I cant check if the item is in my inventory to add the value because i am using a looting bag.

    I could add a longer sleep timer to make sure my player reaches the loot before clicking it again but someitmes my player is frozen.

    Any ideas guys? thanks :)

     

    edit: also another question while iv got you guys, i sleep until !item.exists but that doesnt correctly if there is multiple of the same item on the ground.

  7. 4 hours ago, Czar said:

    Try and split everything up into smaller tasks, I currently do this for my minigame scripts I have a class for each activity in the script:

    For my minigame scripts I use states so once you enter the craft runes state it will stay there until isAllowToLeave() is triggered, and I set each state manually in the onloop.

    LY1ne5c.png

    Ve5FrdP.png

    Ah brill thank you :) I have never tried using state so i will get learning thank you

     

    Edit: Could you share an example please? 

  8. You need to put more information in your main post man.

     

    What are the requrements needed to be able to complete all clues?

    How does it kill falador guards, will it equip my gear to kill them?

    Clue scroll drop rates from guards? 

  9. 11 minutes ago, botgod1 said:

    Have been using this bot for months now, i'd recommend using this for slayer tasks. (get your task, walk it there, set your bot up). Very great way of going unnoticed while being able to train your combat stats.

     

    Really? iv had this script 24 hours and had nothing but problems. Please see my previous posts over last 2 or 3 pages.

    Im also trying to do slayer.

  10. In green dragons mode it doesnt eat to make space to pick up bones, neither does it have the option too.

     

    edit: just watching my bot now, i have anti pk mode enabled, i got attacked by a pker and bot just carrys on fighthing dragons.,

     

    edit2: Bot tried walking to dragons even though  i have games neck as travel method.

     

    edit3: bot just got killed, it has now walked to port sarim for some reason and trying to board boat over and over even though i dont have money,

     

    edit4:gone to do slayer hellhounds in taverly dungeon, bot walking to dungeon cant jump over wall becuase im not 5 agility, should have a failsafe in place for things like this so it doesnt keep trying to hop a wall it cant.

     

    edit5: Went and got 5 agility to let the bot resume. It tried walking through dungeon but could get through agate that neeeds a key, bot should check if has key first before spamming to open door.

     

    edit6: pot just drinks potions before its even no where near the fight zone.

    edit7: went downstiars for a drink, came back and charactar was in lumbbridge, script was supposed to bank when out of food. Mabe could add a feature for bot to go back and pick up yourt stuff when it dies.

     

    Yeah im out of food and its not banking?

     

    Edit8: Took it to bank myself and banked my invent to see if it would regear and walk back to hellhounds. Error pops up saying i dont have lobsters and a dusty key when i do.

    So i stopped the script and started again and loaded the profile i saved. it withdrew all the items this time? suppose its decided they are there now. But now it doesnt close banking interface just sits there instead of walking to hellhounds.

    Im gonna have to go to my dr and get a script for xanax if i want to continue trying to use this.

    edit9: script just died again,. runs out of food then just stays ther doesnt bank.

  11. Ok so im killiong cyclops now for a rune defender and i started script in cyclops room. It attacks a cyclops over at the east side of the room then clicks west on the minimap then clickc cyclops again and repeat causing my character to kangaroo around. 

     

    Iv tried setting a fighting area by highlighting the whole room but still does the same thing.

     

    Edit: Also i have no idea what some settings mean, like "use real distance" ?

  12. Hey thanks for taking note mate. Another thing just remembered, When i set items to withdraw for e.g, i want 10 lobsters, a ring of dueling and a super strength pot, i will have to select say ring of dueling(8) then when script goes to bank i might only have a ring of dueling (7) now so it will stop script. Its annoying because im gonna have to buy 100 ring of dueling (8) because i have to have fuily chgrged ones in bank.

     

    Also yeah if u die with a cannon you might lose a piece because there is 4 pieces unless u protect item. But could have it so script goes to spot with just cannon and puts it down then goes back for gear, that way u wont lose anything and once cannon is on floor u dont lose it.

    • Like 1
  13. Sand crabs

    Okay sand crabs has started working now? yesterday when it went to reset crabs it kept running back and forth.

    Green dragons

    1.In green dragons setup copy inventory doesnt work.

    2.If you try start at bank it will withdraw potions drink them, equip games necklace then bank everything and thats it.

    3.You can't edit settings like after its started like normal. If you press F12 you have to input everything again.

    4. You cant add random loot, if im on slayer task i cant loot larrans key or if i get a looting bag drop cant pick that up.

    5. Yesterday i started at dragons and had a full invent of loot no food, it was supposed to bank after no food left but it just died. 

    6. Obviously you cant bank for more food because u cant start at bank doesnt work and if u start at dragons it doesnt bank after.


    Stronghold of security

    1. Bot walks through a door mid fight and gets stuck there.

    -----------------------------------------------------------------------

    Yesterday had a slayer task to kill rogues, some are level 15 or something and some are level 135 but they have the same name, so i died there because it attacked the high levels.

     

    Will we be able to use cannon at dragons at some point in future? Why do we have to use the seperate green dragons section instead of just the normal mode? Could probably just kill dragons with the normal mode no?

     

    Thanks for taking the time to read. I will try to get some gifs or problems happening and my settings so it is easier to see for yourself.

    • Like 1
  14. What if i want to withdraw a strength pot of any dose? can i do that or a ring of dueling of any amount of charges

     

    edit: when script goes to bank to get more food etc i just get a termination message that doesnt say anything and script stops.

     

  15. Sand crabs is weird it steps underneath crabs to wake them up individually instead of just standing in a spot and it also attacks them instead of waiting for them to just attack you.

     

    Also it drinks my ranging potions like every 10-20 seconds, too frequent

     

    edit:nvm found out how to stay still at crabs sorry

  16. Can you use cannon at green dragons?

     

    My first time using this script aswell im wearing all my gear, got games necklace in invent super str and lobsters and looting bag, when i start script at bank it just sips my super str then banks everything.

×
×
  • Create New...