Ayrtoo
2009-09-09 08:43:34
How Long have You Played Runescape?
6 Year(s)
Are you affilated in anyway with Jagex LTD?
no
Were you Referred to SRL?
What is your general programming knowledge?
Basic Java and c++
Are you a member of any other communities?
sythe,rsbot,rscheater
Tell us about yourself…
Please show us one (or multiple) of your scripts.
6 Year(s)
Are you affilated in anyway with Jagex LTD?
no
Were you Referred to SRL?
What is your general programming knowledge?
Basic Java and c++
Are you a member of any other communities?
sythe,rsbot,rscheater
Tell us about yourself…
From: Ayrtoo
Im Ayrton im 14 and im interested in gaming and potential programming
Please show us one (or multiple) of your scripts.
*A rsbot script.
import java.awt.*;
import java.util.Map;
import com.speljohan.rsbot.bot.Bot;
import com.speljohan.rsbot.event.events.ServerMessageEvent;
import com.speljohan.rsbot.event.listeners.PaintListener;
import com.speljohan.rsbot.event.listeners.ServerMessageListener;
import com.speljohan.rsbot.script.Constants;
import com.speljohan.rsbot.script.Script;
import com.speljohan.rsbot.script.wrappers.*;
import com.speljohan.rsbot.script.ScriptManifest;
import com.speljohan.rsbot.util.ScreenshotUtil;
@ScriptManifest(authors = { "Ayrtoo" }, category = "Magic", name = "Dummy", version = 1)
public class Dummy extends Script implements ServerMessageListener, PaintListener {
public int randomcast1 = random(0, 20)+50;
public int Casts = 0;
public int[] runes = {559,566,4698,555,557};
public int[] staff = {6563,6562,1383,1403,1395,1385,1407,1399};
public int antibanCasts = 0;
public int Spell;
public String SpellUsing;
public int startXP = skills.getCurrentSkillExp(STAT_MAGIC);
public int castxp = 0;
public int gainedXP = 0;
public int startLevel = skills.getCurrentSkillLevel(STAT_MAGIC);
public long startTime;
public String spellChosen;
public String useantiban;
public String Check;
private int Useantiban;
private int checkMlvl;
public boolean b_spellChosen = false;
public int castAmount;
private boolean norunes = false;
private int startxp;
public int runecount = 0;
public int startlvl = 0;
private int checklvl = 0;
Color BG = new Color(0, 0, 0, 100);
RSTile[] death = {new RSTile(3233, 3227), new RSTile(3222, 3241), new RSTile(3211, 3252)};
private int Death = 1;
public void onRepaint(Graphics g) {
if (isLoggedIn()) {
long millis = System.currentTimeMillis() - startTime;
long hours = millis / (1000 * 60 * 60);
millis -= hours * (1000 * 60 * 60);
long minutes = millis / (1000 * 60);
millis -= minutes * (1000 * 60);
long seconds = millis / 1000;
int LevelChange = skills.getCurrentSkillLevel(STAT_MAGIC) - startlvl;
int XPChange = skills.getCurrentSkillExp(STAT_MAGIC) - startxp;
float XPperSec = 0;
if ((minutes > 0 || hours > 0 || seconds > 0) && XPChange > 0) {
XPperSec = ((float) XPChange)/(float)(seconds + (minutes*60) + (hours*60*60));
}
float XPperMin = XPperSec*60;
float XPperHour = XPperMin*60;
float timeTillLvl = 9999;
float secsTillLvl = (int) timeTillLvl;
float minsTillLvl = (int) timeTillLvl;
float hoursTillLvl = (int) timeTillLvl;
if (XPperSec > 0) {
secsTillLvl = skills.getXPToNextLevel(STAT_MAGIC)/XPperSec ;
}
if (XPperMin > 0) {
minsTillLvl = skills.getXPToNextLevel(STAT_MAGIC)/XPperMin ;
}
if (XPperHour > 0) {
hoursTillLvl = skills.getXPToNextLevel(STAT_MAGIC)/XPperHour ;
}
secsTillLvl -= (int) minsTillLvl*60;
minsTillLvl -= (int) hoursTillLvl*60;
if (minsTillLvl < 0) minsTillLvl = 0;
g.setColor(BG);
g.fill3DRect(12, 222, 184, 111, true);
g.setColor(Color.white);
g.drawString("Runtime: " + hours + "h " + minutes
+ "m " + seconds + "s.", 15, 234);
g.drawString("Spell Using: " + SpellUsing, 15, 246);
g.drawString("Casts: " + Casts, 15, 258);
g.drawString("Magic levels gained: " +LevelChange, 15, 270);
g.drawString("Magic EXP gained: " +(skills.getCurrentSkillExp(STAT_MAGIC) - startxp), 15, 282);
g.drawString("EXP per hour: " +(int)XPperHour, 15, 294);
g.drawString("Casts per hour: " +((int)XPperHour / castxp), 15, 306);
g.drawString("XP until level: " + skills.getXPToNextLevel(STAT_MAGIC), 15, 318);
g.drawString(skills.getPercentToNextLevel(Constants.STAT_MAGIC) + "%", 15, 330);
int barsize = 100;
int barheight = 8;
int percentage = skills.getPercentToNextLevel(Constants.STAT_MAGIC);
int transparancy = 160;
int xBar = 45;
int yBar = 321;
// BACKGROUND
g.setColor(new Color(255, 0, 0, transparancy));
g.fillRect(xBar, yBar, barsize, barheight);
// PERCENTAGE
g.setColor(new Color(0, 255, 0, transparancy));
g.fillRect(xBar, yBar, barsize/100*percentage, barheight);
// BORDER
g.setColor(new Color(255, 255, 255, transparancy));
g.drawRect(xBar, yBar, barsize, barheight);
}
}
public void serverMessageRecieved(ServerMessageEvent e) {
if (e.getMessage().contains("You do not have enough")) {
norunes = true;
}
if (e.getMessage().contains("Magic level! You have")) {
checklvl = 1;
}
if (e.getMessage().contains("dead")) {
Death= 1;
}
}
private void Walkpath(RSTile[] path) {
if(!getMyPlayer().isMoving() || distanceTo(getDestination()) <= random(7, 10))
{
walkPathMM(randomizePath(path, 2, 2), 17);
return;
} else antiBan();
}
public void Pickup(int[] id) {
RSItemTile item = getGroundItemByID(25,id);
if (item != null){
if (goTo(item)){
if(getMyPlayer().isMoving())
{
return;
}
atTile(item,"Take");
}
}
return;
}
public boolean goTo(RSTile t){
return goTo(t,5);
}
public boolean goTo(RSTile t,int range) {
if (distanceTo(t) < range) return true;
if (distanceTo(t) < 13){
walkTileMM(t);
wait(random(500,1000));
return false;
}
while(true){
t = new RSTile( ((t.getX()+getMyPlayer().getLocation().getX())/2)+random(-1,1) , ((t.getY()+getMyPlayer().getLocation().getY())/2)+random(-1,1) ) ;
if (distanceTo(t) < 15){
walkTileMM(t);
wait(random(500,1000));
break;
}
}
return false;
}
public boolean isWalking() {
if (getMyPlayer().getAnimation() == 1) {
return true;
} else {
return false;
}
}
public boolean doingSpell() {
if (getMyPlayer().getAnimation() == 1164) {
wait(random(150, 200));
return true;
}
return false;
}
public boolean atSpellInterface(int spell, String actionContains) {
RSInterfaceChild i = RSInterface.getChildInterface(192, spell);
if (!i.isValid()) {
return false;
}
Rectangle pos = i.getArea();
if (pos.x == -1 || pos.y == -1 || pos.width == -1 || pos.height == -1) {
return false;
}
moveMouse((int) random(pos.getMinX(), pos.getMaxX()), (int) random(pos.getMinY(), pos.getMaxY()));
clickMouse(true);
return true;
}
public void Cast(int Spell) {
while (getCurrentTab() != TAB_MAGIC) {
openTab(TAB_MAGIC);
wait(random(50, 50));
}
while (!atSpellInterface(Spell, "Cast")) {
b_spellChosen = true;
}
}
public void attackNPC() {
if (!b_spellChosen) {
Cast(Spell);
}
//RSNPC Dummy = NPCbyID(4474);
RSNPC Dummy = getNearestFreeNPCByID(4474);
moveMouse(Dummy.getScreenLocation().x + random(-10, 10), Dummy.getScreenLocation().y + random(-10, 10));
clickMouse(true);
wait(random(200, 300));
if ((skills.getCurrentSkillExp(STAT_MAGIC) - startXP) > gainedXP) {
Casts++;
antibanCasts++;
gainedXP = (skills.getCurrentSkillExp(STAT_MAGIC) - startXP);
b_spellChosen = false;
wait(random(200, 300));
}
}
@Override
public String getScriptDescription() {
String html = "<html>";
html += "<head>";
html += "<style type=\"text/css\"> hr {color: white} p {margin-left: 20px}</style>";
html += "</head>";
html += "<body>";
html += "<center>";
//html += "<b><font size=\"4\" color=\"red\"> v" + getVersion() + "</font></b><br>";
html += "</center>";
html += "<center><table border=\"0\"><tr><td colspan=\"2\"><center><font size=\"4\"><b>:: Script Settings ::</b></font><BR><font size=\"2\" color=\"red\">Thanks to Aelin for this script setup screen!</font></center></td></tr><tr><td colspan=\"2\"><hr></td></tr><tr><td>";
html += "<center><table border=\"0\"><tr><td colspan=\"2\"><font size=\"4\" color=\"blue\">Start in Lumbridge dummyroom.<BR>" +
" </font></center></td></tr>";
html += "<tr><td><b>Spell : </b></td><td><center><select name=\"spell\">";
html += "<option>Confuse";
html += "<option>Weaken";
html += "<option>Curse";
html += "<option>Vulnerability";
html += "<option>Enfeeble";
html += "<option>Stun";
html += "</select></center></td></tr>";
html += "<tr><td><b>Use antiban? </b></td><td><center><select name=\"antiban\">";
html += "<option>Yes";
html += "<option>No";
html += "</select></center></td></tr>";
html += "<tr><td><b>Check magic lvl after leveled up? </b></td><td><center><select name=\"checklvl\">";
html += "<option>Yes";
html += "<option>No";
html += "</select></center></td></tr>";
html += "<tr><td><b>How many casts?</b><tr><td><center>";
html += "<input type=\"text\" name=\"amount\" value=\"1000\"></center><br>";
html += "<center><table border=\"0\"><tr><td colspan=\"2\"><font size=\"4\" color=\"blue\">Creditz go to:<BR>" +
"Wuppiet (Editing Script, Paint and Antiban)<BR>" +
"H0rn For Fixing For The New Update<BR>" +
"</font></center></td></tr>";
html += "</table>";
html += "</center></body>";
html += "</html>";
return html;
}
public boolean clickcontinue() {
if (getContinueChildInterface() != null) {
if (getContinueChildInterface().getText().contains("to continue")) {
return atInterface(getContinueChildInterface());
}
}
return false;
}
@Override
public boolean onStart(Map<String, String> args) {
startxp = skills.getCurrentSkillExp(STAT_MAGIC);
spellChosen = args.get("spell");
useantiban = args.get("antiban");
Check = args.get("checklvl");
castAmount = Integer.parseInt(args.get("amount"));
if (spellChosen.equals("Confuse")) {
Spell = 2;
castxp = 13;
SpellUsing = "Confuse";
} else if (spellChosen.equals("Weaken")) {
Spell = 7;
castxp = 21;
SpellUsing = "Weaken";
} else if (spellChosen.equals("Curse")) {
Spell = 11;
castxp = 29;
SpellUsing = "Curse";
} else if (spellChosen.equals("Vulnerability")) {
Spell = 50;
castxp = 76;
SpellUsing = "Vulnerability";
} else if (spellChosen.equals("Enfeeble")) {
Spell = 54;
castxp = 83;
SpellUsing = "Enfeeble";
} else if (spellChosen.equals("Stun")) {
Spell = 57;
castxp = 90;
SpellUsing = "Stun";
} else {
return false;
}
if (useantiban.equals("Yes")){
Useantiban = 1;
}
else if (useantiban.equals("No")){
Useantiban = 0;
}
if (Check.equals("Yes")){
checkMlvl = 1;
}
else if (Check.equals("No")){
checkMlvl = 0;
}
startlvl = skills.getCurrentSkillLevel(STAT_MAGIC);
startTime = System.currentTimeMillis();
startxp = skills.getCurrentSkillExp(STAT_MAGIC);
runecount = getEquipmentCount(559);
norunes = false;
startTime = System.currentTimeMillis();
if (isLoggedIn()){
Bot.getEventManager().addListener(PaintListener.class, this);
Bot.getEventManager().addListener(ServerMessageListener.class, this);
setCameraAltitude(true);
}
return true;
}
@Override
public void onFinish() {
return;
}
public boolean isInArea(int maxX, int minY, int minX, int maxY) {
int x = getMyPlayer().getLocation().getX();
int y = getMyPlayer().getLocation().getY();
if (x >= minX && x <= maxX && y >= minY && y <= maxY) {
return true;
}
return false;
}
public void antiBan() {
int randomNum = random(1, 11);
if (antibanCasts == randomcast1 && Useantiban == 1) {
switch (randomNum) {
case 1:
setCameraAltitude(true);
int newCamera = getCameraAngle() + random(0, 270);
if (newCamera >= 360) {
newCamera -= 360;
}
setCameraRotation(newCamera);
randomcast1 = random(0,20)+ random(10 ,25);
antibanCasts = 0;
return;
case 2:
int i = random(0, 14);
if (getCurrentTab() != i) {
openTab(i);
}
randomcast1 = random(0, 20)+ random(40,60);
antibanCasts = 0;
return;
case 3:
int x1 = random(250, 750);
int y1 = random(222, 500);
moveMouse(0, 0, x1, y1);
randomcast1 = random(0, 20)+random (10, 20);
antibanCasts = 0;
return;
case 4:
if (getCurrentTab() != TAB_STATS) {
openTab(TAB_STATS);
moveMouse(random(558,600),random(393,408));
wait(2527);
openTab(TAB_MAGIC);
}
randomcast1 = random(0, 20)+random (50 , 100);
antibanCasts = 0;
return;
case 5:
int x2 = random(0, 250);
int y2 = random(0, 250);
moveMouse(0, 0, x2, y2);
randomcast1 = random(0, 20)+random (10, 20);
antibanCasts = 0;
return;
case 6:
if (getCurrentTab() != TAB_INVENTORY) {
openTab(TAB_INVENTORY);
moveMouse(random(560,725),random(225,450));
wait (random(1000,2500));
}
randomcast1 = random(0, 20)+random (40, 60);
antibanCasts = 0;
return;
case 7:
int angle = getCameraAngle() + random(-90, 90);
if (angle < 0) {
angle = 0;
}
if (angle > 359) {
angle = 0;
}
setCameraRotation(angle);
randomcast1 = random(0, 20)+random (30, 45);
antibanCasts = 0;
return;
case 8:
moveMouse(random(0, 762), random(0, 502));
randomcast1 = random(0, 20)+random (10, 20);
antibanCasts = 0;
return;
case 9:
moveMouse(random(0, 762), random(0, 502));
randomcast1 = random(0, 20)+random (10, 20);
antibanCasts = 0;
return;
case 10:
setCameraAltitude(true);
randomcast1 = random(0, 20)+random (10, 20);
antibanCasts = 0;
return;
case 11:
setCameraAltitude(false);
setCameraAltitude(true);
randomcast1 = random(0, 20)+random (25, 35);
antibanCasts = 0;
return;
}
antibanCasts = 0;
}
}
@Override
public int loop() {
if (Death == 1){
Walkpath(death);
Pickup(staff);
Pickup(runes);
Death = 0;
}
if (checklvl == 1 && checkMlvl ==1){
openTab(TAB_STATS);
moveMouse(random(558,600),random(393,408));
clickMouse(true);
moveMouse(random(70,400),random(40,335));
wait (random(4900,6200));
moveMouse(random(440,460),random(40,55));
clickMouse(true);
wait (random(50,500));
openTab(TAB_MAGIC);
checklvl = 0;
}
if (getMyPlayer().isMoving()) {
return random(300, 400);
}
if (getMyPlayer().isInCombat() && getPlane() == 0) {
if (atTile(new RSTile(3212, 3256), "Climb-up")) {
return random(30000, 40000);
}
return random(300, 400);
}
if (getPlane() == 1) {
atTile(new RSTile(3213, 3256), "Climb-down");
return random(500, 600);
}
if (Casts >= castAmount) {
ScreenshotUtil.takeScreenshot(true);
System.out.println("We're done casting.");
stopAllScripts();
}
if (!isInArea(3213, 3252, 3210, 3254)) {
walkTileMM(new RSTile(3213, (3254 - random(0, 2))));
return random(600, 700);
}
if (norunes) {
ScreenshotUtil.takeScreenshot(true);
return -1;
}
if (!doingSpell()) {
attackNPC();
antiBan();
}
return random(350, 400);
}
}