barolet / kovans-ogbot

Automatically exported from code.google.com/p/kovans-ogbot
0 stars 0 forks source link

KeyError: 'Rückkehrzeit' - returnTime #296

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Bot version: 3.1b
OGame server language: de
OGame server version:  0.83
Using admirals or commander (specify)?: no
Operating System: vista 32bit

Description of the problem:

before the bot ran normally. i didnt change anything and i also tried to
reinstall it. same error.

KeyError: 'Rückkehrzeit'

the spelling of Rückkehrzeit(returnTime) is right, i checked it after
sending a fleet.

main loop
Traceback (most recent call last):
  File "src\OGBot.py", line 108, in run
    self._start()
  File "src\OGBot.py", line 218, in _start
    self.spyPlanets(self.inactivePlanets,
EspionageReport.DetailLevels.buildings
)    # spy pending planets:
  File "src\OGBot.py", line 455, in spyPlanets
    self._spyPlanet(sourcePlanet, targetPlanet, True, msg, probesToSend)
  File "src\OGBot.py", line 487, in _spyPlanet
    self.web.launchMission(self.player, mission, True, slotsToReserve)
  File "src\WebAdapter.py", line 725, in launchMission
    returnTime = parseTime(resultPage[self.translations['returnTime']])
KeyError: 'Rückkehrzeit'
02/07/09 13:20:39 Something unexpected occured, see log file. Stopping bot.

btw, the german language file isnt completely correct

i attach the corrected one

Original issue reported on code.google.com by pimp_r...@web.de on 7 Feb 2009 at 12:40

Attachments:

GoogleCodeExporter commented 8 years ago
thanks for the updated language file!
the regresion expression must not work for german. if you post the source of a 
sent
mission I will fix in.

ex.

<center>
  <script language="JavaScript" src="index_files/flotten.js"></script>
  <table border="0" cellpadding="0" cellspacing="1" width="519">
   <tbody><tr height="20">
    <td class="c" colspan="2">
      <span class="success">Fleet sent:</span>
    </td>
   </tr>
   <tr height="20">
  <th>Mission</th><th>Transport</th>
   </tr>
   <tr height="20">
     <th>Distance</th><th>5</th>
   </tr>
   <tr height="20">
      <th>Speed</th><th>32.000</th>
   </tr>
   <tr height="20">
      <th>Consumption</th><th>1</th>
   </tr>
   <tr height="20">
     <th>Start</th><th><a
href="http://uni.ogame.org/game/index.php?page=galaxy&galaxy=&system=&position=&
session=">[9:999:9]</a></th>
   </tr>
   <tr height="20">
     <th>Target</th><th><a href="">[9:999:9]</a></th>
   </tr>
   <tr height="20">
     <th>Arrival time</th><th>Sun Feb 8 9:34:23</th>
   </tr>
   <tr height="20">
     <th>Return time</th><th>Sun Feb 8 9:36:51</th>
    </tr>
   <tr height="20">
     <td class="c" colspan="2">Ships</td>
   </tr>
      <tr height="20">
     <th width="50%">Small Cargo</th><th>1</th>
   </tr>

   </tbody></table>
<br><br><br><br>
</center>
</div>

Original comment by brain...@gmail.com on 8 Feb 2009 at 8:33

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
<!-- CONTENT AREA -->
<div style="top: 91px; height: 776px;" id="content">
<center>
  <script language="JavaScript" src="index.php-Dateien/flotten.js"></script>
  <table width="519" border="0" cellpadding="0" cellspacing="1">
   <tbody><tr height="20">
    <td class="c" colspan="2">
      <span class="success">Flotte wurde verschickt:</span>
    </td>
   </tr>
   <tr height="20">
  <th>Auftrag</th><th>Spionage</th>
   </tr>
   <tr height="20">
     <th>Entfernung</th><th>5.265</th>
   </tr>
   <tr height="20">
      <th>Geschwindigkeit</th><th>170.000.000</th>
   </tr>
   <tr height="20">
      <th>Verbrauch</th><th>3</th>
   </tr>
   <tr height="20">
     <th>Start</th><th><a
href="http://uni70.ogame.de/game/index.php?page=galaxy&galaxy=&system=&position=
&session=">[]</a></th>
   </tr>
   <tr height="20">
     <th>Ziel</th><th><a
