What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[Plugin] Unstucker - restarts if your character gets stuck

Wow this actually works havent tested the whole unstucker since i dont need it, but the "relad profile" part seems to work fine for now. You should update your Leave game after x Minutes Script with this algorithm. Will report in after testing this for like 5-6 hours. Thx 4 the work
 
Yup seems to be working pretty well so far, managed to force it to get stuck to see if it would reload the profile correctly and it worked pefectly!

Its good we finally have a solution to the profile reloading issue, hopefully someone will put this into a stand alone plugin that that forces a game to restart upon dieing.
 
The correct behavior would be for the plugin to restart the profile as well. Is that possible? Otherwise the waypoint will be messed up.
 
BUG:
From reading your code you tell the ppl to set a profile name with ending .xml
in your stringformat in the code you add the .xml.. think you overlooked that :)

will think character is stuck when identifying rares for an extended period of time

You can fix this by checking the BrainBehavior.IsVendoring
or try using:
if (ZetaDia.Me.CommonData.AnimationState == AnimationState.Casting)

it starts identifing when going to vendor so you can tell your plugin to stop checking while isVendoring = true :)

and to make it more userfriendly read the settings from a text file like some other plugins here already did.
Here is some example from my personal unstucker:
Code:
 private static string path = "Plugins/UnstuckMe/Settings.cfg";
        public void readSettings()
        {
            if (File.Exists(path))
            {
                StreamReader reader = new StreamReader(path);
                while (!reader.EndOfStream)
                {
                    string line = reader.ReadLine();
                    // Check if line is empty or a comment
                    if (line.Trim() == string.Empty || line.StartsWith(";"))
                        continue;
                    string[] split = line.Split(';');
                    split = split[0].Split('=');
                    Log("READ: " + split[0] + " -> \'" + split[1] + "\'");
                    switch (split[0])
                    {
                        case "NeededLogPositions":
                            NeededLoggedPositions = Convert.ToInt32(split[1].Trim());
                            break;
                        case "CheckTime":
                            CheckTime = Convert.ToInt32(split[1].Trim()); 
                            break;
                        case "MaxVendorTime":
                            MaxVendorTime = Convert.ToInt32(split[1].Trim());
                            break;
                        case "RestartTimeout":
                            RestartTimeout = Convert.ToInt32(split[1].Trim());
                            break;
                        case "PositionLoggingInterval":
                            PositionLoggingInterval = Convert.ToInt32(split[1].Trim());
                            break;
                        case "Distance":
                            Distance = Convert.ToInt32(split[1].Trim());
                            break;
                        case "MaxStuckCount":
                            MaxStuckCount = Convert.ToInt32(split[1].Trim());
                            break;
                        case "MaxRandomMoves":
                            MaxRandomMoves = Convert.ToInt32(split[1].Trim());
                            break;
                        case "RandomMoverCheckTime":
                            RandomMoverCheckTime = Convert.ToInt32(split[1].Trim());
                            break;
                        case "MoverDistance":
                            MoverDistance = Convert.ToInt32(split[1].Trim());
                            break;
                        case "MaxDeadCounts":
                            MaxDeadCounts = Convert.ToInt32(split[1].Trim());
                            break;
                        case "DeadCountTimeout":
                            DeadCountTimeout = Convert.ToInt32(split[1].Trim());
                            break;
                        case "ResetStuckCounter":
                            if (split[1].ToLower().Trim().Equals("true"))
                                ResetStuckCounter = true;
                            else
                                ResetStuckCounter = false;
                            break;
                        case "FightAnimationCheckTime":
                            FightAnimationCheckTime = Convert.ToInt32(split[1].Trim());
                            break;
                    }
                    /*
                        c
                     */
                }
                reader.Close();
            }
            else
            {
                Log("ERROR: Can't find \"" + path + "\"");
            }
        }

Config file example:
Code:
; UnstuckMe Settings
NeededLoggedPositions = 5
CheckTime = 18
MaxVendorTime = 60
RestartTimeout = 10
PositionLoggingInterval = 3
Distance = 20
MaxStuckCount = 2
MaxRandomMoves = 5
RandomMoverCheckTime = 3
MoverDistance = 10
MaxDeadCounts = 2
DeadCountTimeout = 130
ResetStuckCounter = false 		; Setting this to true will reset the stuckcounter to 0 instead of decreasing it by 1 for each time we are not stuck (default: false)
FightAnimationCheckTime = 3

btw this is case sensitive you can add the tolower ofc


[edit]
Can't you use ProfileManager.CurrentProfile to get the profile that is used ?
ProfileManager.CurrentProfile.Path ?
[/edit]
 
Last edited:
BUG:
From reading your code you tell the ppl to set a profile name with ending .xml
in your stringformat in the code you add the .xml.. think you overlooked that :)



You can fix this by checking the BrainBehavior.IsVendoring
or try using:
if (ZetaDia.Me.CommonData.AnimationState == AnimationState.Casting)

it starts identifing when going to vendor so you can tell your plugin to stop checking while isVendoring = true :)

