Hi fellow RuneScape Cheaters,
I am new to creating RsBot Scripts so I just replace ID's,
and I would like to know what is wrong with my script.
Mind you, this was a ripp of DrChicken by Aelin.
I am new to creating RsBot Scripts so I just replace ID's,
and I would like to know what is wrong with my script.
//
// Script:
// GoblinGrater.java
//
// Author:
// Gigiwest
//
// Description:
// A Goblin Gutter.
//
// Features:
// Collects cones
// Collects Bones
//
// Imports:
import com.speljohan.rsbot.script.Script;
import com.speljohan.rsbot.script.wrappers.*;
public class GoblinGrater extends Script {
// NPC IDs:
int[] GoblinIDs = new int[] { 2277, 2280, 2276, 2279, 2278 };
// Inventory IDs:
int BonesID = 526;
int CoinsID = 995;
// Misc objects:
final int SS_KILL_goblinS = 10;
final int SS_COLLECT_BONES = 20;
final int SS_COLLECT_coins = 30;
final int SS_BURY_BONES = 40;
int State = SS_KILL_goblinS;
boolean BuryBones = true;
//
// getVersion( )
//
public double getVersion() {
return 0.4;
}
//
// getName( )
//
public String getName() {
return "GoblinGrater";
}
//
// getAuthor( )
//
public String getAuthor() {
return "Aelin";
}
//
// onStart( )
//
public boolean onStart(String[] Args) {
if (Args.length >= 1) {
try {
log("Not burying bones.");
BuryBones = Boolean.parseBoolean(Args[0]);
} catch (Exception e) {
log(e.toString());
}
}
return true;
}
//
// loop( )
//
public int loop() {
// If inventory is full and contains bones, then
// Bury those damn bones!
if (isInventoryFull() && getInventoryCount(BonesID) >= 0 && BuryBones) {
log("Let's bury some bones.");
State = SS_BURY_BONES;
}
// Is player in combat?
if (getMyPlayer().isInCombat()) {
return random(750, 1500);
}
// Process script based upon current event.
switch (State) {
case SS_KILL_GOBLINS:
// Is the player allready in combat?
if (!getMyPlayer().isInCombat()) {
// Find a goblin.
RSNPC goblin = getNearestNPCByID(goblinIDs);
// Was a goblin found?
if (goblin != null) {
log("Attacking goblin.");
atNPC(goblin, "Attack");
if (BuryBones) {
State = SS_COLLECT_BONES;
} else {
State = SS_COLLECT_COINS;
}
return random(1500, 3000);
} else {
log("No (nearby) goblins, exiting.");
return -1;
}
}
return random(750, 1500);
case SS_COLLECT_BONES:
int OldBonesCount = getInventoryCount(BonesID);
RSItemTile Bones = getGroundItemByID(BonesID);
// Was bones found?
if (Bones != null) {
// Yes, so collect!
atTile(Bones, "Take Bones");
wait(random(750, 1500));
if (getInventoryCount(BonesID) > OldBonesCount) {
log("Picked up bones, checking for coins.");
State = SS_COLLECT_coins;
return random(750, 1500);
}
} else {
log("No bones to collect.");
State = SS_COLLECT_coins;
return random(750, 1550);
}
case SS_COLLECT_coins:
int OldcoinsCount = getInventoryCount(coinsID);
RSItemTile coins = getGroundItemByID(coinsID);
// Was coins found?
if (coins != null) {
// Yes, so collect!
atTile(Coins, "Take Feather");
wait(random(750, 1500));
if (getInventoryCount(coinsID) > OldcoinsCount) {
log("Picked up coins, continuing combat.");
State = SS_KILL_goblinS;
return random(750, 1500);
}
}
log("No coins to collect.");
State = SS_KILL_goblinS;
return random(750, 1500);
case SS_BURY_BONES:
if (getInventoryCount(BonesID) <= 0) {
log("No more bones left to burry, continuing combat.");
State = SS_KILL_goblinS;
return random(750, 1500);
} else {
log("Buring bones.");
atInventoryItem(BonesID, "Bury");
return random(750, 1500);
}
}
// If script ever reaches this line,
// something is wrong.
log("Script Failed!");
return -1;
}
}
Mind you, this was a ripp of DrChicken by Aelin.

