-
Posts
106 -
Joined
-
Last visited
-
Feedback
100%
Everything posted by hajar424
-
Hey i would like to buy 14mil for $22.4
-
How much money do you make per hour by telegrabing seeds while training range?
-
ERROR][07/14 02:16:25 fm]: Failed to start script [AL Kharid Warrior] java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.osbot.auX.run(to:583) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException at main.<init>(main.java:41) ... 8 more one question what should getstate return ?
-
My Al kharid warrior bot wont start, can anyone help me? import org.osbot.rs07.script.ScriptManifest; import java.awt.*; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.MethodProvider; import org.osbot.rs07.script.Script; import org.osbot.rs07.utility.Area; import javax.imageio.ImageIO; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.concurrent.TimeUnit; // Manifest @ScriptManifest(author = "Hajar424", info = "Kills Al Kharid Warrior", name = "AL Kharid Warrior", version = 1.18 , logo = "http://i.imgur.com/rYghTrD.png") public class main extends Script implements org.osbot.rs07.canvas.paint.Painter { private ArrayList alist = new ArrayList<String>(); //Variables private final Image bg = getImage("http://i.imgur.com/5ai2EYf.png"); private long timeBegan; private long timeRan; private int ATTcurrentLevel; private int ATTbeginningLevel; private int STRcurrentLevel; private int STRbeginningLevel; private int DEFcurrentLevel; private int DEFbeginningLevel; private int RANcurrentLevel; private int RANbeginningLevel; private int levelsGained; private int warrior_id = 3103; NPC warrior = npcs.closest(warrior_id); //Path private Position[] toWarrior = {new Position(3295,3171,0)}; //Areas private final Area door_area = new Area(3282,3177,3303,3167); private final Area warrior_area = new Area(3282,3177,3303,3167); private final Area bank_area = new Area(3272,3173,3269,3161); //Random Path public static Position[] getRandomPath(Position[] path, int radius){Position[] newPath = new Position[path.length];int idx = 0;for( Position node : path) newPath[idx++] = node.translate(MethodProvider.random(radius), MethodProvider.random(radius));return newPath;} //onLoop @Override public int onLoop() throws InterruptedException { switch (getState()) { case killWarrior: killMethod(); break; case banking: bankingMethod(); break; case walk_bank: walk_bankMethod(); break; case walk_warrior: walk_warriorMethod(); break; default:break; } return (0); } // OnStart @Override public void onStart() { ATTbeginningLevel = skills.getStatic(Skill.ATTACK); STRbeginningLevel = skills.getStatic(Skill.STRENGTH); DEFbeginningLevel = skills.getStatic(Skill.DEFENCE); RANbeginningLevel = skills.getStatic(Skill.RANGED); timeBegan = System.currentTimeMillis(); experienceTracker.startAll(); } private enum State { killWarrior, banking, walk_bank, walk_warrior, idle } private State getState() { if(!myPlayer().isAnimating() && myPlayer().getInteracting() == null && !myPlayer().isMoving() && warrior != null) { return State.killWarrior; } else if (!myPlayer().isAnimating() && myPlayer().getInteracting() == null && !myPlayer().isMoving() && warrior != null) { return State.banking; } else if (!bank_area.contains(myPlayer())) return State.walk_bank; else if (myPlayer().isAnimating() && myPlayer().getInteracting() != null) { return State.walk_warrior; } return (State.idle); } private void bankingMethod() throws InterruptedException { } // -----------Methods------------ public void killMethod() throws InterruptedException { NPC warrior = npcs.closest(warrior_id); if( !myPlayer().isMoving() && !myPlayer().isUnderAttack() && !inventory.isFull() && !doorHandler.handleNextObstacle(door_area)) { if(warrior != null && warrior.isAttackable() && warrior.isOnScreen() ) { warrior.interact("Attack"); } } else { camera.toEntity(warrior); } } private void walk_warriorMethod() throws InterruptedException { } private void walk_bankMethod() throws InterruptedException { } @Override public void onPaint(Graphics2D g) { //THEME g.setColor(new Color(25, 25, 25, 150)); g.fillRect(7, 345, 516, 320); g.setColor(new Color(255, 244, 243, 170)); g.setFont(new Font("Arial", Font.BOLD, 14)); g.fillRect(0, 325, 520, 20); //NAME OF THE BOT g.setColor(new Color(0, 0, 0)); g.setFont(new Font("Arial", Font.BOLD, 14)); g.drawString("AL KHARID WARRIOR", 10, 338); // XP tracker g.setColor(new Color(255, 255, 255)); g.setFont(new Font("Arial", Font.BOLD, 10)); g.drawString("Attack: " + experienceTracker.getGainedXP(Skill.ATTACK) + " Xp", 10, 364); g.drawString("Strength: " + experienceTracker.getGainedXP(Skill.STRENGTH) + " Xp", 10, 384); g.drawString("Defence: " + experienceTracker.getGainedXP(Skill.DEFENCE) + " Xp", 10, 404); g.drawString("Range: " + experienceTracker.getGainedXP(Skill.RANGED) + " Xp", 10, 424); // combat lvl ATTcurrentLevel = skills.getStatic(Skill.ATTACK); g.drawString("| LVL: " + ATTbeginningLevel+"/"+ATTcurrentLevel, 120,364); STRcurrentLevel = skills.getStatic(Skill.STRENGTH); g.drawString("| LVL: " + STRbeginningLevel+"/"+STRcurrentLevel, 120,384); DEFcurrentLevel = skills.getStatic(Skill.DEFENCE); g.drawString("| LVL:" + DEFbeginningLevel+"/"+DEFcurrentLevel, 120,404); RANcurrentLevel = skills.getStatic(Skill.RANGED); g.drawString("| LVL:" + RANbeginningLevel + "/" + RANcurrentLevel, 120, 424); // Paint time and xp per hour g.setFont(new Font("Arial", Font.BOLD, 12)); timeRan = System.currentTimeMillis() - this.timeBegan; g.drawString("[ Time: "+ft(timeRan)+" ]",10,444 ); String myskill = "STRENGTH"; g.drawString("Xp/Hour: " + experienceTracker.getGainedXPPerHour(Skill.forName(myskill)) + " Xp" , 120, 444); g.drawImage(bg, 397, 364, null); } //Image private Image getImage(String url) {try {return ImageIO.read(new URL(url));} catch (IOException e) {}return null; } //Time private String ft(long duration) { String res = ""; long days = TimeUnit.MILLISECONDS.toDays(duration); long hours = TimeUnit.MILLISECONDS.toHours(duration) - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration)); long minutes = TimeUnit.MILLISECONDS.toMinutes(duration) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS .toHours(duration)); long seconds = TimeUnit.MILLISECONDS.toSeconds(duration) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS .toMinutes(duration)); if (days == 0) {res = (hours + ":" + minutes + ":" + seconds); }else { res = (days + ":" + hours + ":" + minutes + ":" + seconds); } return res; } }
-
So how do i check what skill the user gets Xp from, sorry for asking to much but i would like to be a good SDN scripter
-
Hey right now i can only show xp/hour for a specific skill experienceTracker.getGainedXPPerHour(Skill.STRENGTH) How can i show all the skills in Xp/hour
-
Are is interested to work with me? Al Kharid Warrior
hajar424 replied to hajar424's topic in Scripting Help
i have used JFrame alot but the problem is how do i start.. -
Are is interested to work with me? Al Kharid Warrior
hajar424 replied to hajar424's topic in Scripting Help
I have already made a STAT but i have to improve it, i am not so good at Java And i know JFrame i just dont know how to start with adding a button and implement it to my bot. What i need is someone who have time to just show me how to begin -
NEW TITE: Are you interested to work with me? Al Kharid Warrior Hello i am working on my Al kharid warrior bot but i need someone who knows how to use STATES and making a form where you can type food you would like to eat and get from bank. Right now my bot is a bit slower then kwarrior and i would like to improve that My bot can: Attack Warrior Open doors if there is a warrior inside. Show info about Time,Xp and so on... I Wish to: Go to Bank for food Having a form for the kind of food you would like to get in bank Faster or as fast as Kwarrior
-
Here is some tips: I added "Willow logs" so it don't drop the important things in the inventory and in the second code i removed the "Chop-down" and added "Chop down" inventory.dropAll("Willow logs"); Willow.interact("Chop down");
-
If i had VIP i would acess the VIP bots, but not for botting but instead learning how a good VIP bot works and then improving my scripting by understanding how professional programmers write think and solve problems !
-
How do you add a counter or something that show how many seconds,minutes and hours you have played?
-
-SOLVED- Thanks Flamezzz g.drawString("Current:"+ experienceTracker.getGainedXP(Skill.STRENGTH),10,364);
-
I get a error then saying that it dont know the variable
-
My Current strenght xp dont changes when i attack someone, and when i try to put the variables in the onloop() i get error because onPaint() metod cant use variables from onLoop() @Override public void onPaint(Graphics2D g) { int currentStrenghtxp = skills.getExperience(Skill.STRENGTH); int beginningStrenghtxp = (skills.getExperience(Skill.STRENGTH)); int strenghtXpGained = currentStrenghtxp - beginningStrenghtxp; g.setColor(new Color(25, 25, 25, 100)); g.fillRect(7, 345, 516, 320); g.setColor(new Color(228, 211, 22)); g.drawString("Current:"+strenghtXpGained,10,364); }
-
Hello my name is Hajar and Yes that is me on the profile picture. Since i join osbot i have learned how to make bots, but i have also improved my Java skills. I have learn GFX, CINEMA 4D and how API works. I have new friends on Skype from osbot and i feel happy. Osbot community feels like my second family. There should be more threads on new things like Chrome extensions, Matlab, gVim. I love to learn new things
-
I need some respons/tips of how to improve my logos Here is the first one
-
I would like to use g.fillrect... but in a transparent color, so how do you do that
-
Thanks it works Here is how it can look like @ScriptManifest(name = "TEST", author = "Hajar424", version = 1.0, info = "TEST", logo = "http://i.imgur.com/7k74Br4.png")
-
Hello who can write me a snippet of a empty bot with a manifest where there is a logo on it
-
Osbot don't have antiban, the bot maker have implemented it in the bot
-
I had my bot running for the night but somehow it only botted for 5 hours. Is there any time limit because the bot was running when i logged ut.