and to make it more userfriendly read the settings from a text file like some other plugins here already did.
Here is some example from my personal unstucker:

Config file example:

btw this is case sensitive you can add the tolower ofc


[edit]
Can't you use ProfileManager.CurrentProfile to get the profile that is used ?
ProfileManager.CurrentProfile.Path ?
[/edit]

Thanks for that AnimationState.Casting thing. I'll check it out. I'm personally not a fan of config files (at least, not for a small plugin like this). It might be a little more user friendly, but I'd rather keep things more streamlined.

Last I heard, ProfileManager.CurrentProfile was buggy. I haven't tested it since so I suppose the devs may have fixed it. Have you had any luck with it?

Fixing the .xml thing now.

The correct behavior would be for the plugin to restart the profile as well. Is that possible? Otherwise the waypoint will be messed up.

The plugin does restart the profile. I thought that was what restarting the bot implied.

Hardcoded Profile is pretty crappy :/

No other way of doing it atm.

Wow this actually works havent tested the whole unstucker since i dont need it, but the "relad profile" part seems to work fine for now. You should update your Leave game after x Minutes Script with this algorithm. Will report in after testing this for like 5-6 hours. Thx 4 the work

I think you're confusing me with someone else.
 
Last I heard, ProfileManager.CurrentProfile was buggy. I haven't tested it since so I suppose the devs may have fixed it. Have you had any luck with it?

I did not test any further with currentprofile since last time so dont know what exactly was working and what not
 
How would i do to change at what direction the unstucker is trying to unstuck the character?
Atm it only makes the character walk backwards but it would be better for me and many sark running people if the character would move right so it would prevent the character from being stuck at the chest (0 pickup, nothing good at AH :<).
think this would be the X axis of the character.
 
BUG:
From reading your code you tell the ppl to set a profile name with ending .xml
in your stringformat in the code you add the .xml.. think you overlooked that :)



You can fix this by checking the BrainBehavior.IsVendoring
or try using:
if (ZetaDia.Me.CommonData.AnimationState == AnimationState.Casting)

it starts identifing when going to vendor so you can tell your plugin to stop checking while isVendoring = true :)

Where i found this clue?

I search in my profile and in my loot item rule and i don't find anything.
 
Sometimes the profile will proceed even the cellar is closed. The unstucker will kick in and restart the game. Then the profile is completely out of order, I go towards the gate instead of the cellar, and even if I go inside the cellar, it moves towards the chest on the bottom instead of into the room to kill the creeps. Is this because the profile is not properly retstarted? Does anybody know why?
 
BUG:
You can fix this by checking the BrainBehavior.IsVendoring
or try using:
if (ZetaDia.Me.CommonData.AnimationState == AnimationState.Casting)

it starts identifing when going to vendor so you can tell your plugin to stop checking while isVendoring = true :)

Where i found this clue?

I search in my profile and in my loot item rule and i don't find anything.


nope this is the private unstucker I made to test a bit with I am sharing most of my ideas to help improve this unstucker

I won't release it because eax was just the first one to post his plugin and I am continueing mine for learning :)
 
Last edited:
why did you make it all complicated now...

earlier versions didnt need editing
 
why did you make it all complicated now...

earlier versions didnt need editing

+1 on that one....annoying to change settings everytime I want to bot a different character....why the change?
 
+1 on that one....annoying to change settings everytime I want to bot a different character....why the change?
I have read SEVERAL comment about the safety of opening a thread and the warden I made ​​a test to wait from a diferent way. if you dont want to try just ignore ...... why reply ?
 
In the test one...

error CS0246: The type or namespace name 'WaitTimer' could not be found (are you missing a using directive or an assembly reference?)
 
doesnt work at all for me. i edited the profile name, the folder is in my plugins folder, unstucker is checked. and it doesnt even move when stuck...
 
I have read SEVERAL comment about the safety of opening a thread and the warden I made ​​a test to wait from a diferent way. if you dont want to try just ignore ...... why reply ?

i'll try it, i edited it in vs10 to suite my needs.
 
doesnt work at all for me. i edited the profile name, the folder is in my plugins folder, unstucker is checked. and it doesnt even move when stuck...

Post your logs and your Unstucker.cs file.

I have read SEVERAL comment about the safety of opening a thread and the warden I made ​​a test to wait from a diferent way. if you dont want to try just ignore ...... why reply ?

You were misinformed or misinterpreted what you read. Read up on thread safety. It has nothing to do with Thread.Sleep or Warden.

+1 on that one....annoying to change settings everytime I want to bot a different character....why the change?

For a more reliable restart. People were having issues with Unstucker not resetting the profile when it remade the game, hence the change.
If you would like to use the older versions, they're still available (1.7 and 1.8).

why did you make it all complicated now...

earlier versions didnt need editing

Earlier versions also got the character stuck with certain profiles. I've left the older versions up for download though.

What you think about that v1.8
added line 18;, 97,98
to remove thread

Completely pointless. In fact, what you're doing will hog the CPU instead of simply pausing.
 
Back
Top