16
General Programming / Re: Battle.net Instant Messenger!
« on: January 02, 2006, 08:18:39 pm »
I wrote about two years ago... pretty much retarted.
Facebook killed the radio star. And by radio star, I mean the premise of distributed forums around the internet. And that got got by Instagram/SnapChat. And that got got by TikTok. Where the fuck is the internet we once knew?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
dim i, ii, iii as integer
dim r as new Random
dim Hint as string
i = len(Answer)
ii = 0
while ii<>i + 1
Hint = hint + "-"
ii = ii + 1
wend
ii = 0
while ii<>HintLevel + 1
iii = r.InRange(1, i)
Hint = left(hint, iii - 1) + mid(Answer, iii - 1, 1) + mid(hint, iii)
ii = ii + 1
Wend
return hint
[pre]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Properties;
import javax.swing.JComponent;
import callback_interfaces.PluginCallbackRegister;
import callback_interfaces.PublicExposedFunctions;
import callback_interfaces.StaticExposedFunctions;
import exceptions.PluginException;
import plugin_interfaces.ConnectionCallback;
import plugin_interfaces.EventCallback;
import plugin_interfaces.GenericPluginInterface;
public class PluginMain extends GenericPluginInterface implements EventCallback, ConnectionCallback
{
private static ServerSocket serverSocket = null;
private static Socket clientSocket = null;
private static PrintWriter pOut = null;
private static BufferedReader in = null;
private static PublicExposedFunctions tOut = null;
public void load(StaticExposedFunctions staticFuncs)
{
}
public void activate(PublicExposedFunctions out, PluginCallbackRegister register)
{
register.registerEventPlugin(this, null);
register.registerConnectionPlugin(this, null);
tOut = out;
}
public void deactivate(PluginCallbackRegister register)
{
// TODO Auto-generated method stub
}
public String getName()
{
// TODO Auto-generated method stub
return "SBCP";
}
public String getVersion()
{
// TODO Auto-generated method stub
return "1.0";
}
public String getAuthorName()
{
// TODO Auto-generated method stub
return "Ryan Marcus";
}
public String getAuthorWebsite()
{
// TODO Auto-generated method stub
return "None";
}
public String getAuthorEmail()
{
// TODO Auto-generated method stub
return "ryan@marcusfamily.info";
}
public String getLongDescription()
{
// TODO Auto-generated method stub
return "Allows you to connect with SBCP";
}
public Properties getDefaultSettingValues()
{
// TODO Auto-generated method stub
Properties p = new Properties();
return p;
}
public Properties getSettingsDescription()
{
// TODO Auto-generated method stub
Properties p = new Properties();
return p;
}
public JComponent getComponent(String settingName, String value)
{
// TODO Auto-generated method stub
return null;
}
public Properties getGlobalDefaultSettingValues()
{
// TODO Auto-generated method stub
Properties p = new Properties();
return p;
}
public Properties getGlobalSettingsDescription()
{
// TODO Auto-generated method stub
Properties p = new Properties();
return p;
}
public JComponent getGlobalComponent(String settingName, String value)
{
// TODO Auto-generated method stub
return null;
}
public void talk(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("TALK" + user + " " + statstring);
}
public void emote(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("EMOT" + user + " " + statstring);
}
public void whisperFrom(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("WSFM" + user + " " + statstring);
}
public void whisperTo(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("WSCN" + user + " " + statstring);
}
public void userShow(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("USIN" + user + " " + statstring);
}
public void userJoin(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("USJN" + user + " " + statstring);
}
public void userLeave(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("USLV" + user + " " + statstring);
}
public void userFlags(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("USFG" + user + " " + statstring);
}
public void error(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("ERRO" + user + " " + statstring);
}
public void info(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("INFO" + user + " " + statstring);
}
public void broadcast(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("BRDC" + user + " " + statstring);
}
public void channel(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("CHAN" + user + " " + statstring);
}
public final boolean ABORT = false;
public final boolean CONTINUE = true;
/** The bot is about to connect to a server, but hasn't yet. At this point, the connection can be stopped. */
public boolean connecting(String host, int port, Object data) throws IOException, PluginException
{
return false;
}
/** The bot has just connected to the server. */
public void connected(String host, int port, Object data) throws IOException, PluginException
{
try {
serverSocket = new ServerSocket(4444);
} catch (IOException e) {
System.err.println("Could not listen on port: 4444.");
System.exit(1);
}
try
{
clientSocket = serverSocket.accept();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
try
{
pOut = new PrintWriter(clientSocket.getOutputStream(), true);
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
try
{
in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
pOut.println("Connected!");
}
/** The bot is about to disconnect from the server. This is only called for planned disconnects. */
public boolean disconnecting(Object data)
{
return false;
}
/** The bot has disconnected from the server. */
public void disconnected(Object data)
{
}
private static String inputLine = null;
while ("i".equalsIgnoreCase("e"))
{
try
{
inputLine = in.readLine();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
if (inputLine.length() != 0)
{
try
{
tOut.sendText(inputLine);
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
}
[/pre]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Properties;
import javax.swing.JComponent;
import callback_interfaces.PluginCallbackRegister;
import callback_interfaces.PublicExposedFunctions;
import callback_interfaces.StaticExposedFunctions;
import exceptions.PluginException;
import plugin_interfaces.ConnectionCallback;
import plugin_interfaces.EventCallback;
import plugin_interfaces.GenericPluginInterface;
public class PluginMain extends GenericPluginInterface implements EventCallback, ConnectionCallback
{
private static ServerSocket serverSocket = null;
private static Socket clientSocket = null;
private static PrintWriter pOut = null;
private static BufferedReader in = null;
private static PublicExposedFunctions tOut = null;
public void load(StaticExposedFunctions staticFuncs)
{
}
public void activate(PublicExposedFunctions out, PluginCallbackRegister register)
{
register.registerEventPlugin(this, null);
register.registerConnectionPlugin(this, null);
tOut = out;
}
public void deactivate(PluginCallbackRegister register)
{
// TODO Auto-generated method stub
}
public String getName()
{
// TODO Auto-generated method stub
return "SBCP";
}
public String getVersion()
{
// TODO Auto-generated method stub
return "1.0";
}
public String getAuthorName()
{
// TODO Auto-generated method stub
return "Ryan Marcus";
}
public String getAuthorWebsite()
{
// TODO Auto-generated method stub
return "None";
}
public String getAuthorEmail()
{
// TODO Auto-generated method stub
return "ryan@marcusfamily.info";
}
public String getLongDescription()
{
// TODO Auto-generated method stub
return "Allows you to connect with SBCP";
}
public Properties getDefaultSettingValues()
{
// TODO Auto-generated method stub
Properties p = new Properties();
return p;
}
public Properties getSettingsDescription()
{
// TODO Auto-generated method stub
Properties p = new Properties();
return p;
}
public JComponent getComponent(String settingName, String value)
{
// TODO Auto-generated method stub
return null;
}
public Properties getGlobalDefaultSettingValues()
{
// TODO Auto-generated method stub
Properties p = new Properties();
return p;
}
public Properties getGlobalSettingsDescription()
{
// TODO Auto-generated method stub
Properties p = new Properties();
return p;
}
public JComponent getGlobalComponent(String settingName, String value)
{
// TODO Auto-generated method stub
return null;
}
public void talk(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("TALK" + user + " " + statstring);
}
public void emote(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("EMOT" + user + " " + statstring);
}
public void whisperFrom(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("WSFM" + user + " " + statstring);
}
public void whisperTo(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("WSCN" + user + " " + statstring);
}
public void userShow(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("USIN" + user + " " + statstring);
}
public void userJoin(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("USJN" + user + " " + statstring);
}
public void userLeave(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("USLV" + user + " " + statstring);
}
public void userFlags(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("USFG" + user + " " + statstring);
}
public void error(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("ERRO" + user + " " + statstring);
}
public void info(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("INFO" + user + " " + statstring);
}
public void broadcast(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("BRDC" + user + " " + statstring);
}
public void channel(String user, String statstring, int ping, int flags) throws IOException, PluginException
{
pOut.println("CHAN" + user + " " + statstring);
}
public final boolean ABORT = false;
public final boolean CONTINUE = true;
/** The bot is about to connect to a server, but hasn't yet. At this point, the connection can be stopped. */
public boolean connecting(String host, int port, Object data) throws IOException, PluginException
{
return false;
}
/** The bot has just connected to the server. */
public void connected(String host, int port, Object data) throws IOException, PluginException
{
try {
serverSocket = new ServerSocket(4444);
} catch (IOException e) {
System.err.println("Could not listen on port: 4444.");
System.exit(1);
}
try
{
clientSocket = serverSocket.accept();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
try
{
pOut = new PrintWriter(clientSocket.getOutputStream(), true);
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
try
{
in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
pOut.println("Connected!");
String inputLine = null;
while ("i".equalsIgnoreCase("a"))
{
try
{
inputLine = in.readLine();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
if (inputLine.length() != 0)
{
try
{
tOut.sendText(inputLine);
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
/** The bot is about to disconnect from the server. This is only called for planned disconnects. */
public boolean disconnecting(Object data)
{
return false;
}
/** The bot has disconnected from the server. */
public void disconnected(Object data)
{
}
}