SRL Archive - General

How would I make this?


sm321

2012-02-29 05:25:28

I am looking to make something like Gary's Hood Auto-Clicker/Typer to practice. For those who don't know what it is, it's this:



Uploaded with ImageShack.us

I have Microsoft Visual Basic 2010 and know some basics of it, and I am familiar with:

SendKeys('Hello, this is my example', 20);

So how would I go about it? Thanks.

T_D

2012-02-29 22:02:09

Writing one in Java would be much faster - IMO thanks to the robot class (no need to hook anything). Example:

static{
try{
//declare the robot here
}catch(Exception e){
//handle exception
}
}

That would be a way to work with the Robot class without redefining every method/class. And for the timer, it would be extremely easy, example:


public void click(int times){
int current = 0;
do{
//robot click method
current++;
Thread.sleep([milliseconds here]);
}while(current <= times);
}

Don't hate on my crappy looking programming. :)

sm321

2012-03-01 02:54:11

From: T_D
Writing one in Java would be much faster - IMO thanks to the robot class (no need to hook anything). Example:

static{
try{
//declare the robot here
}catch(Exception e){
//handle exception
}
}

That would be a way to work with the Robot class without redefining every method/class. And for the timer, it would be extremely easy, example:


public void click(int times){
int current = 0;
do{
//robot click method
current++;
Thread.sleep([milliseconds here]);
}while(current <= times);
}

Don't hate on my crappy looking programming. :)


Oh, never knew Java would get used. Only problem is, I have no idea how to do Java. What other uses does Java have? Thankyou by the way :)

x[Warrior]x3500

2012-03-01 03:00:58

http://www.roseindia.net/java/use-java/uses-of-java.shtml
http://en.wikipedia.org/wiki/Java_%28programming_language%29

sm321

2012-03-01 07:08:09

From: x[Warrior]x3500
http://www.roseindia.net/java/use-java/uses-of-java.shtml
http://en.wikipedia.org/wiki/Java_%28programming_language%29


Thankyou, it seems worthwhile learning it, however it would take a while to learn.

T_D

2012-03-01 09:18:08

From: sm321
Oh, never knew Java would get used. Only problem is, I have no idea how to do Java. What other uses does Java have? Thankyou by the way :)


Java can pretty much be used for all common applications without much hassle. .NET is nice, I program in it a lot, but without the openness to it - it lacks on a few good thing. You are quite welcome, I hope I have helped you. Have a wonderful day.

sm321

2012-03-01 10:37:12

From: T_D
Java can pretty much be used for all common applications without much hassle. .NET is nice, I program in it a lot, but without the openness to it - it lacks on a few good thing. You are quite welcome, I hope I have helped you. Have a wonderful day.


.NET as in VB .NET? I'm currently learning very minor pascal things, then hopefully build up to RuneScape bots. You have helped, but I don't think I will go down the Java root just yet. I have made a very quick and simple yet effective autotyper on Simba. Thankyou :)

T_D

2012-03-01 14:30:03

From: sm321
.NET as in VB .NET? I'm currently learning very minor pascal things, then hopefully build up to RuneScape bots. You have helped, but I don't think I will go down the Java root just yet. I have made a very quick and simple yet effective autotyper on Simba. Thanlyou :)


Yes, compared to Java they don't have as many cool features although (at least with c-sharp), .NET seems a little more mature.

Sin

2012-03-01 14:34:59

Writing one in SIMBA is much easier ;)

T_D

2012-03-01 15:17:25

From: Sin
Writing one in SIMBA is much easier ;)


I agree, I was comparing to VB .NET :)

Edit: I wrote you a quick example of a very very simple mouse clicking program in Java. Here ya go!


package org.TD.robotmanager;

import java.awt.*;

/**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/1/12
* Time: 3:49 PM
* To change this template use File | Settings | File Templates.
*/
public class manager {
public Robot robot;

public manager(){
try{
robot = new Robot();
}catch(AWTException e){
System.out.println("Fatal exception: \n" + e.getMessage());
}
}
}

package org.TD;

import org.TD.robotmanager.manager;

import java.awt.event.InputEvent;

