ilpersi / bhbot Goto Github PK
View Code? Open in Web Editor NEWA bot that automates a game called Bit Heroes
License: GNU General Public License v3.0
A bot that automates a game called Bit Heroes
License: GNU General Public License v3.0
Using the latest version and repository - this happens consistently, at least when doing z2d1.
Upon encountering a familiar, after the view button has been clicked, an emergency restart is triggered.
Settings:
persuasionLevel 1
bribeLevel 4
To reproduce, this will force restarts:
familiars squib 1; driffin 1; violace 1; krackers 1; yeti 1
while leaving out the yeti will work just fine:
familiars squib 1; driffin 1; violace 1; krackers 1
It happens when ANY familiar is encountered, doesn't have to be Yeti himself, but he needs to be in that list.
Is this maybe an issue with the cues for Yeti, or a typo somewhere? Seems quite odd to me. Reinstalling Chromium and recloning from scratch did not fix the issue for me.
Sry for reposting, but I wasn´t sure if anybody saw it in the other post "autofunctions"
He enables autoshrine, doesn´t have enough points, but forgets to deactivate it and starts a dungeon, which he never passes due to him not realising he has to deactivate it
I have the newest master, so it seems he still gets confused by this
Originally posted by @Larrush in #29 (comment)
Also there is one small issue with autorevive. If 2 or more players die at the same time, he only revives one of them.
I guess he is just not expecting that the one behind could also be dead.
Not a big Issue, just thought I´d mention it ^^
This is more a cosmetic issue.
The settings for the above are effectively percentages (like for energy). However they are treated as actual values.
E.g. minTickets 5 is actually 50% of the tickets bar not 5 ticket. It's 5 tickets only if the total ticket is 10 (standard value). However with GvG some guilds have more than 10 tickets (e.g. 12) in which case minTickets 5 is equivalent to more than 5 tickets (e.g. 6 in previous example)
Hi - the script fails when DPI is not 100%.
Running it on windows with 150% dpi scaling and it does not capture the full screen (as seen via shot command) - changed to 100% dpi scaling and everything (so far) seems to work.
Thanks.
It's nothing super important but i configured Pushover and it doesn't send me any message :3
Any ideas?
This is not an Issue, but I wasn´t sure where else I could post it.
Would it be possible to implement a reviving/heal function?
Where once a group member dies, the bot resurrects them and continues the game.
There is another bot that can do that, but I prefer to use this one since its so much more convenient.
(The other bot does it by activating Disable autopilot on death. When someone dies, the game "pauses" and the bot searches for the grave. Depending on your settings he uses either a small, average or big potion. I thought this might help.)
Sorry for posting this in the Issue section! I am not too familiar with GitHub.
Not high on my priority list, but an ongoing issue.
Found another issue with autoshrine.
When checking shards/tokens in the middle of another action, he activates autoshrine, but if there are no available points he sometimes forgets to deactivate.
But when he starts a dungeon after that, he gets lost since he isn´t used to having shrine active while running dungeons
Hi,
I would like to switch the project to a Maven one. This has the following advantages over the current status:
@Fortigate are you ok with this?
Hi, first of all thanks for the excellent job!
Than, I have an issue with the raid, every time the bot attemp to do it, happens this error:
"Error: detected raid type is 0, which is an error. Restarting..."
and than:
"Doing driver emergency restart..."
It seems it can't detect the R1Only cue or something like this.
Thank you very much!
Hello again,
I can´t change the reconnect timer anymore to a lower amount.
Even though I set it to 15 he still waits 1h
<2019/04/11 22:03:46> Game element found. Starting to run bot..
<2019/04/11 22:04:29> Disconnect has been detected. Probably due to user interaction. Sleeping for 1h...
<2019/04/11 22:04:29> Paused for 1h.
I lately get random disconnects and I would like to let him log back quicker ^^
Thanks already!
If the 4th dungeon is started and the 'not enough energy' failsafe from processDungeon is triggered the bot cannot close the dialogue and return to the main screen as it's expecting the exit screens from D1-3.
Nvm, just realized it's not in english, my bad.
You can currently only run portal #1 with the last used token amount. When they are active again I will look into implementing it properly.
The ad delivery system was changed last year so the existing code does not work.
I just realised that the bot ran r7 yesterday, even though I had thursdayraids on r1 and he didn't do any dungeons.
I am so sorry for posting so many issues lately.
I would like to help so much but I don't know anything about coding😖
So I just want to say thanks for taking the time to make this bot as good as it is! :)
i think the raid interface used to look differently which is why it bugs now, also the expedition isnt added to the bot, will there be some sort of update?
On the VDS server it is possible to put a bot?
also make the normal instruction or normal pack for installation git
Lately he always leaves my head off after pvp, but usually doesn't give me an error message for that.
He once gave me a message like: "couldn't find equipment button" but I forgot to screenshot it.
I'll turn around the command so head is first and mainhand is second to see if it still occurs in that order
<2019/03/27 13:35:43> BHBot v34.1 started.
<2019/03/27 13:35:43> Found 18 familiar cue(s) with old format.
<2019/03/27 13:35:43> Found 53 familiar cue(s) with new format.
<2019/03/27 13:35:43> Idle mode started, no actions will be taken
<2019/03/27 13:35:43> Found Chromium in C:\Users\***\AppData\Local\Chromium\Application\chrome.exe
<2019/03/27 13:35:43> Found chromedriver in C:\Users\***\Favorites\Downloads\BHBot-master\chromedriver.exe
<2019/03/27 13:35:43> Found cues in C:\Users\***\Favorites\Downloads\BHBot-master\cues
<2019/03/27 13:35:43> Driver started succesfully
Starting ChromeDriver 2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90) on port 38171
Only local connections are allowed.
<2019/03/27 13:35:49> Something went wrong with driver restart. Will retry in a few minutes... (sleeping)
org.openqa.selenium.WebDriverException: unknown error: cannot create temp dir for unpacking extensions
(Driver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 61 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: '****', ip: '192.168.0.***', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201'
Driver info: driver.version: ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:122)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)
at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:125)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:212)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:157)
at MainThread.connectDriver(MainThread.java:752)
at MainThread.restart(MainThread.java:881)
at MainThread.run(MainThread.java:1038)
at java.lang.Thread.run(Unknown Source)
I always get this error when opening the new version of BHBot.
Folder looks like this, in case its an obvious mistake I am missing.
Version 34 works perfectly fine, it´s just when I upgrade to the "auto chromedriver version" that I get this.
When i launch bhbot.bat and chromedriver.exe, this message appear : Something went wrong with driver restart. Will retry in a few minutes... (sleeping)
Its working ?
Was wondering why one of my accounts never had gems.. if you have medium potions but no large potions the bot will click the large potions, and then click the yes button for purchase potions instead of use potion, spending 200gems on a large revive. ouch.
it seems that the bot sometimes stays at the "not enough energy" popup, and the console shows that the dungeon was initiated, and nothing changes
<2019/03/18 00:36:45> BHBot v33 started.
<2019/03/18 00:36:45> Idle mode started, no actions will be taken
<2019/03/18 00:36:45> Driver started succesfully
org.openqa.selenium.WebDriverException: unknown error: no chrome binary at C:\Users\L\AppData\Local\Chromium\Application\chrome.exe
(Driver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 44 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'DESKTOP-MLHEQOO', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$22(ProtocolHandshake.java:365)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)
at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:368)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:137)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:174)
at MainThread.connectDriver(MainThread.java:720)
at MainThread.restart(MainThread.java:838)
at MainThread.run(MainThread.java:989)
at java.lang.Thread.run(Unknown Source)
Chromium is installed, and chrome.exe is in this directory. Is there anything I can do to fix this error?
Setting a different port alone for each instance does not seem to work when attempting to run multiple instances of chromedriver and the bot itself . Maybe it needs an unique chrome profile for each instance?
Chromium has been asking it everytime window is closed. Is there some way to enable it permanently?
I would have two more Suggestions.
First is to have an autoidle mode, where the bot logs off for a certain amount of time, so other players wont get suspicious, because I am online most of the time.
Second would be to save Shrine/Boss until the end of a Raid+T/G.
Since the raids got so much harder in comparison to R4/R5,even a good team can be torn apart on Heroic.
Saving Shrines for the boss can help alot with that problem.
(And I don´t want to know what they do with R7 in a few weeks)
I would find it awesome if these two things could also be implemenented at some point.
But even without those features, this is still an awesome Bot, and I just wanted to say thanks again!
PS: Thanks for the revive function! It helps alot on Trials 🥇
Hi,
Chromedriver opens up a new window but doesn't do anything with it (leaves it open).
Getting this error:
[10672:8760:0323/212127.267:ERROR:cache_util_win.cc(19)] Unable to move the cache: 5
[10672:8760:0323/212127.283:ERROR:cache_util.cc(140)] Unable to move cache folder C:\Users\bland-\Desktop\BHBot-master\chrome_profile\ShaderCache\GPUCache to C:\Users\bland-\Desktop\BHBot-master\chrome_profile\ShaderCache\old_GPUCache_000
[10672:8760:0323/212127.285:ERROR:disk_cache.cc(168)] Unable to create cache
[10672:8760:0323/212127.285:ERROR:shader_disk_cache.cc(620)] Shader Cache Creation failed: -2
Created new window in existing browser session.
Any thoughts?
Just stating that I'm a total noob as with programming.
I can't find a download for Chrome v69. Offline installers just install the latest version v71. Is there a download link that you know works?
I can't implement these as I haven't unlocked them.
When I change to this
Set minimum resources (Amount for the bot to leave for manual play)
minShards 0
minTokens 0
minEnergyPercentage 1
minTickets 0
minBadges 0
The bot always leaves one point, even though I have setup Ticket usage to 1 for example.
My max points look like this
Set maximum resources (For calculating value when you have guild perks)
maxShards 7
maxTokens 12
maxTickets 12
maxBadges 13
PS: I just wanted to say thanks for picking up this great bot again!
Where they removed for some reason? I cannot find the web folder at all. Web/linux scripts, as it is described in the wiki.
The console says "Game element found. Starting to run bot..." and nothing happens in the game. What do i do?
Hi and thanks for your activity.
I'm a little confused:
auto shrine causes problems both activated and deactivated.
Perhaps it is more correct to say that it creates anomalies even when deactivated.
Probably I am clumsy, but I get stuck often because of unexpected windows or other problems due to auto-shrine (and auto-revive).
I was also blocked by kongregate for trying too many times to login, I do not know how it could happen, I was afk
I remain at your disposal to answer more precise questions and I hope to be of help
Right now you have two settings to control how expeditions work:
# Expedition difficulty level
expeditionDifficulty 200
# Expeditions to run
# format is h4 50; h2 50; first letter is expedition type ('h' for hallowed 'i' for inferno) followed by portal number 1-4, second is chance to run
expeditions h2 50; h4 50
Sometimes this can be inconsistent because there will never be two expeditions at the same time and if you forgot settings for an expedition (in the previous example there only are hallowed configurations) the bot will basically switch to the other one keeping the portal.
if (e!= currentExpedition) {
BHBot.log("Wrong expedition in settings: " + portalName + " , automatically setting it to " + (currentExpedition == 1 ? "Hallowed" : "Inferno"));
e = currentExpedition;
}
As a new expedition is coming out in a couple of days I would like to change how the settings behave and have something like:
# format is p1 300 25: first letter is p followed by portal number (1, 2, 3, 4) then difficulty (300) and finally the chance to run
expeditions p1 300 25;p2 300 25;p3 300 50;
This would make it more flexible and independent from the expedition. To ease the transition some checks would be added in place to warn the user if he's using the old settings.
@Fortigate what do you think? Are you ok with this?
Every screenshot the bot takes is saved into the %appdata%/temp/ folder and is not automatically cleared. Produces about 30GB a month of files.
If you have both doExpedition
and doGVG
enabled in your settings, and GvG is active but expedition is not, GvG will never trigger due to the fact that they both rely on the timeLastBadgesCheck
variable for timing. Expedition status is evaluated first, and even though the expedition button is not found, it sets the timeLastBadgesCheck variable to the current time:
https://github.com/Betalord/BHBot/blob/277169c534105f404dacbf9d69f081b8d5adffbf/src/main/java/MainThread.java#L1434
This has the undesirable side of effect of GvG (which is checked later in the timing loop) never meeting its timing requirement, and thus never getting executed:
https://github.com/Betalord/BHBot/blob/277169c534105f404dacbf9d69f081b8d5adffbf/src/main/java/MainThread.java#L1976
This is likely to have happened to some people this week, since we just transitioned from the Inferno expedition to GvG. The short term fix for this is for users to set doExpedition 0
in their config files. Longer term fixes might include either using different timing variables for the two code blocks, or moving expedition into the existing GvG/Invasion codeblock.
Latest versions have high cpu usage while running events
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.