scsfl
-
Posts
30 -
Joined
-
Last visited
Content Type
Forums
Articles
Bug Tracker
Downloads
Store
Posts posted by scsfl
-
-
On 10/22/2020 at 2:57 AM, Artek said:
So today during grind player attacked me, bot instead of picking a player, was still attacking and chasing fleeing mob. Is there a way to make wrobot switch attacking player ?
You have to modify ur fightclass.
public void Initialize() { FightEvents.OnFightLoop += TargetSwitcher; } public void Dispose() { FightEvents.OnFightLoop -= TargetSwitcher; } private void TargetSwitcher(WoWUnit woWPlayer, System.ComponentModel.CancelEventArgs cancelable) { WoWPlayer player = ObjectManager.GetNearestWoWPlayer(ObjectManager.GetObjectWoWPlayer().Where(o => o.IsAttackable).ToList()); if (player == null || !player.IsValid || !player.IsAlive || player.Faction == ObjectManager.Me.Faction || player.IsFlying || player.IsMyTarget || woWPlayer.Guid == player.Guid) return; if (player.InCombatWithMe && ObjectManager.Target.Type != WoWObjectType.Player) { cancelable.Cancel = true; Fight.StartFight(player.Guid, robotManager.Products.Products.ProductName != "WRotation", false); } }
-
-
Fixed. Thank you for code review.
-
Brilliant advice man! I'm very appreciating your help.
var luaString = @" function OnEvent(self, event) local args = { } eventInfo = {CombatLogGetCurrentEventInfo()} for key, value in pairs(eventInfo) do table.insert(args, tostring(value)) end _G.args = (table.concat(args, ',')) end print ('frame works') f = CreateFrame('Frame') f: SetAttribute(name, 'CLEU') f: RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED') f: SetScript('OnEvent', OnEvent)";
Now I'm able to access _G.args from OnEventsLuaStringWithArgs ?. Thanks ?
-
Can I ask one more dumb question please.
Ok I did lua string that initialize lua frame and I'm able to store the payload in table each time event fired.
luaString = @" local function OnEvent(self, event) local args = { } eventInfo = {CombatLogGetCurrentEventInfo()} for key, value in pairs(eventInfo) do table.insert(args, tostring(value)) end args = (table.concat(args, ',')) print (args) --debug end local f = CreateFrame('Frame') f: SetAttribute(name, 'CLEU') f: RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED') f: SetScript('OnEvent', OnEvent)";
Also I've got a C# function that which takes CLEU args as parameter. Is there way to call this function inside luaString? In other words I need to send args to a function every time event fired.
The only thing comes in mind is to create chat frame inside lua string, sent CLEU args to this frame and read this frame using EventsLuaWithArgs.OnEventsLuaStringWithArgs. But It looks awful ?
-
Hi there!
Does anybody know Is there way to make fight class listen to Lua events? Especially COMBAT_LOG_EVENT_UNFILTERED.
Yeah I know there is EventsLuaWithArgs.OnEventsLuaStringWithArgs but it pretty often skips COMBAT_LOG_EVENT_UNFILTERED and even when it fires it doesn't return any args cuz I have to use CombatLogGetCurrentEventInfo() function to get a payload.
How can I subscribe COMBAT_LOG_EVENT_UNFILTERED with args using c#?
Thank you.
-
This options is not about determinating which rotation spells should be casted or skipped. As Droidz said earlier with that options your next rotation spell tries to launch before it can be used and that is why in some cases this spell could be skipped.
If you want your rotation to work as you intend I do not recommend to use this option.
-
Most advanced and fundamental fight class sample I've ever seen. Awesome work.
The only moment I still didn't get is wanding. Sometimes while wanding the bot is something like can't change rotation step. I mean for example i've got 10 steps in my rotation. Wanding has lowest priority. And if all conditions is fit for wanding he starts shoot. Everything is fine, but if he starts wanding, rotation step is not changing until I manually interrupt hes wanding process by pressing any movement key. Right after that rotation is working again as it should and bot continues rotate steps. Even other rotations spells with "force" enabled doesn't work.
This problem happens only when bot is wanding. For other spells everything is good.
My conditions for wanding:
new RotationStep(new RotationSpell("Shoot"), 10f, (s, t) => MeHaveWand() && !RotationCombatUtil.IsAutoShooting() && !Me.GetMove, RotationCombatUtil.BotTarget),
private static bool MeHaveWand() { return ObjectManager.Me.GetEquipedItemBySlot(InventorySlot.INVSLOT_RANGED) != 0 ? true : false; }
public static bool IsAutoShooting() { return Lua.LuaDoString<bool>("return IsAutoRepeatSpell('Shoot')"); }
Maybe some problems with spell verification. Wow vanilla.
-
Hi. Try this. Returns a dictionary where key is itemname and value is lowest price.
private static Dictionary<string, int> GetLowestItemPrice() { Dictionary<string, int> CheapestItems = new Dictionary<string, int>(); List<AuctionHelpers.AuctionItem> ItemsList = new List<AuctionHelpers.AuctionItem>(); List<string> ItemsToCheck = /*your list of items*/ int LowestPrice = 0; if (AuctionHelpers.AuctionHouseIsShown()) foreach (string item in ItemsToCheck) { AuctionHelpers.BrowseNameSetText(item); Thread.Sleep(2000); AuctionHelpers.IsUsableCheckButtonSetChecked(false); if (AuctionHelpers.BrowseSearchButtonIsEnabled()) { AuctionHelpers.BrowseSearchButtonClick(); Thread.Sleep(2000); while (AuctionHelpers.BrowseNextPageButtonIsEnabled()) { if (AuctionHelpers.GetBrowsePageItems().Any()) { ItemsList.AddRange(AuctionHelpers.GetBrowsePageItems()); AuctionHelpers.BrowseNextPageButtonClick(); Thread.Sleep(1000); } } if (AuctionHelpers.GetBrowsePageItems().Any()) ItemsList.AddRange(AuctionHelpers.GetBrowsePageItems()); ItemsList.RemoveAll(i => (i.Name != item) || (i.BuyoutPricePerUnit == 0)); LowestPrice = ItemsList.Min(price => price.BuyoutPricePerUnit); CheapestItems.Add(item, LowestPrice); } } foreach (KeyValuePair<string, int> kvp in CheapestItems) { Logging.Write("Itemname = " + kvp.Key + "Itemprice " + kvp.Value); } AuctionHelpers.CloseAuctionHouse(); return CheapestItems; }
-
Thanks. But I've already checked wManager lib and I didn't see anything suits my need. Anyway looks like the only method is using lua.
-
Hi there!
Trying to make own AH product. And there is a question. How do I get list of items currently sailing by me? I've tried
AuctionHelpers.GetBrowsePageItems()
But looks like it only works for "Browse" tab of AH. So i cannot get list of elements when I'm on "Auction" tab. Is there built-in function? Or it could be resolved only by lua?
-
Ok replace your bin\wManager.dll in wrobot folder to attached file and launch bot via relogger. Just temporary solution.
-
Same here! After last wrobot update it's became broken!
-
Hi. Tell me please how can I make some action right after specific string appears in general chat? This is not player message, its a string, generated by luascript in some plugin.
-
One more question. Is there way to detect stuck nodes? Yeah, I know there is an option in wrobot for this, but I need to do it manually in my plugin. Thanks :)
update: got it. U have to add following condition
!wManager.wManagerSetting.IsBlackListedAllConditions() -
Hello Droidz! Tell me please how can I check is there any gatherable or mineable corpse near me? Tried
ObjectManager.GetWoWUnitLootable().Where(p => p.GetDistance <= 5).ToList()
but its only works for common loot, not for gather herbs or mine ore from corpse.
Thanks.
-
On 02.03.2017 at 2:42 PM, testingz said:
yes that works so
Erm, I don't get, does option "Loot mobs" should be turned ON?
-
Just now, forerun said:
So you need to loot only mobs from the list and not any other? :D
Yeah, it would be perfect :)
-
Does anyone know how to setup loot distance? Not search radius in wrobot options, but exactly loot radius. I need it to avoid looting every mob in 300 radius. And if I turn off "Loot mobs" option bot doesn't loot spawned mobs (e.g. withered hungerer).
-
Thank you so much! So for felslate it's gonna look something like this:
float radius = 50; foreach (var o in ObjectManager.GetObjectWoWGameObject()) { if (o.IsValid && o.GetDistance < radius && o.CanOpen && o.Name == "Felslate Deposit") { // your code here } }
Right?
-
Hi! 2 noob questions from me :)
1) How can I check is there any lootable node (felslate for example) in specific radius? Center of the circle is a bot.
2) Can I check a condition when some player put me in target? In other words i need to do some action when i've been selected by another player.
Implement own mount routine
in Developers assistance
Posted
hello community!
I'm trying to implement following method in druid FC: when condition met bot has to use flying mount, else ground mount.
There is following logic: I'm subscribing to OnPathFinderFindPath event and checking if I need to use flying path to destination point. If so then I'm setting destination flying and calling LongMove.LongMoveGo(destination).
Function that check if I need to fly.
The problem that this method is not stable. Sometimes it works fine, sometimes especially after farming state bot literally walks by the ground in flying form, then he might continue flying. I couldn't get where does he get this ground points when there is LongMove between 2 points 🙂
When I use built-in flying mechanics everything works decent. But I don't know how to implement similar flight mechanics.