-
Posts
225 -
Joined
-
Last visited
Content Type
Forums
Articles
Bug Tracker
Downloads
Store
Posts posted by Seminko
-
-
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:
QuoteSince 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...
-
Here's an idea, does facing the target count as movement? Because if it doesn't it would make sense... we're trying to cancel bot movement but facing the target is still there?
This is probably not the case but I'm trying to think of everything because we don't seem to be able to find out what's wrong.
-
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); }
-
Also, tried with StrafeLeft and it does the same thing I've been explaining at the begining, it just runs circles around the mob...
I'm frustrated...
-
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); }
-
Alright, here is the FULL code I use so you can actually try it for yourselves:
Removed
And here's the video: https://www.youtube.com/watch?v=GW3p0FZMMCE
-
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.
-
2 minutes ago, Marsbar said:
I'd be surprised if it doesn't error;
BuffRotation();
CheckConjureWaterRank();
CheckConjureFoodRank();These functions don't exist,
They exist :) I just removed them from the enclosed code because they're not relevant for our issue :)
3 minutes ago, Marsbar said:also you left out using wManager.Events; again :P
True, adding it now :)
-
For reference, here is the code without errors, but still bad movement:
Spoilerusing 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; } } }
-
Nope, does the same thing :( moves an inch back, waits a few ms, moves an inch back etc... definitely not that 1250ms as expected
-
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.
-
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 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"?
-
Here is the condensed code:
Spoilerusing 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; } } }
-
Nope I use CSharp
Edit: should I post my code? Maybe it would be easier to spot where the issue is
-
Received an error. Seems the bot doesn't like the ' += ' and ' ; ' in this:
MovementEvents.OnMoveToPulse += MovementEvents_OnMoveToPulse; MovementEvents.OnMovementPulse += MovementEvents_OnMovementPulse;
Or I put it where it doesn't belong.
-
10 minutes ago, Matenia said:
Basically, for the entire duration that you take over movement (also OnMoveToPulse you'll probably need), you need to cancel all other movement events.
So I should use the code in the way I guessed above? EDIT: nope, that doesn't seem to be the correct usage.
-
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; };
-
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.
-
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?
-
have never used Quester, will look into it
-
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?
-
-
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...
[SOLVED] Move after Frost Nova - is it really that hard?
in WRobot for Wow Vanilla - Help and support
Posted
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?