Jump to content

Pudge

WRobot user
  • Posts

    347
  • Joined

  • Last visited

Reputation Activity

  1. Thanks
    Pudge got a reaction from Photogenic in How to cast revive once?   
    Works, thanks

     
    var corpse = ObjectManager.GetObjectWoWCorpse().FirstOrDefault(); if (corpse.IsValid) { Lua.LuaDoString("print('corpse exists, name: ["+corpse.Name+"], guid: ["+corpse.Guid+"], baseadress: ["+corpse.GetBaseAddress+"]')"); SpellManager.CastSpellByNameLUA("Revive"); Interact.InteractGameObject(corpse.GetBaseAddress); }  
  2. Like
    Pudge got a reaction from Talamin in How to cast revive once?   
    Works, thanks

     
    var corpse = ObjectManager.GetObjectWoWCorpse().FirstOrDefault(); if (corpse.IsValid) { Lua.LuaDoString("print('corpse exists, name: ["+corpse.Name+"], guid: ["+corpse.Guid+"], baseadress: ["+corpse.GetBaseAddress+"]')"); SpellManager.CastSpellByNameLUA("Revive"); Interact.InteractGameObject(corpse.GetBaseAddress); }  
  3. Thanks
    Pudge reacted to Matenia in Manipulations in character selection menu   
    That should work. Lua.LuaDoString takes some extra arguments like "notInGame" or something, so maybe try those
  4. Like
    Pudge reacted to Matenia in Manipulations in character selection menu   
    Extract GlueXML from your client's MPQ find out what everything is called and then use those names.
  5. Like
    Pudge reacted to zzzar in Get names of players from GetWhoInfo() to list   
    var list = new List<string>();
    for (int i = 0; i <30; i++)   // 30 is example
    {
    var x = Lua.LuaDoString<string>(string.Format("name, guild, level, race, class, zone, classFileName = GetWhoInfo({0}); return name", i));
    list.Add(x);
    }
     
  6. Like
    Pudge got a reaction from TheSmokie in Quest : the gift that keeps on giving   
    hi, you can try this method
    ObjectManager.GetObjectWoWUnit().Count(u => u.IsMyPet && u.Name == "Scarlet Ghoul") == 5  
  7. Thanks
    Pudge got a reaction from TheSmokie in Setting wrobot runecode   
    https://marsbars.gitlab.io/unoffical-wrobot-api-docs/api/wManager.wManagerSetting.html
  8. Like
    Pudge reacted to Droidz in Check Mammoth spell   
    Hey,
    to check if has mount try
    wManager.Wow.Helpers.SpellManager.ExistMount("mount name"); or
    wManager.Wow.Helpers.SpellManager.ExistSpellBook("mount name");  
    to check if mount is mounted try
    wManager.Wow.Helpers.SpellManager.HaveBuffLua("mount name");  
  9. Like
  10. Like
    Pudge reacted to Droidz in Plugin for attacking specific mobs?   
    Hello, Try this plugin: GatheringMobSpawns.cs
    using System.Collections.Generic; using System.Windows.Forms; using robotManager.Helpful; using wManager.Wow.Bot.States; public class Main : wManager.Plugin.IPlugin { public void Initialize() { var grinderState = new Grinding {EntryTarget = new List<int> {98232, 98234, 98235, 98233 } }; // http://www.wowhead.com/npc=98232/withered-hungerer , http://www.wowhead.com/npc=98234/nightmare-creeper , http://www.wowhead.com/npc=98235/frenzied-fox, http://www.wowhead.com/npc=98233/withered-hungerer robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) => { if (state != null && state.DisplayName == "Farming") { if (grinderState.NeedToRun) { grinderState.Run(); cancelable.Cancel = true; } } }; Logging.Write("[GatheringMobSpawns] Loadded."); } public void Dispose() { Logging.Write("[GatheringMobSpawns] Disposed."); } public void Settings() { MessageBox.Show("[GatheringMobSpawns] No settings for this plugin."); } }  
  11. Like
    Pudge reacted to Droidz in [ToTown] Unable to reach the vendor, blacklist it 120 minutes   
    To unblacklist vendor (add you own condition, check if you are in smart pull):
    robotManager.Events.LoggingEvents.OnAddLog += delegate(Logging.Log log) { if (!log.Text.Contains("[ToTown] Unable to reach the vendor, blacklist it 120 minutes (you can disable this NPC in NPC DB tab 'Tools').")) return; foreach (var n in NpcDB.ListNpc) { n.BlackList(-1); } }; Or make copy of npcdb before to start fight (in smartpull) and restaure copy after fight
    (but yes I need to add blacklist events)
  12. Like
    Pudge reacted to Droidz in Clear log code   
    Hello,
    You cannot clear log from external code.
    To track log use "robotManager.Events.LoggingEvents.OnAddLog" like here https://wrobot.eu/forums/topic/9443-totown-unable-to-reach-the-vendor-blacklist-it-120-minutes/?do=findComment&comment=43952
  13. Like
    Pudge reacted to FNV316 in Snippets codes for quest profiles   
    Force Taxi (Vanilla) & automatically get TaxiButton by name
    var position = new Vector3(-8835.76f, 490.084f, 109.6157f); int npcEntryId = 352; if (!ObjectManager.Me.IsOnTaxi) { if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId)) { int node; Usefuls.SelectGossipOption(GossipOptionsType.taxi); node = wManager.Wow.Helpers.Lua.LuaDoString<int>("for i=0,30 do if string.find(TaxiNodeName(i),'Ironforge') then return i end end"); wManager.Wow.Helpers.Lua.LuaDoString("TakeTaxiNode(" + node + ")"); } } Step "RunCode" and wrap it into a while loop (as shown in Droidz example).
    For 'position' you have to add the position of the flight master the bot is going to use.
    For 'npcEntryID' you have to add the ID of the corresponding flight master.
    For 'Ironforge' you have to change it to the name of the taxi node you wanna travel to. Has not to be the full name, an explizit part of the destination is enough (f.e. 'Stormwind' instead of 'Stormwind City').
    The code above makes the bot travelling from Stormwind to Ironforge.
  14. Like
    Pudge reacted to Droidz in [Schedule] Shut down computer   
    hello, https://stackoverflow.com/questions/1215139/reboot-machine-from-a-c-wpf-app
  15. Like
    Pudge reacted to Droidz in [Schedule] Shut down computer   
    Hello, i'll not add this option, but you can run this code for that:
    robotManager.Helpful.Others.ShutDownPc(); (run this code in quester or custom profile)
  16. Thanks
    Pudge got a reaction from happiness7 in fly away if you meet a specific player   
    private void initializeEnemiesList() { if (_settings.enemyAlertEnabled) { string[] enemySplit = _settings.enemyNamesList.Split(','); myEnemyList = new List<string>(enemySplit); } } public void enemyAlert() { var enemiesNearMe = GetEnemiesNearMe(_settings.enemyScanRange, myEnemyList); if (!(ObjectManager.Me.InCombatFlagOnly) && enemiesNearMe.Count > 0 && (DateTime.Now > nextEnemyAlertTime)) { nextEnemyAlertTime = DateTime.Now.AddSeconds(_settings.enemyAlertWaitTime); var enemyNames = ""; foreach (var enemy in enemiesNearMe) { enemyNames += (enemy.Name + " "); } moveto(); Logging.Write("[RoboAlert] Enemies Near Me "); wManager.Wow.Helpers.Lua.LuaDoString("BasicScriptErrors:SetScale(6) if BasicScriptErrors:IsShown() then BasicScriptErrors:Hide() end message('HATER " + enemyNames + "')"); } private void moveto() { wManager.Events.FightEvents.OnFightLoop += delegate (WoWUnit unit, CancelEventArgs cancelable) { var enemiesNearMe = GetEnemiesNearMe(_settings.enemyScanRange, myEnemyList); if (enemiesNearMe.Count > 0) { var toPosition = new Vector3(4286.155, -884.4277, 251.7935, "Flying"); wManager.Wow.Helpers.MovementManager.MoveTo(toPosition); while (wManager.Wow.Helpers.MovementManager.InMoveTo && toPosition.DistanceTo(wManager.Wow.ObjectManager.ObjectManager.Me.Position) > 17) { System.Threading.Thread.Sleep(10000); } } }; } What code could be placed in the body of the method moveto() so that the bot flew to a specific point if the enemy suddenly appeared nearby, And after that the bot returned
  17. Like
    Pudge reacted to Marsbar in C# Fightclass development - video tutorial   
    Hi..
    People often attempt to get into making stuff in C# for wrobot but often don't know where to begin. In this video tutorial I attempt to explain some of the basics of fightclass development in visual studio.
    I've attached the solution I was showing in the video to this post.
    ps. Sorry about my voice and my coughing, I'm currently a bit ill ? watching it back I also didn't touch on quite a few points. Let me know if you have questions and I can either do another video or just write out the answers.
    I'll do a video on plugin creation (which I find more interesting) soon™
    FightClassTutorial.zip
  18. Like
    Pudge reacted to Droidz in Fisherbot Quest   
    Hello, use quest type "OverridePulseCSharpCode" with code:
    Vector3 fishPosition = new Vector3(-9387.61, -120.2896, 58.53797, "Flying"); float fishRotation = 4; if (!FishingTask.IsLaunched) { if (GoToTask.ToPosition(fishPosition, 1.5f)) { ObjectManager.Me.Rotation = fishRotation; FishingTask.LoopFish(); } } return true; (replace "-9387.61, -120.2896, 58.53797" by fishing position and 4 by fishing rotation (you can get position and rotation in WRobot tab "Tools" > "Dev... tools" > "Me/Target Position"))
    Don't forget to stop fishing, for it, after pulse fishing quest, in quests order add step type "RunCode" with code:
    wManager.Wow.Bot.Tasks.FishingTask.StopLoopFish();  
    Sample profile: FishingTest.xml
  19. Like
    Pudge reacted to Droidz in move back if... add code in fightclass editor   
    Hello,
    In fightclass general settings, in option "Additional C# code" add code like:
    static Main() { wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) => { if (unit.IsValid && !ObjectManager.Me.IsCast && (unit.IsStunned || unit.Rooted)) { wManager.Wow.Helpers.Move.Backward(Move.MoveAction.PressKey, 1500); } }; } (code not tested)

  20. Like
    Pudge reacted to Matenia in Totown state?   
    ToTown.ToTownInProgress (although I've noticed that sometimes that boolean is set despite not actually going to town, so try Logging.Status.ToLower().Contains("town")).
  21. Like
    Pudge reacted to Droidz in [Wotlk] Looking for WoW API   
    https://web.archive.org/web/20100726112636/http://wowprogramming.com/docs/api_categories
  22. Like
    Pudge reacted to Droidz in Possible to search for object?   
    You can found some others source code here: http://wrobot.eu/files/category/26-plugins/
    I have write sample code (no tested):
    using System.Collections.Generic; using System.Threading; using System.Windows.Forms; using robotManager.Helpful; using robotManager.Products; using wManager.Plugin; using wManager.Wow.Helpers; using Timer = robotManager.Helpful.Timer; public class Main : IPlugin { private List<string> Names = new List<string> { "ObjNpc Name 1", "ObjNpc Name 2", "ObjNpc Name ...", }; private bool _isLaunched; public void Initialize() { _isLaunched = true; var timer = new Timer(1500); timer.ForceReady(); Logging.Write("[Search Objects] Loadded."); while (_isLaunched && Products.IsStarted) { try { if (timer.IsReady && Conditions.ProductIsStartedNotInPause) { foreach (var o in wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWUnit()) { try { if (o.IsValid && !string.IsNullOrEmpty(o.Name) && Names.Contains(o.Name)) { // Code here where NPC found: MessageBox.Show("Npc found: " + o.Name); } } catch {} } foreach (var o in wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWGameObject()) { try { if (o.IsValid && !string.IsNullOrEmpty(o.Name) && Names.Contains(o.Name)) { // Code here where object found: MessageBox.Show("Object found: " + o.Name); } } catch { } } timer.Reset(); } } catch { } Thread.Sleep(300); } } public void Dispose() { _isLaunched = false; Logging.Write("[Search Objects] Disposed."); } public void Settings() { MessageBox.Show("[Search Objects] No settings for this plugin."); } } (replace "ObjNpc Name ..." line 15 by object or npc name (case sensitivity))
  23. Like
    Pudge reacted to Droidz in Snippets codes for quest profiles   
    Catch Zeppelin/Ship
    Quest profile: Catch Zeppelin and Ship Sample.xml
    // Sample of how to use Zeppelin/Ship // In this sample, WRobot catch Zeppelin from Kalimdor (Ogrimmard) to Northrend (Borean Tundra (Warsong Hold)) /* Quest settings: * Can condition: "return Usefuls.ContinentId == (int) ContinentId.Kalimdor;" * Is complete condition: "return Usefuls.ContinentId == (int) ContinentId.Northrend && !ObjectManager.Me.InTransport;" * Not required in quest log: "True" * Quest type: "OverridePulseCSharpCode" */ // You can get zeppelin/ship/player positions and entry ID in tab "Tools" > "Development Tools" > "Dump all informations" (or "Memory information"). // Settings: var zeppelinEntryId = 186238; // Zeppelin/Ship EntryId // From var fromZeppelinWaitPosition = new Vector3(1775.066, -4299.745, 151.0326); // Position where Zeppelin/Ship waits players (from) var fromPlayerWaitPosition = new Vector3(1762.322, -4282.175, 133.1072); // Position where the player waits Zeppelin/Ship (from) var fromPlayerInZeppelinPosition = new Vector3(1768.199, -4289.856, 133.1912); // Position where the player waits in the Zeppelin/Ship (from) // To var toZeppelinWaitPosition = new Vector3(2837.908, 6187.443, 140.1648); // Position where Zeppelin/Ship waits players (to) var toPlayerLeavePosition = new Vector3(2836.5, 6184.367, 121.9332); // Position to go out the Zeppelin/Ship (to) // Change WRobot settings: wManager.wManagerSetting.CurrentSetting.CloseIfPlayerTeleported = false; // Code: if (!Conditions.InGameAndConnectedAndProductStartedNotInPause) return true; if (Usefuls.ContinentId == (int)ContinentId.Kalimdor) { if (!ObjectManager.Me.InTransport) { if (GoToTask.ToPosition(fromPlayerWaitPosition)) { var zeppelin = ObjectManager.GetWoWGameObjectByEntry(zeppelinEntryId).OrderBy(o => o.GetDistance).FirstOrDefault(); if (zeppelin != null && zeppelin.Position.DistanceTo(fromZeppelinWaitPosition) < 1) { GoToTask.ToPosition(fromPlayerInZeppelinPosition); } } } } else if (Usefuls.ContinentId == (int)ContinentId.Northrend) { if (ObjectManager.Me.InTransport) { var zeppelin = ObjectManager.GetWoWGameObjectByEntry(zeppelinEntryId).OrderBy(o => o.GetDistance).FirstOrDefault(); if (zeppelin != null && zeppelin.Position.DistanceTo(toZeppelinWaitPosition) < 1) { GoToTask.ToPosition(toPlayerLeavePosition); } } } return true;  
  24. Like
    Pudge reacted to Droidz in Hi ... Have you an easy tip for :   
    Hello,
     
    To get if it is enemy player:
    if (ObjectManager.Target.Type == WoWObjectType.Player) { if (((WoWPlayer) ObjectManager.Target).PlayerFaction != ObjectManager.Me.PlayerFaction) { // Is enemy player } } To interact with your current target (this is useless because it is already your target):
    Interact.InteractGameObject(ObjectManager.Target.GetBaseAddress); I ignore exactly what is your objective, but if you want search and interact with an enemy player you can use code like:
    List<WoWPlayer> enemyPlayerList; if (ObjectManager.Me.IsAlliance) enemyPlayerList = ObjectManager.GetWoWUnitHorde(); else enemyPlayerList = ObjectManager.GetWoWUnitAlliance(); WoWPlayer nearestPlayerEnemy = ObjectManager.GetNearestWoWPlayer(enemyPlayerList); if (nearestPlayerEnemy.IsValid && nearestPlayerEnemy.IsAlive && nearestPlayerEnemy.GetDistance < 150) { Interact.InteractGameObject(nearestPlayerEnemy.GetBaseAddress); if (ObjectManager.Me.Target == nearestPlayerEnemy.Guid) { // OK } } To get the nearest attackable NPC:
    List<WoWUnit> unitList = ObjectManager.GetObjectWoWUnit(); List<WoWUnit> enemyUnitList = new List<WoWUnit>(); foreach (var woWUnit in unitList) { if (woWUnit.IsValid && woWUnit.IsAlive && woWUnit.Reaction <= Reaction.Neutral && UnitCanAttack.CanAttack(woWUnit.GetBaseAddress, ObjectManager.Me.GetBaseAddress)) enemyUnitList.Add(woWUnit); } WoWUnit nearestUnitEnemy = ObjectManager.GetNearestWoWUnit(enemyUnitList); if (nearestUnitEnemy.IsValid && nearestUnitEnemy.IsAlive && nearestUnitEnemy.GetDistance < 150) { Interact.InteractGameObject(nearestUnitEnemy.GetBaseAddress); if (ObjectManager.Me.Target == nearestUnitEnemy.Guid) { // OK } }
  25. Like
    Pudge reacted to Droidz in Checking if unit is hostile   
    Hello, you can check Reaction:
    wManager.Wow.ObjectManager.ObjectManager.Target.Reaction You can also use:
    wManager.Wow.ObjectManager.ObjectManager.Target.IsAttackable or use this lua code:
    Lua.LuaDoString<bool>("return UnitCanAttack('player', 'target');")  
×
×
  • Create New...