auto typer

Discussion in 'Programming General' started by flickflackflick, Jul 25, 2010.

auto typer
  1. Unread #1 - Jul 25, 2010 at 10:01 AM
  2. flickflackflick
    Joined:
    Jul 18, 2010
    Posts:
    109
    Referrals:
    0
    Sythe Gold:
    0

    flickflackflick Active Member

    auto typer

    could anyone show me how to make an autotyper, i think it would go in this section :eek:
     
  3. Unread #2 - Jul 25, 2010 at 1:57 PM
  4. Jimmy
    Joined:
    Jun 24, 2008
    Posts:
    2,421
    Referrals:
    10
    Sythe Gold:
    25

    Jimmy Ghost
    Retired Sectional Moderator $5 USD Donor

    auto typer

    In order to simulate key events you would call the keyPress() and keyRelease() methods of the java.awt.Robot class after obtaining an instance of the class. The int argument that you pass to the method is the VK key code of the key to press/release. The VK keycodes are kept as constants in the java.awt.event.KeyEvent class. An extremely example of this can be found here.
     
  5. Unread #3 - Jul 25, 2010 at 9:26 PM
  6. itsboom
    Joined:
    May 7, 2010
    Posts:
    290
    Referrals:
    0
    Sythe Gold:
    0

    itsboom Forum Addict

    auto typer

    Heres a basic autotyper, but I made it not allow any symbols due to them causing it errors
    Code:
    
    
    import java.awt.AWTException;
    import java.awt.GridLayout;
    import java.awt.Robot;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.KeyEvent;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JTextField;
    
    public class Main extends JFrame implements ActionListener,Runnable{
        JTextField one,two;
        char[] arr;
        public Main(){
            one = new JTextField(20);
            two = new JTextField(20);
            setSize(250,150);
            setLayout(new GridLayout(5,5));
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setTitle("Autotyper");
           setResizable(false);
            add(one);
           two.setEditable(false);
            add(two);
            JButton b = new JButton("Go!");
            add(b);
            b.addActionListener(this);
        }
        public Main(char[] ar){
          //  this();
            arr = ar;
        }
        public static void main(String[] args){
            try{
                
                new Main().setVisible(true);
            }catch(Exception e){e.printStackTrace();}
        }
        private void copy(Robot robot, char[] charsToPrint){
            robot.setAutoDelay(100);
            for(char l : charsToPrint)
            {
                if(Character.isUpperCase(l)){
                    robot.keyPress(16);
                    pNr(robot,(int)l);
                    robot.keyRelease(16);
                }
                else if (Character.isLetterOrDigit(l))pNr(robot, Character.toUpperCase(l));
                else if(Character.isWhitespace(l))pNr(robot,KeyEvent.VK_SPACE);
            }
           edit(true);
           one.requestFocus();
           one.setText(null);
        }
        private void pNr(Robot robot, int to)
        {
    
            robot.keyPress(to);
            robot.keyRelease(to);
        }
        public void run(){
            try{
                copy(new Robot(),arr);
            }catch(AWTException e){System.err.println(e);};
        }
        private void edit(boolean edit){
            one.setEditable(edit);
            two.setEditable(!edit);
        }
        public void actionPerformed(ActionEvent e){
            if(one.getText().length() < 1)
                return;
            edit(false);
            two.setText(null);     
            two.requestFocus();
            arr = one.getText().toCharArray();
            try{
                new Thread(this).start();
            }catch(Exception ae){ae.printStackTrace();}
    
        }
    }
    
     
  7. Unread #4 - Jul 26, 2010 at 5:18 PM
  8. flickflackflick
    Joined:
    Jul 18, 2010
    Posts:
    109
    Referrals:
    0
    Sythe Gold:
    0

    flickflackflick Active Member

    auto typer

    ok, wow thanks, now i see it, i couldnt of done this

    thanks alot though, and what do i put that in?
     
  9. Unread #5 - Jul 26, 2010 at 8:59 PM
  10. itsboom
    Joined:
    May 7, 2010
    Posts:
    290
    Referrals:
    0
    Sythe Gold:
    0

    itsboom Forum Addict

    auto typer

    put it in a document called Main.java, then compile and run it, this is only an example that will type in the jtextfield.
     
  11. Unread #6 - Jul 26, 2010 at 10:53 PM
  12. flickflackflick
    Joined:
    Jul 18, 2010
    Posts:
    109
    Referrals:
    0
    Sythe Gold:
    0

    flickflackflick Active Member

    auto typer

    hm...idk what u mean by that im extremely new to coding and havent ever tried java before
     
  13. Unread #7 - Aug 1, 2010 at 2:35 PM
  14. db0winsanity
    Joined:
    Dec 28, 2008
    Posts:
    109
    Referrals:
    0
    Sythe Gold:
    0

    db0winsanity Active Member

    auto typer

    your best bet is to use that one as a guide, and start from scratch, otherwise you'll never understand it.. check out Netbeans, the gui editor is nice for beginers
     
  15. Unread #8 - Aug 31, 2010 at 1:48 PM
  16. nulty
    Joined:
    Jul 31, 2010
    Posts:
    3
    Referrals:
    0
    Sythe Gold:
    0

    nulty Newcomer

    auto typer

< VB Network Transfer | Omegle Auto Talker >

Users viewing this thread
1 guest


 
 
Adblock breaks this site