ilpersi / BHBot

A bot that automates a game called Bit Heroes
GNU General Public License v3.0
28 stars 32 forks source link

Is there any way for chromium to enable flash automatic? #38

Closed bbicudo closed 5 years ago

bbicudo commented 5 years ago

Chromium has been asking it everytime window is closed. Is there some way to enable it permanently?

Larrush commented 5 years ago

You probably have to go through the init.bat again. As far as I understand the init.bat enables the auto flash option

bbicudo commented 5 years ago

Also bot freezes on "NEWS" window and does nothing after the game loads.

Capturar

bbicudo commented 5 years ago

You probably have to go through the init.bat again. As far as I understand the init.bat enables the auto flash option

I always open it by using "init.bat". Don't know why it's happening :/

Larrush commented 5 years ago

Then thats probably the reason. You should open it with the bhbot.jar

bbicudo commented 5 years ago

init.bat calls javaw bhbot.jar

So i'm opening it via bhbot.jar anyway hehe :3

Larrush commented 5 years ago

Yes but with a different starting parameter. Init ia supposed to setup so it pauses after the page has been loaded.

BhBot is the one to go with for automatic work.

Larrush commented 5 years ago

But the flash problem is still there am I right?

bbicudo commented 5 years ago

Tried running bhbot after driver start, it keeps the same. Loads, gets the game element and then freezes

bbicudo commented 5 years ago

You're right T.T

Larrush commented 5 years ago

In that case I would personally try to reinstall the bot. Set it up again and try if that works

Get the newest master and see if that helps

bbicudo commented 5 years ago

Ok. I'll report back asap.

bbicudo commented 5 years ago

Same problem.

Ran init first time. Logged in and accepted flash. When i run the bot again it asks for flash again :/

And freezes in "NEWS" window

Larrush commented 5 years ago

Ok but you opened it with the bhbot.jar now?

Larrush commented 5 years ago

Try typing resume when it freezes at News

bbicudo commented 5 years ago

Now it can't find game element anymore. It's so weird .-.

Larrush commented 5 years ago

Can you post a screenshot of it again?

bbicudo commented 5 years ago

Capturar

bbicudo commented 5 years ago

Restarted it a bunch of times and it was able to fing game element. It's caused by flash asking (if i accept flash before 5 seconds of loading page, it finds game element, else it fails silently).

Now about freezing on news:

Capturar

EDIT:

Also tried to force something (i dismissed the NEWS windows manually):

Capturar

bbicudo commented 5 years ago

Tried rebuilding it again, no success... Any other ideas?

@Larrush If you want to i can provide remote access to my machine for troubleshooting.

Larrush commented 5 years ago

Hmm, I can't think of anything right now.

Can you post your settings from the .ini?

bbicudo commented 5 years ago
                ____  __  ______        __  
               / __ )/ / / / __ )____  / /_  
              / __  / /_/ / __  / __ \/ __/
             / /_/ / __  / /_/ / /_/ / /_  
            /_____/_/ /_/_____/\____/\__/ 

## BHBot settings file, read through carefully if you're setting up for the first time ##
## Apologies for readibility, it's getting a bit crowded with the new features ##
## Any queries just raise an issue on GitHub ##                                                

# Used to automatically log-in if you are logged out, not required if you have security concerns
#username yourusername
#password yourpassword

# Enable/disable various activities
# If both Dungeons and World Boss are enabled Dungeons will take priority
doRaids 1
doDungeons 0
doWorldBoss 1
doTrials 1
doGauntlet 1
doPVP 1
doExpedition 1
doInvasion 1
doGVG 1
collectBounties 1
collectFishingBaits 1

# Set maximum resources (For calculating values with guild perks)
maxShards 5
maxTokens 12
maxTickets 11
maxBadges 12

# Set minimum resources (Amount for the bot to leave for manual play)
minShards 0
minTokens 0
minEnergyPercentage 0
minTickets 0
minBadges 0

# Set resource cost of activities
costPVP 1
costGVG 5
costTrials 5
costGauntlet 5
costInvasion 5
costExpedition 5

# Trials/Gauntlet difficulty level
difficulty 200

# Expedition difficulty level
expeditionDifficulty 200

