Make sure the last submitted is not the same!
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
80ab3f42fc
commit
b4d270698a
Binary file not shown.
BIN
sigPlace.jar
BIN
sigPlace.jar
Binary file not shown.
@ -105,6 +105,7 @@ public class sigPlace {
|
||||
try {
|
||||
Robot r = new Robot();
|
||||
Reader lastReader = null;
|
||||
Reader lastSubmittedReader = null;
|
||||
int matches=0;
|
||||
final int EXPECTED_MATCHES=7;
|
||||
boolean submitted=false;
|
||||
@ -135,7 +136,7 @@ public class sigPlace {
|
||||
matches=0;
|
||||
submitted=false;
|
||||
}
|
||||
if (matches>=EXPECTED_MATCHES&&!submitted) {
|
||||
if (matches>=EXPECTED_MATCHES&&!submitted&&!lastSubmittedReader.equals(result)) {
|
||||
System.out.println("Data is reasonable, prepare for submitting...");
|
||||
try {
|
||||
POSTRequest postRes = new POSTRequest("http://"+args[1]+"/uploadform.html",temp);
|
||||
@ -144,6 +145,7 @@ public class sigPlace {
|
||||
playSound(Paths.get("ding.wav"));
|
||||
System.out.println("Successful!");
|
||||
submitted=true;
|
||||
lastSubmittedReader=result;
|
||||
}
|
||||
} catch (FailedResponseException e) {
|
||||
System.out.println("Failed! "+e.getMessage());
|
||||
|
Loading…
x
Reference in New Issue
Block a user