/**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/1/12
* Time: 3:50 PM
* To change this template use File | Settings | File Templates.
*/
public class test {
public manager m = new manager();

public void ClickMouse(boolean left){
if(left){
m.robot.mousePress(InputEvent.BUTTON1_MASK);
m.robot.mouseRelease(InputEvent.BUTTON1_MASK);
}else{
m.robot.mousePress(InputEvent.BUTTON2_MASK);
m.robot.mouseRelease(InputEvent.BUTTON2_MASK);
}
}
public void SendString(String text){
for(char c : text.toCharArray()){
m.robot.keyPress(c);
m.robot.keyRelease(c);
}
//m.robot.keyPress(KeyEvent.VK_ENTER);
//m.robot.keyRelease(KeyEvent.VK_ENTER);
//Uncomment those above to send the keys to the focused window.
}
}
TO RUN:

import org.TD.robotmanager.manager;
import org.TD.test;

/**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/1/12
* Time: 3:47 PM
* To change this template use File | Settings | File Templates.
*/
public class start {

public static manager man = new manager();
public static test t = new test();
public static void main(String[]args)throws InterruptedException{
/*
Initialize the GUI here
*/
for(int i = 0; i < 5; i++){
t.ClickMouse(true);
Thread.sleep(500);
}
}
}

Please don't hate for the programming being fugly. EDIT: I just quickly made the SendString method, I am unsure if it will work 100% and you would have to add a timer in between the keys being pressed to make it look human but it looks like it would work.

sm321

2012-03-02 02:40:11

From: Sin
Writing one in SIMBA is much easier ;)


Ye, I'm attempting to learn that. :)

From: T_D
I agree, I was comparing to VB .NET :)

Edit: I wrote you a quick example of a very very simple mouse clicking program in Java. Here ya go!


package org.TD.robotmanager;

import java.awt.*;

/**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/1/12
* Time: 3:49 PM
* To change this template use File | Settings | File Templates.
*/
public class manager {
public Robot robot;

public manager(){
try{
robot = new Robot();
}catch(AWTException e){
System.out.println("Fatal exception: \n" + e.getMessage());
}
}
}

package org.TD;

import org.TD.robotmanager.manager;

import java.awt.event.InputEvent;

/**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/1/12
* Time: 3:50 PM
* To change this template use File | Settings | File Templates.
*/
public class test {
public manager m = new manager();

public void ClickMouse(boolean left){
if(left){
m.robot.mousePress(InputEvent.BUTTON1_MASK);
m.robot.mouseRelease(InputEvent.BUTTON1_MASK);
}else{
m.robot.mousePress(InputEvent.BUTTON2_MASK);
m.robot.mouseRelease(InputEvent.BUTTON2_MASK);
}
}
public void SendString(String text){
for(char c : text.toCharArray()){
m.robot.keyPress(c);
m.robot.keyRelease(c);
}
//m.robot.keyPress(KeyEvent.VK_ENTER);
//m.robot.keyRelease(KeyEvent.VK_ENTER);
//Uncomment those above to send the keys to the focused window.
}
}
TO RUN:

import org.TD.robotmanager.manager;
import org.TD.test;

/**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/1/12
* Time: 3:47 PM
* To change this template use File | Settings | File Templates.
*/
public class start {

public static manager man = new manager();
public static test t = new test();
public static void main(String[]args)throws InterruptedException{
/*
Initialize the GUI here
*/
for(int i = 0; i < 5; i++){
t.ClickMouse(true);
Thread.sleep(500);
}
}
}

Please don't hate for the programming being fugly. EDIT: I just quickly made the SendString method, I am unsure if it will work 100% and you would have to add a timer in between the keys being pressed to make it look human but it looks like it would work.


Thanks :) How would I put this into use?

T_D

2012-03-02 12:06:28

From: sm321
Ye, I'm attempting to learn that. :)



Thanks :) How would I put this into use?


Use the methods I have gave you and add to it. You would want to make a GUI so you wont have to use it ass a cli like.

EDIT: A very small and easy to fix with the 'sendString' method, I will send you a personal message with a little more complex example for you to use. Keep looking for the personal message.

Daniel

2012-03-07 03:26:02


begin
MoveMouse(100, 100); // Move's the mouse.
if(IsKeyDown(VK_F4)) then // Check's if the F4 key is pressed.
SendKeys('Message!' + #13); // Type a message.
end.

Voila. Much easier than Java :)

sm321

2012-03-07 03:27:32

From: Daniel

begin
MoveMouse(100, 100); // Move's the mouse.
if(IsKeyDown(VK_F4)) then // Check's if the F4 key is pressed.
SendKeys('Message!' + #13); // Type a message.
end.

Voila. Much easier than Java :)


Yeah, I made a simple on Simba too :)