kovan / kovans-ogbot

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

[PATCH] Language fixes + problems #306

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Bot version: trunk
OGame server language: nl
OGame server version: 0.83
Using admirals or commander (specify)?:
Operating System: ubuntu

I got the trunk version running on the dutch server, had to make a lot of
language fixes, which are included in a new dutch language file.

But I did run into some issues besides that. First of all the check if your
impuls drive is above level 5 crashes the program if you haven't researched
impulse enige at all (level 0).

The next two errors I received when parsing the espionage reports, so are
probably language specific but not fixable by simply translating.

The header of an espionage report starts as follows
<td class=c colspan=4>Grondstoffen&nbsp;op ***** <a href=#
onclick=showGalaxy(*,***,**); >[*:***:**]</a> (Speler '****')<br /> op
03-17 21:44:45&nbsp;</td>

Look at teh two "&nbsp;" those aren't parsed correctly by the regular
expression. The first one I can fix by translating resourcesOn to
Grondstoffen&nbsp;op . But the second one is more annoying.

The second issue is in the same espionage reports: resource names end with
a ':' that prevents the parser from recognizing the resource name properly.

Included is the diff patch that will fix everything for the dutch version,
but the patch will most likely break other languages.

Original issue reported on code.google.com by karel.lo...@gmail.com on 17 Mar 2009 at 9:53

Attachments:

GoogleCodeExporter commented 9 years ago
WebAdapter.py:692, I added a line to catch an ItemNotFoundError, which is
occasionally thrown for some reason when selecting attack as a mission. I can 
only
assume it is sometimes not listed. 

try:
    form['order'] = [str(mission.missionType)]
except ItemNotFoundError:
    continue
except ControlNotFoundError:
    continue

Original comment by karel.lo...@gmail.com on 18 Mar 2009 at 8:48

GoogleCodeExporter commented 9 years ago
Forget the error with the semicolon in the first message, seems it was just a 
result
of a translation error. The reason the fix worked was because he didn't detect 
mine
levels at all with that improper regular expression and was therefor not 
crashing.
The other issues are still valid. (updated language file)

Original comment by karel.lo...@gmail.com on 18 Mar 2009 at 4:30

Attachments:

GoogleCodeExporter commented 9 years ago
Well, I've been making some minor alterations, so I thought I'd prepare a patch 
that
should work for all languages (including dutch) with those alterations.

Fixes include:
 - Small stability updates, basically comes down to swallowing an error here and there. 
 - Fixed multiple source planets, support for this was basically complete, I just had
to write the code that reads the configuration properly and builds the list of 
source
planets. It seems to work quite well.
 - Attacks will be performed when there are not enough cargo ships but more than 5.
Basically this is kind of bypassing the logic that was in place, but it was 
flawed.
It would look at the next possible attack and see if that one was perhaps more
profitable, but not taking into account that there are probably not enough 
ships to
attack that target aswell. To make a long story short, in most cases the 
algorithm
would decide to not attack anything at all.
 - Fixed detection of moons: Due to a bug moons were detected as a second planet with
same coordinates.
 - The latest dutch language file

Original comment by karel.lo...@gmail.com on 28 Mar 2009 at 3:45

Attachments:

GoogleCodeExporter commented 9 years ago
Traceback (most recent call last):
  File "src\OGBot.py", line 106, in run
    self._connect()
  File "src\OGBot.py", line 139, in _connect
    self.web.updatePlayerData(self.player)
  File "src\WebAdapter.py", line 410, in updatePlayerData
    self.getStats(player, "pts", overview)
  File "src\WebAdapter.py", line 787, in getStats
    player.rank = int(stats.group(1).replace('.',''))
AttributeError: 'NoneType' object has no attribute 'group'

Ive tried to translate it to portuguese and im getting this error ... Can 
anyone help?

Original comment by AndredeP...@gmail.com on 1 Apr 2009 at 2:26

GoogleCodeExporter commented 9 years ago
when i apply the latest patch i get this error:

D:\Descargas\kovans-king-vash-ogbot-source_3.1b(2)>c:\python26\python -O src\OGB
ot.py
04/14/09 11:14:43 Contacting server...
04/14/09 11:14:44 Logged in with user reventador.
Traceback (most recent call last):
  File "src\OGBot.py", line 104, in run
    self._connect()
  File "src\OGBot.py", line 137, in _connect
    self.web.updatePlayerData(self.player)
  File "src\WebAdapter.py", line 415, in updatePlayerData
    self.getResearchLevels(player, [player.colonies[0]])
  File "src\WebAdapter.py", line 499, in getResearchLevels
    player.research[self.translationsByLocalText[fullName]] = int(level)
KeyError: 'Tecnolog\xc3\xada de espionaje'
04/14/09 11:14:55 Something unexpected occured, see log file. Stopping bot.

Original comment by abv....@gmail.com on 14 Apr 2009 at 9:16

GoogleCodeExporter commented 9 years ago
ogame.com.es has changed now the version is 0.84 can you fix bot for this 
update?

Original comment by abv....@gmail.com on 14 Apr 2009 at 9:20

GoogleCodeExporter commented 9 years ago
languageCode = pt
old = False

# as found in the overview page:
fields = campos
rank = Classificação

#research page
expeditionTechnology = Tecnologia de Exploração Espacial

# when being attacked
aHostile = Uma frota inimiga
itsMissionIs = A missão é

# as found on the fleets page
expeditions = Expedições

#as found on shipyard and defense page
durationRemaining = Duração

Is this correct?

Traceback (most recent call last):
  File "src\OGBot.py", line 106, in run
    self._connect()
  File "src\OGBot.py", line 139, in _connect
    self.web.updatePlayerData(self.player)
  File "src\WebAdapter.py", line 410, in updatePlayerData
    self.getStats(player, "pts", overview)
  File "src\WebAdapter.py", line 787, in getStats
    player.rank = int(stats.group(1).replace('.',''))
AttributeError: 'NoneType' object has no attribute 'group'

This problem could be result of a bad translation?
regars bruno

Original comment by Bruno.Miguel.Tavares.Silva@gmail.com on 9 May 2009 at 9:12

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by kovansog...@gmail.com on 2 Apr 2010 at 9:44