Jump to content
Parabot - Bot for Ikov, DreamScape, SoulPlay, RuneWild, and more
Sign in to follow this  
Empathy

EBarBuyer [Runique] [Open Source]

Recommended Posts

Hello Parabot,

Today I am releasing my Steel Bar buying script. It goes hand in hand with my API, so in order to compile it, you need to download my API, which can be located here:

Here is the script:

https://gist.github.com/KarimiM/a3e1fd7040d481990a91

 

Spoiler

 

package com.runique.misc;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;

import org.parabot.environment.api.interfaces.Paintable;
import org.parabot.environment.api.utils.Time;
import org.parabot.environment.api.utils.Timer;
import org.parabot.environment.scripts.Category;
import org.parabot.environment.scripts.Script;
import org.parabot.environment.scripts.ScriptManifest;
import org.parabot.environment.scripts.framework.LoopTask;
import org.rev317.min.api.methods.Bank;
import org.rev317.min.api.methods.Game;
import org.rev317.min.api.methods.Inventory;
import org.rev317.min.api.methods.Menu;
import org.rev317.min.api.methods.Npcs;
import org.rev317.min.api.wrappers.Npc;

import com.runique.framework.Location;
import com.runique.framework.RuniqueObject;

@ScriptManifest(author = "Empathy", category = Category.UTILITY, description = "Buys steel bars.", name = "EBarBuyer", servers = { "Runique" }, version = 1.0)
public class SteelBarBuyer extends Script implements LoopTask, Paintable {

	int runes;
	Timer time = new Timer();
	final Location chest = new Location(3211, 3437);

	@SuppressWarnings("deprecation")
	@Override
	public int loop() {
		
		Npc n = Npcs.getClosest(6970);
		
		if (!Inventory.isEmpty()) {
			RuniqueObject.interact(0, 4483, RuniqueObject.getObject(chest));
			Time.sleep(() -> Bank.isOpen(), 7000);
			if (Bank.isOpen()) {
				Menu.sendAction(315, 253575168, 62, 5386);
				Time.sleep(() -> Inventory.isEmpty(), 5000);
				Menu.sendAction(200, 0, 0, 5384);
			}
		}

		if (n != null & Inventory.isEmpty() && Game.getOpenBackDialogId() == -1 && Game.getOpenInterfaceId() == -1) {
			System.out.println("Running to Pikkupstix");
			n.interact(2);
			Time.sleep(() -> Game.getOpenBackDialogId() != -1, 6000);
		}

		if (Game.getOpenBackDialogId() != -1) {
			System.out.println("Opening shop.");
			Menu.sendAction(315, 253575168, 360, 2462);
			Time.sleep(() -> Game.getOpenInterfaceId() != -1, 3000);
		}

		if (Game.getOpenInterfaceId() != -1) {
			Menu.sendAction(53, 2353, 11, 20703);
			Time.sleep(() -> !Inventory.isEmpty(), 3000);
			runes += 28;
		}

		return 250;
	}

	@Override
	public void paint(Graphics g1) {
		Graphics2D gr = (Graphics2D) g1;
		gr.setColor(Color.WHITE);
		gr.setFont(new Font("Verdana", 0, 12));
		gr.drawString("By: Empathy", 333, 120);
		gr.drawString("Runtime: " + time.toString(), 333, 100);
		gr.drawString("Runes:  " + runes + " (" + time.getPerHour(runes) + "/hr)", 333, 80);
		gr.drawRect(330, 6, 183, 130);
		Graphics2D rect = (Graphics2D) g1;
		rect.setColor(new Color(0, 0, 0, 120));
		rect.fillRect(330, 6, 183, 130);
	}
}

 

 

Regards,

Empathy

Edited by Empathy

Share this post


Link to post
Share on other sites
29 minutes ago, Breakage said:

How can I get this working with parabot client?

You need to get the setup his API first then you can add the script by following my tutorial which is found below:

 

Share this post


Link to post
Share on other sites
6 hours ago, myturtles said:

You need to get the setup his API first then you can add the script by following my tutorial which is found below:

 

so I use the Java files as source files and then use parabot as the jar file and it'll make the Api?

Share this post


Link to post
Share on other sites
4 minutes ago, bradbailey21 said:

so I use the Java files as source files and then use parabot as the jar file and it'll make the Api?

ok so you compile the api like you would a script and just place it in the server folder

Share this post


Link to post
Share on other sites
On 2/19/2016 at 10:27 PM, Empathy said:

Hello Parabot,

Today I am releasing my Steel Bar buying script. It goes hand in hand with my API, so in order to compile it, you need to download my API, which can be located here:

Here is the script:

https://gist.github.com/KarimiM/a3e1fd7040d481990a91

 

Hidden Content

 

Regards,

Empathy

ignore this :P
Edited by myturtles

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

Sign in to follow this  

×
×
  • Create New...