-
Posts
88 -
Joined
-
Last visited
-
Feedback
100%
Everything posted by Septron
-
There, I centered it for you
-
Hello, I make tutorial for debugging and reloading classes at runtime using intellij. drag osbot into your folder like so click here click this thing click this on the dropdown click this and select the osbot jar add "-debug" to program arguments like so click apply down at the bottom to save the profile WOW you complete part 1 Part 2 start now click this thing again find remote it look like this You don't need to change anything, just hit apply now run osbot profile wait for it to launch and login then run the attach thing and it'll connect now you can reload classes on the fly like a pro gratz rep+ me plz
-
I'm pretty sure it's anti-flood on jagex's end. If you hop more than a couple times within a certain time period they disconnect you
-
Sure thing man!
-
I support this message.
-
When unchecking the bury bone option it should remove bones from the loot table.
-
Ok, so I ripped this out of a chatter-bot-api and made it easier to use and static... /* chatter-bot-api Copyright (C) 2011 pierredavidbelanger@gmail.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ package me.linus.chat; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Reader; import java.io.StringWriter; import java.math.BigInteger; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder; import java.security.MessageDigest; import java.util.LinkedHashMap; import java.util.Map; public class Cleverbot { private static final String url = "http://www.cleverbot.com/webservicemin"; private static final Map<String, String> vars; static { vars = new LinkedHashMap<String, String>(); vars.put("start", "y"); vars.put("icognoid", "wsf"); vars.put("fno", "0"); vars.put("sub", "Say"); vars.put("islearning", "1"); vars.put("cleanslate", "false"); } public static String parametersToWWWFormURLEncoded( Map<String, String> parameters) throws Exception { StringBuilder s = new StringBuilder(); for (Map.Entry<String, String> parameter : parameters.entrySet()) { if (s.length() > 0) { s.append("&"); } s.append(URLEncoder.encode(parameter.getKey(), "UTF-8")); s.append("="); s.append(URLEncoder.encode(parameter.getValue(), "UTF-8")); } return s.toString(); } public static String post(String url, Map<String, String> parameters) throws Exception { URLConnection connection = new URL(url).openConnection(); connection .setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0"); connection.setDoOutput(true); connection.setDoInput(true); OutputStreamWriter osw = new OutputStreamWriter( connection.getOutputStream()); osw.write(parametersToWWWFormURLEncoded(parameters)); osw.flush(); osw.close(); Reader r = new BufferedReader(new InputStreamReader( connection.getInputStream())); StringWriter w = new StringWriter(); char[] buffer = new char[1024]; int n = 0; while ((n = r.read(buffer)) != -1) { w.write(buffer, 0, n); } r.close(); return w.toString(); } public static String md5(String input) throws Exception { MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(input.getBytes("UTF-8")); BigInteger hash = new BigInteger(1, md5.digest()); return String.format("%1$032X", hash); } public static String stringAtIndex(String[] strings, int index) { if (index >= strings.length) return ""; return strings[index]; } public static String think(String message) throws Exception { vars.put("stimulus", message); String formData = parametersToWWWFormURLEncoded(vars); String formDataToDigest = formData.substring(9, 29); String formDataDigest = md5(formDataToDigest); vars.put("icognocheck", formDataDigest); String response = post(url, vars); String[] responseValues = response.split("\r"); vars.put("sessionid", stringAtIndex(responseValues, 1)); vars.put("logurl", stringAtIndex(responseValues, 2)); vars.put("vText8", stringAtIndex(responseValues, 3)); vars.put("vText7", stringAtIndex(responseValues, 4)); vars.put("vText6", stringAtIndex(responseValues, 5)); vars.put("vText5", stringAtIndex(responseValues, 6)); vars.put("vText4", stringAtIndex(responseValues, 7)); vars.put("vText3", stringAtIndex(responseValues, 8)); vars.put("vText2", stringAtIndex(responseValues, 9)); vars.put("prevref", stringAtIndex(responseValues, 10)); vars.put("emotionalhistory", stringAtIndex(responseValues, 12)); vars.put("ttsLocMP3", stringAtIndex(responseValues, 13)); vars.put("ttsLocTXT", stringAtIndex(responseValues, 14)); vars.put("ttsLocTXT3", stringAtIndex(responseValues, 15)); vars.put("ttsText", stringAtIndex(responseValues, 16)); vars.put("lineRef", stringAtIndex(responseValues, 17)); vars.put("lineURL", stringAtIndex(responseValues, 18)); vars.put("linePOST", stringAtIndex(responseValues, 19)); vars.put("lineChoices", stringAtIndex(responseValues, 20)); vars.put("lineChoicesAbbrev", stringAtIndex(responseValues, 21)); vars.put("typingData", stringAtIndex(responseValues, 22)); vars.put("divert", stringAtIndex(responseValues, 23)); return stringAtIndex(responseValues, 16); } } Example usage: package me.linus; import java.io.BufferedReader; import java.io.InputStreamReader; import me.linus.chat.Cleverbot; public class Chat { public static void main(String... a) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Me: "); while(true) { String console = br.readLine(); console = Cleverbot.think(console); System.out.println("CB: " + console); System.out.print("Me: "); } } } Example output: Me: Hello CB: How are you? Me: Good, you? CB: I'm doing alright. Me: That's good to hear! CB: How are you doing? Me: Like I just said, I'm doing good CB: How am I confusing? Me: I didn't say you were confusing CB: Yes you did. Me: No, no I didn't CB: Yes, you did. Me: Fuck you CB: Yes, please.
-
PROTIP: Chickens can't kill you.
-
This is just something I threw together really quick import org.osbot.script.rs2.skill.Skill; public class Goal { public final Skill skill; public final int target; public final GoalEvent event; public Goal(Skill skill, int target, GoalEvent event) { this.skill = skill; this.target = target; this.event = event; } } import org.osbot.script.Script; public abstract class GoalEvent { private final Script script; public GoalEvent(Script script) { this.script = script; } public abstract void onGoalReached(); } import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.osbot.script.Script; public class HandleGoals { private final List<Goal> goals; private final Script script; public HandleGoals(Script script) { this.script = script; this.goals = new ArrayList<>(); } public void provide(Goal... goals) { for(Goal goal : goals) { if(!this.goals.contains(goal)) this.goals.add(goal); } } public void remove(Goal... goals) { for(Goal goal : goals) { if(this.goals.contains(goal)) this.goals.remove(goal); } } public boolean check() { Iterator<Goal> iterator = this.goals.iterator(); while(iterator.hasNext()) { Goal goal = iterator.next(); if(goal.target >= this.script.client.getSkills().getCurrentLevel(goal.skill)) { goal.event.onGoalReached(); this.remove(goal); return true; } } return false; } } Example Implementation... //put this anywhere in the script class private HandleGoals handle = null; //in your onStart put this... this.handle = new HandleGoals(this); handle.provide(new Goal(Skill.ATTACK, 99, new GoalEvent(this) { @Override public void onGoalReached() { log("I have reached my goal, tell me what to do now in this method"); } })); //in your onLoop put this... if(handle != null) handle.check();
-
public class Timer { private boolean running = false; private long startTime = 0; private long stopTime = 0; public void start() { this.startTime = System.currentTimeMillis(); this.running = true; } public void stop() { this.stopTime = System.currentTimeMillis(); this.running = false; } public long elapsed() { long elapsed; if(running) elapsed = (System.currentTimeMillis() - startTime); else elapsed = (stopTime - startTime); return elapsed; } public int getHourly(int number) { return (int) (number * 3600000.0D / elapsed()); } public String getFormattedString() { long time = elapsed() / 1000; return String.format("%02d:%02d:%02d", time / 3600, (time % 3600) / 60, (time % 60)); } } Example usage... public static void main(String... a) throws InterruptedException { Timer time = new Timer(); time.start(); Thread.sleep(1000); System.out.println(time.getFormattedString()); }
-
import java.awt.AWTException; import java.awt.Image; import java.awt.MenuItem; import java.awt.PopupMenu; import java.awt.SystemTray; import java.awt.TrayIcon; import java.awt.event.ActionListener; public class Tray { private PopupMenu popup; private final TrayIcon tray; private final String scriptName; private boolean showing = false; public Tray(Image image, String scriptName) { this.tray = new TrayIcon(image, scriptName); this.scriptName = scriptName; } public void show() throws AWTException { if (SystemTray.isSupported()) { if (this.tray != null) { this.tray.setToolTip(this.scriptName); this.tray.setImageAutoSize(true); SystemTray.getSystemTray().add(this.tray); this.showing = true; } } else { throw new AWTException("System Tray is not supported!"); } } public void hide() { if(this.showing == true && this.tray != null) { SystemTray.getSystemTray().remove(tray); this.showing = false; } } public void addMenuItem(MenuItem item, ActionListener listener) { item.addActionListener(listener); this.popup.add(item); if(this.tray != null) this.tray.setPopupMenu(popup); } public void sendDisplayMessage(String message, TrayIcon.MessageType type) { if(this.showing == true) this.tray.displayMessage(this.scriptName, message, type); } } Example usage... final Tray tray = new Tray(ImageIO.read(new URL("http://i.imgur.com/HGN98TQ.gif")), "Cool Script"); tray.addMenuItem(new MenuItem("Hide"), new ActionListener() { @Override public void actionPerformed(ActionEvent e) { tray.hide(); } }); tray.show(); tray.sendDisplayMessage("Cool Script initalized!", TrayIcon.MessageType.INFO);
- 1 reply
-
- 2
-
-
BASE 2 [ 0, 1] BASE 10 [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] To convert BASE 10 into BASE 2 is a simple matter. For this example, I will choose 45 for the number. To find the BASE 2 number of 45 you have to find the lowest power of 2 that 45 can fit into... Power of 2 ^ 0 = 1.0 Power of 2 ^ 1 = 2.0 Power of 2 ^ 2 = 4.0 Power of 2 ^ 3 = 8.0 Power of 2 ^ 4 = 16.0 Power of 2 ^ 5 = 32.0 Power of 2 ^ 6 = 64.0 <-- BINGO So now we take it back a step to 2 ^ 5 at 32 and we have a 1 Next we repeat the process with 45 - 32 = 13 Power of 2 ^ 0 = 1.0 Power of 2 ^ 1 = 2.0 Power of 2 ^ 2 = 4.0 Power of 2 ^ 3 = 8.0 <-- BINGO However, because we skiped 2 ^ 4 we need to add a 0 and a 1 We now have 101 So now we take 13 - 8 = 5 Power of 2 ^ 0 = 1.0 Power of 2 ^ 1 = 2.0 Power of 2 ^ 2 = 4.0 <-- BINGO We now have 1011 5 - 4 = 1 Power of 2 ^ 0 = 1.0 <-- BINGO We skipped 2 ^ 1 so we add a 0 and a 1 We now have 101101 System.out.println(Integer.parseInt("" + 101101, 2)); // = 45 Now, this could be automated using this sniplet of code found on google: public static long toBinary(int n) { String b = ""; // binary representation as a string while (n != 0) { int r = (int) (n % 2); // remainder b = r + b; // concatenate remainder n /= 2; // reduce n } return Long.parseLong(b); } Now, for some people that don't understand what this is doing, let's break it down into the steps it follows in the loop So to break it down the first line is actually saying, what's the remainder of n when divided by 2 and set that to r The next line is saying add r to b (string of numbers) then set that to the current b Finally the last line is saying divide n by 2 then set that to n
-
Death
-
Sounds cool, I'm horrible with graphics so this might come in hand. Will you be releasing psd's or what? Sounds exciting!