|
@@ -1,7 +1,5 @@
|
|
package GPN;
|
|
package GPN;
|
|
|
|
|
|
-import de.nplusc.izc.tools.baseTools.Detectors;
|
|
|
|
-import de.nplusc.izc.tools.baseTools.Tools;
|
|
|
|
import org.apache.logging.log4j.Level;
|
|
import org.apache.logging.log4j.Level;
|
|
import org.apache.logging.log4j.LogManager;
|
|
import org.apache.logging.log4j.LogManager;
|
|
import org.apache.logging.log4j.Logger;
|
|
import org.apache.logging.log4j.Logger;
|
|
@@ -52,7 +50,7 @@ public class BotGame {
|
|
FFQueue.add(new int[]{x,y,g});
|
|
FFQueue.add(new int[]{x,y,g});
|
|
return boardFF(id);
|
|
return boardFF(id);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ int heads_touched = 0;
|
|
private int boardFF(int id)
|
|
private int boardFF(int id)
|
|
{
|
|
{
|
|
int rv_r=0;
|
|
int rv_r=0;
|
|
@@ -88,6 +86,7 @@ public class BotGame {
|
|
if(headBuffer[y][cwi]||headBuffer[y][cei]||headBuffer[csi][x]||headBuffer[cni][x])
|
|
if(headBuffer[y][cwi]||headBuffer[y][cei]||headBuffer[csi][x]||headBuffer[cni][x])
|
|
{
|
|
{
|
|
rv_r+= g==0?1:0;
|
|
rv_r+= g==0?1:0;
|
|
|
|
+ heads_touched++;
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
boardFF[y][x]=id;
|
|
boardFF[y][x]=id;
|
|
@@ -141,13 +140,6 @@ public class BotGame {
|
|
}
|
|
}
|
|
|
|
|
|
public void game(){
|
|
public void game(){
|
|
- new Thread(()->{
|
|
|
|
- while(true)
|
|
|
|
- {
|
|
|
|
- Tools.dlg(false,"Toggle","any");
|
|
|
|
- switchItharder=!switchItharder;
|
|
|
|
- }
|
|
|
|
- });//.start();
|
|
|
|
returnMsgs.add("join|masterX244|öoewiuvföewugewgw");
|
|
returnMsgs.add("join|masterX244|öoewiuvföewugewgw");
|
|
try {
|
|
try {
|
|
Socket sck=new Socket("gpn-tron.duckdns.org", 4000);
|
|
Socket sck=new Socket("gpn-tron.duckdns.org", 4000);
|
|
@@ -276,6 +268,7 @@ public class BotGame {
|
|
|
|
|
|
}
|
|
}
|
|
if(ln.contains("tick")&&gaming) {
|
|
if(ln.contains("tick")&&gaming) {
|
|
|
|
+ heads_touched=0;
|
|
String boardview = "";
|
|
String boardview = "";
|
|
for(int i=0;i<ch;i++)
|
|
for(int i=0;i<ch;i++)
|
|
{
|
|
{
|
|
@@ -428,17 +421,25 @@ public class BotGame {
|
|
north=0;
|
|
north=0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if((highest<((cw*ch)/playercount)||playercount<3))
|
|
|
|
|
|
+ if((highest<((cw*ch)/(playercount+1))||playercount<3))
|
|
{
|
|
{
|
|
l.info("Switcheroo zone reached");
|
|
l.info("Switcheroo zone reached");
|
|
|
|
|
|
if(ticksSinceStart %10==0)
|
|
if(ticksSinceStart %10==0)
|
|
{
|
|
{
|
|
l.info("chkFlick");
|
|
l.info("chkFlick");
|
|
|
|
+ if(heads_touched<2&&playercount>5&&ticksSinceStart>150)
|
|
|
|
+ {
|
|
|
|
+ l.info("headcount:"+heads_touched);
|
|
|
|
+ switcheroo=!switcheroo;
|
|
|
|
+ }
|
|
if((ticksSinceStart /10)%3<2)
|
|
if((ticksSinceStart /10)%3<2)
|
|
{
|
|
{
|
|
l.info("flick");
|
|
l.info("flick");
|
|
switcheroo=!switcheroo;
|
|
switcheroo=!switcheroo;
|
|
|
|
+ } {
|
|
|
|
+ l.info("flick");
|
|
|
|
+ switcheroo=!switcheroo;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -530,7 +531,7 @@ public class BotGame {
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- return;
|
|
|
|
|
|
+ throw new Error();
|
|
}
|
|
}
|
|
|
|
|
|
} catch (IOException ex) {
|
|
} catch (IOException ex) {
|
|
@@ -581,11 +582,6 @@ public class BotGame {
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
- game();
|
|
|
|
- if(Detectors.isJavaw())
|
|
|
|
- {
|
|
|
|
- JOptionPane.showMessageDialog(null, "Host given to Program is invalid", "ERROR", JOptionPane.ERROR_MESSAGE);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|