Jump to content

Twin

Members
  • Posts

    1334
  • Joined

  • Last visited

  • Feedback

    100%

Posts posted by Twin

  1. This script never went anywhere, and not going to release something only 5 people can use at a time.

     

    Code is really sloppy, and I wrote it a while ago, but maybe someone will find use out of it, as it works and it covers a few elements. World hopping, buying from a store, interface interaction, and interacting with an object in your inventory, then having that interact with an object.

     

    Main class

    import org.osbot.rs07.api.Store;
    import org.osbot.rs07.api.filter.Filter;
    import org.osbot.rs07.api.map.Position;
    import org.osbot.rs07.api.model.Entity;
    import org.osbot.rs07.api.model.NPC;
    import org.osbot.rs07.api.ui.Message;
    import org.osbot.rs07.api.ui.RS2Widget;
    import org.osbot.rs07.api.ui.Skill;
    import org.osbot.rs07.api.ui.World;
    import org.osbot.rs07.api.util.GraphicUtilities;
    import org.osbot.rs07.script.Script;
    import org.osbot.rs07.script.ScriptManifest;
    import org.osbot.rs07.utility.Area;
    import org.osbot.rs07.api.Worlds;
    
    import java.util.Random;
    import java.util.concurrent.TimeUnit;
    
    import org.osbot.rs07.api.ui.World;
    
    import Timer.Timer;
    
    import java.awt.*;
    
    @ScriptManifest(author = "Twin 763", info = "Karamja Knife Maker", name = "Twins Karamja Knives", version = 1, logo = "")
    public class BronzeBuyer extends Script {
    	private Timer animationTimer;
    	private int currentLevel;
    	private int beginningLevel;
    	private int levelsGained;
    	private int beginningXP;
    	private int currentXp;
    	private int xpGained;
    	private Position posToOutline = new Position(0, 0, 0);
    	private int gp;
    	private int knivesMade;
    	@Override
    	public void onStart() {
    	
    		animationTimer = new Timer(0L);
    		timeBegan = System.currentTimeMillis();
    		beginningLevel = skills.getStatic(Skill.SMITHING);
    		beginningXP = skills.getExperience(Skill.SMITHING);
    	}
    	private long timeBegan;
    	private long timeRan;
    
    	Position[] pathToPaint = new Position[] {};
    	Position[] toSmith = { new Position(2765, 3124, 0),
    			new Position(2768, 3120, 0), new Position(2771, 3116, 0),
    			new Position(2774, 3112, 0), new Position(2778, 3109, 0),
    			new Position(2782, 3106, 0), new Position(2787, 3104, 0),
    			new Position(2792, 3102, 0) };
    
    	Position[] leaveSmith = { new Position(2793, 3099, 0),
    			new Position(2788, 3101, 0), new Position(2785, 3105, 0),
    			new Position(2781, 3108, 0), new Position(2777, 3112, 0),
    			new Position(2773, 3115, 0), new Position(2769, 3118, 0),
    			new Position(2765, 3121, 0) };
    
    	Area GENERALSTORE = new Area(2761, 3117, 2772, 3126);
    	Area SMITH = new Area(2794, 3106, 2786, 3096);
    	
    	private enum State {
    		SMITH, BUY, WALKTOANVIL, WALKTOSTORE, WAIT
    	};
    
    	private State getState() {
    		Entity anvil = objects.closest("Anvil");
    		NPC jim = npcs.closest("Jiminua");
    		if (anvil != null && inventory.contains("Bronze bar")
    				&& SMITH.contains(myPlayer())
    				&& needToResume(4000L, animationTimer)
    				&& !myPlayer().isAnimating())
    			return State.SMITH;
    		if (!inventory.isFull() && GENERALSTORE.contains(myPlayer())
    				&& jim != null)
    			return State.BUY;
    		if (inventory.isFull() && !SMITH.contains(myPlayer()))
    			return State.WALKTOANVIL;
    		if (!inventory.contains("Bronze bar")
    				&& !GENERALSTORE.contains(myPlayer()))
    			return State.WALKTOSTORE;
    		return State.WAIT;
    	}
    
    	@Override
    	public int onLoop() throws InterruptedException {
    		switch (getState()) {
    		case SMITH:
    			Entity anvil = objects.closest("Anvil");
    			RS2Widget k = widgets.get(312, 24, 2);
    			if (anvil != null) {
    				inventory.interact("Use", "Bronze bar");
    				sleep(random(500, 1000));
    			}
    			if (inventory.isItemSelected() == true) {
    				anvil.interact("Use");
    				sleep(random(500, 1000));
    			}
    			if (k != null && k.isVisible() && !myPlayer().isAnimating()) {
    				k.interact("Smith X Sets");
    				sleep(random(500, 1000));
    				keyboard.typeString("" + random(28, 100000));
    				sleep(random(1000, 1500));
    			}
    			break;
    		case BUY:
    			NPC jim = npcs.closest("Jiminua");
    			if (jim != null) {
    				jim.interact("Trade");
    				sleep(random(2000, 2500));
    				store.buy(2349, 10);
    				sleep(random(500, 1000));
    			}
    			if (store.getAmount("Bronze bar") == 0)
    			{
    			
    				  worlds.hopToP2PWorld();
    				  	break;
    			}
    			if (inventory.isFull())
    				break;
    		case WAIT:
    			sleep(random(500, 700));
    			break;
    		case WALKTOANVIL:
    			if (!SMITH.contains(myPlayer()))
    				localWalker.walkPath(toSmith);
    			if (SMITH.contains(myPlayer()))
    				break;
    		case WALKTOSTORE:
    			if (!GENERALSTORE.contains(myPlayer())&&!inventory.contains("Bronze bar"))
    				localWalker.walkPath(leaveSmith);
    			if (GENERALSTORE.contains(myPlayer()))
    				break;
    		default:
    			break;
    		}
    		return random(200, 300);
    	}
    
    	@Override
    	public void onExit() {
    		
    	}
    	@Override
    	public void onMessage(Message message) throws InterruptedException
    	{
    	if(message.getMessage().toString().contains("You hammer the bronze"))
    	{
    	
    		knivesMade++;
    		knivesMade++;
    		knivesMade++;
    		knivesMade++;
    		knivesMade++;
    	}
    	}
    	@Override
    	public void onPaint(Graphics2D g) 
    	{
    		Graphics2D gr = g;
    		
    		currentLevel = skills.getStatic(Skill.SMITHING);
    		levelsGained = currentLevel - beginningLevel;
    		g.drawString("Starting level " + beginningLevel + " / Current Level "
    				+ currentLevel + " ( +" + levelsGained + " )", 40, 290);
    		timeRan = System.currentTimeMillis() - this.timeBegan;
    		g.drawString(ft(timeRan), 40, 230);
    		currentXp = skills.getExperience(Skill.SMITHING);
    		xpGained = currentXp - beginningXP;
    		gp = knivesMade*44;
    		g.drawString("Money made "+gp,40,250);
    		g.drawString("Experience gained " + xpGained, 40, 310);
    		g.drawString("Bronze knives made "+knivesMade,40,270);
    		if (posToOutline != null)
    			drawTileIngame(this, g, posToOutline, Color.WHITE);
    		if (pathToPaint != null)
    			for (Position p : pathToPaint) {
    				drawMinimapPosition(this, g, p, Color.ORANGE, true);
    			}
    		g.setColor(Color.green);
    		g.fillRect((int) getMouse().getPosition().getX() - 5, (int) getMouse()
    		    .getPosition().getY(), 13, 3);
    		  g.fillRect((int) getMouse().getPosition().getX(), (int) getMouse()
    		    .getPosition().getY() - 5, 3, 13);
    	}
    
    	public void checkAnimationTimer(Timer timerToUpdate) {
    		if (this.myPlayer().isAnimating()) {
    			timerToUpdate.reset();
    		}
    	}
    
    	public boolean needToResume(long idleTimeout, Timer t) {
    		checkAnimationTimer(t);
    		if (t.getElapsed() >= idleTimeout)
    			return true;
    		else
    			return false;
    	}
    
    	
    	public void drawTileIngame(Script script, Graphics g, Position p,
    			Color positionColor) {
    		g.setColor(positionColor);
    		Polygon PosHighlight = p.getPolygon(script.getBot());
    		g.drawPolygon(PosHighlight);
    	}
    
    	private String ft(long duration) {
    		String res = "";
    		long days = TimeUnit.MILLISECONDS.toDays(duration);
    		long hours = TimeUnit.MILLISECONDS.toHours(duration)
    				- TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration));
    		long minutes = TimeUnit.MILLISECONDS.toMinutes(duration)
    				- TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS
    						.toHours(duration));
    		long seconds = TimeUnit.MILLISECONDS.toSeconds(duration)
    				- TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS
    						.toMinutes(duration));
    		
    		if (days == 0) {
    			res = (hours + ":" + minutes + ":" + seconds);
    		} else {
    			res = (days + ":" + hours + ":" + minutes + ":" + seconds);
    		}
    		return res;
    	}
    
    	public static void drawMinimapPosition(Script script, Graphics g,
    			Position p, Color positionColor, boolean fill) {
    		if (p != null) {
    			short[] minimapP = GraphicUtilities.getMinimapScreenCoordinate(
    					script.getBot(), p.getX(), p.getY());
    			if (minimapP[0] > 0) {
    				g.setColor(positionColor);
    				if (fill) {
    					g.fillRect(minimapP[0] - 2, minimapP[1] - 2, 4, 4);
    				} else {
    					g.drawRect(minimapP[0] - 2, minimapP[1] - 2, 4, 4);
    				}
    			}
    		}
    	}
    }
    
    

    Timer class(credit to apaec)

    package Timer;
    
    public class Timer
    {
    
        private long period;
        private long start;
     
        public Timer(long period)
        {
            this.period = period;
            start = System.currentTimeMillis();
        }
    
        public long getElapsed()
        {
            return System.currentTimeMillis() - start;
        }
    
        public long getRemaining()
        {
            return period - getElapsed();
        }
    
        public boolean isRunning()
        {
            return getElapsed() <= period;
        }
    
        public void reset()
        {
            start = System.currentTimeMillis();
        }
        
        public void stop()
        {
            period = 0;
        }
    
        public static String format(long milliSeconds)
        {
            long secs = milliSeconds / 1000L;
            return String.format("%02d:%02d:%02d", new Object[] {
                Long.valueOf(secs / 3600L), Long.valueOf((secs % 3600L) / 60L), Long.valueOf(secs % 60L)
            });
        }
    }
    

     

    I will not compile this for anyone, or send you the local version, you can do that yourself if you want to use it.

    • Like 1
  2. pushing the update tonight! all that will be left to add is setting back up your gear if you get killed, and making looting bags more reliable.

     

    What i'd recommend is using a 60/60/40 account for optimal farming. a DDs, rune plate legs, glory, then a anti dragon shield, then whatever plate body you want, same for helm. So like, addy plate and hlem, just something cheap.

     

    Pushed.

     

    If you don't have a trial and would like one, reply to this comment.

     

    Update is pushed, let me know how it runs!

  3. if your teleblocked your going to die no matter what anyway so its all good i dont expect the bot to kill a player lol if it gets teleblocked just try to get it to run south and thats it

     

    Alright, then  my last thing to really add is a regearing option. Might take me a bit to get it all figured out but it shouldn't be to bad.

    • Like 1
  4. Hmm is there a way to detect people wearing a specific set of clothes? Or like... Not rune? What about when it senses it being teleblocked it runs south or tries to while eating? After any attack hop world's?

     

    It already does world hop after it gets into the safezone if it manages to get away. And no, I don't think it's possible to see what people are wearing. I was going to get combat levels of all the nearest players, and if one is your level then run, but then if another bot comes along to farm them, it will just tele away.

     

    Because currently, that's the only issue, and i'm not sure if there's much I can do about it, other than that, I just need to fix the looting bag and add in waiting for the loot when the dragon dies, instead of instantly finding another one to kill.

     

    West dragons are working great, i've been running it for about 30 minutes now and no issues, just need to see how it's going to handle changing out glorys.

  5. So there is really nothing I can do against people who use teleblock. Ancients is easy, the second you get frozen the bot just teleports away. With teleblock, you can't move and you can't teleport, so they bot can only sit there until it dies. I'm not really to sure what to do about that either.. :/

     

    What I can do is have the bot regear at lumbridge, then teleport back to it's area, so essentially you'll just three item it. Weapon, rune chain, rune legs, then either switch one of those out for a glory, use a shitty counterpart, or you'll have a varrock tab instead.

  6. Okay guys, no obligations today. I'm getting this done and 100% working today. I have an accounnt, I have like 14 hours to do nothing but program. So far i've changed around the states(the wait it looks at things to happen in order) and that has done wonders for stability. I may not need to rewrite as much as I thought. Lootingbags are going to be the only issue.

  7. So a monopoly is not allowed, no matter how good the product/service may be? Not in the sense that one developer will be behind it, taking all the income.

    Comsumers should be able to decide what they want to buy, without quality being a concern, if it's possible to do so, which in this case, it is.

    Rules like this only slow down the progress of the community, as developers are not forced to innovate, leaving programmers to keep doing the ordinary. We won't get very far that way.

    No offense to the rules set in place (would be nice if there was a place to reference them), I understand their intentions, but I think the majority of the community would much prefer a community moving at a fast pace. I can't speak for them, but some kind of poll would allow them to decide.

    Everyone fights everything and nothing gets done. Plus, if you make good scripts, you'll get more sales because people know you put out quality content. It's not as bad as you're making it out.

  8. Would I be able to pay a scripter to give me a 1 to 1 tutoring session on the OSBot API and IntelliJ, helping me learn how to create my own scripts. I would like to reiterate that I am not paying them to make me a private script, but learn how to make my own. 

     

    How much do you know about java? I don't think many people are willing to coach you through the entire learning phases of java. The api is one thing, but to teach the basics of java would be annoying.

  9. Sorry everyone, i've been really lazy with scripting. I'm going to try and get the motivation to fix this all up tomorrow but I literally have to rewrite a huge chunk of it. I know what's wrong with it, i'm just being lazy about fixing it. :/ i'll try my best to get everything done tomorrow, or at least a huge chunk of it.

  10. Ok, So I started a brand new account on my new laptop to test out this Mirror mode, I've had my laptop around 2 weeks I have OSbot and OSbuddy (for my main) I Haven't ever botted my main and have all my cash

     

     

    On my pure I have Recently used MysteryAgility for 35 Agility (yesterday) and ApaAlcher (today) .. Not for extended periods, Im not banned Etc no message from JaGeX and when I spoke on forums they said I was accessed by a 3rd party, Upon checking my G.E history my pure's alch's were sold for 74m, So Im guessing it's one of these two script's could have been corrupted or that the account manager has been leaked? 

    I don't think either apaec or mysteryy are willing to risk their careers on osbot for 140 dollars

     

  11. Hey dude few problems with the script,

    When banking it doesnt take the varrock tab,

    When going to dragons it gets stuck befor the ditch and it wont go over soon as i click on it and go over it takes off and its away but its just the ditch

     

    maybe support games necklace and duelling ring

    im going to try wests soon aswell

    other than that its wicked bro tbh but yeah thanks man hope this feedback helps out

     

    I'm rewriting banking entirely today, after getting an account to test it myself, it's really really sloppy. And yeah I know of that issue for east dragons, that's an easy fix. I have a better idea for banking that should make it a lot smoother and not as cluttered. Thanks for the feedback :)

    doesn't work for me

    i can't add it to scripts :L

    It's still in the testing phase, I can add you to the list, but it's incredibly buggy right now. West dragons work fine, but it has an issue withdrawing antifire potions. I'm going to rewrite banking today, and that should fix a lot of issues.

    • Like 1
  12. 800k right now


     

    1. Pictures of the account stats  

    http://oi60.tinypic.com/2n0ikxv.jpg

        2. Pictures of the login details

    http://oi62.tinypic.com/2w5jfc5.jpg

        3. Pictures of the total wealth (if there is any)

    maybe 4k...

        4. Pictures of the quests completed

    no quests

        5. The price you will be starting bids at: 400k 07

        6. The A/W (Auto-win) for your account: 1m 07

        7. The methods of payment you are accepting: 07 gp, paypal (trusted only)

        8. Your trading conditions: You go first or we will find a MM we both agree on (on your cost)

        9. Account status: 

    http://oi61.tinypic.com/2mo1ppz.jpg

       10. Original/previous owners AND Original Email Address

    email not registered 

    I'm original owner

     

     

  13. east dragons. its leaving teletabs after the third/fourth trip, trying to eat while banking and gets stuck trying to tele in 20+ wild. gonna try west dragons

     

     

    That has to be mirrormode issues, I never got any of that, I tested using standard mode. I'll look at it though.

  14. have 3 bots running one got stuck at ditch earlier but running normal now

    East dragons or west? I think I had it get stuck once at easy dragons but I fixed it manually and didn't have the issue again.

    Super exited for when this comes out! smile.png

    *edit Can I test this for you? I could post some progress if you'd like

    Yeah I'll get you in a second.

×
×
  • Create New...