Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Java by WiFI ( 15 years ago )
import java.awt.*;
import java.awt.event.*;
import java.lang.Integer;
import javax.swing.*;
import javax.imageio.ImageIO;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.awt.image.BufferedImage;
import com.rsbuddy.event.listeners.PaintListener;
import com.rsbuddy.script.ActiveScript;
import com.rsbuddy.script.Manifest;
import com.rsbuddy.script.methods.*;
@SuppressWarnings("deprecation")
@Manifest(authors={"Salvation"}, name="WiFi Alcher", keywords={"Loss or Gain, Alch, Magic"}, version=1.0, description="Alches any item. Gains Magic Exp.")
public class WiFiAlcher extends ActiveScript implements MouseListener, PaintListener {
private gui gui;
boolean startScript = false;
boolean HasItems = false;
boolean UseStaff = false;
boolean HidePaint = false;
BufferedImage normal = null;
BufferedImage clicked = null;
String AlchType;
int AlchItem;
int Profit = 0;
int Cash = 0;
int NatureRune = 561;
int FireRune = 554;
int startExp = 0;
int expGained = 0;
int runeCheck = 0;
int startLevel = 0;
int levelsGained = 0;
int FireStaff[] = { 1387, 3054 };
int hoursTNL, secsTNL, minsTNL, nextLevel, xpToLevel;
long hours, minutes, seconds, expTime;
long startTime = System.currentTimeMillis();
@Override
public boolean onStart() {
gui = new gui();
gui.setVisible(true);
while(!startScript) { sleep(10); }
try {
final URL cursorURL = new URL("http://i48.tinypic.com/313623n.png");
final URL cursor80URL = new URL("http://i46.tinypic.com/9prjnt.png");
normal = ImageIO.read(cursorURL);
clicked = ImageIO.read(cursor80URL);
} catch(MalformedURLException e) {
log.severe("Unable to buffer cursor.");
} catch(IOException e) {
log.severe("Unable to open cursor image.");
}
return true;
}
public int loop() {
if(!HasItems) { checkItems(); return Random(100,1000); }
if(Game.isLoggedIn()) {
AntiBan();
GetAlchProfit();
if(Game.getCurrentTab() != Game.TAB_INVENTORY) {
if(AlchType.equalsIgnoreCase("high alch")) {
Magic.castSpell(Magic.SPELL_HIGH_LEVEL_ALCHEMY);
} else {
Magic.castSpell(Magic.SPELL_LOW_LEVEL_ALCHEMY);
}
sleep(Random(100, 1000));
} else {
if(Inventory.getItem(AlchItem) != null && Inventory.getItem(NatureRune) != null && UseStaff == true) {
if(Game.isSpellSelected()) {
Inventory.getItem(AlchItem).click(true);
}
} else if(Inventory.getItem(AlchItem) != null && Inventory.getItem(NatureRune) != null && Inventory.getItem(FireRune) != null && UseStaff == false) {
if(Game.isSpellSelected()) {
Inventory.getItem(AlchItem).click(true);
}
} else {
HasItems = false;
return Random(100,1000);
}
sleep(Random(1000,1300));
while(Game.isLoggedIn() && Game.getCurrentTab() != Game.TAB_MAGIC && !isPaused()) { Game.openTab(Game.TAB_MAGIC); sleep(Random(200, 400)); }
}
}
return Random(100,1000);
}
private int Random(int i, int j) {
// TODO Auto-generated method stub
return 0;
}
public void checkItems() {
if(Equipment.containsOneOf(FireStaff)) {
UseStaff = true;
while(Game.getCurrentTab() != Game.TAB_INVENTORY && Game.isLoggedIn() && !isPaused()) { Game.openTab(Game.TAB_INVENTORY); sleep(Random(400, 800)); }
if(Inventory.contains(NatureRune) && Inventory.contains(AlchItem)) {
HasItems = true;
Game.openTab(Game.TAB_MAGIC);
return;
} else {
log.severe("Stopping Script: Out of Runes or stuff to Alch!");
Game.logout(false);
stopScript();
}
} else {
UseStaff = false;
while(Game.getCurrentTab() != Game.TAB_INVENTORY && Game.isLoggedIn() && !isPaused()) { Game.openTab(Game.TAB_INVENTORY); sleep(Random(400, 800)); }
if(Inventory.contains(NatureRune) && Inventory.contains(FireRune) && Inventory.contains(AlchItem)) {
HasItems = true;
Game.openTab(Game.TAB_MAGIC);
return;
} else {
log.severe("Stopping Script: Out of Runes or stuff to Alch!");
Game.logout(false);
stopScript();
}
}
}
private void stopScript() {
// TODO Auto-generated method stub
}
private Image getImage(String url) {
try {
return ImageIO.read(new URL(url));
} catch(IOException e) {
return null;
}
}
private final Color color1 = new Color(218, 200, 164);
private final Color color2 = new Color(0, 123, 255);
private final Color color3 = new Color(19, 42, 111);
private final Color color4 = new Color(255, 0, 51);
private final Color color5 = new Color(0, 255, 0, 130);
private final Color color6 = new Color(0, 0, 0);
private final Color color7 = new Color(0, 153, 0);
private final Color color8 = new Color(0, 0, 255);
private final BasicStroke stroke1 = new BasicStroke(1);
private final Font font1 = new Font("Calibri", 0, 12);
private final Image img1 = getImage("http://i54.tinypic.com/rm5lzq.png");
private final Image img2 = getImage("http://shiningpaladins.com/images/skillcape/magic_cape.gif");
public void onRepaint(Graphics g1) {
Graphics2D g = (Graphics2D)g1;
g.setColor(color1);
g.fillRect(8, 345, 487, 113);
g.fillRect(8, 459, 503, 14);
g.setColor(color2);
g.fillRoundRect(177, 345, 2, 112, 16, 16);
g.setColor(color3);
g.setStroke(stroke1);
g.drawRoundRect(177, 345, 2, 112, 16, 16);
g.drawImage(img1, 189, 366, null);
g.setFont(font1);
g.setColor(color4);
g.drawString("http://wifiscripts.webs.com/", 10, 469);
g.drawString("Script made by WiFi", 400, 470);
g.drawImage(img2, 363, 340, null);
g.setColor(color6);
g.fillRoundRect(3, 2, 251, 26, 16, 16);
g.setColor(color5);
g.drawRoundRect(3, 2, 251, 26, 16, 16);
g.setColor(color7);
g.drawString("This script is only compatible with RSBuddy.", 9, 19);
g.setColor(color8);
g.drawString("This script Alches any Object.", 12, 361);
g.drawString("This script will also gain tons", 11, 376);
g.drawString("of levels, you will gain or lose", 11, 392);
g.drawString("some money so beware!", 12, 407);
if (normal != null) {
final int Mouse_x = Mouse.getLocation().x;
final int Mouse_y = Mouse.getLocation().y;
final int Mouse_x2 = Mouse.getPressLocation().x;
final int Mouse_y2 = Mouse.getPressLocation().y;
final long mpt = System.currentTimeMillis() - Mouse.getPressTime();
if (Mouse.getPressTime() == -1 || mpt >= 1000) {
g.drawImage(normal, Mouse_x - 8, Mouse_y - 8, null);
}
if (mpt < 1000) {
g.drawImage(clicked, Mouse_x2 - 8, Mouse_y2 - 8, null);
g.drawImage(normal, Mouse_x - 8, Mouse_y - 8, null);
}
}
}
public Point p;
public Rectangle button = new Rectangle(497, 346, 14, 13);
public void MouseClicked(MouseEvent e){}
public void MousePressed(MouseEvent m) {}
public void MouseExited(MouseEvent e) {}
public void MouseEntered(MouseEvent e) {}
public void MouseReleased(MouseEvent e) {
p = e.getPoint();
if(button.contains(p)) { HidePaint = !HidePaint; }
}
public void GetAlchProfit() {
if(Profit == 0 && Game.getCurrentTab() == Game.TAB_INVENTORY) {
Integer Money = Inventory.getCount(true, 995);
if(Cash == 0) { Cash = Money; }
if(Money != Cash && Profit == 0) {
Profit = Money - Cash;
}
}
}
public void AntiBan() {
Integer i = Random(1, 100);
switch(i)
{
case 40:
Mouse.setSpeed(Random(4,7));
break;
case 50:
Camera.setCompassAngle(Random(1,360));
break;
}
}
public class gui extends JFrame {
public gui() {
initComponents();
}
private void button1ActionPerformed(ActionEvent e) {
if(textField1.getText().toString().isEmpty()) {
java.awt.Toolkit.getDefaultToolkit().beep();
JOptionPane.showMessageDialog(gui, "You must enter a item ID to continue.");
} else {
AlchType = comboBox1.getSelectedItem().toString();
AlchItem = Integer.parseInt(textField1.getText().toString());
startScript = true;
setVisible(false);
}
}
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
label1 = new JLabel();
textField1 = new JTextField();
button1 = new JButton();
comboBox1 = new JComboBox();
label2 = new JLabel();
//======== gui ========
{
setTitle("WiFi Alcher");
setResizable(false);
Container guiContentPane = getContentPane();
//---- label1 ----
label1.setText("Item ID:");
//---- button1 ----
button1.setText("Start");
button1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
button1ActionPerformed(e);
}
});
//---- comboBox1 ----
comboBox1.setModel(new DefaultComboBoxModel(new String[] {
"High Alch", "Low Alch"
}));
//---- label2 ----
label2.setText(" Type:");
GroupLayout guiContentPaneLayout = new GroupLayout(guiContentPane);
guiContentPane.setLayout(guiContentPaneLayout);
guiContentPaneLayout.setHorizontalGroup(
guiContentPaneLayout.createParallelGroup()
.addGroup(guiContentPaneLayout.createSequentialGroup()
.addGroup(guiContentPaneLayout.createParallelGroup()
.addGroup(guiContentPaneLayout.createSequentialGroup()
.addContainerGap()
.addComponent(button1, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE))
.addGroup(GroupLayout.Alignment.TRAILING, guiContentPaneLayout.createSequentialGroup()
.addGroup(guiContentPaneLayout.createParallelGroup()
.addGroup(guiContentPaneLayout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(label1, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE))
.addGroup(guiContentPaneLayout.createSequentialGroup()
.addContainerGap()
.addComponent(label2, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)))
.addGroup(guiContentPaneLayout.createParallelGroup()
.addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, 111, GroupLayout.PREFERRED_SIZE)
.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 115, GroupLayout.PREFERRED_SIZE))))
.addContainerGap())
);
guiContentPaneLayout.setVerticalGroup(
guiContentPaneLayout.createParallelGroup()
.addGroup(GroupLayout.Alignment.TRAILING, guiContentPaneLayout.createSequentialGroup()
.addContainerGap()
.addGroup(guiContentPaneLayout.createParallelGroup()
.addComponent(label1, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)
.addGroup(guiContentPaneLayout.createSequentialGroup()
.addGap(5, 5, 5)
.addComponent(textField1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(guiContentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(label2, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(button1, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
pack();
setLocationRelativeTo(getOwner());
}
// JFormDesigner - End of component initialisation //GEN-END:initComponents
}
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private JFrame gui;
private JLabel label1;
private JTextField textField1;
private JButton button1;
private JComboBox comboBox1;
private JLabel label2;
// JFormDesigner - End of variables declaration //GEN-END:variables
}
@Override
public void mouseClicked(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent arg0) {
// TODO Auto-generated method stub
}
}
Revise this Paste