Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.FlowLayout;
- import java.util.Random;
- import javax.swing.JCheckBox;
- import javax.swing.JFrame;
- import javax.swing.JOptionPane;
- import javax.swing.JPanel;
- import javax.swing.JTextArea;
- import javax.swing.event.ChangeEvent;
- import javax.swing.event.ChangeListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSComponent;
- import org.rsbot.script.wrappers.RSInterface;
- import org.rsbot.script.wrappers.RSTile;
- @ScriptManifest(authors = { "Fierze" }, name = "FierzeDicingScammer")
- public class FierzeDicingScammer extends Script {
- String message;
- Random random = new Random();
- String effect[] = {"Flash2:", "glow3:", "glow1:", "red:", "wave2:", "wave:", "White:"};
- String txt[] = {"55 x2 Legiting dicing join dicer", "Legit 55x2 cc (dicer)", "Legit 55x2 dice games in (dicer)"};
- String txt2[] = {"55 x2 Legiting dicing join my cc dicer", "55x2 in my cc - Trusted with 57m+!", "55x2 Legiting dicing join my cc", "55x2 Trusted Dicing in my cc"};
- RSTile startTile;
- long timer2;
- boolean acceptAccepted = false;
- long timer = 0;
- public boolean isOnTradeWindow(){
- if(interfaces.get(334).isValid() || interfaces.get(335).isValid()){
- return true;
- }else{
- return false;
- }
- }
- public boolean onStart(){
- startTile = getMyPlayer().getLocation();
- acceptAccepted = (JOptionPane.showInputDialog("Accept when other Player accepts or accept when other player adds Item (Recommended >(first = true,or second = false").contains("true"));
- return true;
- }
- public void dance(){
- if(!isOnTradeWindow()){
- RSInterface inter = interfaces.get(464);
- if(game.getCurrentTab() == 13){
- RSComponent dance = inter.getComponent(random(14,17));
- if(dance != null){
- if(timer < System.currentTimeMillis()){
- if(!isOnTradeWindow()){
- dance.doClick();
- }
- keyboard.sendTextInstant(effect[random.nextInt(effect.length)]+""+txt[random.nextInt(txt.length)], true);
- timer = System.currentTimeMillis()+7000;
- }
- }
- }else{
- game.openTab(13);
- }
- }else{
- RSInterface tradeOne = interfaces.get(335);
- if(tradeOne != null){
- RSComponent hasAccepted = tradeOne.getComponent(37);
- if(hasAccepted != null){
- if(acceptAccepted){
- if(hasAccepted.getText().contains("accepted")){
- RSComponent acceptOne = tradeOne.getComponent(17);
- if(acceptOne != null){
- acceptOne.doClick();
- }
- }
- }else{
- RSComponent wealth = tradeOne.getComponent(45);
- if(wealth != null){
- if(!wealth.getText().contains("transfer")){
- RSComponent acceptOne = tradeOne.getComponent(17);
- if(acceptOne != null){
- acceptOne.doClick();
- }
- }
- }
- }
- }
- }
- RSInterface tradeTwo = interfaces.get(334);
- if(tradeTwo != null){
- RSComponent acceptTwo = tradeTwo.getComponent(21);
- if(acceptTwo != null){
- acceptTwo.doClick();
- sleep(1000);
- }
- }
- }
- }
- public void checkMessages(){
- if(!isOnTradeWindow()){
- RSInterface chatBox = interfaces.get(137);
- if(chatBox != null){
- for(int x = 180; x < 280; x++){
- if(chatBox.getComponent(x) != null && chatBox.getComponent(x).getAbsoluteY() > 330){
- String curCompText = chatBox.getComponent(x).getText();
- if(curCompText.contains("wishes to trade with you")){
- if(!isOnTradeWindow()){
- for(String y: chatBox.getComponent(x).getActions()){
- if(y.contains("trade"));
- chatBox.getComponent(x).doAction("trade");
- }
- sleep(1000);
- }
- }else if(curCompText.contains("accepted")){
- if(timer2 < System.currentTimeMillis()){
- keyboard.sendText("Aww Sorry", true);
- }
- }else if(curCompText.contains("declined")){
- if(timer2 < System.currentTimeMillis()){
- keyboard.sendText(txt2[random.nextInt(txt2.length)], true);
- timer2 = System.currentTimeMillis()+5000;
- }
- }
- }
- }
- }
- }
- }
- public void checkArea(){
- if(!new RSArea(new RSTile(startTile.getX()-5, startTile.getY()-5), new RSTile(startTile.getX()+5, startTile.getY()+5)).contains(getMyPlayer().getLocation())){
- walking.walkTo(startTile);
- }
- }
- @Override
- public int loop() {
- checkArea();
- checkMessages();
- dance();
- return 100;
- }
- }
Add Comment
Please, Sign In to add comment