Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.tbot.bot.TBot;
- import org.tbot.internal.AbstractScript;
- import org.tbot.internal.Manifest;
- import sun.audio.AudioPlayer;
- import sun.audio.AudioStream;
- import javax.mail.*;
- import javax.mail.internet.InternetAddress;
- import javax.mail.internet.MimeMessage;
- import java.io.FileInputStream;
- import java.io.FileNotFoundException;
- import java.io.IOException;
- import java.io.InputStream;
- import java.util.Properties;
- /**
- * Created by Brian on 11/12/2015.
- */
- @Manifest(name = "tester", authors = "Brian_Dev", version = 1.0, description = "Kills cows")
- public class hoh extends AbstractScript {
- @Override
- public int loop() {
- log("test");
- TBot.getBot().getScriptHandler().pauseScript(true);
- return 1000;
- }
- public void onPause() {
- // open the sound file as a Java input stream
- String gongFile = "C:\\Users\\Brian\\Downloads\\air.wav";
- InputStream in = null;
- try {
- in = new FileInputStream(gongFile);
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- // create an audiostream from the inputstream
- AudioStream audioStream = null;
- try {
- audioStream = new AudioStream(in);
- } catch (IOException e) {
- e.printStackTrace();
- }
- // play the audio clip with the audioplayer class
- AudioPlayer.player.start(audioStream);
- sleep(4000);
- final String username = "xx@gmail.com";
- final String password = "xx";
- Properties props = new Properties();
- props.put("mail.smtp.auth", "true");
- props.put("mail.smtp.starttls.enable", "true");
- props.put("mail.smtp.host", "smtp.gmail.com");
- props.put("mail.smtp.port", "587");
- Session session = Session.getInstance(props,
- new javax.mail.Authenticator() {
- protected PasswordAuthentication getPasswordAuthentication() {
- return new PasswordAuthentication(username, password);
- }
- });
- try {
- Message message = new MimeMessage(session);
- message.setFrom(new InternetAddress("xx@gmail.com"));
- message.setRecipients(Message.RecipientType.TO,
- InternetAddress.parse("xx@vtext.com"));
- message.setSubject("");
- message.setText("test1");
- Transport.send(message);
- log("sent msg");
- } catch (MessagingException e) {
- throw new RuntimeException(e);
- }
- log("Paused.");
- TBot.getBot().getScriptHandler().pauseScript(false);
- ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement