Skip to content

Commit

Permalink
back to orig source for now
Browse files Browse the repository at this point in the history
  • Loading branch information
XelRSC committed May 28, 2011
1 parent 3deae8a commit 816f52b
Show file tree
Hide file tree
Showing 80 changed files with 1,372 additions and 1,369 deletions.
2 changes: 1 addition & 1 deletion readme
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Everything is fucked up ;P have to update most stuff..
Back to orig source for now.
1 change: 0 additions & 1 deletion resources/Manifest.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Main-Class: org.rsbot.Boot
Class-Path: lib/xel.jar

Name: org/rsbot
Sealed: true
Expand Down
Binary file added resources/images/database_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
245
245
2 changes: 0 additions & 2 deletions src/org/rsbot/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.rsbot.util.ApplicationException;
import org.rsbot.util.io.IOHelper;


import javax.swing.*;

import java.awt.*;
Expand All @@ -33,7 +32,6 @@ public static void main(final String[] args) {
System.setProperty("java.io.tmpdir", Configuration.Paths.getGarbageDirectory());
gui = new BotGUI();
gui.setVisible(true);

} catch (final Exception e) {
e.printStackTrace();
System.out.print(e.getMessage());
Expand Down
1 change: 0 additions & 1 deletion src/org/rsbot/Boot.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.net.URLDecoder;



/**
* @author Paris
*/
Expand Down
20 changes: 6 additions & 14 deletions src/org/rsbot/bot/Crawler.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package org.rsbot.bot;

import org.rsbot.Configuration;
import org.rsbot.util.io.HttpClient;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
Expand Down Expand Up @@ -50,22 +49,15 @@ public Crawler(final String root) {

private String downloadPage(final String url, final String referer) {
try {
final HttpURLConnection con = Configuration.getHttpConnection(new URL(url));
final HttpURLConnection con = HttpClient.getHttpConnection(new URL(url));
if (referer != null && !referer.isEmpty()) {
con.addRequestProperty("Referer", referer);
}
final BufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream()));
final StringBuilder buf = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
buf.append(line);
}
reader.close();
return buf.toString();
} catch (final Exception e) {
return HttpClient.downloadAsString(con);
} catch (final IOException e) {
e.printStackTrace();
return "";
}
return null;
}

private String firstMatch(final String regex, final String str) {
Expand Down
4 changes: 1 addition & 3 deletions src/org/rsbot/event/impl/DrawInventory.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@
import java.awt.*;

public class DrawInventory implements PaintListener {

private final MethodContext ctx;

public DrawInventory(final Bot bot) {
ctx = bot.getMethodContext();
}

@Override
public void onRepaint(final Graphics render) {
if (!ctx.game.isLoggedIn()) {
return;
}

if (ctx.game.getCurrentTab() != Game.TAB_INVENTORY) {
if (ctx.game.getTab() != Game.Tab.INVENTORY) {
return;
}

Expand Down
10 changes: 5 additions & 5 deletions src/org/rsbot/event/impl/DrawWeb.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import org.rsbot.bot.Bot;
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.script.internal.wrappers.TileData;
import org.rsbot.script.methods.MethodContext;
import org.rsbot.script.methods.Web;
import org.rsbot.script.internal.wrappers.TileData;
import org.rsbot.script.wrappers.RSPlayer;
import org.rsbot.script.wrappers.RSTile;

Expand All @@ -18,7 +18,6 @@
* @author Timer
*/
public class DrawWeb implements PaintListener {

private final MethodContext ctx;

/**
Expand Down Expand Up @@ -49,10 +48,11 @@ public void onRepaint(final Graphics render) {
}
final RSTile oT = player.getLocation();
final int plane = ctx.game.getPlane();
final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
final Iterator<Map.Entry<Short[], Integer>> rs = Web.rs_map.entrySet().iterator();
while (rs.hasNext()) {
Map.Entry<RSTile, Integer> e = rs.next();
final RSTile t = e.getKey();
final Map.Entry<Short[], Integer> e = rs.next();
final Short[] tile = e.getKey();
final RSTile t = new RSTile(tile[0], tile[1], tile[2]);
final int key = e.getValue();
if (t.getZ() == plane && ctx.calc.distanceBetween(t, oT) < 105) {
render.setColor(TileData.Questionable(key) ? Color.yellow : TileData.Special(key) ? Color.cyan : Color.red);
Expand Down
5 changes: 3 additions & 2 deletions src/org/rsbot/event/impl/TTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.rsbot.bot.Bot;
import org.rsbot.event.listeners.TextPaintListener;
import org.rsbot.script.methods.Game;
import org.rsbot.script.methods.Game.Tab;
import org.rsbot.util.StringUtil;

import java.awt.*;
Expand All @@ -17,9 +18,9 @@ public TTab(final Bot bot) {

@Override
public int drawLine(final Graphics render, int idx) {
final int cTab = game.getCurrentTab();
final Tab cTab = game.getTab();
StringUtil.drawLine(render, idx++,
"Current Tab: " + cTab + (cTab != -1 ? " (" + Game.TAB_NAMES[cTab] + ")" : ""));
"Current Tab: " + cTab.description() + " (" + cTab.index() + ")");
return idx;
}

Expand Down
6 changes: 3 additions & 3 deletions src/org/rsbot/event/impl/TUserInputAllowed.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public TUserInputAllowed(final Bot bot) {

@Override
public int drawLine(final Graphics render, int idx) {
StringUtil.drawLine(render, idx++, "User Input: " +
(bot.inputFlags == 0 && !bot.overrideInput ?
"[red]Disabled (" + bot.inputFlags + ")" : "[green]Enabled"));
final String i = bot.overrideInput || bot.inputFlags == 3 ? "[green]Enabled" :
"[red]Disabled (" + bot.inputFlags + ")";
StringUtil.drawLine(render, idx++, "User Input: " + i);
return idx;
}
}
4 changes: 2 additions & 2 deletions src/org/rsbot/gui/AccountManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.rsbot.Configuration;
import org.rsbot.script.AccountStore;
import org.rsbot.script.provider.ScriptDeliveryNetwork;
import org.rsbot.service.DRM;

import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
Expand Down Expand Up @@ -48,7 +48,7 @@ public class AccountManager extends JDialog implements ActionListener {
private static final AccountStore accountStore = new AccountStore(new File(FILE_ACCOUNT_STORAGE));

static {
accountStore.setPassword(ScriptDeliveryNetwork.getInstance().getKey());
accountStore.setPassword(DRM.getServiceKey());
try {
accountStore.load();
} catch (final IOException ignored) {
Expand Down
Loading

0 comments on commit 816f52b

Please sign in to comment.