BrandonWill / GrepolisBot

24 stars 12 forks source link

break down #3

Closed Frank18000 closed 8 years ago

Frank18000 commented 8 years ago

Exception in thread "JavaFX Application Thread" java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(Unknown Source) at Grepolis.Farming.parseHTML(Farming.java:40) at Grepolis.GrepolisBot$8$1.handle(GrepolisBot.java:1098) at Grepolis.GrepolisBot$8$1.handle(GrepolisBot.java:1029) at com.sun.javafx.webkit.UIClientImpl.lambda$dispatchWebEvent$52(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.webkit.UIClientImpl.dispatchWebEvent(Unknown Source) at com.sun.javafx.webkit.UIClientImpl.alert(Unknown Source) at com.sun.webkit.WebPage.fwkAlert(Unknown Source) at com.sun.webkit.network.URLLoader.twkDidFinishLoading(Native Method) at com.sun.webkit.network.URLLoader.notifyDidFinishLoading(Unknown Source) at com.sun.webkit.network.URLLoader.lambda$didFinishLoading$96(Unknown Source) at com.sun.javafx.application.PlatformImpl.lambda$null$173(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(Unknown Source) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$148(Unknown Source) at java.lang.Thread.run(Unknown Source)

Frank18000 commented 8 years ago

i think this was caused by a city that was ocupied The bot works again

BrandonWill commented 8 years ago

Hmm, I looked through the data that's sent by the server. CIties report conqueror units, but I don't have any accounts on a conquering world to verify.

Whether the city has a conqueror or not is sent upon logging in. I'll put it in the code when I'm done with classes in about 3 hours. Hopefully it'll work!

BrandonWill commented 8 years ago

Issue should now be fixed!

Frank18000 commented 8 years ago

the bot works great and all the cities are found know

when i am doing a conquest the bot thinks that the citie is being conquerd

BrandonWill commented 8 years ago

Hmm. I'm going to have to look into what it looks like when you're being conquered.

I noticed when building stuff and you filled out the queue, the bot would stop so I applied a fix to that earlier.

BrandonWill commented 8 years ago

Next time you have a city being conquered, there's a button named "Bot Debugger" and click the button.

Go to the town that's being conquered and open up the farming villages and try to farm. A lot of requests like "GET" and "POST" will show up. One will be something like... GET /game/farm_town_overviews?town_id

Click on the "GET" and then click on "reponse" and paste it here. I'll be able to fix the conqueror problem with that information.

Right now, I can see if you have any conquerors when the bot is first loaded, but if someone starts to conquer you while it's already loaded it wouldn't be able to detect it. That information could possibly help with that.