Jump to content

Seminko

Members
  • Posts

    225
  • Joined

  • Last visited

Posts posted by Seminko

  1. 4 minutes ago, Apexx said:

    It simply checks the distance between the player and player target. If the distance between is < 8 yards, it will back pedal.
    ManageMovement is a boolean option in my fight class settings.

    I have not tried strafing, it would just seem pointless to strafe when I can achieve greater distance just back pedaling and not have to worry about character rotation.

    I don't know about you but when I see someone backpaddling it seems suspicious not to mention it is significantly slower than strafing.

    I would very much like to see if strafing worked for you. Would you try and let us know?

  2. 6 minutes ago, Apexx said:

    I don't understand the problem really. I use the following for my hunter fight class without any OnEvent methods:

    
    if (!MyTarget.IsTargetingMe && Vector3.Distance(Me.Position, MyTarget.Position) < 8 && HunterSettings.CurrentSetting.ManageMovement)
        Move.Backward(Move.MoveAction.PressKey, 800);

    And it works flawlessly.

    Since I see Vector3, do you manage the movement yourself? Because I don't, I let the bot decide the movement.

    Also try it with Move.StrafeLeft

    Also what does the ManageMovement setting do?

     

    EDIT:

    Quote

    Since I see Vector3, do you manage the movement yourself? Because I don't, I let the bot decide the movement.

    With my poor understanding of CSharp and the bot itself I've seen some people claiming they handle the toon movement themselves using a separate code. I don't even know if that could be done but worth asking...

  3. 22 minutes ago, Matenia said:

    Yes, try 

    
    wManager.Wow.Helpers.Move.Backward(Move.MoveAction.DownKey, );

    so it will press the key for 1000 ms (down). The ms is the time it will press it. With PressKey it will go up and down in 50ms (or 1000, or whatever) hence the movement you're seeing.

    lol are you serious DownKey instead of PressKey, so obvious, yet still not so... :-D

     

    Alright, so Move.Backward + DownKey works, but that would work even without all the MovementEvents_OnMovementPulse shennanigans.

    When I try wManager.Wow.Helpers.Move.StrafeLeft(Move.MoveAction.DownKey, 1000); it STILL tries to face the target, running around in circles, practically indefinitely because I am well within the 6yr range we set up in the while loop.

    I even tried ForceIgnoreAttack, still the same thing. The strange thing is that even though it leaves the 6yr radius it continues strafing. It's like it doesn't wait for the movement to stop to continue.

    while (ObjectManager.Target.GetDistance <= 6)
    {
    	wManager.Wow.Helpers.Conditions.ForceIgnoreIsAttacked = true;
    	isTooClose = true;
    	wManager.Wow.Helpers.Move.StrafeLeft(Move.MoveAction.DownKey, 2500); // wManager.Wow.Helpers.Move.StrafeLeft(Move.MoveAction.PressKey, 1500);
    	wManager.Wow.Helpers.Conditions.ForceIgnoreIsAttacked = false;
    	//Thread.Sleep(1250);
    }

     

    If the bot doesn't wait for the Move to resolve before continuing the script I tried putting in Sleep. Still the same thing, runs around in circles until the mob is dead.

    while (ObjectManager.Target.GetDistance <= 6)
    {
    	wManager.Wow.Helpers.Conditions.ForceIgnoreIsAttacked = true;
    	isTooClose = true;
    	wManager.Wow.Helpers.Move.StrafeLeft(Move.MoveAction.DownKey, 2500); // wManager.Wow.Helpers.Move.StrafeLeft(Move.MoveAction.PressKey, 1500);
    	Thread.Sleep(2500);
    	wManager.Wow.Helpers.Conditions.ForceIgnoreIsAttacked = false;
    	//Thread.Sleep(1250);
    }

     

  4. 7 minutes ago, Matenia said:

    Looks to me like you need to call the movement function with maybe 50ms instead of 1250.

    What does that parameter mean? I haven't been able to find any explanation to it so I assumed it defined how long should the movement be active for, in other words for how long the key should be pressed.

     

    I tried this, which somewhat works but it moves backwards REALLY choppy, it really looks like it presses S every 50ms, however changing it to something like 5000 doesn't do much...

    while (ObjectManager.Target.GetDistance <= 6)
    			{
    				isTooClose = true;
    				wManager.Wow.Helpers.Move.Backward(Move.MoveAction.PressKey, 50); // wManager.Wow.Helpers.Move.StrafeLeft(Move.MoveAction.PressKey, 1500);
    				//Thread.Sleep(1250);
    			}

     

  5. 1 minute ago, Matenia said:

    You actually need to set isTooClose to false again after the while loop and maybe give it a short Thread.Sleep(500) or so at the end of each iteration.
    Does the bot interrupt movement and then starts strafing again? Or is the strafing itself just choppy?

     

    I highly recommend getting Visual Studio and doing a basic C# tutorial (or even Java, they're essentially the same

    I'll try to record it so you guys know what I'm talking about.

  6. For reference, here is the code without errors, but still bad movement:

    Spoiler
    
    using System;
    using System.Linq;
    using System.Threading;
    using System.Windows.Forms;
    using robotManager.Helpful;
    using robotManager.Products;
    using wManager.Wow.Class;
    using wManager.Wow.Enums;
    using wManager.Wow.Helpers;
    using wManager.Wow.ObjectManager;
    using System.Configuration;
    using System.ComponentModel;
    using System.IO;
    using robotManager;
    using System.Collections.Generic;
    using Timer = robotManager.Helpful.Timer;
    
    public class Main : ICustomClass
    {
        public float Range { get { return 29f; } }
    
        private bool iMageLaunched;
        private ulong _lastTarget;
    	private Timer _timer;
    	private const int CastEverySeconds = 120;
    	private Timer _timerFrostNova;
    	private const int CastEverySecondsFrostNova = 26;
    	private int cooldownc;
    	private bool isTooClose = false;
    
        public void Initialize() // When product started, initialize and launch Fightclass
        {
            iMageLaunched = true;
    		MovementEvents.OnMoveToPulse += MovementEvents_OnMoveToPulse;
    		MovementEvents.OnMovementPulse += MovementEvents_OnMovementPulse;
    		Logging.Write("iMage initialized.");
            Start();
        }
    
        public void Dispose() // When product stopped
        {
            iMageLaunched = false;
            Logging.Write("iMage stopped.");
        }
    
        public void ShowConfiguration() // When use click on Fight class settings
        {
            iMageSettings.Load();
            iMageSettings.CurrentSetting.ToForm();
            iMageSettings.CurrentSetting.Save();
        }
    
    	private void MovementEvents_OnMovementPulse(List<Vector3> points, CancelEventArgs cancelable)
    	{
    		if (isTooClose)
    		{
    			cancelable.Cancel = true;
    		}
    	}
    
    	private void MovementEvents_OnMoveToPulse(Vector3 point, CancelEventArgs cancelable)
    	{
    		if (isTooClose)
    		{
    			cancelable.Cancel = true;
    		}
    	}
    
        
    
    
        // SPELLS:
        public Spell ConjureWater = new Spell ("Conjure Water");
        // etc etc
    
    
    
        private void CombatRotation()
    	{
    		if (ObjectManager.Target.GetDistance <= 9 && ObjectManager.Target.GetDistance >= 6 && !ObjectManager.Target.HaveBuff("Frost Nova") && !ObjectManager.Target.HaveBuff("Frostbite") && ObjectManager.Target.HealthPercent >= 25 && (_timerFrostNova == null || _timerFrostNova.IsReady)) // && ObjectManager.Target.GetDistance >= 6 
    		{
    			if (ObjectManager.Me.IsCast)
    			{
    				Lua.LuaDoString("SpellStopCasting();");
    				Thread.Sleep(250);
    				SpellManager.CastSpellByNameLUA("Frost Nova");
    				_timerFrostNova = new Timer(CastEverySecondsFrostNova * 1000);
    				Thread.Sleep(1500);
    			}
    			else
    			{
    				SpellManager.CastSpellByNameLUA("Frost Nova");
    				_timerFrostNova = new Timer(CastEverySecondsFrostNova * 1000);
    				Thread.Sleep(1500);
    			}
    			return;
    		}
    		else if ((ObjectManager.Target.HaveBuff("Frost Nova") || ObjectManager.Target.HaveBuff("Frostbite")) && ObjectManager.Target.GetDistance <= 6)
    		{
    			while (ObjectManager.Target.GetDistance <= 6)
    			{
    				isTooClose = true;
    				wManager.Wow.Helpers.Move.Backward(Move.MoveAction.PressKey, 1250); // wManager.Wow.Helpers.Move.StrafeLeft(Move.MoveAction.PressKey, 1500);
    			}
    			return;
    		}
    		// etc etc
    	}
        
       
        public void Start()
        {
            
            Logging.Write("iMage Loaded");
            while (iMageLaunched)
            {
                if (!Products.InPause)
                    {
                        if (!ObjectManager.Me.IsDeadMe)
                        {
                            if (!ObjectManager.Me.IsMounted && !ObjectManager.Me.InCombat && !Fight.InFight && !ObjectManager.Me.HaveBuff("Drink") && !ObjectManager.Me.HaveBuff("Food"))
    						{
                                BuffRotation();
    							CheckConjureWaterRank();
    							CheckConjureFoodRank();
                            }
    
                            if (Fight.InFight && ObjectManager.Me.Target > 0)
                            {
                                CombatRotation();
                            }
                        }
                    }
                Thread.Sleep(50);
            }
            Logging.Write("iMage is now stopped.");
        }
    
    
        [Serializable]
        public class iMageSettings : Settings
        {
            public iMageSettings()
            {
                ConfigWinForm(new System.Drawing.Point(400, 400), "iMage" + Translate.Get("Settings"));
            }
    
            public static iMageSettings CurrentSetting { get; set; }
    
            public bool Save()
            {
                try
                {
                    return Save(AdviserFilePathAndName("iMage-Mage", ObjectManager.Me.Name + "." + Usefuls.RealmName));
                }
                catch (Exception e)
                {
                    Logging.WriteError("iMageSettings > Save(): " + e);
                    return false;
                }
            }
    
            public static bool Load()
            {
                try
                {
                    if (File.Exists(AdviserFilePathAndName("iMage-Mage", ObjectManager.Me.Name + "." + Usefuls.RealmName)))
                    {
                        CurrentSetting =
                            Load<iMageSettings>(AdviserFilePathAndName("iMage-Mage",
                                                                        ObjectManager.Me.Name + "." + Usefuls.RealmName));
                        return true;
                    }
                    CurrentSetting = new iMageSettings();
                }
                catch (Exception e)
                {
                    Logging.WriteError("iMageSettings > Load(): " + e);
                }
                return false;
            }
        }
    }

     

     

  7. 1 minute ago, Marsbar said:

    I believe that is because they're static.

    A lot of these types of errors can easily be highlighted by a better editor that references the wrobot dlls. Visual studio community edition is free (although quite a heavy editor) and there are some others, its all based on preference.

    Ha, no error this time... Let me see if it does what we're after... Be back in a second with an update.

  8. 5 minutes ago, Marsbar said:

    Ahh...

    using wManager.Events;

    Alright, this solved the error.

    Now it has a problem with these two, saying that the line if (isTooClose) or to be more specific Main.isTooClose requires a link to an object (or sth similar, I have it in my native language, not english)

    	private static void MovementEvents_OnMovementPulse(List<Vector3> points, CancelEventArgs cancelable)
    	{
    		if (isTooClose)
    		{
    			cancelable.Cancel = true;
    		}
    	}
    
    	private static void MovementEvents_OnMoveToPulse(Vector3 point, CancelEventArgs cancelable)
    	{
    		if (isTooClose)
    		{
    			cancelable.Cancel = true;
    		}
    	}

     

    Also, this is my first encounter with C# hence these, probably obvious, mistakes on my part.

  9. 9 minutes ago, Matenia said:

    Edit: You just pasted the code somewhere...

    You need to move

     

    
    MovementEvents.OnMoveToPulse += MovementEvents_OnMoveToPulse;
    	MovementEvents.OnMovementPulse += MovementEvents_OnMovementPulse;

    to your Initialize function. It needs to be called from somewhere...

    Didn't help. Now it says MovementEvents doesn't exist in the current context

     

    5 minutes ago, Marsbar said:

    Using Visual studio? Ctrl+K Ctrl+D, formats your code, i was really confused, thought you were doing the events in the ShowConfiguration().

    No I don't, i use Notepad++ and the code looks good inside but gets messed up when I paste it here

     

    5 minutes ago, Marsbar said:

    also would you not do?

    
    MovementEvents.OnMoveToPulse += delegate { MovementEvents_OnMoveToPulse; };
    MovementEvents.OnMovementPulse += delegate { MovementEvents_OnMovementPulse; };

     

    Tried using this and same as above, it doesn't exist in the current context. Am I missing "an include"? I mean "using xyz"?

  10. Here is the condensed code:

    Spoiler
    
    using System;
    using System.Linq;
    using System.Threading;
    using System.Windows.Forms;
    using robotManager.Helpful;
    using robotManager.Products;
    using wManager.Wow.Class;
    using wManager.Wow.Enums;
    using wManager.Wow.Helpers;
    using wManager.Wow.ObjectManager;
    using System.Configuration;
    using System.ComponentModel;
    using System.IO;
    using robotManager;
    using System.Collections.Generic;
    using Timer = robotManager.Helpful.Timer;
    
    public class Main : ICustomClass
    {
        public float Range { get { return 29f; } }
    
        private bool iMageLaunched;
        private ulong _lastTarget;
    	private Timer _timer;
    	private const int CastEverySeconds = 120;
    	private Timer _timerFrostNova;
    	private const int CastEverySecondsFrostNova = 26;
    	private int cooldownc;
    	private bool isTooClose = false;
    
        public void Initialize() // When product started, initialize and launch Fightclass
        {
            iMageLaunched = true;
            Logging.Write("iMage initialized.");
            Start();
        }
    
        public void Dispose() // When product stopped
        {
            iMageLaunched = false;
            Logging.Write("iMage stopped.");
        }
    
        public void ShowConfiguration() // When use click on Fight class settings
        {
            iMageSettings.Load();
            iMageSettings.CurrentSetting.ToForm();
            iMageSettings.CurrentSetting.Save();
        }
    	
    	MovementEvents.OnMoveToPulse += MovementEvents_OnMoveToPulse;
    	MovementEvents.OnMovementPulse += MovementEvents_OnMovementPulse;
    
    	private static void MovementEvents_OnMovementPulse(List<Vector3> points, CancelEventArgs cancelable)
    	{
    		if (isTooClose)
    		{
    			cancelable.Cancel = true;
    		}
    	}
    
    	private static void MovementEvents_OnMoveToPulse(Vector3 point, CancelEventArgs cancelable)
    	{
    		if (isTooClose)
    		{
    			cancelable.Cancel = true;
    		}
    	}
    
        
    
    
        // SPELLS:
        public Spell ConjureWater = new Spell ("Conjure Water");
        // etc etc
    
    
    
        private void CombatRotation()
    	{
    		if (ObjectManager.Target.GetDistance <= 9 && ObjectManager.Target.GetDistance >= 6 && !ObjectManager.Target.HaveBuff("Frost Nova") && !ObjectManager.Target.HaveBuff("Frostbite") && ObjectManager.Target.HealthPercent >= 25 && (_timerFrostNova == null || _timerFrostNova.IsReady)) // && ObjectManager.Target.GetDistance >= 6 
    		{
    			if (ObjectManager.Me.IsCast)
    			{
    				Lua.LuaDoString("SpellStopCasting();");
    				Thread.Sleep(250);
    				SpellManager.CastSpellByNameLUA("Frost Nova");
    				_timerFrostNova = new Timer(CastEverySecondsFrostNova * 1000);
    				Thread.Sleep(1500);
    			}
    			else
    			{
    				SpellManager.CastSpellByNameLUA("Frost Nova");
    				_timerFrostNova = new Timer(CastEverySecondsFrostNova * 1000);
    				Thread.Sleep(1500);
    			}
    			return;
    		}
    		else if ((ObjectManager.Target.HaveBuff("Frost Nova") || ObjectManager.Target.HaveBuff("Frostbite")) && ObjectManager.Target.GetDistance <= 6)
    		{
    			while (ObjectManager.Target.GetDistance <= 6)
    			{
    				isRunning = true
    				wManager.Wow.Helpers.Move.Backward(Move.MoveAction.PressKey, 1250); // wManager.Wow.Helpers.Move.StrafeLeft(Move.MoveAction.PressKey, 1500);
    			}
    			return;
    		}
    		// etc etc
    	}
        
       
        public void Start()
        {
            
            Logging.Write("iMage Loaded");
            while (iMageLaunched)
            {
                if (!Products.InPause)
                    {
                        if (!ObjectManager.Me.IsDeadMe)
                        {
                            if (!ObjectManager.Me.IsMounted && !ObjectManager.Me.InCombat && !Fight.InFight && !ObjectManager.Me.HaveBuff("Drink") && !ObjectManager.Me.HaveBuff("Food"))
    						{
                                BuffRotation();
    							CheckConjureWaterRank();
    							CheckConjureFoodRank();
                            }
    
                            if (Fight.InFight && ObjectManager.Me.Target > 0)
                            {
                                CombatRotation();
                            }
                        }
                    }
                Thread.Sleep(50);
            }
            Logging.Write("iMage is now stopped.");
        }
    
    
        [Serializable]
        public class iMageSettings : Settings
        {
            public iMageSettings()
            {
                ConfigWinForm(new System.Drawing.Point(400, 400), "iMage" + Translate.Get("Settings"));
            }
    
            public static iMageSettings CurrentSetting { get; set; }
    
            public bool Save()
            {
                try
                {
                    return Save(AdviserFilePathAndName("iMage-Mage", ObjectManager.Me.Name + "." + Usefuls.RealmName));
                }
                catch (Exception e)
                {
                    Logging.WriteError("iMageSettings > Save(): " + e);
                    return false;
                }
            }
    
            public static bool Load()
            {
                try
                {
                    if (File.Exists(AdviserFilePathAndName("iMage-Mage", ObjectManager.Me.Name + "." + Usefuls.RealmName)))
                    {
                        CurrentSetting =
                            Load<iMageSettings>(AdviserFilePathAndName("iMage-Mage",
                                                                        ObjectManager.Me.Name + "." + Usefuls.RealmName));
                        return true;
                    }
                    CurrentSetting = new iMageSettings();
                }
                catch (Exception e)
                {
                    Logging.WriteError("iMageSettings > Load(): " + e);
                }
                return false;
            }
        }
    }

     

     

  11. 3 minutes ago, Matenia said:

    MovementEvents.OnMovementPulse might be what you're looking for.
    Intercept all other events for a while, until you're done moving.

    Could you please ellaborate on that? How would I use it correctly?

     

    EDIT: do I just go with this, then use Move.Backwards and then set it to false?

    wManager.Events.MovementEvents.OnMovementPulse += (points, cancelable) =>
    {
    	cancelable.Cancel = true;
    };

     

  12. 8 hours ago, Apexx said:
    
    if (SpellManager.GetSpellCooldownTimeLeft("Frost Nova") > 0)
    {
        wManager.Wow.Helpers.Move.Backward(Move.MoveAction.PressKey, 1000);
    }

     

    I've tried Move.Backward but I don't like backpaddling, hence I wanted to use strafe.

    EDIT: also, one would think that Move.MoveAction.PressKey, 1000 would hold the key pressed for one second, however it doesn't. It presses it for a few miliseconds. It feels like the script doesn't pause for it to be resolved and continues with the while loop which I have set to Thread.Sleep(50); Or it might have sth to do with what I described with the strafe, ie the bot doesn't want to move away from the mob and I'm telling him otherwise resulting in only a ms of movement.

  13. I've been scouring the forums for a solution to this and everything is very unreliable, at least with my limited knowledge.

    I've tried these, but for both of these the bot is trying to face the target during the strafe, hence it starts doing circles around the mob not really getting away from it.

    wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.STRAFELEFT, 1250);
    Move.StrafeLeft(Move.MoveAction.PressKey, 1250);

    The only reliable way I found how to get away from the mob is to pause the bot (below code) before the move, which makes the movement go as I want to but it messes the bot up in some situations.

    robotManager.Products.Products.InPause = true;
    Move.StrafeLeft(Move.MoveAction.PressKey, 1250);
    robotManager.Products.Products.InPause = false;

    Surely, there is a simple, clean way of doing this?

  14. I recently discovered relogger, it's awesome.

    Now, I want the bot to run grinder for a bit and then go to a specific fishing spot and fish. Unfortunately, I have no idea how to do that.

    I was thinking using like a gathering profile with only one waypoint right near the water but first, how would I tell relogger to switch profiles once the location is reached, and more importantly second, when I tried with a fishing profile and the bot reached the spot, my char was not facing the water and kept throwing the line into the ground.

    Ideas?

  15. Yesterday I tried using the 'Shutdown computer also when closing the game' option in the Advanced General settings, tab Stop game / bot / Security and apparently the bot didn't like it.

    Thing to note, I used it in conjunction with the scheduler, with the scheduler ending with /To home and /Close game. The PC did not shutdown.

    This is the result from the log:

    [F] 03:48:31 - [Spell] Cast Fishing (Fishing)
    [F] 03:48:34 - [Spell] Cast Fishing (Fishing)
    03:48:42 - [Schedule] Stop product Fisherbot
    03:48:42 - iMage stopped.
    03:48:42 - [AntiAfk] Disposed.
    03:48:42 - [Fisher] Stopped
    03:48:42 - [Fisher] Stopped
    03:48:42 - [Fisher] Closed
    [D] 03:48:42 - [FightPetBattle] Cannot load pet battle fight class, use default.
    [D] 03:48:42 - [Spell] spellName=Battle Pet Training => Failed
    03:48:43 - [Schedule] To home, use Hearthstone.
    [D] 03:48:56 - [Info] Continent change, Mauradon to Kalimdor
    [D] 03:48:56 - [Blacklist] Added, 0 uniques Npcs, 0 Blackspots and 0 Npcs types (Training dummy ignored = True).
    03:48:56 - [Schedule] Product /To home (line 6) started for 0,1 minutes.
    03:48:59 - [Security] Player Nearby(Feroze since 3 sec (total time near since bot started)), pause bot
    03:49:02 - [Schedule] Stop product /To home
    03:49:02 - [Schedule] Close game.
    [E] 03:49:02 - !Memory.IsProcessOpen
    
    [E] 03:49:02 - !Memory.IsProcessOpen
    
    [E] 03:49:03 - !Memory.IsProcessOpen
    
    [E] 03:49:03 - !Memory.IsProcessOpen
    
    REPEATS THE SAME MESSAGE LIKE THOUSAND TIMES, THE PC WAS NOT SHUTDOWN...

     

×
×
  • Create New...