I will post bugs and suggestions in this thread and will update it whenever.
And I really hope the suggestions in this post will be considered, as I feel like most suggestions made are barely ever considered.
Bugs
- Ressurection gets interrupted:
The bot first attempts to walk to the dead character and outputs ‘Attempting to res X’ in the logger. Then instead of casting the skill, it gets interrupted by either buffing, party buffing or healing and does not res the dead character. After buffing etc. is done, the same thing gets repeated over and over, until another character of mine dies and the condition to group res triggers. Then it successfully resurrects the entire party due to the condition being the highest priority task.
See for yourself: 0O0rGydSq2.mp4
- Balloon inflation (Inventory → Item → Inflation) gets stuck because it instantly tries to sort the inventory after the balloon pops.
- Lure script does not recognize/use python functions as commands, in contrary to town/walk scripts.
Suggestions
Rework the tasks system:
The bot has very static behavior when it comes to buffing, attacking, healing, ressing, etc. For example, when a character dies it switches to the ressing task and executes all individual ressing tasks in a loop. Next, when it switches to party buffing, it loops through every single task in the party buffing task until it’s done.
This type of behavior is very inefficient and can cause the bot to get stuck very often. For instance, when ressing is completed and the bot switches to party buffing, and in the meantime other party members die, the dead party members will have to wait until all buffing has been done before they will be ressed. Once buffing is done, it starts ressing again and never gets to the healing task and party members keep dying.
I have come up with the following idea to solve this problem:
while (bot_running) {
// walk to spot, or other tasks before arriving at training place
// ...
val dead_member = get_next_dead_member(party_members)
if (dead_member) {
ressurect(dead_member, res_skills)
return
}
val low_hp_member = get_next_lowhp(party_members)
if (low_hp_member) {
cast_heal(low_hp_member, heal_skills)
return
}
val inactive_buff = get_next_inactive_buff(buffs)
if (inactive_buff) {
buff_self(inactive_buff)
return
}
val buffable_member = get_next_inactive_buff(party_buffs, party_members)
if (buffable_member) {
cast_buff(buffable_member, party_buff)
return
}
// do other stuff.. (attack/pickup/etc)
}
Using guard clauses this way makes it easier for the bot to adapt to adapt to different situations in the game. For example, if a member dies, the bot switches to ressing immediately without having to wait for buffing or party buffing to complete. Once no dead party members are present, the bot checks if a member can be healed. If all members are healthy, it will switch to self buffing. If in the meantime a party member reaches low health, the bot will immediately switch to the healing task and heal until all members are healthy.
I think if you get rid of the looping way of attacking and buffing, the speed of the bot will greatly improve.
Assign party leader
- Besides leaving party if specified player(s) are not the party leader, make it assign that player as party master if the current local player is the party leader. The bot can get stuck if all players are constantly leaving the party due to the party leader being nearby but not being the party leader.
Character skills Python api
- Add character skills to Python api. I have parsed the packet to retrieve the current available skills on the character and I could share the api, but it would be nice if the bot could provide them internally as I’m not 100% sure whether I did it correctly.