href="http://uni70.ogame.de/game/index.php?page=galaxy&galaxy=&system=&position=
&session=">[]</a></th>
   </tr>
   <tr height="20">
     <th>Ankunftszeit</th><th>Sun Feb 8 13:24:08</th>
   </tr>
   <tr height="20">
     <th>Rückkehrzeit</th><th>Sun Feb 8 13:24:44</th>
    </tr>
   <tr height="20">
     <td class="c" colspan="2">Schiffe</td>
   </tr>
      <tr height="20">
     <th width="50%">Spionagesonde</th><th>4</th>
   </tr>

   </tbody></table>
<br><br><br><br>
</center>
</div>

Original comment by King.Vash@gmail.com on 10 Feb 2009 at 12:11

GoogleCodeExporter commented 8 years ago

Original comment by King.Vash@gmail.com on 10 Feb 2009 at 12:12

GoogleCodeExporter commented 8 years ago
the problem is in the translation if you use 

R\xfcckkehrzeit

it works 

Original comment by King.Vash@gmail.com on 10 Feb 2009 at 12:25

GoogleCodeExporter commented 8 years ago
it doesnt work for me:

KeyError: 'R\xfcckkehrzeit'

its strange that earlier the bot worked normally.

is it possible that ogame changed the source code?

Original comment by pimp_r...@web.de on 10 Feb 2009 at 11:39

GoogleCodeExporter commented 8 years ago
unlikely that they changed it

                resultPage = {}
                for type, value in self.REGEXPS['fleetSendResult'].findall(page):
                    resultPage[type] = value

                # fill remaining mission fields
        print resultPage
                raise BotError( shipType )
                arrivalTime = parseTime(resultPage[self.translations['arrivalTime']])
            returnTime = parseTime(resultPage[self.translations['returnTime']])
                mission.setTimes(arrivalTime, returnTime)

ignore the error, look at the output and see what name is listed with return 
time

Original comment by King.Vash@gmail.com on 11 Feb 2009 at 2:01

GoogleCodeExporter commented 8 years ago

Original comment by King.Vash@gmail.com on 16 Feb 2009 at 7:02

GoogleCodeExporter commented 8 years ago
i dont exactly understand what you mean.

if i ignore the error nothing happens, the bot just stops.

the only output i have i have already sent in the first post.

Original comment by pimp_r...@web.de on 16 Feb 2009 at 1:21

GoogleCodeExporter commented 8 years ago
in webadapter.py 
change 

            resultPage = {}
                for type, value in self.REGEXPS['fleetSendResult'].findall(page):
                    resultPage[type] = value

                # fill remaining mission fields
                arrivalTime = parseTime(resultPage[self.translations['arrivalTime']])
            returnTime = parseTime(resultPage[self.translations['returnTime']])
                mission.setTimes(arrivalTime, returnTime)
                mission.distance = 
int(resultPage[self.translations['distance']].replace('.', ''))
                mission.consumption =
int(resultPage[self.translations['consumption']].replace('.', ''))

to 

                resultPage = {}
                for type, value in self.REGEXPS['fleetSendResult'].findall(page):
                    resultPage[type] = value

                # fill remaining mission fields
        print resultPage
                raise BotError( shipType )
                arrivalTime = parseTime(resultPage[self.translations['arrivalTime']])
            returnTime = parseTime(resultPage[self.translations['returnTime']])
                mission.setTimes(arrivalTime, returnTime)

and post the output here

Original comment by brain...@gmail.com on 19 Feb 2009 at 3:15

GoogleCodeExporter commented 8 years ago
02/22/09 13:55:15 Bot started.
main loop
{'Ankunftszeit': 'Sun Feb 22 13:52:38', 'Start': '<a href="index.php?page=galaxy
&galaxy=4&system=155&position=11&session=cebe03eac793" >[4:155:11]</a>', 'Auftra
g': 'Spionage', 'Ziel': '<a href="index.php?page=galaxy&galaxy=4&system=135&posi
tion=8&session=cebe03eac793" >[4:135:8]</a>', 'Spionagesonde': '4', 'R\xc3\xbcck
kehrzeit': 'Sun Feb 22 13:53:12', 'Geschwindigkeit': '170.000.000', 'Verbrauch':
 '3', 'Entfernung': '4.600'}
02/22/09 13:55:34 Error: espionageProbe

Original comment by pimp_r...@web.de on 22 Feb 2009 at 1:00

GoogleCodeExporter commented 8 years ago
the error is in the language file, you must change ü to ü, ä to ä ect...

Original comment by dvdgeis...@googlemail.com on 22 Feb 2009 at 11:47

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by King.Vash@gmail.com on 23 Feb 2009 at 7:10