# World Boss Settings
# World Boss (Orlag, Nether or Melvin)
worldBossType Melvin
# World Boss Difficulty (1 = Normal, 2 = Hard, 3 = Heroic)
worldBossDifficulty 1
# World Boss Tier (Tier 3 to Tier 10)
worldBossTier 10
# World Boss Timer (time to get a full lobby, on timeout return to main screen)
worldBossTimer 60
# If the lobby doesn't fill in time, run a dungeon instead? (0 = no, 1 = yes), useful for non peak hours
dungeonOnTimeout 1
# World Boss solo setting if you want to run low tier HC's solo
worldBossSolo 0

# Auto-revive Settings (Auto-revive needs "Disable auto-pilot on death" setting to be enabled in game to work)
# 0=Disabled, 1=Trials/Gauntlet only, 2=Raids only, 3=Trials/Gauntlet and Raids
autoRevive 0
# Order to attempt to use revives (3 is 100% revive, 2 is 60%, 1 is 40%)
potionOrder 213
# Enable this setting to use 100% revives on the first slot, as the frontline tends to need them the most
tankPriority 0

# Auto-shrine (automatically attempt to save shrines for trials/raid boss encounters. 0 = disabled, 1 = enabled)
autoShrine 0
# Battle delay, this is the time with no encounters before enabling shrines.
battleDelay 60
# Shrine delay, this is the delay to traverse the map for shrines before enabling the boss
shrineDelay 20

# Dungeon solo threshold
# This zone and zones under it will be run solo to complete solo heroic bounties
minSolo 2

# Dungeons to run
# format is: z2d1 3 50;z2d4 50; first is zone/dungeon, second is difficulty and third is chance to run (z4's don't need difficulty defined)
dungeons z4d1 3 30

# Dungeons/Raids to run on Thursday (if you want to take advantage of capture day enter dungeons/raids here, else delete/comment out the lines)
#thursdayDungeons z6d3 3 100
#thursdayRaids 1 3 100

# 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

# Raids to run
# format is: 6 3 20;1 3 50; first is raid tier, second is difficulty level and the third is chance to run
raids 7 1 100

# Skeleton chest opening (0=decline all, 1=open all, 2=open in raid only)
openSkeletonChest 0

# PvP Stripping (You can unequip items to lower your TS to avoid high level players).
# Delete the line if you do not need it.
# fomat is: pvpstrip b r 
# (m=mainhand, o=offhand, b=body, r=ring, h=head, n=neck)
pvpstrip o r

# if autoconsume is 1 (enabled), then bot will automatically consume consumables defined by 'consumables' string
autoconsume 0

# the 'consumables' string defines consumables (separated by spaces) that should be always in use.
# Example: "consumables exp_minor item_major gold_average". This will make sure those 3 consumables are always in use.
# Possible consumable types are: exp_*, item_*, speed_* and gold_* (where * is minor, average or major).
consumables exp_minor gold_minor item_minor

# Enable/disable familiar bribing with gems
autoBribe 0

# Currently available familiars:
# R1: Squib, Ragnar, Shade, Olxa, Astaroth
# R2: Driffin, Violace, Oevor, Mimzy, Kaleido
# R3: Bargz, Krackers, Jack, Bully, CaptWoodbeard
# R4: J3-17, Duobomz, Robomax-6000, X4-Gombo, XL-Ombis400
# R5: Xanthin, Svirnic, Gelvins, Zol
# R6: Crum, Sprout, Flitty, Columbus

# All: Gobby
# Z1: Dryad, Grimz, LordCerulean
# Z2: Yeti, Blubber, Gemm
# Z3: Nosdoodoo, Jeb, Quirrel
# Z4: Rexie, Warty, Kovalg
# Z5: Torlim, Zorul, Tealk
# Z6: Rugumz, Blemb, Moghur
# Z7: Vedaire
# Z8: Googamenz

# format is; squib 5; astaroth 1; violace 2. familiar name first, amount you want to bribe second
# When a familiar is bribed this file will be automatically updated with the updated bribe counter
# ***Be careful with spelling, unknown familiars will crash the bot, if in doubt copy from list above***
familiars squib 0

# Development settings

# Saves a screenshot when encountering an unknown familiar, useful for adding cues for missing familiar bribing
familiarScreenshot 0

# Debug settings
debugDetectionTimes 0
hideWindowOnRestart 0
restartAfterAdOfferTimeout 1
reconnectTimer 60
doAds 0

# Activity Counters
# dungeonsrun 0
# worldbossrun 1

