This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private final Pattern AUTHORIZATION_PATTERN = Pattern.compile("authorized\\s*=\\s*([0-9.]+)"); | |
| private boolean isAuthorized(String url) { | |
| try { | |
| int userId = Environment.getUserId(); | |
| String authorized = ""; | |
| URL site = new URL(url); | |
| BufferedReader in = new BufferedReader(new InputStreamReader(site.openStream())); | |
| String line; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ProgrammingChallenge { | |
| public static void main(String... args) { | |
| System.out.println(stringTimes("Hi", 5)); | |
| } | |
| public static String stringTimes(String str, int n) { | |
| StringBuilder sb = new StringBuilder(); | |
| if (n <= 0) { | |
| System.err.println("n must be > 0"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.itcooker.strategies; | |
| import org.itcooker.constants.Data; | |
| import org.itcooker.functions.AbstractStrategy; | |
| import org.powerbot.game.api.methods.Walking; | |
| import org.powerbot.game.api.methods.interactive.NPCs; | |
| import org.powerbot.game.api.methods.tab.Inventory; | |
| import org.powerbot.game.api.methods.widget.Bank; | |
| import org.powerbot.game.api.util.Time; | |
| import org.powerbot.game.api.wrappers.interactive.NPC; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Drops extends Strategy implements Task { | |
| private int profit; | |
| GroundItem loot; | |
| private Map<Integer, Integer> prices = new HashMap<Integer, Integer>(); | |
| @Override | |
| public boolean validate() { | |
| return GroundItems.getNearest(GroundItems.ALL_FILTER) != null; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public void onStop() { | |
| try { | |
| URL submit = new URL( | |
| "http://site.com/submit.php?user=(...)&timeran=(...)&otherparameters=..."); | |
| URLConnection con = submit.openConnection(); | |
| con.setRequestProperty( | |
| "User-Agent", | |
| "| i recommend you set a fake user agent which you read on the website side by $_SERVER['HTTP_USER_AGENT'] |"); | |
| con.setDoInput(true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Image img; | |
| ... | |
| @Override | |
| protected void setup() { | |
| img = getImage("http://website.com/image.png", "image.png"); | |
| } | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.powerbot.concurrent.LoopTask; | |
| import org.powerbot.game.api.ActiveScript; | |
| import org.powerbot.game.api.Manifest; | |
| @Manifest(authors = { "" }, name = "") | |
| public class Looper extends ActiveScript { | |
| @Override | |
| protected void setup() { | |
| submit(new Loop()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.lang.reflect.Field; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| public class FieldsToArray { | |
| public int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, i = 0, | |
| j = 0, k = 0, l = 0; | |
| public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.logging.Logger; | |
| import org.powerbot.concurrent.Task; | |
| import org.powerbot.concurrent.strategy.Strategy; | |
| import org.powerbot.game.api.ActiveScript; | |
| import org.powerbot.game.api.Manifest; | |
| import org.powerbot.game.api.methods.Tabs; | |
| @Manifest(authors = { "_phl0w" }, name = "Emote tab checker.") | |
| public class EmoteClassChecker extends ActiveScript { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @author Cakemix | |
| * @author Coma | |
| * @param id | |
| * the item id | |
| * @return the price | |
| * @throws IOException | |
| */ | |
| private int getPrice(int id) throws IOException { | |
| URL url = new URL("http://open.tip.it/json/ge_single_item?item=" + id); |