i wub turkey
2012-02-02 16:59:18
How Long have You Played Runescape?
8 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, C, C++
Are you a member of any other communities?
If this is asking about botting sites, runedream
Tell us about yourself…
Please show us one (or multiple) of your scripts.
Nightshade - its about done just got to add potion support for summoning
8 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, C, C++
Are you a member of any other communities?
If this is asking about botting sites, runedream
Tell us about yourself…
From: i wub turkey
I am Stan
I am 17
I Loveeeee animals
My interests career wise is to become a gaming programmer
Oh yea, i live up in canada :p
Please show us one (or multiple) of your scripts.
Nightshade - its about done just got to add potion support for summoning
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import javax.imageio.ImageIO;
import org.runedream.api.Script;
import org.runedream.api.ScriptManifest;
import org.runedream.api.methods.Camera;
import org.runedream.api.methods.Game;
import org.runedream.api.methods.ImageUtil;
import org.runedream.api.methods.Inventory;
import org.runedream.api.methods.Mouse;
import org.runedream.api.util.Log;
import org.runedream.api.util.Random;
@ScriptManifest(
authors = { "Iwubturkey"},
name = "NightShade",
version = 0.4,
description = "Picks up nightshade at the skavid caves.",
keywords = {},
language = { true, true, true, true })
public class NightShade extends Script{
//Color codes and distances for item detection
private static final Color petalFloor = new Color(76,68,78);
private static final Color leafFloor = new Color(46,67,37);
private static final Point distNSFloor = new Point(-9, 15);
private static final Color petalInv = new Color(77,106,54);
private static final Color leafInv = new Color(107,95,110);
private static final Point distNSInv = new Point(-18, -15);
private static final Color pouch1 = new Color(100,84,66);
private static final Color pouch2 = new Color(173,169,150);
private static final Point distPouch = new Point(-16, -15);
private static final Color summonAct = new Color(115,189,160);
private static final Point summonActLoc = new Point(714,151);
//Class variables
private static int PICKED_UP = 0;
private static int BANKED = 0;
private static double TIME = 0;
public boolean onStart(){
Mouse.setSpeed(Random.random(7, 11));
TIME = System.currentTimeMillis();
Game.clickCompass();
Camera.pitchUp(1000);
if (!Game.getOpenTab().equals("Inventory")) {
Mouse.click(Random.random(642, 670), Random.random(170, 200)); //returns to inventory tab
}
return true;
}
public int loop() {
Point pt = null;
//checks if you currently have a familiar summoned
//Will resummon if you don't, and will log out if you don't have any pouches.
if(!checkColor(summonAct, summonActLoc)){
if((pt = findItem(pouch1, pouch2, distPouch)).equals(new Point(-1,-1))){
int x = pt.x;
int y = pt.y;
Mouse.click(x,y);
sleep(Random.random(500,700));
Mouse.click(x, y + Random.random(38,50));
sleep(Random.random(500,700));
}else{
logOut();
Log.log("Out of pouches. Logging out...");
return -1;
}
}
//picks up everything on the ground.
//loops incase there is more than one on the ground.
while(!(pt = findItem(petalFloor, leafFloor, distNSFloor)).equals(new Point(-1,-1))){
int x = pt.x;
int y = pt.y;
Mouse.click(x,y);
sleep(Random.random(500,700));
Mouse.click(x, y + Random.random(21,32));
sleep(Random.random(500,700));
}
//stores it.
//Loops through incase it picked up more than one.
while(!(pt = findItem(petalInv, leafInv, distNSInv)).equals(new Point(-1,-1))){
int x = Random.random(698,715);
int y = Random.random(135,153);
Mouse.click(x,y);
sleep(Random.random(500,700));
Mouse.click(x, y + Random.random(21,32));
sleep(Random.random(500,700));
Mouse.click(pt);
sleep(Random.random(500,700));
Mouse.click(pt.x, pt.y + Random.random(21,32));
sleep(Random.random(500,1000));
BANKED++;
}
//Still needs to add potion support and to check if there are scrolls left to use.
return 1000;
}
//The very simple paint.
public void onRepaint(Graphics g){
Image NSPic = null;
try {
NSPic = ImageIO.read(new URL("http://i1024.photobucket.com/albums/y308/dudebrosick/Cave_nightshade_detail-1.png"));
} catch (IOException e) {
}
g.setColor(new Color(203,186,153));
g.fillRect(7,345,505,128);
g.setColor(Color.BLACK);
g.drawString("Time Running : " + getTime(System.currentTimeMillis() - TIME), 11, 360);
g.drawString("Total picked up: " + PICKED_UP ,11,380);
g.drawString("Total banked: " + BANKED ,11,400);
g.drawString("Banked/Hour: " + (int)(BANKED/(3600000*(System.currentTimeMillis() - TIME))),11,420);
g.setFont(new Font("Salaryman", 1, 25));
g.drawString("Version Beta 0.4",220,380);
g.drawImage(NSPic, 220, 370, null, null);
g.drawString("Version Beta 0.4",220,380);
g.drawString("BatShade",220,440);
}
/**
* This is a time display method from jaanu22
*
* @param millis
* - Give it the current counter time in milliseconds.
* @return
* - Returns the time in a more readable format
*/
private static String getTime(double millis){
double time = millis / 1000;
String seconds = Integer.toString((int) (time % 60));
String minutes = Integer.toString((int) ((time % 3600) / 60));
String hours = Integer.toString((int) (time / 3600));
for (int i = 0; i < 2; i++)
{
if (seconds.length() < 2)
{
seconds = "0" + seconds;
}
if (minutes.length() < 2)
{
minutes = "0" + minutes;
}
if (hours.length() < 2)
{
hours = "0" + hours;
}
}
return hours + ":" + minutes + ":" + seconds;
}
/**
* Return the center point between two points of color, indicating where the desire object is.
* Returns (-1,-1) if the point is not found.
*
* @param col1
* - The color value of a point on object.
* @param col2
* - The color value of a point on object.
* @param p
* - the distance x and y between the two points of color.
* @return
*/
private Point findItem(Color col1, Color col2, Point p){
Point out = new Point(0,0);
List<Point> test1 = ImageUtil.getPointsWithColor(Game.getImage(), col1,.05);
List<Point> test2 = ImageUtil.getPointsWithColor(Game.getImage(), col2,.05);
boolean pointFound = false;
for(int i = 0;i < test1.size();i++){
for(int j = 0;j < test2.size();j++){
if(test1.get(i).x - test2.get(j).x == p.x){
if(test1.get(i).y - test2.get(j).y == p.y){
out = new Point((int)((test1.get(i).x + test2.get(j).x)/2),
(int)((test1.get(i).y + test2.get(j).y)/2));
pointFound = true;
}
}
}
}
if(pointFound)return out;
else return new Point(-1,-1);
}
/**
* Returns whether the given point is a certain color.
* Accounts for the variable colors that runescape produces whenever you log in.
* @param col
* - Color to check for.
* @param p
* - Point to check at.
* @return
*/
private boolean checkColor(Color col, Point p){
List<Point> test = ImageUtil.getPointsWithColor(Game.getImage(), col,.05);
for(int i = 0; i < test.size(); i++){
if(test.get(i).x == p.x && test.get(i).y == p.y){
return true;
}
}
return false;
}
/**
* Logs you out.
*/
private void logOut(){
Mouse.click(Random.random(758,784),Random.random(4,15));
sleep(Random.random(500,700));
Mouse.click(Random.random(576,708),Random.random(355,372));
sleep(Random.random(500,700));
}
public void onStop(){
Log.log("Thanks for using NightShade!");
Log.log("Total runtime of: " + getTime(System.currentTimeMillis() - TIME));
Log.log("You collected a total of " + BANKED + " nightshade!");
}
}