# This section of the setting is dedicated to the Pushover integration
# https://pushover.net/faq#overview-what
# Do you want to enable the Pushover integration?
enablePushover 0
# Pushover APP_TOKEN
poAppToken yourAppToken
# Pushover USER_TOKEN
poUserToken yourUserToken
# Do you want to be notified when BHbot crash?
poNotifyCrash 1
# Keep alive notification to be triggered every n hours
poNotifyAlive 6
# Do you want to be notified when BHbot finds unexpected errors?
poNotifyErrors 1
# Do you want to be notified when you receive a PM?
poNotifyPM 1

# FAMILIAR PRESETS
# To quickly farm for specific Familiars uncomment the lines below instead of defining them under dungeons/raids.
# Familiar names are included if you want to define them in the auto-briber.

# BOBODOM (Ragnar, Blubber, Nosdoodoo, Yeti)
# dungeons z2d2 3 33; z3d1 3 33; z2d1 3 34
# raids 1 3 100

# WEMMBO (Squibbo, Driffin, Warty, Jeb, Gemm)
# dungeons z4d2 3 33; z3d2 3 33; z2d3 3 34
# raids 1 3 50; 2 3 50

# REMRUADE (Shade, LordCerulean, Zorul, Rexie)
# dungeons z1d3 3 33; z5d1 3 33; z5d2 3 34
# raids 1 3 100

# KORGZ (Oevor, Kovalg, Quirrel, Grimz)
# dungeons z1d1 3 33; z3d3 3 33; z4d3 3 34
# raids 2 3 100
Larrush commented 5 years ago

Wait which version of chromium do you have?

bbicudo commented 5 years ago

The one you put in the wiki for download

bbicudo commented 5 years ago

mini_installer is the one i used (for windows)

bbicudo commented 5 years ago

Java is 8u201. Also, if you want to try troubleshooting it here there's no problem for me to provide remote access ok?

Larrush commented 5 years ago

I am not sure if I can still help. If you have the chromiumv69, the bot should be able to auto enable flash after initialising the init and enabling flash in that window. After that BhBot should never have problems with flash.

I think at this point you need the help from @fortigate or @ilpersi

bbicudo commented 5 years ago

I'll wait for then :) thanks for the help so far @Larrush

ilpersi commented 5 years ago

Short answer: Yes.

Long answer: you can make it so that flash is always enabled even with latest versions of Chrome/Chromium using the DefaultPluginsSetting policy. I am familiar with windows where a .reg file is enough.

I have it working locally but not ready for release (not on top of my priorities), as a work-around copy the code below here and save it in a file named flash-always-on and run it. You will be prompted cause you need admin rights to run it.

Please note that, as I did not have time to review the config carefully, this proposed workaround is enabling Flash for all the sites, not just for Bit Heroes.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google]

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome]
"DefaultPluginsSetting"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\PluginsAllowedForUrls]
"1"="http://*"
"2"="https://*"
bbicudo commented 5 years ago

Thanks @ilpersi.

Will test it and report ASAP.

bbicudo commented 5 years ago

Chromium keeps asking for flash to be enabled even after importing the reg key.

Also i noticed something when i start Chromium:

Capturar

bbicudo commented 5 years ago

Ok, so i messed up a little with chromium and finally got it accepting flash automatically (just flushed all user data after importing the reg key. It worked until this step).

But game keeps frozen on "NEWS" window again lol

Sorry guys for giving you so much trouble :/

ilpersi commented 5 years ago

Did the bot dismiss the news pop-up?

bbicudo commented 5 years ago

No. It stops in the news window and does nothing.

bbicudo commented 5 years ago

Ok i have news.

It works fine in windows 7 but freezes in windows 10.

My notebook is running windows 10. I setup the bot into a virtual machine running w7 and it runs just fine.

Will keep on running it on the VM until we find some way to fix it on W10. Also, i'll verify differences on paths and regs to see if i can come up with something to help you guys.

ilpersi commented 5 years ago

My development and running machines are both on windows 10, so I expect this to work fine on that OS. It is quite strange that it is not working for you. Do you have any kind of antivirus or similar software on your W10 machine?

bbicudo commented 5 years ago

Ok, problem solved.

AVAST! open both bhbot.exe and bhbot.jar in sandbox.

Put an exclusion and it worked.

Thanks for everyone that helped me with this issue. You guys rock :)