Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Buy OSRS Gold

Sell OSRS Gold

King Khurram

Registered
  • Content Count

    12
  • Joined

  • Last visited

  • Feedback

    0%

Community Reputation

0 Neutral

About King Khurram

  • Rank
    New Botter
  1. Hello I am currently making a script, and I am at the point where I would like to add Antiban. The problem is, after I attempt to create an instance of ABC2, i receive THIS error. Below is a snippet of the code. public class AlKharidTanner extends Script { // ABCL2 public static final ABC2Util abc_util = new ABC2Util(); I receive this error twice on the above code, and once in the import statement regarding ABCL2. If it helps, I also noticed that I could not find this specific class in the external library, as shown HERE. Please, any help would be appreciated. I read three of Trilez's guides (Tutorial on how to script, Antiban1 and ABC2), and still could not find a way to solve this issue. If I also try to construct a variable, and try to access a method of ABC2, I cannot find it after the dot. int run_at = this.abc_util. Thank you in advance. Below is my entire code if needed. package scripts; import org.tribot.api.Clicking; import org.tribot.api.DynamicClicking; import org.tribot.api.General; import org.tribot.api.Timing; import org.tribot.api.input.Mouse; import org.tribot.api.types.generic.Condition; import org.tribot.api.util.ABC2Util; import org.tribot.api2007.*; import org.tribot.api2007.types.RSItem; import org.tribot.api2007.types.RSNPC; import org.tribot.api2007.types.RSTile; import org.tribot.script.Script; import org.tribot.script.ScriptManifest; /** * Created by ____ on 2016-08-13. */ @ScriptManifest(authors = "fffff", name = "King Al Kharid Tanner v1.00", category = "Money") public class AlKharidTanner extends Script { // ABCL2 public static final ABC2Util abc_util = new ABC2Util(); // DECLARATION + INITIALIZATION OF INTEGER CONSTANTS private static final int COIN_ID = 995; private static final int COWHIDE_ID = 1739; private static final int LEATHER_ID = 1741; private static final int HARD_LEATHER_ID = 1743; private static final int TANNER_NPC_ID = 3231; private static final int TANNING_INTERFACE_INDEX = 324; // For now, I will only declare one tile, as my knowledge regarding banning is low. // I HAVE ABSOLUTELY NO IDEA WHY I HAVE TO CONSTRUCT AN OBJECT HERE, DESPITE IT NOT BEING STATIC. ONLY THING I SEE // DIFFERENT FROM OTHER CLASSES IS THAT THIS CLASS IS NOT FINAL. private static final RSTile TANNER_TILE = new RSTile(3274,3191,0); // MOUSE POSITIONS: SOFT LEATHER. private static final int MIN_X_SOFT_LEATHER = 73; private static final int MIN_Y_SOFT_LEATHER = 87; private static final int MAX_X_SOFT_LEATHER = 114; private static final int MAX_Y_SOFT_LEATHER = 121; // getMousePosition() consumes nothing, to produce an array with 2 element, indicating the coordinates where the // mouse should click to tan hides. // getMousePosition: None -> Int[] private int[] getMousePosition(){ int x_position = General.random(this.MIN_X_SOFT_LEATHER, this.MAX_X_SOFT_LEATHER); int y_position = General.random(this.MIN_Y_SOFT_LEATHER, this.MAX_Y_SOFT_LEATHER); int temp_array[] = {x_position, y_position}; return temp_array; } // bank() consumes nothing to produce a boolean determining if we were successful in banking the items. // bank: None -> Bool private boolean bank(){ // Open the bank Banking.openBank(); // Let's ensure that the banking interface is actually opened. if (!Timing.waitCondition(new Condition() { @Override public boolean active() { return Banking.isBankScreenOpen(); }}, General.random(2000, 3500))){ // Banking interface has not opened. Return false, we were unable to bank. System.out.println("FAILED TO BANK"); return false; } // Banking interface is opened now, commence the rest of the operation. // Deposit all items but coins in bank. Banking.depositAllExcept(COIN_ID); General.sleep(250, 1000); // Withdraw cowhides. The "0" indicates that we are going to "Withdraw all". if (!Banking.withdraw(0, COWHIDE_ID)){ // Unable to withdraw items, return false. System.out.println("FAILED TO BANK"); return false; } // Normal people dont close banking interface, so leave it open. Everything has been completed. Return true. System.out.println("SUCCESSFULLY BANKED"); return true; // v1.00 Test results: Seems like no issue what so ever. } // inBank() consumes nothing to produce true if the player is near a bank, false otherwise. // inBank: None -> Bool private boolean inBank(){ sleep(150); boolean in_bank = Banking.isInBank(); System.out.println("Are we in the bank :" + in_bank); return in_bank; } // inTanner() consumes nothing to produce a boolean which indicates whether we are near the tanner or not. // inTanner: None -> Bool private boolean inTanner(){ // Search to see if we can find the tanner final RSNPC[] tanner = NPCs.findNearest(TANNER_NPC_ID); // Did we find the tanner? Null check so we don't recieve a unbounded array error afterwards. if (tanner.length < 1){ // Could not find the tanner. Return false. return false; } // Tanner is near us, let's check if he's on the screen. If he isn't turn camera towards him. if (!tanner[0].isOnScreen()){ // we get the tile position of the tanner, and then turn the camera towards it. Camera.turnToTile(tanner[0].getPosition()); } // Now, there are a few things we must consider: // We must wait, until the camera has fully moved before clicking. // Once camera has stopped, tanner may have moved away, therefore we have to do it again. // The Timing class has a method waitCondition which allows us to do this. It waits an alloted amount of time, // in hope a certain condition will result in true. The condition we will use is if the tanner is on screen. // if it doesn't happen in the alloted time, we will presume that we are not near the tanner, and return false. boolean test = (Timing.waitCondition(new Condition() { @Override public boolean active() { return tanner[0].isOnScreen(); } }, General.random(3000, 4000))); System.out.println("Are we in the tanner: " + test); return test; // v1.00 Test results: Seems fine. An issue may occur because it turns to it, but tanner may move from screen + // barely shows him. } // walkToTanner() consumes nothing to produce a booleans, that determines whether we were successful in walking // towards the tanner. // walkToTanner: None -> Bool private boolean walkToTanner(){ // Walk to the tanner tiles if (!WebWalking.walkTo(TANNER_TILE)){ System.out.println("FAILED TO WALK TO TANNER"); return false; } // Wait till we arive to the tile. if (!Timing.waitCondition(new Condition() { @Override public boolean active() { return inTanner(); } }, General.random(8000, 13000))) { // Were unable to get near the tanner. System.out.println("FAILED TO WALK TO THE TANNER, DID NOT MAKE IT IN TANNER."); return false; } // We have made walked to the tanner, and are succesfully inside the tanner building, or near tanner. True. System.out.println("SUCCESFULLY WALKED TO TANNER."); return true; // v1.00 seems fine. } // walkToBank() consumes nothing to produce a boolean indicating whether we were successful with regards to walking // to the bank. // walkToBank: None -> Bool private boolean walkToBank(){ // Walk to the bank. WebWalking.walkToBank(); // Ensure that we arrive at the bank. if (!Timing.waitCondition(new Condition() { @Override public boolean active() { return inBank(); } }, General.random(8000, 13000))) { // Were unable to get near the banker. System.out.println("FAILED TO WALK TO THE BANK, DID NOT MAKE IT IN BANK."); return false; } System.out.println("SUCCESSFULLY WALKED TO THE BANK."); return true; //v1.00 seems fine. } // tan() consumes nothing to produce a boolean determining whether we were successful in tanning the hides or not. // tan: None -> Bool private boolean tan(){ // We are at the tanning location. Time to turn hides into leather. We will begin by findin the NPC that tans. final RSNPC[] tanner = NPCs.findNearest(TANNER_NPC_ID); // Null check, check if we actually found him. if (tanner.length < 1){ // We did not find the tanner, we cannot tan. Return false. return false; } // We found the tanner. Now let's try to get our stuff tanned. DynamicClicking.clickRSNPC(tanner[0], "Trade"); // The following statements heavily rely on whether or on the correct interface is opened. Using the interface // explorer, the tanners interface has an index value of 324. This will be used with conjuction with the // Timing class to ensure that the interface is opened before we do the other statements. if (!Timing.waitCondition(new Condition() { @Override public boolean active() { return (Interfaces.isInterfaceValid(TANNING_INTERFACE_INDEX)); } }, General.random(2500, 4000))){ System.out.println("WE FAILED TO OPEN THE TANNING INTERFACE. RETURNING FALSE."); return false; } // We have successfully opened the tanning interface. Now, let's move the mouse to the soft leather section. int temp_pos[] = getMousePosition(); int temp_x = temp_pos[0]; int temp_y = temp_pos[1]; General.sleep(1000,1500); Mouse.move(temp_x, temp_y); // perhaps needs a sleep? // We know should be hovering over the tanning option for soft leather. Lets tan all. Mouse.click(3); // Right clicks. ChooseOption.select("Tan All"); // Selects "Tan All" option. // We will now do one final check to ensure that our inventory is comprised of only leather and coins. // This is so we 100% know if we successfully tanned. This will be done by checking if we have more than one // leather within our inventory (as we started with 0. We will do this once the interface is closed, since // it automatically closes when finished. /*if (Timing.waitCondition(new Condition() { @Override public boolean active() { sleep(50); return !(Interfaces.isInterfaceValid(TANNING_INTERFACE_INDEX)); } }, General.random(1000, 1200))){ // Interface is still valid, for whatever reason. We could close and try again, but for now, just return // false. System.out.println("WE FAILED TO TAN"); return false; }*/ General.sleep(1500, 3000); if (Inventory.getCount(this.LEATHER_ID) == 0){ // We have FAILED TO tan, return false. System.out.println("FAILED TANNED. RETURNING FALSE."); return false; } // We have succesfully tanned, return true. System.out.println("SUCCESSFULLY TANNED. RETURNING TRUE."); return true; // v1.00 works beautifully. sOMETIMES doesnt click trade tanner. } // UNUSED ATM // invetoryCheck(RSItem[]) is a function that consumes a RSItem[] in order to determine how the script should begin. // it produces nothing. // invetoryCheck: RSItem[] -> None private String inventoryCheck(RSItem[] inventory){ // No items in inventory check. if (inventory.length < 1){ // Go to bank and get your shit. return "Go to banker."; // Let's check if coins are even in the Inventory. If they are, check if we have cow-hides. If not, go to bank. } else if (coinInInvetory(inventory)){ // Lets check if the inventory is comprised of only cowhides and coins. inventory = Inventory.filterDuplicates(inventory); if (inventory.length == 2 && ((Inventory.getCount(COWHIDE_ID)) > 1)){ // Now, so far, we have proved that there are coins in the inventory, and cowhides only. We are done // here. We just need to go to tanner. We can now enter the loop. return "Go to Tanner."; } } return "Go to banker."; } // coinInInventory consumes an RSItem[] to produce a boolean, determining whether or not coins // were found in the inventory. private boolean coinInInvetory(RSItem[] inventory){ if ((Inventory.find(COIN_ID)).length >= 1){ System.out.println("We found the coins."); return true; }else{ System.out.println("No coins found."); return false; } } @Override public void run() { System.out.println("Initiating start up."); System.out.println("Please ensure that coins are in your inventory."); while (true){ // For CPU. sleep(100); // First step should be identifying where you are, and doing the tasks accordingly. Let's check if we are // at the bank. If we are, check if inventory is full of cowhides, leather, or neither. if (inBank()){ // If we are in the bank, determine if we want to bank, or leave the bank. // If we have more than 1 leather in inventory, just go to bank and start from there. if (Inventory.getCount(COWHIDE_ID) > 1) { walkToTanner(); } else { bank(); } } else if (inTanner()){ // Determine whether we already have tanned cowhides or not. // if we have cowhides, tan them. if (Inventory.getCount(COWHIDE_ID) > 1) { tan(); } else { // We don't have any cowhides in inventory. Go to bank. walkToBank(); } } else { // You are in the middle of nowhere. Check if you need to go to the bank, or to the tanner. if (Inventory.getCount(COWHIDE_ID) > 1){ walkToTanner(); } else { walkToBank(); } } } } } SOLUTION: Was using a depreciated class as c#2bot has stated. Used the appropriate class and import statement and it worked.
  2. You capitalized "Scripts" at the top. Make it lower case. Java convention requires you to do so.
  3. Can personally vouch for him. Purchased, and within 5 minutes got my money. Very nice people.
  4. Thank you very much for the help, I will try this out now.
  5. My understanding was that this only worked when the RSObject you are looking for is actually on your screen (please correct me if I am incorrect)? In the event, that none are on your screen, what should I do?
  6. Hi, I'm pretty new to scripting, and I've been having a lot of trouble with this script, specifically, finding the rune essence rock from when you teleport to that area. I originally made 4 tiles, each representing the general area around the rock, and I would use a loop to find out which tile was the closest. Problem is, for some reason, the position changes drastically. To elaborate, I would make the tiles, then log out. After about 10 minutes, I would log back in to test out my script, and the position completely changes (i.e the x coordinate was in the 9000s before, but now it's in the 11000s). How can I get across this? How can I find the best rock to go to, without the use of specific position. Thank you for your help. EDIT: Solution to this issue is below.
  7. Hello, I have just recently purchased VIP, and I would like to start scripting using my own scripts. I followed many guides, and I'm almost certain I've dont everything correctly, yet, the client is not showing my script. I have my .class file in the specified tribot/bin/script folder, and the manifest within the .class file is: @ScriptManifest(authors = {"King Khurram"}, name = "PowerMiner", category = "Mining") How can I fix this so that I can immediately begin scripting? Thank you advance, anything is appreciated. Edit: Also, my understanding is that the VIP is just automatically put into the client? I purchased VIP, and did nothing afterwards. Is there any other process I have to do in order to activate the VIP into the client, or does it know I am VIP based on the username and password I input in. EDIT 2 SOLUTION: The problem I was facing was that I had the package named "Scripts" instead of "scripts" (lowercase s). For some reason it has to be lower case.
  8. Hi I sent you the 9.50 yesterday and was wondering when I would get VIP-e.
  9. Sorry, I don't have an answer to this quesiton, but I would like to ask OP a question. Is this an issue you personally are facing due to unknown reasons, or this issue due to the fact that you have windows 10? I ask because I was going to update my windows to windows 10. Thank you.
  10. Hi, I've recently began learning Java, and want to begin scripting; however, I have an issue. I've followed the below guide, and yet, I still cannot find my script on the TriBot client. I made the script manifest properly, and I checked if everything was imported properly. I've looked all over this forums for a solution; yet I have not found one. Most solutions that I did find, referred the OP to the Script Repository; however, I want to test my own script that I created instead of using a script that was already made by somebody else. Basically, I'm asking how can I add local scripts into the tribot client? Any help is appreciated, thank you.
×
×
  • Create New...