 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
systat Advanced Cheater
Reputation: 0
Joined: 15 Feb 2008 Posts: 54
|
Posted: Thu Apr 17, 2008 11:01 am Post subject: Java Bot(Spammer Included) |
|
|
Well, I started learning Java few days ago, and decided to make an IRC bot, so here it is, I used this http://www.jibble.org/pircbot.php framework to easily create bot, and swing library to make GUI
BotCore.java
| Code: | import org.jibble.pircbot.PircBot;
public class BotCore extends PircBot {
int i=55;
public BotCore(String Log,String Name,String Vers) {
this.setLogin(Log);
this.setName(Name);
this.setVersion(Vers);
this.setMessageDelay(5000);
}
public void onMessage(String channel, String sender,
String login, String hostname, String message) {
if(message.contains("DAJ OP")&&sender.equalsIgnoreCase("brzi_baba_zg"))
sendMessage("chanserv","OP #bot brzi_baba_zg");
if(message.contains("DAJ OP")&&!sender.equalsIgnoreCase("brzi_baba_zg"))
sendMessage(channel,message+", NOT!!!");
}
protected void onPrivateMessage(String sender,
String login,
String hostname,
String message) {
if(sender.equals("brzi_baba_zg"))
sendMessage(sender,"Pozdrav Gazda.");
else
sendMessage(sender,"Ti nisi ON!");
}
protected void onJoin(String channel,
String sender,
String login,
String hostname) {
quitServer("http://www.youtube.com/watch?v=NX1fqMGQWtI&feature=related -> LUDA PESMA BRATE!!");
}
}
|
GUI.java
| Code: | import java.awt.*;
import java.awt.event.*;
import java.io.IOException;
import javax.swing.*;
import org.jibble.pircbot.IrcException;
import org.jibble.pircbot.NickAlreadyInUseException;
public class GUI extends JApplet implements ActionListener{
int NumberOfBots=0;
JTextField BotName;
JTextField IRCServer;
JTextField Channel;
JButton Start;
JCheckBox SpamIt;
JLabel Name;
JLabel Server;
JLabel Chan;
JLabel lNOB;
JTextField NOB;
public void init() {
try {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
makeGUI();
}}
);
} catch(Exception e) {
System.out.println("Ne mogu da napravim zbog: "+e);
}
}
@SuppressWarnings("deprecation")
private void makeGUI(){
JFrame frame = new JFrame();
frame.show();
setLayout(new FlowLayout());
Name=new JLabel("Name");
add(Name);
BotName=new JTextField(15);
BotName.setText("Systat");
add(BotName);
Server=new JLabel("Server");
add(Server);
IRCServer=new JTextField(15);
IRCServer.setText("chat.tportal.hr");
add(IRCServer);
Chan=new JLabel("Channel");
add(Chan);
Channel=new JTextField(15);
Channel.setText("#TEST");
add(Channel);
lNOB=new JLabel("Number Of Bots");
add(lNOB);
NOB=new JTextField(6);
add(NOB);
Start=new JButton("Start");
add(Start);
Start.addActionListener(this);
SpamIt=new JCheckBox("Spam",false);
add(SpamIt);
}
public void actionPerformed(ActionEvent ae){
String str=ae.getActionCommand();
boolean b = SpamIt.isSelected();
if(str.equals("Start")){
int aInt = Integer.parseInt(NOB.getText());
if(b==true)
for(int i=0;i<aInt;i++){
BotCore bot=new BotCore("Chatter",BotName.getText(),"JavaLooser");
bot.setVerbose(true);
NumberOfBots++;
try {
bot.connect(IRCServer.getText());
bot.changeNick(BotName.getText()+NumberOfBots);
bot.joinChannel(Channel.getText());
} catch (NickAlreadyInUseException e) {
} catch (IOException e) {
} catch (IrcException e) {
}
}
else {
BotCore bot=new BotCore("Chatter",BotName.getText(),"JavaLooser");
bot.setVerbose(true);
try {
bot.connect(IRCServer.getText());
//NumberOfBots++;
bot.changeNick(BotName.getText());
bot.joinChannel(Channel.getText());
} catch (NickAlreadyInUseException e) {
System.out.println("===NICKNAME ALREADY IN USE===");
} catch (IOException e) {
} catch (IrcException e) {
}
}
}
repaint();
}
}
|
Sadly Java is really shitty programming language, larger applications made in Java is slow, they crash every 5 minutes, they all have some shitty splash screens, to make user think that program is loading, and crap like that...
_________________
uuuuuuuuuuuuu |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Thu Apr 17, 2008 11:39 am Post subject: |
|
|
Eh Java isn't really horrifyingly slow anymore and the crashing likely isn't it's fault.
Look into C# otherwise.
|
|
| Back to top |
|
 |
systat Advanced Cheater
Reputation: 0
Joined: 15 Feb 2008 Posts: 54
|
Posted: Thu Apr 17, 2008 12:08 pm Post subject: |
|
|
Maybe, but sandbox is really making me sad, It doesn't allow to show whole Java potential...
_________________
uuuuuuuuuuuuu |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|