Wisling / tibiaauto

Tibia Auto is made to excel in the automation of various aspects of the playing the MMORPG Tibia
31 stars 17 forks source link

Reopen backpacks #3

Closed felipetnh closed 8 years ago

felipetnh commented 9 years ago

Tibia implemented a new state called Pending State. Whenever the Tibia client goes from the Active State to the Pending State, the message of "trying to reconnect" (or something like that) appears and Tibia keeps trying to reconnect, rather than actually logging out. The problem is that when Tibia is actually able to reconnect automatically, it closes our backpacks.

My solution would be to set a timer on Auto Login that would reopen the backpacks, in case they were closed. So every X seconds, Auto Login would check if the backpacks are opened, and then would open them again in case they were closed.

Wisling commented 9 years ago

That sounds like a very good solution. It's better than the one where Tibia logs you out 'cause you can't do anything and you log back in again(not really a solution). It should take 20 minutes to implement, I'll see if I get to it before you :P

felipetnh commented 9 years ago

haha I won't probably get it done before you, since I wasn't able to build it properly.

How is the tutorial on how to build going? Are you working on it? That would be super helpful! :D

stryku commented 9 years ago

I posted small tutorial. Maybe it'll help you :) http://tibiaauto.net/forum/viewtopic.php?f=33&t=1018053

felipetnh commented 8 years ago

How is this going here, @Wisling? :)

felipetnh commented 8 years ago

I'm thinking about placing the same code that opens backpacks of the Auto Login module (mod_login.cpp lines 543~619) inside the toolThreadProc() of mod_cavebot.cpp I would use a timer created with SetTimer (https://msdn.microsoft.com/en-us/library/ms644906(VS.85).aspx) to run that function every X seconds.

Of course I'd have to tweek the code a bit for it to first check if the backpack is open already or not and only open the closed ones. Also, I have no idea how to get the info of AutoLogin on which backpacks are supposed to be open from the Cavebot module. Any thoughts?

How does that sound to you guys? My goal is to only reopen closed backpacks every X seconds IF the cavebot module is enabled. Any help would be appreciated... :D

Wisling commented 8 years ago

There's a way to make the Cavebot read the AutoLogin information, but the modules are meant to be highly independant. Even the walking priority in each module is generic and can work even if a module was missing. I think the backpack reopener should be a part of the AutoLogin and not the Cavebot. No need to create a new interface and the code is already done for you! Though a tricky part would be to allow the user to not use the login feature and only use the backpack opener. Hope that helps and GL!

felipetnh commented 8 years ago

Why can't you do it, @Wisling? :) I have little to no time whatsoever to code this and I'm totally unfamiliar with the code. And you said you could do it in 20 minutes... ahaha xD

What I would do regarding your tricky part is that I would add a checkbox "Reopen backpacks" that is independent of the module. By that I mean that even if we do not enable Auto Login, it should still work. I think we can start the timer when we check the checkbox and kill it when we uncheck it.

Wisling commented 8 years ago

I will get to it if you don't :P Going to make a stable release of TA first though.

felipetnh commented 8 years ago

Nice... :D I'm gonna leave that to you, then... I'll only have time to try to get this done in two weeks. I'm swamped... xD

felipetnh commented 8 years ago

http://i.imgur.com/XS2kiZU.jpg This is why I need this Backpack Opener... hahaha

Wisling commented 8 years ago

Made this change for the next release. It is simple but I'll find it useful too! Quick relogins are far too common during bad connections to go without something like this.

felipetnh commented 8 years ago

Awesome! Thanks Wisling! :)