Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.SwingUtilities;
- import org.omg.CORBA.Environment;
- import org.runedream.api.Script;
- import org.runedream.api.ScriptManifest;
- import org.runedream.api.methods.Camera;
- import org.runedream.api.methods.Game;
- import org.runedream.api.methods.Keyboard;
- import org.runedream.api.util.Log;
- import org.runedream.api.util.Random;
- import org.runedream.api.util.Timer;
- @ScriptManifest(
- authors = { "Nissan Nut" },
- name = "Nissan's AutoTalker",
- version = 1.0,
- description = "Nissan Nut's Auto typing tool.",
- keywords = {"Nissan Nut" , "Auto" , "Talker", "AutoTalker"},
- language = { true, true, true, true })
- public class AutoTalker extends Script {
- AutoTalkerUI UI = new AutoTalkerUI();
- private boolean start = false;
- private boolean msg1;
- private boolean msg2;
- private boolean msg3;
- private boolean msg4;
- private boolean msg5;
- private boolean randomize;
- private boolean humanlike;
- private boolean rotation;
- private boolean randomorder;
- private String msg_1;
- private String msg_2;
- private String msg_3;
- private String msg_4;
- private String msg_5;
- private int intervalS, intervalMs;
- private int keystrokeMin, keystrokeMax;
- private Timer interval = new Timer(10);
- @Override
- public boolean onStart(){
- try {
- SwingUtilities.invokeAndWait(new Runnable() {
- public void run() {
- UI.setVisible(true);
- }
- });
- } catch (Throwable e) {
- }
- return true;
- }
- @Override
- public int loop() {
- Update();
- if (start && interval.getRemaining() <= 0){
- if(humanlike && randomorder){
- if (msg1 && Random.random(1, 5) == 1)
- Keyboard.sendKeys(msg_1, true, keystrokeMin, keystrokeMax);
- if (msg2 && Random.random(1, 5) == 1)
- Keyboard.sendKeys(msg_2, true, keystrokeMin, keystrokeMax);
- if (msg3 && Random.random(1, 5) == 1)
- Keyboard.sendKeys(msg_3, true, keystrokeMin, keystrokeMax);
- if (msg4 && Random.random(1, 5) == 1)
- Keyboard.sendKeys(msg_4, true, keystrokeMin, keystrokeMax);
- if (msg5 && Random.random(1, 5) == 1)
- Keyboard.sendKeys(msg_5, true, keystrokeMin, keystrokeMax);
- }else if (randomorder){
- if (msg1 && Random.random(1, 5) == 1)
- Keyboard.sendKeysInstant(msg_1, true);
- if (msg2 && Random.random(1, 5) == 1)
- Keyboard.sendKeysInstant(msg_2, true);
- if (msg3 && Random.random(1, 5) == 1)
- Keyboard.sendKeysInstant(msg_3, true);
- if (msg4 && Random.random(1, 5) == 1)
- Keyboard.sendKeysInstant(msg_4, true);
- if (msg5 && Random.random(1, 5) == 1)
- Keyboard.sendKeysInstant(msg_5, true);
- }else if (humanlike){
- if (msg1)
- Keyboard.sendKeys(msg_1, true, keystrokeMin, keystrokeMax);
- if (msg2)
- Keyboard.sendKeys(msg_2, true, keystrokeMin, keystrokeMax);
- if (msg3)
- Keyboard.sendKeys(msg_3, true, keystrokeMin, keystrokeMax);
- if (msg4)
- Keyboard.sendKeys(msg_4, true, keystrokeMin, keystrokeMax);
- if (msg5)
- Keyboard.sendKeys(msg_5, true, keystrokeMin, keystrokeMax);
- }else{
- if (msg1)
- Keyboard.sendKeysInstant(msg_1, true);
- if (msg2)
- Keyboard.sendKeysInstant(msg_2, true);
- if (msg3)
- Keyboard.sendKeysInstant(msg_3, true);
- if (msg4)
- Keyboard.sendKeysInstant(msg_4, true);
- if (msg5)
- Keyboard.sendKeysInstant(msg_5, true);
- }
- Log.log(msg_1);
- int i = intervalS * 1000 + intervalMs;
- if (randomize)
- i += Random.random(0, 250);
- interval.setEndIn(i);
- if (rotation)
- Rotate();
- }
- return Random.random(1, 5);
- }
- private void Rotate() {
- for (int i=0; i<Random.random(1, 4); i++){
- if (Random.random(1, 70) == 1)
- Camera.rotateLeft(Random.random(100, 1000));
- if (Random.random(1, 70) == 1)
- Camera.rotateRight(Random.random(100, 1000));
- if (Random.random(1, 70) == 1)
- Camera.pitchDown(Random.random(100, 1000));
- if (Random.random(1, 70) == 1)
- Camera.pitchUp(Random.random(100, 1000));
- }
- }
- private void Update() {
- start = UI.start;
- msg1 = UI.msg1;
- msg2 = UI.msg2;
- msg3 = UI.msg3;
- msg4 = UI.msg4;
- msg5 = UI.msg5;
- randomize = UI.randomize;
- humanlike = UI.humanlike;
- rotation = UI.rotation;
- randomorder = UI.randomorder;
- msg_1 = UI.msg_1;
- msg_2 = UI.msg_2;
- msg_3 = UI.msg_3;
- msg_4 = UI.msg_4;
- msg_5 = UI.msg_5;
- intervalS = UI.intervalS;
- intervalMs = UI.intervalMs;
- keystrokeMin = UI.keystrokeMin;
- keystrokeMax = UI.keystrokeMax;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment