Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 9.13 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. import javax.swing.*;
  4. import javax.swing.border.*;
  5.  
  6. import org.rsbot.script.Script;
  7. import org.rsbot.script.ScriptManifest;
  8.  
  9. @ScriptManifest(authors = "Radioactive", keywords = {"Other"}, name = "iSing", version = 1.0, description = "This will sing songs for you.")
  10.  
  11. public class iSing extends Script {
  12.  
  13.     private final String Song1[] = { "Song: Rick Astley - Never gonna give you up", "We’re no strangers to love,",
  14.         "You know the rules and so do I", "A full commitment’s what I’m thinking of,",
  15.         "You wouldnt get this from any other guy", "I just wanna tell you how I’m feeling,",
  16.         "Gotta make you understand...", "Never gonna give you up,",
  17.         "Never gonna let you down,", "Never gonna run around and desert you",
  18.         "Never gonna make you cry,", "Never gonna say goodbye,",
  19.         "Never gonna tell a lie and hurt you","We’ve known each other for so long",
  20.         "Your heart’s been aching", "But you’re too shy to say it",
  21.         "Inside we both know what’s been going on,", "We know the game and we’re gonna play it",
  22.         "And if you ask me how I’m feeling,", "Don’t tell me you’re too blind to see...",
  23.         "Never gonna give you up,", "Never gonna let you down,",
  24.         "Never gonna run around and desert you", "Never gonna make you cry,",
  25.         "Never gonna say goodbye,", "Never gonna tell a lie and hurt you",
  26.         "Never gonna give you up,", "Never gonna let you down,",
  27.         "Never gonna run around and desert you", "Never gonna make you cry,",
  28.         "Never gonna say goodbye,", "Never gonna tell a lie and hurt you",
  29.         "Never gonna give you up,", "Never gonna let you down,",
  30.         "Never gonna run around and desert you", "Never gonna make you cry,",
  31.         "Never gonna say goodbye,", "Never gonna tell a lie and hurt you",
  32.         "We’ve known each other for so long", "Your heart’s been aching",
  33.         "But you’re too shy to say it", "Inside we both know what’s been going on,",
  34.         "We know the game and we’re gonna play it", "I just wanna tell you how I’m feeling,",
  35.         "Gotta make you understand...", "Never gonna give you up,",
  36.         "Never gonna let you down,", "Never gonna run around and desert you",
  37.         "Never gonna make you cry,", "Never gonna say goodbye,",
  38.         "Never gonna tell a lie and hurt you","Never gonna give you up,",
  39.         "Never gonna let you down,", "Never gonna run around and desert you",
  40.         "Never gonna make you cry,", "Never gonna say goodbye,",
  41.         "Never gonna tell a lie and hurt you" };
  42.  
  43.     private final String Song2[] = { "Song: Justin Bieber - One time", "Me plus you, I'ma tell you one time",
  44.         "Me plus you, I'ma tell you one time", "Me plus you, I'ma tell you one time", "One time, one time",
  45.         "When I met you girl my heart went knock knock", "Now them butterflies in my stomach won't stop stop",
  46.         "And even though it's a struggle love is all we got", "And we gon' keep keep climbing to the mountain top",
  47.         "Your world is my world", "And my fight is your fight",
  48.         "My breath is your breath", "And your heart",
  49.         "And girl you're my one love, my one heart", "My one life for sure",
  50.         "Let me tell you one time", "I'ma tell you one time",
  51.         "And I'ma be your one guy", "You'll be my number one girl",
  52.         "Always making time for you", "I'ma tell you one time",
  53.         "I'ma tell you one time", "You look so deep, you know that it humbles me",
  54.         "You're by my side, them troubles them not trouble me", "Many have called but the chosen is you",
  55.         "Whatever you want shawty I'll give it to you", "Your world is my world",
  56.         "And my fight is your fight", "My breath is your breath",
  57.         "And your heart", "And girl you're my one love, my one heart",
  58.         "My one life for sure", "Let me tell you one time",
  59.         "I'ma tell you one time", "And I'ma be your one guy",
  60.         "You'll be my number one girl", "Always making time for you",
  61.         "I'ma tell you one time", "I'ma tell you one time",
  62.         "Shawty right there", "She's got everything I need",
  63.         "And I'ma tell her one time", "Give you everything you need down to my last dime",
  64.         "She makes me happy", "I know where I'll be",
  65.         "And girl you're my one love, my one heart", "My one life for sure",
  66.         "Let me tell you one time", "I'ma tell you one time",
  67.         "And I'ma be your one guy", "You'll be my number one girl",
  68.         "Always making time for you", "I'ma tell you one time",
  69.         "I'ma tell you one time", "Me plus you, I'ma tell you one time",
  70.         "Me plus you, I'ma tell you one time", "Me plus you, I'ma tell you one time",
  71.         "One time, one time" };
  72.    
  73.     Gui gui;
  74.  
  75.     @Override
  76.     public boolean onStart() {
  77.         gui = new Gui();
  78.         gui.setVisible(true);
  79.         return true;
  80.     }
  81.  
  82.     @Override
  83.     public int loop() {
  84.         if (gui.startClicked) {
  85.             Song();
  86.             gui.startClicked = false;
  87.         }
  88.         return 3000;
  89.     }
  90.  
  91.     public void Song() {
  92.         final String[] song;
  93.         switch (gui.ComboBox1.getSelectedIndex()) {
  94.             case 0:
  95.                 song = Song1;
  96.                 break;
  97.             case 1:
  98.                 song = Song2;
  99.                 break;
  100.             default:
  101.                 return;
  102.         }
  103.         for (final String line : song) {
  104.             keyboard.sendText(line, true);
  105.             sleep(500, 1500);
  106.         }
  107.     }
  108.    
  109.     @SuppressWarnings("serial")
  110.     public class Gui extends JFrame {
  111.    
  112.         public Gui() {
  113.             initComponents();
  114.         }
  115.  
  116.         private boolean startClicked = false;
  117.         private JButton Start;
  118.         private JButton Pause;
  119.         private JButton Switch;
  120.         private JLabel Text;
  121.         private JLabel Color;
  122.         private JLabel Effect;
  123.         private JComboBox ComboBox1;
  124.         private JComboBox ComboBox2;
  125.         private JComboBox ComboBox3;
  126.         private JLabel label3; 
  127.        
  128.         @SuppressWarnings("unused")
  129.         private void initComponents() {
  130.        
  131.             Start = new JButton();
  132.             Pause = new JButton();
  133.             Switch = new JButton();
  134.             Text = new JLabel();
  135.             Color = new JLabel();
  136.             Effect = new JLabel();
  137.             ComboBox1 = new JComboBox();
  138.             ComboBox2 = new JComboBox();
  139.             ComboBox3 = new JComboBox();
  140.             label3 = new JLabel();
  141.  
  142.             setResizable(false);
  143.             setTitle("iSing");
  144.             Container contentPane = getContentPane();
  145.             contentPane.setLayout(null);
  146.  
  147.             Start.setText("Start");
  148.             Start.setBorder(new MatteBorder(1, 1, 1, 1,  java.awt.Color.black));
  149.             contentPane.add(Start);
  150.             Start.setBounds(5, 5, 75, 25);
  151.             Start.addActionListener(new ActionListener() {
  152.                 public void actionPerformed(ActionEvent e) {
  153.                     startClicked = true;
  154.                 }
  155.             );
  156.  
  157.             Pause.setText("Pause");
  158.             Pause.setBorder(new MatteBorder(1, 1, 1, 1,  java.awt.Color.black));
  159.             Pause.setEnabled(false);
  160.             contentPane.add(Pause);
  161.             Pause.setBounds(5, 35, 75, 25);
  162.  
  163.             Switch.setText("Switch World");
  164.             Switch.setBorder(new MatteBorder(1, 1, 1, 1,  java.awt.Color.black));
  165.             Switch.setEnabled(false);
  166.             contentPane.add(Switch);
  167.             Switch.setBounds(5, 65, 75, 25);
  168.  
  169.             Text.setText("Text:");
  170.             Text.setFont(Text.getFont().deriveFont(Text.getFont().getStyle() | Font.ITALIC));
  171.             contentPane.add(Text);
  172.             Text.setBounds(new Rectangle(new Point(85, 10), Text.getPreferredSize()));
  173.  
  174.             Color.setText("Color:");
  175.             Color.setFont(Color.getFont().deriveFont(Color.getFont().getStyle() | Font.ITALIC));
  176.             contentPane.add(Color);
  177.             Color.setBounds(new Rectangle(new Point(85, 40), Color.getPreferredSize()));
  178.  
  179.             Effect.setText("Effect:");
  180.             Effect.setFont(Effect.getFont().deriveFont(Effect.getFont().getStyle() | Font.ITALIC));
  181.             contentPane.add(Effect);
  182.             Effect.setBounds(new Rectangle(new Point(85, 70), Effect.getPreferredSize()));
  183.  
  184.             ComboBox1.setModel(new DefaultComboBoxModel(new String[] {
  185.                 "Never Gonna Give You Up",
  186.                 "One Time" 
  187.             }));
  188.             ComboBox1.setBorder(new MatteBorder(1, 1, 1, 1,  java.awt.Color.black));
  189.             contentPane.add(ComboBox1);
  190.             ComboBox1.setBounds(125, 5, 160, 25);
  191.  
  192.             ComboBox2.setEnabled(false);
  193.             ComboBox2.setModel(new DefaultComboBoxModel(new String[] {
  194.                 "Yellow",
  195.                 "Red",
  196.                 "Green",
  197.                 "Purple",
  198.                 "Cyan",
  199.                 "White",
  200.                 "Flash 1",
  201.                 "Flash 2",
  202.                 "Flash 3",
  203.                 "Glow 1",
  204.                 "Glow 2",
  205.                 "Glow 3",
  206.                 "[Random]"
  207.             }));
  208.             ComboBox2.setBorder(new MatteBorder(1, 1, 1, 1,  java.awt.Color.black));
  209.             contentPane.add(ComboBox2);
  210.             ComboBox2.setBounds(125, 35, 160, 25);
  211.  
  212.             ComboBox3.setEnabled(false);
  213.             ComboBox3.setModel(new DefaultComboBoxModel(new String[] {
  214.                 "None",
  215.                 "Wave",
  216.                 "Wave 2",
  217.                 "Scroll",
  218.                 "Slide",
  219.                 "Shake",
  220.                 "Scramble",
  221.                 "[Random]"
  222.                     }
  223.                 )
  224.             );
  225.             ComboBox3.setBorder(new MatteBorder(1, 1, 1, 1,  java.awt.Color.black));
  226.             contentPane.add(ComboBox3);
  227.             ComboBox3.setBounds(125, 65, 160, 25);
  228.  
  229.             label3.setText("iSing by: Radioactive");
  230.             contentPane.add(label3);
  231.             label3.setBounds(new Rectangle(new Point(5, 95), label3.getPreferredSize()));
  232.  
  233.             {
  234.                 Dimension preferredSize = new Dimension();
  235.                 for(int i = 0; i < contentPane.getComponentCount(); i++) {
  236.                     Rectangle bounds = contentPane.getComponent(i).getBounds();
  237.                     preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  238.                     preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  239.                 }
  240.                 Insets insets = contentPane.getInsets();
  241.                 preferredSize.width += insets.right;
  242.                 preferredSize.height += insets.bottom;
  243.                 contentPane.setMinimumSize(preferredSize);
  244.                 contentPane.setPreferredSize(preferredSize);
  245.             }
  246.             setSize(295, 140);
  247.             setLocationRelativeTo(getOwner());
  248.         }
  249.     }
  250. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement