Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
public class Main {
public static void main(String[] args) {
// Byte code:
// 0: ldc 'user.dir'
// 2: invokestatic getProperty : (Ljava/lang/String;)Ljava/lang/String;
// 5: astore_1
// 6: new java/io/File
// 9: dup
// 10: new java/lang/StringBuilder
// 13: dup
// 14: aload_1
// 15: invokestatic valueOf : (Ljava/lang/Object;)Ljava/lang/String;
// 18: invokespecial <init> : (Ljava/lang/String;)V
// 21: ldc '/config-one.yml'
// 23: invokevirtual append : (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 26: invokevirtual toString : ()Ljava/lang/String;
// 29: invokespecial <init> : (Ljava/lang/String;)V
// 32: astore_2
// 33: aload_2
// 34: invokevirtual exists : ()Z
// 37: ifne -> 60
// 40: aload_2
// 41: invokevirtual createNewFile : ()Z
// 44: pop
// 45: getstatic java/lang/System.out : Ljava/io/PrintStream;
// 48: ldc 'Config created - go edit it.'
// 50: invokevirtual println : (Ljava/lang/String;)V
// 53: return
// 54: astore_3
// 55: aload_3
// 56: invokevirtual printStackTrace : ()V
// 59: return
// 60: aload_2
// 61: invokestatic loadConfiguration : (Ljava/io/File;)Lorg/bukkit/configuration/file/YamlConfiguration;
// 64: astore_3
// 65: aload_3
// 66: ldc 'id'
// 68: invokevirtual getString : (Ljava/lang/String;)Ljava/lang/String;
// 71: astore #4
// 73: aload_3
// 74: ldc 'password'
// 76: invokevirtual getString : (Ljava/lang/String;)Ljava/lang/String;
// 79: astore #5
// 81: aload_3
// 82: ldc 'trainer'
// 84: invokevirtual getString : (Ljava/lang/String;)Ljava/lang/String;
// 87: astore #6
// 89: aload_3
// 90: ldc 'delay'
// 92: invokevirtual getInt : (Ljava/lang/String;)I
// 95: istore #7
// 97: iload #7
// 99: ifne -> 107
// 102: sipush #1000
// 105: istore #7
// 107: ldc 'webdriver.chrome.driver'
// 109: new java/lang/StringBuilder
// 112: dup
// 113: aload_1
// 114: invokestatic valueOf : (Ljava/lang/Object;)Ljava/lang/String;
// 117: invokespecial <init> : (Ljava/lang/String;)V
// 120: ldc '/chromedriver.exe'
// 122: invokevirtual append : (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 125: invokevirtual toString : ()Ljava/lang/String;
// 128: invokestatic setProperty : (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
// 131: pop
// 132: new org/openqa/selenium/chrome/ChromeDriver
// 135: dup
// 136: invokespecial <init> : ()V
// 139: astore #8
// 141: aload #8
// 143: ldc 'https://www.tppcrpg.net/login.php'
// 145: invokeinterface get : (Ljava/lang/String;)V
// 150: ldc2_w 1000
// 153: invokestatic sleep : (J)V
// 156: goto -> 166
// 159: astore #9
// 161: aload #9
// 163: invokevirtual printStackTrace : ()V
// 166: aload #8
// 168: ldc 'LoginID'
// 170: invokestatic name : (Ljava/lang/String;)Lorg/openqa/selenium/By;
// 173: invokeinterface findElement : (Lorg/openqa/selenium/By;)Lorg/openqa/selenium/WebElement;
// 178: iconst_1
// 179: anewarray java/lang/CharSequence
// 182: dup
// 183: iconst_0
// 184: aload #4
// 186: aastore
// 187: invokeinterface sendKeys : ([Ljava/lang/CharSequence;)V
// 192: aload #8
// 194: ldc 'NewPass'
// 196: invokestatic name : (Ljava/lang/String;)Lorg/openqa/selenium/By;
// 199: invokeinterface findElement : (Lorg/openqa/selenium/By;)Lorg/openqa/selenium/WebElement;
// 204: iconst_1
// 205: anewarray java/lang/CharSequence
// 208: dup
// 209: iconst_0
// 210: aload #5
// 212: aastore
// 213: invokeinterface sendKeys : ([Ljava/lang/CharSequence;)V
// 218: aload #8
// 220: ldc '/html/body/div[3]/div/form/p[3]/input'
// 222: invokestatic xpath : (Ljava/lang/String;)Lorg/openqa/selenium/By;
// 225: invokeinterface findElement : (Lorg/openqa/selenium/By;)Lorg/openqa/selenium/WebElement;
// 230: invokeinterface click : ()V
// 235: ldc2_w 1000
// 238: invokestatic sleep : (J)V
// 241: goto -> 251
// 244: astore #9
// 246: aload #9
// 248: invokevirtual printStackTrace : ()V
// 251: aload #8
// 253: new java/lang/StringBuilder
// 256: dup
// 257: ldc 'https://www.tppcrpg.net/battle.php?Battle=Trainer&Trainer='
// 259: invokespecial <init> : (Ljava/lang/String;)V
// 262: aload #6
// 264: invokevirtual append : (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 267: invokevirtual toString : ()Ljava/lang/String;
// 270: invokeinterface get : (Ljava/lang/String;)V
// 275: ldc2_w 1000
// 278: invokestatic sleep : (J)V
// 281: goto -> 291
// 284: astore #9
// 286: aload #9
// 288: invokevirtual printStackTrace : ()V
// 291: iconst_1
// 292: istore #9
// 294: iload #7
// 296: i2l
// 297: invokestatic sleep : (J)V
// 300: goto -> 456
// 303: astore #10
// 305: aload #10
// 307: invokevirtual printStackTrace : ()V
// 310: goto -> 456
// 313: aload #8
// 315: ldc '/html/body/div[3]/div/div/div[2]/span/input'
// 317: invokestatic xpath : (Ljava/lang/String;)Lorg/openqa/selenium/By;
// 320: invokeinterface findElement : (Lorg/openqa/selenium/By;)Lorg/openqa/selenium/WebElement;
// 325: invokeinterface click : ()V
// 330: goto -> 440
// 333: astore #10
// 335: aload #8
// 337: ldc '/html/body/div[3]/div/div/div[1]/div[1]/div[3]/fieldset/div'
// 339: invokestatic xpath : (Ljava/lang/String;)Lorg/openqa/selenium/By;
// 342: invokeinterface findElement : (Lorg/openqa/selenium/By;)Lorg/openqa/selenium/WebElement;
// 347: ldc 'title'
// 349: invokeinterface getAttribute : (Ljava/lang/String;)Ljava/lang/String;
// 354: ldc '0% HP Remaining'
// 356: invokevirtual equalsIgnoreCase : (Ljava/lang/String;)Z
// 359: ifeq -> 440
// 362: iload #9
// 364: iconst_5
// 365: if_icmpne -> 371
// 368: iconst_0
// 369: istore #9
// 371: iinc #9, 1
// 374: aload #8
// 376: new java/lang/StringBuilder
// 379: dup
// 380: ldc '/html/body/div[3]/div/div/div[3]/div[1]/ul/li['
// 382: invokespecial <init> : (Ljava/lang/String;)V
// 385: iload #9
// 387: invokevirtual append : (I)Ljava/lang/StringBuilder;
// 390: ldc ']/a'
// 392: invokevirtual append : (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 395: invokevirtual toString : ()Ljava/lang/String;
// 398: invokestatic xpath : (Ljava/lang/String;)Lorg/openqa/selenium/By;
// 401: invokeinterface findElement : (Lorg/openqa/selenium/By;)Lorg/openqa/selenium/WebElement;
// 406: invokeinterface click : ()V
// 411: goto -> 440
// 414: astore #11
// 416: aload #8
// 418: new java/lang/StringBuilder
// 421: dup
// 422: ldc 'https://www.tppcrpg.net/battle.php?Battle=Trainer&Trainer='
// 424: invokespecial <init> : (Ljava/lang/String;)V
// 427: aload #6
// 429: invokevirtual append : (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 432: invokevirtual toString : ()Ljava/lang/String;
// 435: invokeinterface get : (Ljava/lang/String;)V
// 440: iload #7
// 442: i2l
// 443: invokestatic sleep : (J)V
// 446: goto -> 456
// 449: astore #10
// 451: aload #10
// 453: invokevirtual printStackTrace : ()V
// 456: aload #8
// 458: ldc '/html/body/div[3]/div/div/div[1]/div[2]/div[3]/fieldset/div'
// 460: invokestatic xpath : (Ljava/lang/String;)Lorg/openqa/selenium/By;
// 463: invokeinterface findElement : (Lorg/openqa/selenium/By;)Lorg/openqa/selenium/WebElement;
// 468: ldc 'title'
// 470: invokeinterface getAttribute : (Ljava/lang/String;)Ljava/lang/String;
// 475: ldc '0% HP Remaining'
// 477: invokevirtual equalsIgnoreCase : (Ljava/lang/String;)Z
// 480: ifeq -> 313
// 483: goto -> 497
// 486: astore #10
// 488: getstatic java/lang/System.out : Ljava/io/PrintStream;
// 491: ldc 'Catcha Appeared - please complete it and close the window.'
// 493: invokevirtual println : (Ljava/lang/String;)V
// 496: return
// 497: aload #8
// 499: ldc '/html/body/div[3]/div/div/div[2]/span/input'
// 501: invokestatic xpath : (Ljava/lang/String;)Lorg/openqa/selenium/By;
// 504: invokeinterface findElement : (Lorg/openqa/selenium/By;)Lorg/openqa/selenium/WebElement;
// 509: invokeinterface click : ()V
// 514: goto -> 294
// 517: astore #10
// 519: getstatic java/lang/System.out : Ljava/io/PrintStream;
// 522: ldc 'Catcha Appeared - please complete it and close the window.'
// 524: invokevirtual println : (Ljava/lang/String;)V
// 527: return
// Line number table:
// Java source line number -> byte code offset
// #15 -> 0
// #16 -> 6
// #17 -> 33
// #19 -> 40
// #20 -> 45
// #21 -> 53
// #22 -> 54
// #23 -> 55
// #24 -> 59
// #27 -> 60
// #28 -> 65
// #29 -> 73
// #30 -> 81
// #31 -> 89
// #32 -> 97
// #33 -> 102
// #36 -> 107
// #37 -> 132
// #38 -> 141
// #40 -> 150
// #41 -> 156
// #42 -> 161
// #44 -> 166
// #45 -> 192
// #46 -> 218
// #48 -> 235
// #49 -> 241
// #50 -> 246
// #52 -> 251
// #54 -> 275
// #55 -> 281
// #56 -> 286
// #58 -> 291
// #61 -> 294
// #62 -> 300
// #63 -> 305
// #66 -> 310
// #68 -> 313
// #69 -> 330
// #71 -> 335
// #72 -> 362
// #73 -> 368
// #75 -> 371
// #76 -> 374
// #78 -> 411
// #79 -> 416
// #83 -> 440
// #84 -> 446
// #85 -> 451
// #66 -> 456
// #88 -> 483
// #89 -> 488
// #90 -> 496
// #93 -> 497
// #94 -> 514
// #95 -> 519
// #96 -> 527
// Local variable table:
// start length slot name descriptor
// 0 528 0 args [Ljava/lang/String;
// 6 522 1 path Ljava/lang/String;
// 33 495 2 x Ljava/io/File;
// 55 5 3 e1 Ljava/io/IOException;
// 65 463 3 config Lorg/bukkit/configuration/file/FileConfiguration;
// 73 455 4 userID Ljava/lang/String;
// 81 447 5 password Ljava/lang/String;
// 89 439 6 trainerToFight Ljava/lang/String;
// 97 431 7 milis I
// 141 387 8 driver Lorg/openqa/selenium/WebDriver;
// 161 5 9 e Ljava/lang/InterruptedException;
// 246 5 9 e Ljava/lang/InterruptedException;
// 286 5 9 e Ljava/lang/InterruptedException;
// 294 234 9 i I
// 305 5 10 e1 Ljava/lang/InterruptedException;
// 335 105 10 e Ljava/lang/Exception;
// 416 24 11 e1 Ljava/lang/Exception;
// 451 5 10 e Ljava/lang/InterruptedException;
// 488 9 10 e Ljava/lang/Exception;
// 519 9 10 e Ljava/lang/Exception;
// Exception table:
// from to target type
// 40 53 54 java/io/IOException
// 150 156 159 java/lang/InterruptedException
// 235 241 244 java/lang/InterruptedException
// 275 281 284 java/lang/InterruptedException
// 294 300 303 java/lang/InterruptedException
// 310 483 486 java/lang/Exception
// 313 330 333 java/lang/Exception
// 335 411 414 java/lang/Exception
// 440 446 449 java/lang/InterruptedException
// 497 514 517 java/lang/Exception
}
}


What I have tried:

this is the
xpath("//a[contains(.,'Restart Battle')]").click() 
for restart button.

if any one can help me that be great thanks!
Posted
Updated 22-Apr-21 17:01pm
Comments
Dave Kreskowiak 23-Apr-21 0:24am    
OK, so your entire code is this:
public class Main {
    public static void main(String[] args) {
    }
}

Everything else is a comment and isn't even code to begin with. There's literal no code to execute.
pocket monster 23-Apr-21 1:22am    
i have upploaded the java script file i posted the link below, when you run it only completes only one cycle.
i wanted to restart and run it many times.
https://files.fm/u/bzu9au6a9

this is the thing i posted above as well
Dave Kreskowiak 23-Apr-21 9:57am    
Sorry, but no sane individual would ever go download code from an untrusted person, from an untrusted site, and execute it.

The relevant code gets pasted into your question or it doesn't get looked at.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900