Jump to content

Salvite's Free Experiments Farmer


salvite

Recommended Posts

HELLO EVERYONE!!!
This is my first post on this forum and I hope everyone enjoys this release.
 
I just spent ~2 hrs making a super simple Experiment farmer (mostly b/c eFighter is currently broken)
 
Just go into the area and run the script, auto looks for the closest experiment, checks to see if other people are attacking it already, displays exp gained (no i didnt add an exp/hr as i wanted this to be super lightweight and working as fast as i could)
 
Includes a basic anti-ban script while you are attacking an experiment.

 

If you would like me to develop this further, please donate using the link in my signature (this script will always be free so if you ever paid any money for this demand a refund immediately)
 
here is the .jar file link:
 
http://www.filedropper.com/freeexperiments

 

here is the code in case you want to comment:

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.net.URL;

import javax.imageio.ImageIO;

import org.osbot.rs07.api.Combat;
import org.osbot.rs07.api.filter.Filter;
import org.osbot.rs07.api.filter.IdFilter;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import static org.osbot.rs07.api.ui.Skill.ATTACK;
import static org.osbot.rs07.api.ui.Skill.STRENGTH;
import static org.osbot.rs07.api.ui.Skill.DEFENCE;
import static org.osbot.rs07.api.ui.Skill.RANGED;
import static org.osbot.rs07.api.ui.Skill.MAGIC;
import static org.osbot.rs07.api.ui.Skill.HITPOINTS;

@ScriptManifest(name = "FreeExperiments", author = "Salvite", version = 1.0D, info = "Forever free experiment killer.", logo = "")
public class Experiments extends Script {

	/*
	 * Variables
	 */

	private long startTime;
	private int attackStart;
	private int strengthStart;
	private int defenseStart;
	private int rangedStart;
	private int magicStart;
	private int hitpointsStart;

	/*
	 * Inherited Methods
	 */

	// Called at start
	public void onStart() {
		try {
			startTime = System.currentTimeMillis();
			attackStart = getSkills().getExperience(ATTACK);
			strengthStart = getSkills().getExperience(STRENGTH);
			defenseStart = getSkills().getExperience(DEFENCE);
			rangedStart = getSkills().getExperience(RANGED);
			magicStart = getSkills().getExperience(MAGIC);
			hitpointsStart = getSkills().getExperience(HITPOINTS);
		} catch (Exception e) {
			// Catch
		}
	}

	// Called more than once.
	public int onLoop() {
		try {
			if(!getCombat().isFighting())
			{
				@SuppressWarnings("unchecked")
				NPC npcToAttack = getNpcs().closest(
						new Filter<NPC>(){

							@Override
							public boolean match(NPC npc) {

								if(npc.getId() == 1275 || npc.getId() == 1274)
								{
									return npc != null && !npc.isUnderAttack() && npc.isAttackable() && npc.getHealthPercent() != 0;
								}
								
								return false;
							}
						});
				
				npcToAttack.interact("Attack");
			}
			else
			{
				this.antiBan();
			}
			
		} catch (Exception e) {
			// Catch
		}
		return 1;
	}

	// Called at script stop
	public void onExit() {

	}
	

    public void antiBan() throws InterruptedException {
        if (random(0, 50) == 1) {
            switch (random(0, 6)) {
                case 0:
                    this.camera.movePitch(gRandom(20, 60));
                    this.log("Antiban: 0");
                    break;
                case 1:
                    this.getTabs().getSkills().open();
                    this.getSkills().hoverSkill(ATTACK);
                    this.log("Antiban: 1");
                    sleep(random(1111, 2777));
                    break;
                case 2:
                    this.camera.moveYaw(110 + random(25, 80));
                    this.log("Antiban: 2");
                    break;
                case 3:
                    this.camera.moveYaw(random(1, 359));
                    this.log("Antiban: 3");
                    break;
                case 4:
                    this.getMouse().moveOutsideScreen();
                    sleep(random(3333, 5473));
                    this.log("Antiban: 4");
                    break;
                case 5:
                    this.mouse.moveRandomly();
                    this.log("Antiban: 5");
                    break;
                case 6:
                    this.log("Antiban: 6");
                    switch (random(1, 7)) {
                        case 1:
                            this.getTabs().open(Tab.ATTACK);
                            break;
                        case 2:
                            this.getTabs().open(Tab.QUEST);
                            break;
                        case 3:
                            this.getTabs().open(Tab.EQUIPMENT);
                            break;
                        case 4:
                            this.getTabs().open(Tab.PRAYER);
                            break;
                        case 5:
                            this.getTabs().open(Tab.MAGIC);
                            break;
                        case 6:
                            this.getTabs().open(Tab.FRIENDS);
                            break;
                        case 7:
                            this.getTabs().open(Tab.SETTINGS);
                            break;

                    }
            }
        }
    }

	// Called more than once, even during pause.
	public void onPaint(Graphics2D g) {
		g.setColor(Color.WHITE);
		g.setFont(new Font("Arial", Font.PLAIN, 10));
		g.drawString("Attack EXP	: " + (getSkills().getExperience(ATTACK) - attackStart), 25, 50);
		g.drawString("Strength EXP	: " + (getSkills().getExperience(STRENGTH) - strengthStart), 25, 60);
		g.drawString("Defense EXP	: " + (getSkills().getExperience(DEFENCE) - defenseStart), 25, 70);
		g.drawString("Ranged EXP	: " + (getSkills().getExperience(RANGED) - rangedStart), 25, 80);
		g.drawString("Magic EXP		: " + (getSkills().getExperience(MAGIC) - magicStart), 25, 90);
		g.drawString("Hitpoints EXP	: " + (getSkills().getExperience(HITPOINTS) - hitpointsStart), 25, 100);
		
		int totalExpGain = (getSkills().getExperience(ATTACK) - attackStart)
				+ (getSkills().getExperience(STRENGTH) - strengthStart)
				+ (getSkills().getExperience(DEFENCE) - defenseStart)
				+ (getSkills().getExperience(RANGED) - rangedStart)
				+ (getSkills().getExperience(MAGIC) - magicStart)
				+ (getSkills().getExperience(HITPOINTS) - hitpointsStart);

		g.drawString("Total EXP		: " + totalExpGain, 25, 110);
		
		//double hoursElapsed = (System.currentTimeMillis() - startTime ) / 3600000.0;
		//g.drawString("Hours elapsed : " + hoursElapsed, 25, 120);
	}

	/*
	 * Non-Inherited Methods
	 */
	
	//Non-Inherited methods go here.

	/*
	 * Useful Methods
	 */

	//XP for level
	public int getXPForLevel(int level) {
		int points = 0;
		int output = 0;
		for (int lvl = 1; lvl <= level; lvl++) {
			points += Math.floor((double) lvl + 300.0
					* Math.pow(2.0, (double) lvl / 7.0));
			if (lvl >= level)
				return output;
			output = (int) Math.floor(points / 4);
		}
		return 0;
	}
	
	

}
  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...