Brian
-
Posts
92 -
Joined
-
Last visited
Content Type
Forums
Articles
Bug Tracker
Downloads
Store
Posts posted by Brian
-
-
1 hour ago, reapler said:
So, i wrote a method which works (at least for me):
[DllImport("user32.dll")] static extern bool SetWindowText(IntPtr hWnd, string text); public void SetText(string processname, string text) { IntPtr mainWindowHandle = IntPtr.Zero; foreach (var obj in System.Diagnostics.Process.GetProcesses()) { //or you can search for other parameter / characteristics which wow contains but searching for processname is normaly enough if (obj.ProcessName == processname)// => in my case the executable in my wow folder is Wow.exe { Logging.Write("Process found: " + obj.ProcessName + "[" + obj.Id + "]."); mainWindowHandle = obj.MainWindowHandle; break; } } if (mainWindowHandle != IntPtr.Zero) { SetWindowText(mainWindowHandle, text); } else { Logging.Write("No process with the name '" +processname+"' was found.\nPlease check your executable's name."); } }
usage:
SetText("Wow","Hello World!");
but remember:
processname != windowtext => the field "ProcessName" is read only so it can't be changed on running processes. If you really want to change the process' name, you can only influence it on startup or by creating a new process.
Edit: this one gets the right one, if several processes exist:
[DllImport("user32.dll")] static extern bool SetWindowText(IntPtr hWnd, string text); public void SetText(string processname, string text) { IntPtr mainWindowHandle = IntPtr.Zero; foreach (var obj in System.Diagnostics.Process.GetProcesses()) { if (obj.ProcessName == processname)// => in my case the executable in my wow folder is Wow.exe { if (wManager.Wow.Memory.PlayerName(obj.Id) == wManager.Wow.ObjectManager.ObjectManager.Me.Name) { Logging.Write("Process found: " + obj.ProcessName + "[" + obj.Id + "][" + wManager.Wow.ObjectManager.ObjectManager.Me.Name+ "]"); mainWindowHandle = obj.MainWindowHandle; break; } } } if (mainWindowHandle != IntPtr.Zero) { SetWindowText(mainWindowHandle, text); } else { Logging.Write("No process with the name '" +processname+"' was found.\nPlease check your executable's name."); } }
Thanks, I'll test later when Im available. The second method is exactly what I'm looking for!
-
2 hours ago, reapler said:
Hello, it's not possible to change the process name(on runtime => you can retaliate at msdn documentation) and you must specify which IntPtr do you mean:
There are several IntPtr which you can get from the process but i belive you want the mainwindowhandle? or you can explain for what the IntPtr is needed.
Edit: forgot to write that you can change the process name by simply rename wow.exe but it will doesn't affect the process name while it's running:
Logging.Write(wManager.Wow.Memory.WowMemory.Memory.GetProcess().ProcessName);
I need to change the process name and I can do it via
[DllImport("user32.dll")]
static extern void SetWindowText(IntPtr hWnd, string windowName);But I need to get the main window handle.. Also, wManger.WoW.Memory.WoWMemory.Memory.. no GetProcess exists, only serialize
-
Is it possible to change process name of attached WoW process?
Also, how would I get an IntPtr to the attached WoW process?
-
21 minutes ago, eeny said:
wManager.Wow.Bot.Tasks.GoToTask.ToPosition(new Vector3(x.xf, y.yf, z.zf));
may do it- not sure how your black magic works...
worked, thanks
-
The anti-afk plugin is not working. (I am on 3.3.5), I am in combat for like 30minutes ~ and can't move and I go AFK and sometimes will logout. How can I avoid this?
-
4 minutes ago, eeny said:
I wrote a tutorial on this.
if your doing a dungeon you will likely be using "quester". Make a pulse thats a 'kill and loot ' and just make the co-ordinates on the other side of the instance portal. Make the iscomplete condition
return (wManager.Wow.Helpers.Usefuls.ContinentId == (int)wManager.Wow.Enums.ContinentId.DeepholmeDungeon)
Where DeepholmeDungeon is the name of the zone of the instance you will be entering.
Edit- could use a followpath and have it end on the other side of the instance portal.
I use BlackMagic in my instance so it is all done in a plugin
-
I don't need to use pathfinding or what not, just need the bot to click a x,y,z location. (Entering an instance..)
-
So, I need to return the processID of the attached wrobot instance. How can I do this? (There will be multiple wrobot/wow's running so I need the attached instance)
-
1 hour ago, Pasterke said:
You can try :
string[] result = Lua.LuaDoString<string>("local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId=what you want to check",0);
then result[0] should contains name, result[1] rank etc ...
This is for OP, not for me :P, I use it just fine
-
3 hours ago, Pasterke said:
That way it's not possible. Or you use an foreach loop or an switch construction.
But a,b,... stands for what ?
string name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = Lua.LuaDoString<string>("BuffStatus('target','Hunter's Mark')");
-
1 hour ago, MrBottie said:
I know you can do this to retrieve a bool or a string or whatever you want but it's a bit more complicated than that
If you want to retrieve multiple values;
a,b,c,d,e,f,g = Lua.LuaDoString<string>("UnitIsDead('target'));
a,b,c.. are the respective values in order
-
Lua.LuaDoString<string>("UnitIsDead('target')")
-
So, when I am in combat and lets say the unit is unattackable or behind me or something the player moves / turns to try and fix itself. I don't want this. If the bot is in combat, I don't want it to move at all even if my target is unattackable. How can I do this? Or, is there a way I can completely pause the bot in combat and unpause after combat? (I have my own rotation/combat manager that has sesperate from wrobot)
" [MovementManager] Trying something funny, hang on" I want to disable this, I only want movement to happen if I specifically call .Move
-
Just making this in a plugin with an empty bot base! Solved
-
How do I start dialog / manage gossip in C# with an NPC by name? Or do I have to use LUA?
One more question, how can I check (via either LUA or a bot function) if I can talk to a npc? So basically, I talk to an npc, and after I can no longer speak with that npc, I want to move onto the next step, how would I check if I can no longer speak to an npc using his name?
-
So, I am attempting to make a very complex dungeon script, I need to use C# for a lot of the code with external DLLs. Is there any official way of handling this? If not, I'll probably just create the entire script in a plugin with an empty bot base, but that will be a bit annoying.
-
What is the correct API to send a keystroke?
-
So I am playing a class with all instants and 400 ping, so I would like my fightclass to spam the next button until it is pressed. How would I do that? Maybe not a full out spam, but start looking for next button to press a couple hundred milliseconds early. I tried :
cooldownc = Lua.LuaDoString<int>("start, duration, enabled = GetSpellCooldown('Black Arrow'); return start;"); if (cooldownc == 0 && BlackArrow.IsDistanceGood && BlackArrow.KnownSpell) { BlackArrow.Launch(); return; }
Instead of :
if (BlackArrow.IsSpellUsable && BlackArrow.IsDistanceGood && BlackArrow.KnownSpell) { BlackArrow.Launch(); return; }
But it breaks the rotation and gets out of order because there is so much spamming it backs up. I tried adding sleeps but they didn't help much, rotation was suboptimal.
using System; using System.Threading; using robotManager.Helpful; using robotManager.Products; using wManager.Wow.Class; using wManager.Wow.Helpers; using wManager.Wow.ObjectManager; public class Main : ICustomClass { public float Range { get { return 30f; } } private bool _isLaunched; private WoWUnit _lastTarget; public void Initialize() { _isLaunched = true; Logging.Write("Lock1.0 Started"); Rotation(); } public void Dispose() { _isLaunched = false; Logging.Write("Lock1.0 Stop in progress."); } public void ShowConfiguration() { Logging.Write("Lock1.0 No setting for this Fight Class."); //MessageBox.Show("[My fightclass] No setting for this Fight Class."); } public Spell BlackArrow = new Spell("Black Arrow"); public Spell KillCommand = new Spell("Kill Command"); public Spell ChimShot = new Spell("Chimera Shot"); public Spell MultiShot = new Spell("Multi-Shot"); public Spell AimedShot = new Spell("Aimed Shot"); public Spell ExpShot = new Spell("Explosive Shot"); public Spell SteadyShot = new Spell("Steady Shot"); public Spell KillShot = new Spell("Kill Shot"); public Spell HunterMark = new Spell("Hunter's Mark"); public Spell SerpSting = new Spell("Serpent Sting"); public Spell BeastWrath = new Spell("Bestial Wrath"); public Spell RapidFire = new Spell("Rapid Fire"); public Spell Readiness = new Spell(23989); public Spell CallPet = new Spell("Call Pet"); public int SerpID = 49001; public int HuntID = 19423; internal void Rotation() { Logging.Write("Lock1.0 Is started."); while (_isLaunched) { try { if (!Products.InPause) { if (!ObjectManager.Me.IsDeadMe) { //buffRotation(); if (Fight.InFight && ObjectManager.Me.Target > 0 && ObjectManager.Me.SpeedMoving == 0 && !ObjectManager.Me.GetMove) { CombatRotation(); } else if (ObjectManager.Me.Target == 0) { } } } } catch (Exception e) { Logging.WriteError("[My fightclass] ERROR: " + e); } Thread.Sleep(10); // Pause 10 ms to reduce the CPU usage. } Logging.Write("[My fightclass] Is now stopped."); } Aura GetAuraByPlayer(int ID) { Aura final = new Aura(0); Aura[] TargetAuras = ObjectManager.Target.GetAllBuff().ToArray(); foreach (Aura i in TargetAuras) { if (i.IsValid() && i.Owner == wManager.Wow.ObjectManager.ObjectManager.Me.Guid && i.SpellId == ID) { final = i; return i; } } return final; } internal void CombatRotation() { Aura SerpAura = GetAuraByPlayer(SerpID); Aura HuntAura = GetAuraByPlayer(HuntID); int cooldown; int cooldownb; int cooldownc; int cooldownd; int cooldowne; int cooldownf; int cooldowng; int cooldownh; int cooldowni; int cooldownj; if (!ObjectManager.Pet.IsValid) { CallPet.Launch(); return; } if (HunterMark.IsSpellUsable && HunterMark.IsDistanceGood && HunterMark.KnownSpell) { if (!ObjectManager.Target.HaveBuff("Hunter's Mark")) { HunterMark.Launch(); return; } } cooldown = Lua.LuaDoString<int>("start, duration, enabled = GetSpellCooldown('Bestial Wrath'); return start;"); if (BeastWrath.IsSpellUsable && BeastWrath.IsDistanceGood && BeastWrath.KnownSpell) { BeastWrath.Launch(); return; } if (RapidFire.IsSpellUsable && RapidFire.KnownSpell) { if (!ObjectManager.Me.HaveBuff("Rapid Fire")) { RapidFire.Launch(); return; } } if (SerpSting.IsDistanceGood && SerpSting.KnownSpell) { if (SerpAura.SpellId == 0) { SerpSting.Launch(); return; } } cooldownc = Lua.LuaDoString<int>("start, duration, enabled = GetSpellCooldown('Black Arrow'); return start;"); if (BlackArrow.IsSpellUsable && BlackArrow.IsDistanceGood && BlackArrow.KnownSpell) { BlackArrow.Launch(); return; } cooldowni = Lua.LuaDoString<int>("start, duration, enabled = GetSpellCooldown('Explosive Shot'); return start;"); if (ExpShot.IsSpellUsable && ExpShot.IsDistanceGood && ExpShot.KnownSpell) { ExpShot.Launch(); return; } cooldownd = Lua.LuaDoString<int>("start, duration, enabled = GetSpellCooldown('Chimera Shot'); return start;"); if (ChimShot.IsSpellUsable && ChimShot.IsDistanceGood && ChimShot.KnownSpell) { ChimShot.Launch(); return; } cooldowne = Lua.LuaDoString<int>("start, duration, enabled = GetSpellCooldown('Kill Command'); return start;"); if (KillCommand.IsSpellUsable && KillCommand.IsDistanceGood && KillCommand.KnownSpell) { KillCommand.Launch(); return; } cooldownf = Lua.LuaDoString<int>("start, duration, enabled = GetSpellCooldown('Multi-Shot'); return start;"); if (MultiShot.IsSpellUsable && MultiShot.IsDistanceGood && MultiShot.KnownSpell) { MultiShot.Launch(); return; } cooldowng = Lua.LuaDoString<int>("start, duration, enabled = GetSpellCooldown('Aimed Shot'); return start;"); if (AimedShot.IsSpellUsable && AimedShot.IsDistanceGood && AimedShot.KnownSpell) { AimedShot.Launch(); return; } cooldownh = Lua.LuaDoString<int>("start, duration, enabled = GetSpellCooldown('Kill Shot'); return start;"); if (KillShot.IsSpellUsable && KillShot.IsDistanceGood && KillShot.KnownSpell && ObjectManager.Target.HealthPercent < 20) { KillShot.Launch(); return; } cooldownj = Lua.LuaDoString<int>("start, duration, enabled = GetSpellCooldown('Readiness'); return start;"); Logging.WriteDebug(cooldownj.ToString()); if (Readiness.IsSpellUsable && Readiness.KnownSpell) { Readiness.Launch(); return; } if (SteadyShot.IsSpellUsable && SteadyShot.IsDistanceGood && SteadyShot.KnownSpell) { SteadyShot.Launch(); return; } } }
that is what my rotation looks like, a bunch of those if statements
-
If I have an object A I want to target, how wold I do that?
-
34 minutes ago, insidiouz said:
1-60 NE quest path completed testing now then posting Spacegoats next who will share much of the NE profile that 1 will be faster most alliance will share the same 20+ paths the hard stuff done just 1-20 each human faction then they share paths horde will be the same after the 1st profile the rest will be fast. Id like to see our community grow and for that we need some profile diversity. I realised the time involved before I posted and that my word would be expected to be held.I look forward to adding to our database many things that it lacks.
People only play Horde BC, so NE is kinda useless :D
-
2 minutes ago, Zwox said:
Nope i dont use timer
Curruption (Once p Target) same for curse of agony
theres your issue. Don't do once per target, check if it has buff and if not, apply it. Never use once per target.
- dida1990 and BetterSister
- 2
-
-
A proc is a player buff, so check player for buff nightfall, also you could check the cast time of shadow bolt, but the first way is better.
-
It should keep attempting to apply the second dot, because it should check if the dot is applied and if not, apply it. Are you using timers? If so, don't. You should never use a timer in a combat rotation.
Run out if shannox attacks me
in Developers assistance
Posted
check if Npc Shannox is not null, if not null run out