Jump to content

zwaffel

Lifetime Sponsor
  • Posts

    232
  • Joined

  • Last visited

  • Feedback

    100%

Posts posted by zwaffel

  1. 20 hours ago, Czar said:

    Cool release, I highly recommend making that while statement more safe, add a few breaks to check if the script is running/paused otherwise you may need to ALT + F4 out of the bot

    Aside from that, should be super useful to the community, good job on sharing :)

     

    Hi, thanks for the feedback ill make some changes and push an update later on :)

    • Like 1
  2. Jar upload keeps failing so here is source code.

     

    source outdated, wont be uploading the new source since it has been split in multiple classes for the gui etc.

     

    import org.osbot.rs07.api.Bank;
    import org.osbot.rs07.api.model.GroundItem;
    import org.osbot.rs07.api.model.Item;
    import org.osbot.rs07.api.ui.Skill;
    import org.osbot.rs07.api.ui.Spells;
    import org.osbot.rs07.event.InteractionEvent;
    import org.osbot.rs07.script.Script;
    import org.osbot.rs07.script.ScriptManifest;
    import org.osbot.rs07.utility.ConditionalSleep;
    
    import java.awt.*;
    import java.util.ArrayList;
    
    @ScriptManifest(info = "makes glass have air staff equiped", name = "Glass make", logo = "", author = "Zwaffel", version = 1)
    public class Main extends Script {
    
        private int sand_in_invetory, seaweed_in_invetory, astrals_in_inventory, fire_runes_in_invetory, glass_made, glass_before_cast;
        private final String SEAWEED = "Giant seaweed";
        private final String SAND = "Bucket of sand";
        private final String GLASS = "Molten glass";
        private final int REQUIRED_SEAWEED = 3;
        private final int REQUIRED_SAND = 18;
    
    
        @Override
        public void onStart() throws InterruptedException
        {
            super.onStart();
            getExperienceTracker().start(Skill.MAGIC);
            getExperienceTracker().start(Skill.CRAFTING);
        }
    
        @Override
        public int onLoop() throws InterruptedException
        {
    
            // kijken of er meer dan 20 glas op de grond ligt
            if (getAmountOfGlassOnTheFloor() > 20)
            {
                // glas blijven oprapen tot er geen meer op de grond ligt
                pickupGlassFromGround();
            }
            else if (!getBank().isOpen())
            {
                getBank().open();
            }
    
            if (hasEnoughAstralRunes() && hasEnoughFireRunes() && hasEnoughSandInInvetory() && hasEnoughSeaweedInInventory())
            {
                makeGlass();
            }
            if (inventory.contains(GLASS))
            {
                bankGlass();
            }
    
    
            return 700;
        }
    
        private void pickupGlassFromGround() throws InterruptedException
        {
    
            while (floorContainsGlass() && !getBot().getScriptExecutor().isPaused())
            {
    
                ArrayList<GroundItem> grounditems = new ArrayList<>(getGroundItems().get(myPlayer().getX(), myPlayer().getY()));
                for (GroundItem glass : grounditems)
                {
    
                    if (glass.getName().equals(GLASS))
                    {
                        int glass_on_floor = getAmountOfGlassOnTheFloor();
    
                        InteractionEvent take = new InteractionEvent(glass, "Take");
                        take.setOperateCamera(false);
                        take.setWalkingDistanceThreshold(1);
                        take.setWalkTo(true);
                        if (!getBot().getScriptExecutor().isPaused())
                        {
    
                            if (!getInventory().isFull())
                            {
                                execute(take);
                                new ConditionalSleep(1000, 250) {
                                    @Override
                                    public boolean condition() throws InterruptedException
                                    {
                                        return glass_on_floor > getAmountOfGlassOnTheFloor();
                                    }
                                }.sleep();
                            }
                            else
                                bankGlass();
                        }
                        else
                            break;
    
                    }
                }
            }
        }
    
        private void evaluateGlassMade()
        {
            //tellen hoeveel glass er in de inventory zit.
            if (inventory.contains(GLASS))
            {
                glass_made += getInventory().getAmount(GLASS) - glass_before_cast;
            }
        }
    
        private int getAmountOfGlassOnTheFloor()
        {
            ArrayList<GroundItem> grounditems = new ArrayList<>(getGroundItems().get(myPlayer().getX(), myPlayer().getY()));
            int count = 0;
            for (GroundItem glass : grounditems)
            {
                if (glass.getName().equals(GLASS))
                {
                    count++;
                }
            }
    
            return count;
        }
    
    
        private boolean floorContainsGlass()
        {
            ArrayList<GroundItem> grounditems = new ArrayList<>(getGroundItems().get(myPlayer().getX(), myPlayer().getY()));
    
    
            for (GroundItem glass : grounditems)
            {
                if (glass.getName().equals(GLASS))
                {
                    return true;
                }
            }
            return false;
        }
    
        private void makeGlass() throws InterruptedException
        {
            Item seaweed = getInventory().getItem(SEAWEED);
            Item sand = getInventory().getItem(SAND);
            glass_before_cast = (int) getInventory().getAmount(GLASS);
            if (sand != null && seaweed != null)
            {
    
                // if bank is open, close bank.
                if (getBank().isOpen())
                {
                    getBank().close();
                    new ConditionalSleep(1000, 250) {
                        @Override
                        public boolean condition() throws InterruptedException
                        {
                            return !getBank().isOpen();
                        }
                    }.sleep();
                }
                magic.castSpell(Spells.LunarSpells.SUPERGLASS_MAKE);
                sleep(1000);
                new ConditionalSleep(5000, 1000) {
                    @Override
                    public boolean condition() throws InterruptedException
                    {
                        return !myPlayer().isAnimating();
                    }
                }.sleep();
    
                evaluateGlassMade();
    
            }
        }
    
        private boolean withdrawFromBank(int amount, String itemName)
        {
    
            if (bank.isOpen())
            {
                if (getBank().contains(itemName) && getBank().getAmount(itemName) >= amount)
                {
                    log("Bank contains " + itemName);
                    getBank().withdraw(itemName, amount);
                    new ConditionalSleep(2000, 500) {
                        @Override
                        public boolean condition() throws InterruptedException
                        {
                            return getInventory().contains(itemName);
                        }
                    }.sleep();
                    return true;
    
    
                }
                else
                {
                    log("Bank does not contain required item + " + itemName);
                    stop();
                    return false;
                }
            }
            return false;
        }
    
    
        private boolean hasEnoughAstralRunes()
        {
            if (getInventory().contains("Astral rune"))
            {
                astrals_in_inventory = getInventory().getItem("Astral Rune").getAmount();
                if (astrals_in_inventory > 100)
                {
                    return true;
                }
            }
            else
                return withdrawFromBank(500, "Astral rune");
    
            return false;
        }
    
        private boolean hasEnoughFireRunes()
        {
            if (getInventory().contains("Fire rune"))
            {
                fire_runes_in_invetory = getInventory().getItem("Fire rune").getAmount();
                if (fire_runes_in_invetory > 500)
                {
                    return true;
                }
    
            }
            else
                return withdrawFromBank(1000, "Fire rune");
    
            return true;
    
        }
    
    
        /*
        kijkt of er genoeg seaweed in de invtoroy is.
         */
        private boolean hasEnoughSeaweedInInventory()
        {
            if (getInventory().contains(SEAWEED))
            {
                Item seaweed = getInventory().getItem(SEAWEED);
                seaweed_in_invetory = seaweed.getAmount();
    
                if (seaweed_in_invetory == REQUIRED_SEAWEED)
                {
                    return true;
                }
                else return withdrawFromBank(REQUIRED_SEAWEED - seaweed_in_invetory, SEAWEED);
            }
            else
                return withdrawFromBank(REQUIRED_SEAWEED, SEAWEED);
    
    
        }
    
        /*
        kijkt of er genoeg buckets in de inventory zijn.
         */
        private boolean hasEnoughSandInInvetory()
        {
            if (getInventory().contains(SAND))
            {
                log("inv contains sand");
                Item bucket = getInventory().getItem(SAND);
                sand_in_invetory = bucket.getAmount();
                if (sand_in_invetory == REQUIRED_SAND)
                {
                    log("no more sand needed");
                    return true;
                }
                else
                    log("getting sand from the bank.");
                return withdrawFromBank(REQUIRED_SAND - sand_in_invetory, SAND);
    
            }
            else
                log("No sand in inv withdrawing");
            return withdrawFromBank(REQUIRED_SAND, SAND);
    
        }
    
        private void bankGlass() throws InterruptedException
        {
            if (bank.isOpen())
            {
                bank.deposit(GLASS, Bank.STORE_ALL);
                glass_before_cast = 0;
            }
            else
            {
                getBank().open();
                new ConditionalSleep(1000, 100) {
                    @Override
                    public boolean condition() throws InterruptedException
                    {
                        return bank.isOpen();
                    }
                }.sleep();
                bankGlass();
            }
    
        }
    
        @Override
        public void onExit() throws InterruptedException
        {
            super.onExit();
        }
    
    
        @Override
        public void onPaint(Graphics2D e)
        {
            super.onPaint(e);
    
            e.drawString("Glass made = " + glass_made, 15, 295);
            e.drawString("magic exp gained = " + getExperienceTracker().getGainedXP(Skill.MAGIC), 15, 310);
            e.drawString("Crafting exp gained = " + getExperienceTracker().getGainedXP(Skill.CRAFTING), 15, 325);
            e.drawString("magic exp/h =  " + getExperienceTracker().getGainedXPPerHour(Skill.MAGIC), 200, 310);
            e.drawString("crafting exp/h =  " + getExperienceTracker().getGainedXPPerHour(Skill.CRAFTING), 200, 325);
        }
    
    
    }

     

  3. This program is designed to cast glass make in order to create molten glass.

    Been using this on my ironman without any trouble.

    Requirements:

    • Plenty of astral and fire runes.
    • Buckets of sand.
    • Be on the lunar spell book.

    Features:

    • The bot will take the extra dropped glass from the floor once it contains enough.
    • The bot will keep going until it runs out of supply.
    • Should work at any bank.
    • Gets an air staff out of the bank and equips it.
    • simple gui with quit options and the option to use seaweed instead of giant seaweed

     

     

    FmP63pw.png.d9fa6a9516af380d2d43b68ed2e6a2f6.png

     

     

    If you encounter a bug please let me know, be as precise as you can be so i can recreate the bug and fix it.

    Uploading to the forums didn't work so uploaded it elsewhere.

    https://mega.nz/#!H8pzzCLK!xGVMASw1KNpYCvqG1W9ZkS1vMrLUu-PCzlccDTuMKDM

    To use go to your Osbot folder (usually in c/users/*username*/osbot/  navigate to the Scripts folder and drag it in there. Reload your scripts and it should appear.

     

     

    Currently v2.

    Changelog:

     

    v2.

    Gui added with the options to stop at X amount of glass made, buckets used, sand used or stop when out of supply.

    option added in the gui to use normal seaweed instead of giant seaweed.

     

    v1.1

    While loop has been made more safe, the bot will now check if the user has paused the bot or not.

    Upcoming update:

     

    Will be making a gui for this which will give you the options, to exit the script after X amount or glass made.

    Exit on X amount of buckets or seaweed used.

    Grabbing a staff from the bank and equipping it.

    General updates to the code will also come as i made this quickly for myself to use and wasn't actually planning on releasing to the public.

     

     

     

  4. Yeh it really depends i have had an account with 3bans spread over 7years.

    Than again another account had a ban a year later i botted on it and it instantly got permed.

  5. 7 minutes ago, Malcolm said:

    @zwaffel

    Did you have a games necklace/glory in your bank? If you did were they only with 1 charge?

    I think we found the source of the issue with the bot thinking you had blue dragons. Just trying to resolve the issue with the fire giants now. There are not required items for Fire Giants which makes me think you didn't have a games necklace/glory and that should get resolved

    Could it be the potions i think i had 2 super cmb selected but 0 in the bank. However i bought 10 myself but than first problem where it was on blue dragons got fixed and it instantly went to the task like it should have had with the 2 super combats i purchased myself. It didnt try to buy anything.

    I had a glory 6 equipped and several glory(3) in the bank. I also had 1 game neck (7)

  6. Gratz on release ! 

    Going to test this out. :D

     

    Edit:

    Spend around 45min to get it to work but i haven't been able to get it to run.

    My current task is Fire giants, when i start the script it will say that my current task is blue dragons and will try to gear for it but this fails.

    He will take one falador teleport out of the bank and than do nothing while the log is printing false.

    [INFO][Bot #1][05/05 09:42:36 PM]: Obsidian cape
    [INFO][Bot #1][05/05 09:43:03 PM]: Vannaka selected
    [INFO][Bot #1][05/05 09:43:04 PM]: Blue dragons
    [INFO][Bot #1][05/05 09:43:10 PM]: false
    [INFO][Bot #1][05/05 09:43:12 PM]: false
    [INFO][Bot #1][05/05 09:43:13 PM]: false
    [INFO][Bot #1][05/05 09:43:14 PM]: false
    [INFO][Bot #1][05/05 09:43:14 PM]: false
    [INFO][Bot #1][05/05 09:43:15 PM]: false
    [INFO][Bot #1][05/05 09:43:16 PM]: false
    [INFO][Bot #1][05/05 09:43:17 PM]: false
    [INFO][Bot #1][05/05 09:43:18 PM]: false

    My task is NOT blue dragons its fire giants however even with a slayer gem in the inventory he will not check my tasks. When i launch the script he just assumes i have blue dragons.

    Restocking etc is enabled but it does not buy the items i assume it wants ( anti fire shield ).

    I have tried to select kill off task and than select Fire giants. This also does not work.  Here he opens the bank and notices he needs more items -> withdraws cash -> opens G.E -> opens a Buy tab - > closes buy tab -> opens bank -> deposit cash -> withdraws cash -> opens G.E -> .... loop forever.

    The log here prints

    [INFO][Bot #1][05/05 09:45:55 PM]: Turael selected
    [INFO][Bot #1][05/05 09:45:55 PM]: Fire giants
    [INFO][Bot #1][05/05 09:46:01 PM]: Restock mode
    [INFO][Bot #1][05/05 09:46:03 PM]: Restock mode
    [INFO][Bot #1][05/05 09:46:04 PM]: Restock mode
    [INFO][Bot #1][05/05 09:46:06 PM]: Restock mode
    [INFO][Bot #1][05/05 09:46:11 PM]: Restock mode
    [INFO][Bot #1][05/05 09:46:13 PM]: Restock mode
    [INFO][Bot #1][05/05 09:46:14 PM]: Restock mode
    [INFO][Bot #1][05/05 09:46:15 PM]: Restock mode

    Hope this info is enough.

    • Like 1
  7. 5 hours ago, alqqu said:

    @zwaffel @dazeldo @leony

    now my accounts get disabled before i can even complete all of the 3 quests which give me 7 qp??? i ran the script twice on 2 different accounts on my main home pc and they completed tut island & 7qp and without any problems / bans and then went onto chop some oak logs??? am i getting monitored closely rn on my VPS or wtf? and btw would some proxies help?

    dont use vps to create the accounts, that's a servery ip. get a residential proxy / ip

    Yes proxy's will help (residential proxy's)

  8. When you try to cook raw chicken with location lumbridge it will trow a nullpointer and exit the script as soon as it loads the task. 

     

    [ERROR][Bot #1][03/27 11:27:32 AM]: Error in script executor!
    java.lang.NullPointerException
    	at org.aio.d.a.m.prn.E(rl:45)
    	at org.aio.a.cON.E(vb:99)
    	at org.aio.a.a.COn.d(ab:81)
    	at org.aio.a.a.COn.I(ab:184)
    	at org.aio.script.AIO.onLoop(mc:274)
    	at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(df:126)
    	at java.lang.Thread.run(Unknown Source)
    [INFO][Bot #1][03/27 11:27:32 AM]: Found null pointer exception. Task failed, exiting.
    [INFO][Bot #1][03/27 11:27:32 AM]: org.aio.d.a.m.prn.l(rl:62)
    [INFO][Bot #1][03/27 11:27:32 AM]: org.aio.d.c.cON.I(zn:93)
    [INFO][Bot #1][03/27 11:27:32 AM]: org.aio.a.cON.I(vb:136)
    [INFO][Bot #1][03/27 11:27:32 AM]: org.aio.a.a.COn.d(ab:67)
    [INFO][Bot #1][03/27 11:27:32 AM]: org.aio.a.a.COn.I(ab:181)
    [INFO][Bot #1][03/27 11:27:32 AM]: org.aio.script.AIO.onLoop(mc:274)
    [INFO][Bot #1][03/27 11:27:32 AM]: org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(df:126)
    [INFO][Bot #1][03/27 11:27:32 AM]: java.lang.Thread.run(Unknown Source)
    [INFO][Bot #1][03/27 11:27:35 AM]: Terminating script Explv's AIO...
    [INFO][Bot #1][03/27 11:27:35 AM]: Script Explv's AIO has exited!

     

  9. 2 hours ago, t0r3 said:

    Ok, so u mean one method for oaks, one for tree's and so on?

    chopOaks();

    chopTrees();

    Yeah that would be better down the line, adding willows and yews :)

    thanks!

    You could make a method Chop that takes 2 parameters a Location and a String for the tree name. Than you could reuse the function by just passing in the name of the tree and the location where it needs to be chopped. You could do this for your bank method as well, make a method getRightAxe() which returns a string (the name of your axe) than pass it in by parameter (bank method) or in the withdrawItem method itself. 

    This logic can be reused for allot of things it will make your code cleaner and save you some time typing. 

    Also every time you loop you set your int wcLvl again you could just get it once at onStart than every time you get a level (You see the widget or you read it from chat) you could update it to save some cpu time. 

  10. The bug when its standing on a brothers grave and does the prayer things seems to happpen when all brothers are dead and sometimes when one is allive. So far that i have seen it is when hes doing the tunnels and needs to emergency teleport out. When it comes back and it sees all the brothers are dead it does not know what to do and it will trow the nullpointer and just keeps changing the status while standing above a grave. 

×
×
  • Create New...