Explorar o código

Ok so we now correctly sift thru to ensure we don't have just 1 warp
sectors

ScriptExplore

david %!s(int64=5) %!d(string=hai) anos
pai
achega
e2362cab14
Modificáronse 1 ficheiros con 8 adicións e 7 borrados
  1. 8 7
      flexible.py

+ 8 - 7
flexible.py

@@ -1109,14 +1109,20 @@ class ScriptExplore(object):
             # TEST
             #self.dense = [
             #    {'sector': 2, 'density': 0, 'warps': 1, 'navhaz': 0, 'anom': False},
+            #    {'sector': 1, 'density': 0, 'warps': 1, 'navhaz': 0, 'anom': False},
+            #    {'sector': 3, 'density': 0, 'warps': 2, 'navhaz': 0, 'anom': False},
             #]
 
             if not self.dense:
                 log.msg("No New Sectors Found!")
                 self.send2player("Find a new area for me to search in!")
                 self.deactivate()
-            elif len(self.dense) == 1:
-                if self.dense[0]['warps'] == 1:
+            elif self.dense:
+                t = [] # Pre-Test
+                for d in self.dense:
+                    if d['warps'] != 1:
+                        t.append(d['sector'])
+                if not t:
                     log.msg("No Sectors Found except one move sector!")
                     self.send2player("Find a new area for me to look at!")
                     self.deactivate()
@@ -1142,11 +1148,6 @@ class ScriptExplore(object):
 
             # TEST, Just to show that my code picks the highest sector number if multiple sectors have the same warp count!
             #self.clear = [1, 2, 3]
-            #self.dense = [
-            #    {'sector': 1, 'density': 0, 'warps': 2, 'navhaz': 0, 'anom': False},
-            #    {'sector': 2, 'density': 0, 'warps': 3, 'navhaz': 0, 'anom': False},
-            #    {'sector': 3, 'density': 0, 'warps': 3, 'navhaz': 0, 'anom': False},
-            #]
             #log.msg("Clear: {0} Dense: {1}".format(len(self.clear), len(self.dense)))
 
             # Sort to find greatest warp count