FORUM [27/48]: https://wrobot.eu/forums/forum/48-lua-programming/ #################################################################################################### ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/10012-intercept-macro-arms-pvp-335a-question/ TITLE: Intercept Macro - Arms PvP 3.3.5a - question ---------------------------------------------------------------------------------------------------- Garub Hi, I'm trying to write a simple lua for warrior arms 3.3.5a fightclass that uses intercept when charge is on cooldown. The code is: 1. For berserker stance - intercepting = "no" if GetSpellCooldown("Charge") ~= 0 then intercepting = "yes" end end Return value research: yes Return value var: intercepting Rage greater than 20 and Distance bigger than 8. 2. For Intercept: Buff Berserker Stance, same code as above and disance greater than 8. It doesn't work at all, any suggestions? ? Regards N ---------------------------------------- Unknown You wrote "end" two times instead of one, you need only one "end", because of the "if" statement. That being said, you must add an ability with higher priority that switches the stances (from battle to berserker or from defensive to berserker), otherwise it can't Intercept in Battle/Defensive Stance. Create "Berserker Stance" ability with these conditions: Charge in CD + Intercept not in CD + Stance ~= 2 + Intercept in range Also every stance is not a buff so adding Buff: Berserker Stance will never work. You need to use GetShapeshiftForm(). Greetings ---------------------------------------- Unknown Thanks Scipter! I have rewritten the code for Berserker Stance, but still its not working: intercepting = "no" if GetSpellCooldown("Charge") ~= 0 and GetSpellCooldown("Intercept") == 0 then intercepting = "yes" end Best regards ---------------------------------------- Unknown When I add a second condition apart from the Lua Code, "Target Distance, Bigger or Equal 8", it stops working :x ---------------------------------------- Unknown You need to do test on a dummy, like manually use charge, switch stance (to berserker), and go away, and see if it intercepts automatically the dummy. If yes, then the code is correct, and you just need to add the automatic Berserker Stance switch. In few words, you need to test step by step, don't try to execute too many spells/combinations, test one at time and see if it works, then proceed to the next spell. What you should test step by step is something like this: Automatically charge if target is away and in charge range > switch to berserker stance if target is away and you don't have charge but you have intercept > Intercept Also don't forget to check on the top right corner the conditions like "combat only (put false)" or "check if target is in view (put false)" and so on. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/10725-announce-interrupts-lua-script/ TITLE: Announce Interrupts LUA script ---------------------------------------------------------------------------------------------------- 435 Hello, I want to implement in my addon an announce that writes in party when I get interrupted in the Holy school, so I created a frame, registered event "COMBAT_LOG_EVENT_UNFILTERED" and checked for the "SPELL_INTERRUPT" firing. Works good, nothing to complain. Problem is Penance, not only is a channeled spell, but also it belongs to "Discipline" school, which doesn't exists in the wow school database (only Holy/Nature/Shadow, etc) but I think this is not a real problem. The main problem is with Penance (didn't test with other channeled spell but I believe it's the same), in the /eventtrace, I don't see the "SPELL_INTERRUPT" firing, when kicked. I see only something like "SPELL_FAILED" but that fires even if you stop the spell manually (for example 1 tick penance fake cast). So how can I keep trace of the Penance (and other channeled spells) being interrupted? I found only this and of course it has no replies or solutions: https://eu.battle.net/forums/en/wow/topic/1622868793 Thanks for reading ---------------------------------------- Unknown 99.99% sure that's a bug with your server not firing the correct event, warmane has never been too thorough with that ---------------------------------------- Unknown I read somewhere else (maybe in blizz official forum) that is a common issue, I don't know what to do honestly. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/10741-make-bot-wait/ TITLE: Make Bot Wait ---------------------------------------------------------------------------------------------------- Unknown Hey, I made a plugin to stop the bot at a certain point and make him move again at a later point however my problem is that the method I use is Products.ProductStop(); obviously this also disables the plugin which is needed to re-activate him with Products.ProductStart(); is there any other good method to temp stop him completely? ---------------------------------------- Unknown Anything needs to happen while waiting or he only want to wait and do nohting ? Your question is actually a bit unclear. You can add Thread.Sleep into your function, Thread . Sleep ( 5000 ) // Wait 5 Seconds ---------------------------------------- Unknown I don't want him to do anything basically I want him to afk but the plugin needs to run as it's observer I'd implement it into the FightClass but the movement is not controlled by that so that's why I'm looking for something to pause the bot completely movement, targeting, attacking hence I tried to use Products.ProductStop() ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/10819-framestack-dosent-show-button-names/ TITLE: Framestack dosent show button names ---------------------------------------------------------------------------------------------------- Unknown Hey guys, Trying to write a plugin for TSM (3.3.5), and i need to interact with the UI somehow so i tought do it over LUA with the /click function like, / click TSMStartCancelScanButton but the debug tools not showing me the right button when i hover it. And "/click table: 2C460368" dosent work either. / run print ( GetMouseFocus (): GetName ()) -- prints "nil" in chat if hover over the button Anyone can help me and can explain what happens their ? it looks like to me its from a parent and inheritance from it, not sure tho. I hover over "Start Cancel Scan" at that screen, greets, Dreamful ---------------------------------------- Unknown Hello, you can try to look code of addon ---------------------------------------- Unknown https://github.com/Irame/TSM_WOTLK/blob/fd714be7de31950592b4ac68c620fc6280e1d508/TradeSkillMaster_AuctionDB/Modules/Scanning.lua#L384 ---------------------------------------- Dreamful try to call ---------------------------------------- Unknown i will try that thank you! ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/10860-how-to-run-multi-line-macrotext/ TITLE: how to run multi-line MacroText ---------------------------------------------------------------------------------------------------- Unknown hi, how to run multi-line MacroText once time like: /tar XXX /cast  Swiftmend /targetlasttarget ---------------------------------------- Unknown Hello, if you use bot to run code, you can run normal code and use https://wowwiki.fandom.com/wiki/API_RunMacroText ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/1118-snippets-of-lua-codes-for-fightclass/ TITLE: Snippets of LUA codes (for FightClass) ---------------------------------------------------------------------------------------------------- Unknown Hello, If you have an snippet of lua code for Fight Classes you can share it on this thread. Please share only code that works,  not ask here. ---------------------------------------- Droidz For Rogue (mostly Combat Rogue) : (Discussions about the snippets in the correspondending Threads) Set your poisons out of combat. Manage Redirect and Marked for Death : Use all 4 abilitys to kick a spell. Kick, Blind, Gouge, Kidney Shot. (and Feint, if it is not kickable) : All buffs at once : From Stealth to Combat. Cheap Shot / Ambush, Garotte, Revealing Strike, Sinister (one of them do the job) needs . Cheap Shot (stun), Kidney Shot (stun), Vanish, Cheap Shot (stun), Preparation, Vanish, Cheap Shot (stun), Kidney Shot (stun). I'am sure, your opponent will love you for this ;-) 10 /use 13 and /use 14 . 30 Yards ! and no step closer...bye! How to use the snippets: (looks more then it is) click on the snippet you want mark the whole code (from to ) CTRL-C (copy the marked code) . Go to your mrobot directory open the fight class folder right click on the file do you want to edit Edit (or Edit with Notepad++, if you use Notepad++ ) Go to the last line CTRL-V (append the code to your fight class) Save the new code . start the Fight Class editor open the changed fightclass move the new spell to the right place in the priority list The Codes above are mostly LUA-Scripts without a LUA-Script with a LUA-Condition that needs never to be true. And they work fine! :-) 1.) Lua Script Spell. With a Lua Script we can use our own fantasy Spell name, instead of a real script, because Lua Scripts are bad to be supported (insert,delete,insert) and they are very ugly in the settings window. So we use only a "--Short Description" as lua script. Because we don't have a real LUA script here, we use the comment signs " -- " . 2.) Lua Script Condition. The script here do the whole work. The local variable result is only needed to get a log-file entry. See also. A description for the snippets are in the correspondending Threads ---------------------------------------- Networkz Activate/Deactivate spells of rotation with wow macro In wow create new macro with this code: /run if pausecooldown == 1 then pausecooldown = 0; print("pause desactivated") else pausecooldown = 1; print("pause activated") end Now in your spell add condition script lua: LuaScript: if not (pausecooldown == 1) then resultCooldown = "canlaunch" else resultCooldown = "" end Research: canlaunch Var: resultCooldown After, just click on macro to pause your spells. PS: You can change variables name. EDIT: Sample here: ---------------------------------------- Droidz Here is my snippet for checking time left on buffs (on yourself). _, _, _, _, _, duration, expirationTime, _, _, _, _ = UnitBuff("player","Inquisition"); t = GetTime(); timeRemaining = expirationTime - t; if (timeRemaining <= 6) then retV = "1"; else retV = "0"; end This will cast Inquisition when there is 6 seconds left on the buffs life. Great for spells that you want up 100% of the time. To get this to work, you might have to remove the line breaks, so it would actually look like.. _, _, _, _, _, duration, expirationTime, _, _, _, _ = UnitBuff("player","Inquisition");t = GetTime();timeRemaining = expirationTime - t;if (timeRemaining <= 6) hen retV = "1";else retV = "0";end ---------------------------------------- Droidz Here is a work-around for using spells that are off of the global cool down timer (my example is using Heroic Strike from a Warrior). First, add a spell, I tend to name it Faux (Whatever the spell name is) so in this instance, it will be Faux Heroic Strike. It is ideal to place this up high on priority. Next, add in your conditions. For Heroic Strike, I use Rage > 110. Now add in an LUA script with the following information... LUA Script: CastSpellByName("Heroic Strike");retV=1; Return value research: 0 Return value var: retV ... This will trigger your spell to cast. The reason I set retV's value to 1, then check to see if it equals 0 is just to make sure WRobot doesn't try firing a fake spell named Faux Heroic Strike. And boom, now your spell is completely off the GCD. Make sure the spell is off GCD before using this method, or else it will slow down your fight class and ruin your recount heroism. ---------------------------------------- Unknown Quick Search by buff list (useful for detecting poison, stunned ...) LuaScript: local idBuffs={13750,5004,433,121279,20572} for key,value in pairs(idBuffs) do for i=1,40 do local name, _, _, _, _, _, _, _, _, _, spellId = UnitBuff("player", i) if (value==spellId) then result=1 return; end end end result=0 Research: 1 Var: result Replace spells id 13750,5004,... by your buff spells id needed. ---------------------------------------- Unknown Checking time left on buffs (on target) LuaScript: local name = GetSpellInfo(1079); _, _, _, _, _, _, expirationTime = UnitDebuff("target", name); timeRemaining = expirationTime - GetTime(); if (timeRemaining <= 7) then retV = "1"; else retV = "0"; end Research: 1 Var: retV Replace 1079 by your spell id and " timeRemaining <= 7" by your condition (timeRemaining contain time left). ps: to get buff/aura spell id you can use this script: ---------------------------------------- Unknown Stack count LuaScript: returnResult = false; local name = GetSpellInfo(53817); local _, _, _, count = UnitBuff("player", name); if count and count >= 5 then returnResult = true; end Research: true Var: returnResult Replace 53817 by your spell id and " count >= 5 " by your condition ( count contain stack count). ps: to get buff/aura spell id you can use this script: ---------------------------------------- Unknown Target have buff/debuff LuaScript: returnResult = false; local name = GetSpellInfo(53817); local name = UnitDebuff("target", name); if name then returnResult = true; end Research: true Var: returnResult Replace 53817 by your spell id. ps: to get buff/aura spell id you can use this script: ---------------------------------------- Unknown Manage spell targets Here: ---------------------------------------- Unknown Cast pet spell local name = GetSpellInfo(2649); if name then for i=1,50 do local spellName, spellSubName = GetSpellBookItemName(i, BOOKTYPE_PET) if spellName and spellName == name then CastSpell(i, BOOKTYPE_PET); end end end Replace 2649 by your spell id. Put it is spell name, and activate option "Not spell, is lua script" ---------------------------------------- BetterSister Calls function 'callback' after 'duration' seconds http://wow.gamepedia.com/API_C_Timer.After C_Timer.After(3, function() YOURCODEHERE end) SAMPLE: Moving backward during 2 secondes: MoveBackwardStart() C_Timer.After(2, function() MoveBackwardStop() end) Sample of use: http://wrobot.eu/forums/topic/2482-shadow-priest-void-tendrils-help/?do=findComment&comment=11415 ---------------------------------------- Jhin Cast spell if the shift/ctrl/alt key is currently depressed LuaScript: For Shift: isKeyCurrentlyDown = IsShiftKeyDown (); For Ctrl: isKeyCurrentlyDown = IsControlKeyDown (); For Alt: isKeyCurrentlyDown = IsAltKeyDown (); Research: true Var: isKeyCurrentlyDown ---------------------------------------- dida1990 Get type of buff/debuff LuaScript: local name = GetSpellInfo(53817); local name, rank, icon, count, debuffAuraType = UnitAura("player", name); - you can replace player by UnitId - Replace 53817 by your spell id. Research: Magic or Disease or Poison or Curse Var: debuffAuraType ps: to get buff/aura spell id you can use this script: http://wrobot.eu/forums/topic/1689-useful-scripts/?do=findComment%3Fcomment%3D8832 ---------------------------------------- Unknown Check if any buff/debuff by type LuaScript: anyPoison = false ; for i = 1 , 40 do local name , rank , icon , count , debuffAuraType = UnitAura ( "player" , i ); if name and debuffAuraType and debuffAuraType == "Poison" then anyPoison = true ; return ; end end - you can replace player by UnitId - Replace 53817 by your spell id. Research: true Var: anyPoison Wow API: http://wow.gamepedia.com/API_UnitAura You can change "player" by "target" or "pet" or... to check target, pet... buff/debuff. You can change "Poison" by "Magic", "Disease", "Curse". ---------------------------------------- ivansosajigga A better Buffcheck. The charm of this check is: you dont need to check all 40 possible buffs you can access the buff with his name (clearer code) and because you access with the name, you dont get trouble with change buff id's and you can check simple buff combinations without check twice local Moonfire=GetSpellInfo(155625) local t=GetTime(); local buffexp,buff,buffcnt={},{},{}; local i,n,c,x,id,found=0; repeat i=i+1; n,_,_,c,_,_,x,_,_,_,id=UnitAura("target",i,"PLAYER HARMFUL"); if n then buffcnt[n]=c buffexp[n]=x-t buff[n]=id; found=true end until (not n) or (i==40); if found then if buff[Moonfire] then ... end end ---------------------------------------- Tommy Cox Feral Druid - Auto Cat Form (instead of walking) tested on 3.3.5 Basically this forces the character to go in cat form when the bot is walking at normal speed, or dismounted for whatever reason. If character is mounted = do nothing (the mount is faster) if character is NOT mounted, but moving with speed lower than the cat form speed = cat form (you move faster) 1) Put this in the "Add Spell" field: -- Cat Shapeshift CancelUnitBuff ( "player" , "Cat Form" ) CastSpellByName ( "Cat Form" ) 2) Conditions: - Me in Combat: false - Lua Script: luascript slowed = "no" if GetUnitSpeed ( "player" ) > 0 and GetUnitSpeed ( "player" ) < 9 then slowed = "yes" end Return value research: yes Return value var: slowed 3) Spell Setting (top right corner) - Can move during cast: yes - Combat only: false - Not Spell, is lua script: true Tested and working pretty good, it can be used for shapeshifting slowing effects, just remove the "Me in combat: false" condition. Just keep in mind that speed 0 = char not moving speed 7 = char normal speed (walking) speed 9 = cat form You can mess around and see what works better for you. For example you can do an >= 0 instead of >0, in case you want the cat form also when you are not moving (maybe you are in a nova, root, so you can shapeshift it). As it is right now, it shapeshifts the moment you start walking. ---------------------------------------- Unknown Return Deadly Poison Stack Count Lua script : local PoisonName = { "Deadly Poison" , "Deadly Poison II" , "Deadly Poison III" , "Deadly Poison IV" , "Deadly Poison V" , "Deadly Poison VI" , "Deadly Poison VII" , "Deadly Poison VIII" , "Deadly Poison IX" } local PoisonStackCount = 0 ; for Poison = 1 , # PoisonName do for i = 1 , 20 do local name , _ , _ , count = UnitDebuff ( "target" , i ); if ( PoisonName [ Poison ] == name ) then PoisonStackCount = count ; end end end return PoisonStackCount ; You can edit the poisonName table and add any poison that has a stacking effect. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/11639-how-to-save-combat-log/ TITLE: How to save combat log? ---------------------------------------------------------------------------------------------------- Unknown What is the simplest way to save combatLog to a TXT file? (v3.3.5). ---------------------------------------- Unknown For those who do not know this information, just type "/ combatlog". When the wow closes, the log file will be in the Logs folder. I have another question. Who knows what each item in this log means? 1 / 18 13 : 15 : 03.870 SPELL_DAMAGE , 0x0000000000414D1E , "Ishana" , 0x511 , 0xF1300079A8082C6F , "Grandmaster's Training Dummy" , 0x10a28 , 57755 , "Heroic Throw" , 0x1 , 5009 , 5006 , 1 , 0 , 0 , 0 , 1 , nil , nil I found this page, but I can't understand. https://wowwiki.fandom.com/wiki/API_COMBAT_LOG_EVENT ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/11678-talents/ TITLE: Talents ---------------------------------------------------------------------------------------------------- Unknown Hey Can someone share the console command to bind talents in classic? Tried to use /run t,p,a.. script but it does nothing ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/11769-extracting-time-left-on-debuffs-in-1121/ TITLE: Extracting time left on debuffs in 1.12.1 ---------------------------------------------------------------------------------------------------- Unknown Is it possible to obtain the time left for a debuff applied to a mob using Lua code (or other means) in vanilla 1.12.1? I've found some conflicting information for UnitDebuff () Vanilla WoW Wiki states that expirationTime is a valid return . Fandom (as of Dec 2016) does not . I am aware that the C# WRobot function BuffTimeLeft() is explicitly not supported in the 1.12.1 version.  However;  since the client displays debuff countdown timers on the debuff icons, that info is definitely encapsulated in the client.    Does any one have a method to extract it? ---------------------------------------- Unknown | 2019-12-24T08:34:00Z It only works on the player. Just look into any actual 1.12 addon that uses those timers. Enemyframes, LoseControl, you name it. https://github.com/0ldi/LoseControl/blob/master/LoseControl/LoseControl.lua Edited December 24, 2019 by Matenia ---------------------------------------- Unknown Good 'ol wacky vanilla API.  I suppose the most reliable method would be to use an event handler to countdown time since the last application of the debuff.  I was wondering if you had a trick under your sleeve-- Thanks for the confirmation and the code example, Matenia. Happy Festivus! ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/12002-check-mammoth-spell/ TITLE: Check Mammoth spell ---------------------------------------------------------------------------------------------------- Unknown is it possible to check the mount summon spell? I want to add the purchase of the traveler’s tundra mammoth to my quest profile, but after using the item https://www.wowhead.com/item=44234/reins-of-the-travelers-tundra-mammoth how can I check the presence of the mount in the book. But the way SpellManager.KnowSpell () returns false. I will be glad of any help ---------------------------------------- Pudge 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" ); ---------------------------------------- Unknown Thank you very much ---------------------------------------- Unknown For me it doesn't seem to be working. I want to check if the character has learned the mount yet. My code looks like this and it isnt working: if ( wManager . Wow . Helpers . SpellManager . ExistMount ( "White Kodo" )) { wManager . wManagerSetting . CurrentSetting . GroundMountName = "White Kodo" ; } I`m using this complete condition for it: return wManager . wManagerSetting . CurrentSetting . GroundMountName == "White Kodo" ; Can you help me? ---------------------------------------- Unknown try wManager.Wow.Helpers.SpellManager.ExistSpellBook("mount name"); ---------------------------------------- Unknown Thx for your answer pudge, I've already tried the solution you suggested with no success. Do you know another way? ---------------------------------------- Unknown wManager.Wow.Helpers.SpellManager.UpdateSpellBook(); if(wManager.Wow.Helpers.SpellManager.ExistSpellBook("White Kodo")) { Logging.Write("Exist"); wManager.wManagerSetting.CurrentSetting.GroundMountName = "White Kodo"; } or use lua check if (Lua.LuaDoString (@"for i=1,GetNumCompanions('MOUNT') do _,creatureName = GetCompanionInfo('MOUNT', i) if creatureName == 'White Kodo' then return true end end")) { Logging.Write("Exist"); wManager.wManagerSetting.CurrentSetting.GroundMountName = "White Kodo"; } both should work ---------------------------------------- Unknown It works! Thank you! ---------------------------------------- @Harvest Golem @Harvest Golem you can use something like this, local MountsNames = { } for i = 1, GetNumCompanions('MOUNT') do local _, Name = GetCompanionInfo('MOUNT', i); table.insert(MountsNames, Name); end for B = 1 , 25 do local BuffName = UnitBuff("player", B); for Y = 1, #MountsNames do if string.match(BuffName, MountsNames[Y]) then return true; else return false; end end end ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/12224-gettext-from-wow-interface-elements/ TITLE: GetText() from wow interface elements ---------------------------------------------------------------------------------------------------- Unknown Hi! I know that there is a GetText() API but I don’t know how to find the name of the text element I need, framestack shows only the names of the buttons, not the text itself. Is there a way to “extract” text from text elements of the wow interface, like a StaticPopup frame or error frame ? Thanks in advance to everyone who answers ---------------------------------------- Pudge Hi, For popup: https://wrobot.eu/forums/topic/10936-how-to-get-text-from-staticpopup1/?do=findComment&comment=52116 For error message I don't found, it is UIErrorsFrame but I don't found variable/function to get text. But you can do it in C# (code for worlk): string lastError = wManager . Wow . Memory . WowMemory . Memory . ReadStringUTF8 ( wManager . Wow . Memory . WowMemory . Memory . RebaseAddress ( 0x7CFB90 ), 200 ); ---------------------------------------- Unknown Great! bow to you, sensei! ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/12258-unitdebuffunitbuff-for-tbc-243/ TITLE: UnitDebuff/UnitBuff for TBC 2.4.3 ---------------------------------------------------------------------------------------------------- Unknown Is it possible to set a caster check in these functions? UnitDebuff("target","spellname",nil,"player") dont work in TBC. ---------------------------------------- Unknown You just iterate all buffs on the unit and check if the one you're looking for is there ---------------------------------------- Unknown What do you mean by "caster check" exactly? ---------------------------------------- Unknown I want the function to determine whether my debaf is on the target and cast it even if there is such a debaf on the target but from another player. ---------------------------------------- Unknown | 2020-06-11T17:42:07Z You mean " unitCaster "? https://wowwiki.fandom.com/wiki/API_UnitDebuff this should work its C# if ( ObjectManager . Target . GetBuffs ( "Spell name" ). Any ( a => a . Owner == ObjectManager . Me . Guid )) Edited June 11, 2020 by Smokie ---------------------------------------- Zer0 unitCaster doesn't exist in TBC and owner doesn't work either In TBC, if there's a timer it's yours. ---------------------------------------- Unknown Please show an example of a simple check for the presence of a timer for debuff/buff. ---------------------------------------- Unknown Its API for tbc https://web.archive.org/web/20100105220335/http://wowprogramming.com/docs/api/UnitDebuff ---------------------------------------- Unknown for i = 1 , 40 do local name , rank , iconTexture , count , debuffType , duration , timeLeft = UnitDebuff ( "target" , i ); if name == "Frostbolt" and duration ~= nil then -- is mine end end ---------------------------------------- Unknown Thank you, this argument works fine. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/12262-objectposition/ TITLE: ObjectPosition ---------------------------------------------------------------------------------------------------- Unknown I found scripts for automation that set functions for determining the position of objects based on ObjectPosition. However, this does not function in tbc. Is it possible to determine the position of an object in space in tbc? Example function InLOS ( obj1 , obj2 ) local x1, y1, z1 = ObjectPosition (obj1) local x2, y2, z2 = ObjectPosition (obj2) if not TraceLine (x1, y1, z1 + 2.25 , x2, y2, z2 + 2.25 , bit. bor ( 0x10 , 0x100 )) then return true end return false end ---------------------------------------- Unknown Dude idk what that code is even supposed to be. This is literally some random code (looks like Lua). It means nothing. Also you don't even own a wRobot license. You're not getting any help here. ---------------------------------------- Unknown It was FireHack API not wow. ---------------------------------------- Unknown Using a cracked copy of wrobot isn’t a good idea, most servers (decent ones.) have already detected it. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/12584-dump-lua/ TITLE: dump lua ---------------------------------------------------------------------------------------------------- Unknown hello, is there a way to dump all lua on a screen? like if i have a frame there. it will dump all the code inside the frame? ---------------------------------------- Unknown hi, look https://github.com/goldpaw/WoW_UI_Source_WotLK/blob/7ac7bc5b6ebc57f7de70c64aaf61072bb22bc511/AddOns/Blizzard_DebugTools/Dump.lua#L350 -- DEVTOOLS_MAX_ENTRY_CUTOFF = 0 DevTools_Dump ( _G ) ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/12652-gettime-problems/ TITLE: GetTime() problems ---------------------------------------------------------------------------------------------------- Unknown Hello, it's been a while since I don't post here. But I'm kinda back, so I'm working again on some profiles. One is at a good point, but the rotation program (you know the name I dont need to write it so it appears on google and stuff) , is too fast, even if I put max delay, I want to set my "reaction" in a more human way and less suspicious. So let's assume someone in Arena/BG gets a Polymorph, I can dispel it, but that can be istant if I'm not on GCD, or max 1sec delay. Either way it raises some suspects if someone keeps watching me. So I was thinking about dispel only after X seconds of the debuff and there is LUA: local _,_,_,_,_,_,expiration = UnitDebuff("target","Polymorph") First 6 arguments are -useless- so I'll use the 7th (expiration) becasue I need that one specifically. By using a simple /run local _,_,_,_,_,_,expiration = UnitDebuff("target","Polymorph"); print(expiration-GetTime()) you get in your chat the exact amount of seconds remaining before the debuff disappears. So my first attempt to automatize the dispel was just if expiration - GetTime() <= 8 then CastSpellByName("Dispel Magic-Cleanse-Whatever","target") end and after 2 seconds of 10 seconds Polymorph it correctly dispels the target, simulating a human delay. But what if the Poly is in DR? The duration is now 5 seconds not 10, so the script will trigger istantly because 5 is <= 8, thus it doesn't wait those 2 seconds. Ok, easy I thought: if expiration - GetTime() < expiration - GetTime() - 2 then CastSpellByName("Dispel Magic-Cleanse-Whatever","target") end In this way, the Polymorph in DR lasting 5 seconds should be dispelled at 3, exactly after 2 seconds. Guess what? It doesn't work. But if I do a print(expiration-GetTime()-2) or any other number, the seconds are correctly delayed so it's not a syntax problem, expiration is a number, GetTime is a number and 2 is a number. Im not mixing banans with apples. Why when using the " if " statement I can't substract seconds and the script doesn't work, but the print command can add and substract numbers to GetTime()? What am I missing? Greetings, have a nice day! ---------------------------------------- Unknown Is the rotation your using is the pqr I released? ---------------------------------------- Unknown What do you mean, "it doesn't work"? Is there a Lua error or is your condition just faulty and never gets hit? Because if you think about it, GetTime() always changes. You need to know when the buff/debuff started. Yes, you know when it expires, but you don't know when it started unless you take the duration into account. You're not calculating "timeLeft" you're calculating "timeAlreadyPassed". local timeLeft = expiration - GetTime() local timeAlreadyPassed = duration - timeLeft if (timeAlreadyPassed > 2) then CastSpellByName('Simple Logic') end ---------------------------------------- Unknown The problem he is having that with the rotation I released, the spells are firing off way to fast and causing spells to be skipped even if they have conditions ---------------------------------------- @Matenia @Matenia No lua error, the condition is never met. GetTime() changes, that's why instead of putting a number like if expiration - GetTime() <= 6 I want a number that can change so if expiration - GetTime() <= expiration - GetTime() - 2 Should do the trick? As already said, I don't think I'm mixing apples with bananas, in fact if I just ignore the rotation, and apply a debuff on myself, and then print a expiration - GetTime() - 2 I get the exact second remaining of that Debuff, but with -2 offset: expiration - GetTime() would print out 9.9, but since I added a -2, it prints out 7.9 correctly So the syntax is correct , but the rotation program somehow doesn't recognize the if statement if put like that. I can compare expiration - GetTime() only to a number of seconds, not to "itself modified" I already tried to set a variable like local duration = expiration - GetTime() and then if expiration - GetTime() <= duration -2 still doesn't work, I can't understand. I know for sure that expiration - GetTime() will give out a number, so why adding or removing a certain amount of seconds won't make trigger the if statement, but siomehow the print function works? I will check about the start time, but Im afraid I need to use a Frame and register combat log events? That would be annoying. @TheSmokie No the program is fine and I run it at 1000ms delay, no spells are skipped the rotation is flawless I just wanted to make it more human and less bottish ? ---------------------------------------- ScripterQQ My solution still stands. GetTime() is a timestamp of sorts. It ALWAYS changes. That's why you need to calculate the time that has already passed since the spell was applied, which is its full duration MINUS the in which it's going to end. And THAT needs to be larger than 2. ---------------------------------------- Unknown Yes it changes, but why do you think it matters exactly? Look: if X = X - 2 I don't care if X (expiration - GetTime()) changes, because the offset (-2) doesnt change if 10 = 10-2 the result witll be 8 if 25 = 25-2 the result witll be 23 This is what I had in my head. I had to read the combat log to get the time applied, there is no other way as far as I know, not with LUA at least. EDIT: Strikethrough because it was not correct, see posts below. ---------------------------------------- Unknown Can you just use my code example and see if it works? Another example: ExpirationDate = 2020-11-11 18:48:30 (static point in time) CurrentTime = 2020-11-11 18:48:20 (this obviously changes) FullBuffDuration = 10 seconds TimeLeft = ExpirationDate - CurrentTime (this will get lower and lower with time, at the start here, it's 10 seconds) TimeAlreadyPassed = FullBuffDuration - TimeLeft (this is 10-10 = 0) Now as time passes on, the result of TimeAlreadyPassed gets HIGHER and HIGHER until it reaches 10 eventually. So if you look at my condition in my original post, you will see that I validated TimeAlreadyPassed for GREATER THAN 2. If you still haven't read the documentation , please do. ---------------------------------------- Unknown I just figured out why it doesnt work my way: doing if expiration < 8 a normal poly would be dispelled with a 2 seconds delay doing if expiration <= expiration - GetTime() - 2 won't work, because its like writing if 5 <= 3 so thats why it doesnt dispel...Simple maths.. Sometimes I trip over banal things and I think this is one of them. You are correct the only way is getting the start duration and substract the expiration! Later I do some tests ---------------------------------------- @ScripterQQ @ScripterQQ i found this, might help ya ! -- Tabled Cast Time Checking for When you Last Cast Something. CheckCastTime = {} Nova_CheckLastCast = nil function Nova_CheckLastCast ( spellid , ytime ) -- SpellID of Spell To Check, How long of a gap are you looking for? if ytime > 0 then if # CheckCastTime > 0 then for i = 1 , # CheckCastTime do if CheckCastTime [ i ]. SpellID == spellid then if GetTime () - CheckCastTime [ i ]. CastTime > ytime then CheckCastTime [ i ]. CastTime = GetTime () return true else return false end end end end table . insert ( CheckCastTime , { SpellID = spellid , CastTime = GetTime () } ) return true elseif ytime <= 0 then return true end return false end ---------------------------------------- Unknown I dont get this code. Where is supposed to be located the starting duration of the debuff applied by arena1/2/3 (example: Polymorph) As far as I know, the only way is listening to combat log events and grab the start duration from there. And then eventually do the maths. EDIT: Strikethrough because it was not correct, see posts below. ---------------------------------------- ScripterQQ I literally gave you the full solution. You have the time left, you have the full duration . From that you can do the math to get the the starting time in GetTime() value. ---------------------------------------- Unknown Wait sorry Im doing confusion again. The LUA Api of UnitDebuff doesn't provide itself when the debuff has been applied, it only gives duration "10" which is the static default duration of the debuff (Polymorph, no matter if Full or DR), and expiration, which (combined to GetTime()) gives the remaining seconds when the debuff has been applied. So basically I have a static 10 seconds that tells me that the Poly is supposed to last max 10 seconds. This duration doesnt tell me where or when or how, its just a static number, kinda like a SpellID. This 10 will NEVER change. And then a value that changes which is the expiration, it can be 10 if full, 5 if first DR and so on. I dont see any connection with the starting time, the UnitDebuff just tells me "The poly should last 10 seconds. but in this moment, it lasts 5 seconds", or "The poly should last 10 seconds. but in this moment, it lasts 2.5 seconds". As already said, the 10 doesnt change, only the "expiration" changes. Again, unless I track the combat log and grab the start duration from there, the time where the target actually got the debuff,  I cant understand your last message. Maybe time to go to school or something... EDIT: Strikethrough because it was not correct, see posts below. ---------------------------------------- ScripterQQ Because duration is 5 if the poly is on DR, etc. ---------------------------------------- Unknown Duration is always a fixed number (dont recall if 10 seconds for pvp, or 2min for pve), it doesnt change based on DR Thats the first thing I tested and I clearly remembered that it was always showing the "ideal duration", despite the debuff being full, dr, or even immune. Thats why its written "full duration" But even in the case I am completely wrong and I have a bad memory (I dont have time now to test the command again), it clearly says "nil if the debuff was NOT cast by the player" , means that if arena1/2/3 cast Polymoprh, "duration" will always return nil. So again, the only information I can gather from that is the expiration time. Other stuff must be grabbed from the combat log. EDIT: Strikethrough because it was not correct, see posts below. ---------------------------------------- Unknown Have you tried table each unit buffs / debuffs? ---------------------------------------- Unknown UPDATE: I just tried the command and I am still confused because 1) It actually shows the duration 10/5/2.5, not always 10 as I was insisting, so I messed up there somehow 2) That being said, I was expecting to not get any duration result if the debuff was NOT casted by me, so I logged a 3rd char and used the command to see the duration of the poly casted from my mage towards my paladin, and well, it was still saying the duration, despite the debuff being NOT applied by me (I was on Priest, and not even in a group with them) So first of all I apologize for the confusion, second, the LUA API is not updated, or the server I am playihng is bugging, or again, I miss some brain cells lol. anyway for those who wants to try it this is the command I used /run local _, _, _, _, _, duration, expires = UnitDebuff("target","Polymorph") print("Duration: "..duration.." Expires: "..expires-GetTime()) I will do further tests, im not sure if it will give the duration if the poly is casted by arena1/2/3 EDIT: Tried in duel zone, apparently it works, need to test it in Arena, but its very weird, I mean the API clearly says it should return "nil" if not casted by me, so idk..Maybe I miss something..Sorry again for the confusion (and not my intention to sound arrogant or c*cky I was just trying to understand) This is the full test script: --test if UnitDebuff("player","Polymorph") then local _, _, _, _, _, duration, expires = UnitDebuff("player","Polymorph") if expires-GetTime() <= duration - 2 then print("2 seconds has passed since the debuff") end end ---------------------------------------- ScripterQQ | 2020-12-01T08:13:51Z The API docs are outdated or incorrect and that sentence is a reference to TBC, where you couldn't see ANY durations (no timeLeft either) if it's not casted by you. I thought it was pretty common knowledge that in WotLK you can see all durations at all times. This is exactly what the default UI does - how do you think it draws cooldown frames or addons like OmniCC wrap timers over them? So to take my original post from weeks ago: local _ , _ , _ , _ , _ , duration , expiration = UnitDebuff ( "player" , "Polymorph" ) local timeLeft = expiration - GetTime () -- timeLeft in seconds local timeAlreadyPassed = duration - timeLeft -- time the debuff has been applied to the target in seconds if ( timeAlreadyPassed > 2 ) then CastSpellByName ( 'Simple Logic' ) end Edited December 1, 2020 by Matenia ---------------------------------------- @Matenia @Matenia Yeah the fact is I had that API page in my bookmarks since years and I always used it, I never thought it was so outdated since I never encountered any problems, again I apologize... kind feel stupid relying on a TBC page while experts here are telling me some LUA basics... /facepalm ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/12796-string-concatenation-any-character/ TITLE: String concatenation + "any character" ---------------------------------------------------------------------------------------------------- Unknown I was thinking, instead of writing something like if UnitBuff("player","Seal of Light") or UnitBuff("player","Seal of Wisdom") and so on.. Is it possible to do something like if UnitBuff("player","Seal of"*) ? I did some google search and the "." is used to match any character (like when comparing some strings), but I don't see it working with string concatenation For example, in my case I should write something like if UnitBuff("player","Seal of"...) because ".." separates text from variables, and "." should be the "any character", but clearly this isn't the right way to do what I want to do. Any idea? Thanks! ---------------------------------------- ScripterQQ UnitBuff doesn't allow for regex afaik. Just iterate all buffs and use string.match or w/e the Lua function is on each name to do a partial match. In Lua ".." concatenates 2 strings. If you want to use a "." in regex without it representing any character, you can escape it using "\" ---------------------------------------- @Matenia Oh okay no problem. I will do the string.match, I just wanted to make the code more compact and easier, but I guess I have no choice! Thanks for the help as always @Matenia ? ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/12800-string-threading/ TITLE: String threading ---------------------------------------------------------------------------------------------------- Unknown Hello, i cant seem to get this to work. i believe i am getting boolen back but idk if i am wrapping it properly. Lua . LuaDoString ( $ "SetLFGRoles(false, {RDFSettings.CurrentSetting.Tank}, {RDFSettings.CurrentSetting.Heal}, {RDFSettings.CurrentSetting.DPS});" ); ---------------------------------------- Unknown hi, try to use {RDFSettings.CurrentSetting.Tank.ToString().ToLower()} (by default boolean is converted to "True" or "False" if my memory is good) ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/12928-how-to-stop-the-rotation/ TITLE: How to stop the rotation? ---------------------------------------------------------------------------------------------------- Unknown I recently started to make rotations again, and needless to say I'm very rusty. I still remember some good tricks, but I fail at basic stuff. Basically I am using the "rotation we all know", It's divided in different pages on the left (Abilities), and I remember I managed to add a line to stop the rotation (like when im drinking, or having a particular debuff and so on). Example: Ability 1: if UnitBuff("player","Drink") then --code to stop rotation and go back to top of the page, kinda like a while 1=1 end Ability 2 print("Hello World") The idea was not reading the second page/ability because the rotation was stuck in the Ability 1 loop. I can't recall exactly how I managed to do that but I clearly remember it was very basic. The best example is Sindragosa ICC, I registered all 4 different scenarios (10, 10HC, 25, 25HC) and set a "stop healing" command based on the Instability Debuff stacks (lets say >=5 for 10, >=2 for 10HC, >=5 for 25, >=1 or 2 for 25HC) The fact is can't really remember how did I do that, for sure it wasn't a while 1=1, because that stuff immediately starts not responding and forces me to ALT+F4. There is the "return" command , it returns correctly to the top of the page of the ability without executing the code below, but it keeps doing the other abilities that come after in the rotation, the other pages to make it simple. So yeah I really don't remember how did I do that, and I lost all rotations (thats why Im writing them again) Any help, tip? ---------------------------------------- Unknown I solved it, the command is "return true". The rustiness is real...:( ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/13613-how-can-use-lua-script-to-scan-all-the-dialogue/ TITLE: How can use lua script to scan all the dialogue. ---------------------------------------------------------------------------------------------------- Unknown How can use lua script to scan all the dialogue.Someone can teach me ---------------------------------------- Unknown Could do a massive search with in a single radius which mouseover returning text under the npc info. ---------------------------------------- Unknown Can you give me an example ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/1433-useful-links/ TITLE: Useful links ---------------------------------------------------------------------------------------------------- saleh Wow API: http://wowpedia.org/API (seem best, updated for WoD) http://wowprogramming.com/docs/api_categories http://www.wowwiki.com/World_of_Warcraft_API ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/15255-how-to-monitor-the-global-channel-of-information/ TITLE: How to monitor the global channel of information ---------------------------------------------------------------------------------------------------- Unknown Like Broadcast messages,System message ---------------------------------------- Unknown Hello, you should use Wow lua event : https://wrobot.eu/byme/doc/html/E-wManager.Wow.Helpers.EventsLuaWithArgs.OnEventsLuaStringWithArgs.htm ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/1688-lua-and-multi-language-support/ TITLE: Lua and multi-language support ---------------------------------------------------------------------------------------------------- Bear T.O.E. Hello, To create fightclass with support of all wow client language please do use directly the spell name or item name in your script. For get spell name use this: local name = GetSpellInfo(109259); GetSpellInfo (109259 is the id of http://www.wowhead.com/spell=109259 ) For get item name use this: local name = GetItemInfo(6256); GetItemInfo (6256 is the id of http://www.wowhead.com/item=6256/fishing-pole ) The spell/item name in the client language is in variable name , use it like: RunMacroText("/cast " .. name) (if you use direct the spell name of your client language this doesn't works on others languages). ---------------------------------------- Bear T.O.E. Sample Use item: local name = GetItemInfo(6256); RunMacroText("/use " .. name); Use spell: local name = GetSpellInfo ( 109259 ); RunMacroText ( "/cast " .. name ); ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/1689-useful-scripts/ TITLE: Useful scripts ---------------------------------------------------------------------------------------------------- Unknown Hello, You can share here useful lua scripts ---------------------------------------- da8ball Get wow bouton/window name: / run print ( GetMouseFocus (): GetName ()) or / run DEFAULT_CHAT_FRAME : AddMessage ( GetMouseFocus (): GetName ()) Copy this script in wow chat, put your mouse over an button and press enter key. In wow chat appear button name (you can use this like " /click TheButtonName " or " TheButtonName:Click() " or " RunMacroText("/click TheButtonName") " if you use it in fightclass). You can also use macro : /framestack More info: http://wow.gamepedia.com/Framestack ---------------------------------------- Ohren Get base (parent) spell name and the id: Launch this script (in tab "Tools" > "Development Tools" > copy script in textbox and click on button "Lua (return value in 'ret')). for i=1,1000 do local spellName = GetSpellBookItemName(i, BOOKTYPE_SPELL); if not spellName then break; end local _, tid = GetSpellBookItemInfo(i, "player"); local spellNameReal = GetSpellInfo(tid); if  spellNameReal and spellName ~= spellNameReal then print(spellName .. " > " .. "\124cFF4FF763" .. spellNameReal .. " (id: " .. tid .. ")"); else print(spellName .. " (id: " .. tid .. ")"); end end This write in wow chat list of spells of your spellbook and if exist (in green) the parent spell name. (By sample, http://www.wowhead.com/spell=12294/mortal-strike is the parent of http://www.wowhead.com/spell=78/heroic-strike ) ps: Now normally WRobot found automatically the childrens/parents spells. ---------------------------------------- Unknown Dump buff/aura of your character: Entrer this script in wow chat, this return name and id of spells: /run for i=1,40 do local name, _, _, _, _, _, _, _, _, _, spellId=UnitBuff("player",i); if name then local nameReal = GetSpellInfo(spellId) print(spellId.."="..name.."="..nameReal) end end ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/9864-seek-help/ TITLE: Seek help ---------------------------------------------------------------------------------------------------- Unknown Edit the I key ---------------------------------------- Unknown Hello, can you give me detail about your problem ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/2100-skull-marked/ TITLE: Skull marked ? ---------------------------------------------------------------------------------------------------- Unknown Is it possible to detect if there is a marker on the target? (like skull or cross) With the bugfixed "Hostile near" (*happy*) it will be nessasary to concentrate (no AOE) the fire, if the boss is marked and has adds. ---------------------------------------- saleh Hello, You have lua functions GetRaidTargetIndex and SetRaidTarget (or SetRaidTargetIcon ) Samples: Launch the spell id 109259 on the first boss with skull icon: local SpellName = GetSpellInfo(109259) for i = 1, 4, 1 do local UnitIdString = "boss" .. i if UnitExists(UnitIdString) then if GetRaidTargetIndex(UnitIdString) == 8 then CastSpellByName(SpellName, UnitIdString) return end end end Launch the spell id 109259 on the first raid target with skull icon (this code check the target of raid members): local SpellName = GetSpellInfo(109259) for i = 1, 40, 1 do local UnitIdString = "raid" .. i .. "target" if UnitExists(UnitIdString) then if GetRaidTargetIndex(UnitIdString) == 8 then CastSpellByName(SpellName, UnitIdString) return end end end Launch the spell id 109259 on the first party target with skull icon (this code check the target of party members): local SpellName = GetSpellInfo(109259) for i = 1, 4, 1 do local UnitIdString = "party" .. i .. "target" if UnitExists(UnitIdString) then if GetRaidTargetIndex(UnitIdString) == 8 then CastSpellByName(SpellName, UnitIdString) return end end end ps: Replace 109259 by your spell id and add conditions to launch the spell, to launch the spell if mob health is lower than 50%: local SpellName = GetSpellInfo(109259) for i = 1, 4, 1 do local UnitIdString = "party" .. i .. "target" if UnitExists(UnitIdString) then if GetRaidTargetIndex(UnitIdString) == 8 then if UnitHealth(UnitIdString)/UnitHealthMax(UnitIdString)*100 < 50 then CastSpellByName(SpellName, UnitIdString) return end end end end ps2: Code no tested, do not hesitate to tell me if this don't works ---------------------------------------- Unknown Can someone help me. I Have a Mage in Vanilla Wow that I would love to sheep my skull until i tell him to stop it Added in Partychat Lua local SpellName = GetSpellInfo(12824) for i = 1, 4, 1 do local UnitIdString = "party" .. i .. "target" if UnitExists(UnitIdString) then if GetRaidTargetIndex(UnitIdString) == 8 then CastSpellByName(SpellName, UnitIdString) return end end end But comes with and error in game when I ask it to sheep the target ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/2923-party-chat-command-to-make-party-use-items/ TITLE: Party Chat Command to make party use items ---------------------------------------------------------------------------------------------------- Unknown Dear i would like to know command to use it by party chat plugin to command party (slave) to use portal For examble " Portal to Stormwind - ( on WowHead ) WoWGameObject 4396 176296 Or Refreshment Table - ( on WowHead ) WoWGameObject 7537 233282 Or healthstone "Warlock" ...etc Thanks ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/3539-is-dungeon-boss-dead/ TITLE: Is dungeon boss dead ---------------------------------------------------------------------------------------------------- Unknown How do i tell the bot to check if boss in dungeon is dead? Sure i can use ObjectManager.GetWoWUnitHostile() but it's not fail proof ---------------------------------------- Unknown (UnitHealth("target")==0) or direct with UnitIsDead or, in a quester profile: (wManager.Wow.Helpers.Lua.LuaDoString("local _, _, numCriteria = C_Scenario.GetStepInfo(); if not numCriteria or numCriteria == 0 then completedObj = 'true'; return; end; local critID; _, _, completedObj,_,_,_,_,_,critID = C_Scenario.GetCriteriaInfo(4); if critID ~= 24921 then completedObj = 'true'; end;", "completedObj").ToLower() == "true") (You have o change the ( 4 ) in GetCriteriaInfo and the 24921 to the critID of your dungeon ---------------------------------------- Unknown same result as using GetWoWUnitHostile() but since blizzard has own builtin system that tells if you've killed boss already there must be a way to use it ---------------------------------------- Unknown another possibility is to check the saved instances....I've no working code here, but some samples to start are here : https://www.thebuddyforum.com/honorbuddy-forum/200290-checking-instance-locked.html ---------------------------------------- Unknown Droidz made a dungeon sample- check this condition return (wManager.Wow.Helpers.Lua.LuaDoString("local _, _, numCriteria = C_Scenario.GetStepInfo(); if not numCriteria or numCriteria == 0  then completedObj = 'true'; return; end; local critID; _, _, completedObj,_,_,_,_,_,critID = C_Scenario.GetCriteriaInfo(1); ", "completedObj").ToLower() == "true"); C_Scenario.GetCriteriaInfo (1 )  <<<  change the number depending on what number the boss is on the list.  I'M surprised you got botanica to work without that string... ---------------------------------------- Unknown i made botanica compatible with WOTLK so i didn't want to use it ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/3753-how-to-lua-program-only-to-kill-a-specific-number-of-mobs-then-possible-log-out-close-game/ TITLE: How to LUA program only to kill a specific number of mobs then possible log out / close game ---------------------------------------------------------------------------------------------------- Unknown hey all, I want to create a customer profile to kill some mobs, but i want to kill only a specific number of mobs and for a limit time (if possible) then log out / exit bot or game. I have create a custom profile to kill the mobs, but i dont know how to update .cs file to kill only a specific number of mobs. Can anyone help please ? :) Regards, NvD TheCreepingMist.cs ---------------------------------------- BetterSister Hello, you can get number of mob kills in "wManager.Statistics.Kills". The better way is to create plugin. But you can add this code in your custom profile: int maxKill = 10 ; if ( wManager . Statistics . Kills >= maxKill && Conditions . InGameAndConnectedAndAliveAndProductStartedNotInPause && ! Conditions . IsAttackedAndCannotIgnore ) { try { Memory . WowMemory . Memory . GetProcess (). Kill (); // if you want close game } catch {} robotManager . Products . Products . ProductStop (); } ---------------------------------------- Unknown Thanks, I will try it soon :) ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/3759-party-chat-command-to-guild-bank/ TITLE: party chat command to Guild bank ---------------------------------------------------------------------------------------------------- Unknown hi iis there any command to open guild chest for party chat command plugin or a code to interact with object like this One if (wManager.Wow.Helpers.Party.IsInGroup()) { wManager.Wow.Helpers.Interact.InteractGameObject(new wManager.Wow.ObjectManager.WoWPlayer(wManager.Wow.ObjectManager.ObjectManager.GetObjectByGuid(wManager.Wow.Helpers.Party.GetPartyLeaderGUIDHomeAndInstance()).GetBaseAddress).TargetObject.GetBaseAddress); } i need to make charters open guild chest item number 206602 Thanks ---------------------------------------- saleh Hello, use this c# code: if ( wManager . Wow . Helpers . Party . IsInGroup ()) { var o = wManager . Wow . ObjectManager . ObjectManager . GetNearestWoWGameObject ( wManager . Wow . ObjectManager . ObjectManager . GetWoWGameObjectByName ( "Guild Chest" )); if ( o . IsValid ) { wManager . Wow . Helpers . Interact . InteractGameObject ( o . GetBaseAddress , true ); } } (replace "Guild Chest" by game object name how is appear in game (you can get object name when you put mouse over) ---------------------------------------- Unknown Your wow clien is in english? ---------------------------------------- Unknown yes it is English ---------------------------------------- Unknown Sorry Droidz i must be in party It is Work ") Thanks very much ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/3821-quick-example-gatherer-and-interactwithnpc/ TITLE: Quick example: Gatherer and InteractWithNPC ---------------------------------------------------------------------------------------------------- Unknown Hey :), Can someone give me please an example on how to use the below in LUA programming? - Gatherer - InteractWithNPC - InteractWithNPC and gossip 1 and 2 PS: only interact with npc, not go to and interact with npc. Regards, NvD ---------------------------------------- Unknown Hello, With lua, you can interact with NPC (you are limited) but you cannot gatherer, you can found wow api here: wow.gamepedia.com/World_of_Warcraft_API ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/3852-attack-marked-target/ TITLE: Attack marked Target ---------------------------------------------------------------------------------------------------- Unknown local SpellName = GetSpellInfo ( 109259 ) for i = 1 , 4 , 1 do local UnitIdString = "party" .. i .. "target" if UnitExists ( UnitIdString ) then if GetRaidTargetIndex ( UnitIdString ) == 8 then CastSpellByName ( SpellName , UnitIdString ) return end end end hi how can i use this code in fight class or party command plug in Thanks ---------------------------------------- Unknown Hello, put this code instead of spell name, and use option spell option 'Not spell, is lua...': local SpellName = GetSpellInfo ( 109259 ) for i = 1 , 4 , 1 do local UnitIdString = "party" .. i .. "target" if UnitExists ( UnitIdString ) then if GetRaidTargetIndex ( UnitIdString ) == 8 and IsSpellInRange ( SpellName , UnitIdString ) then CastSpellByName ( SpellName , UnitIdString ) return end end end (I have added IsSpellInRange ) And add "lua script" condition: Lua script: needToCast = false ; local SpellName = GetSpellInfo ( 109259 ) for i = 1 , 4 , 1 do local UnitIdString = "party" .. i .. "target" if UnitExists ( UnitIdString ) then if GetRaidTargetIndex ( UnitIdString ) == 8 and IsSpellInRange ( SpellName , UnitIdString ) then needToCast = true ; return end end end Return value research: true Return value var: needToCast To use this code in party chat comman d just use "Action command type" > "Lua" with the first code of this post. of course, replace 109259 by your spell in in all codes. ---------------------------------------- Unknown i do that use it in party but i not work yet :) Test003.xml ---------------------------------------- Unknown i try it again and it is not work ---------------------------------------- Unknown Hello, check if your spell id (109259) is correct ---------------------------------------- Unknown Does not work for me either. Can anyone confirm this is working? I tried several spell IDs and raid target indexes. TBC Private Bot. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/4033-event-handling-possible/ TITLE: Event handling possible? ---------------------------------------------------------------------------------------------------- Unknown Hi, is it possible to add event handling in a fight class ? In this sample someone shout "Hero" and the mage/shaman/whatever cast Bloodlust/Timewarp/whatever. local frame=CreateFrame("Frame"); --[[Need a frame to capture events]] frame:RegisterEvent("CHAT_MSG_SAY"); --[[Register our event]] frame:SetScript("OnEvent",function(self,event,msg) --[[ OnEvent handler receives event triggers ]] if event=="CHAT_MSG_SAY" and msg=="HERO" then --[[ Someone sends "HERO" in /say ]] hero=SpellInfo(2825) CastSpellByName(Hero) end end); ---------------------------------------- Unknown Hello, test.xml (not tested) ---------------------------------------- Unknown Okay, I see, you use a global variable to check a registred frame, hmmm, thats what i try to prevent. (PQR was detected by this)  . ---------------------------------------- Unknown There is little chance that Bliz target your figth class. You can use a global variable name used in legal Wow addons to avoid this problem (or C# code to read chat). ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/4071-compilation-errors/ TITLE: Compilation Errors ---------------------------------------------------------------------------------------------------- Unknown I have some compilation errors with my rotation code. error CS0019 Operator && cannot be used for operand types bool and int Also one of the following. wManager.Wow.ObjectManager.ObjectManager does not have definition for ComboPoint Translated them from finnish best i could. Here is 0.1v of the rotation code. new SpellState("Rake", 16, context => ObjectManager.Me.HaveBuff(5215) && !ObjectManager.Target.HaveBuff(155722), false, false, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Tiger's Fury", 15, context => ObjectManager.Me.GetPowerByPowerType(wManager.Wow.Enums.PowerType.Energy) <= 30, false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Savage Roar", 14, context => Fight.CombatStartSince < 10000 && !ObjectManager.Me.HaveBuff(52610) && ObjectManager.Me.ComboPoint >= 2, false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Healing Touch", 13, context => ObjectManager.Me.HaveBuff(69369) && !ObjectManager.Me.HaveBuff(145152) && ObjectManager.Me.ComboPoint = 5 , false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Rip", 12, context => !ObjectManager.Target.HaveBuff(1079) && ObjectManager.Me.ComboPoint = 5 && Fight.CombatStartSince < 12000, false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Ashemane's Frenzy", 11, context => ObjectManager.Target.HaveBuff(1079) && ObjectManager.Me.HaveBuff(5217), false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Moonfire", 10, context => Fight.CombatStartSince < 10000 && !ObjectManager.Target.HaveBuff(164812) && ObjectManager.Me.ComboPoint < 5 && ObjectManager.Me.HaveBuff(155580), false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Shred", 9, context => Fight.CombatStartSince < 10000 && ObjectManager.Me.ComboPoint < 5, false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Savage Roar", 8, context => ObjectManager.Me.ComboPoint >= 4 && !ObjectManager.Me.HaveBuff(52610), false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Savage Roar", 7, context => ObjectManager.Target.BuffTimeLeft("52610") < 5 && ObjectManager.Me.ComboPoint = 5, false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Rake", 6, context => ObjectManager.Target.BuffTimeLeft("155722") < 3 && ObjectManager.Me.ComboPoint < 5, false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Rake", 5, context => !ObjectManager.Target.HaveBuff(155722) && ObjectManager.Me.ComboPoint < 5, false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Ferocious Bite", 4, context => ObjectManager.Target.HaveBuff(1079) && ObjectManager.Target.HealthPercent < 25, false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Ferocious Bite", 3, context => ObjectManager.Target.BuffTimeLeft("1079") > 8 && ObjectManager.Target.BuffTimeLeft("52610") > 8 && ObjectManager.Me.ComboPoint = 5, false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Rip", 2, context => ObjectManager.ComboPoint = 5 && !ObjectManager.Target.HaveBuff(1079), false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), new SpellState("Rip", 1, context => ObjectManager.Target.BuffTimeLeft("1079") < 5 && ObjectManager.Me.ComboPoint = 5, false, true, false, false, true, true, true, true, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), Just beginner in coding. ---------------------------------------- fatfang If you are looking for objective relevant properties take a look at ObjectManager.Me.X or if you want your target take a look at ObjectManager.Me.TargetObject.X About your error: && ObjectManager.Me.ComboPoint = 5 should be && ObjectManager.Me.ComboPoint == 5 ---------------------------------------- Unknown Ok, thanks. Helped alot :) ---------------------------------------- Unknown Questions like that and people who try to create some good stuff are always welcome. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/4111-counting-imps-demonology-warlock/ TITLE: Counting Imps [Demonology Warlock] ---------------------------------------------------------------------------------------------------- Unknown Working on a very detailed rotation for Demonology Warlocks, but I can't seem to find a way to count how many imps are out with simple LUA. If I can't find a simple solution, I can do a much more complicated and time consuming count with timers, but I'd like to avoid that. ---------------------------------------- Unknown The only way I found is to count it via event...but there is no real event handling in wrobot. http://eu.battle.net/forums/de/wow/topic/7391150363#post-4 ---------------------------------------- Unknown Yes, I was definitely looking to avoid event handling. I suppose I'll leave the demonology class the way it is. Seems risky considering PQR had issues with it from what I've obtained. ---------------------------------------- Unknown Hi! Dont know at all if this is relevant or if it works with imps, but ill post it anyways. http://us.battle.net/forums/en/wow/topic/16647414903 Second post. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/4849-how-can-i-run-lualuastring-a-set-amount-of-times/ TITLE: How can I run Lua.LuaString a set amount of times? ---------------------------------------------------------------------------------------------------- Unknown How can i run Lua.LuaDoString 5 times rather than have 5 lines in my code? ---------------------------------------- Unknown i'm not sure and did not test it but try Lua . LuaDoString ( new List () { "FirstCommand" , "Second command" , "ThirdCommand" }); ---------------------------------------- Unknown Hello, iMod method is good, but you can also use @ http://net-informations.com/q/faq/multilines.html (method 1) like: int numberPetAlive = Lua . LuaDoString (@ " local aliveCount = 0 ; for p = 1 , 3 do local petID , ability1ID , ability2ID , ability3ID , locked = C_PetJournal . GetPetLoadOutInfo ( p ); if petID then local health , maxHealth , _ = C_PetJournal . GetPetStats ( petID ); if health > 0 then aliveCount = aliveCount + 1 ; end end end return aliveCount ; "); ---------------------------------------- Unknown Thank you both! I appreciate the help! ---------------------------------------- Unknown I found an easy way that could be used universally with c#: private static void RepeatAction ( int repeatCount , Action action ) { for ( int i = 0 ; i < repeatCount ; i ++) action (); } Then in the profile: RepeatAction ( 5 , () => { // Action to repeat 5 times. }); ---------------------------------------- Unknown for ( var i = 1 ; i <= 5 ; i ++) Lua . DoString ( "print('go ducks')" ); ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/5460-talent-check/ TITLE: Talent Check? ---------------------------------------------------------------------------------------------------- Unknown Is there a way to check if a Talent is selected for levels 15,30,45, etc. when it's not a usable spell? ---------------------------------------- Unknown Hello, https://mods.curse.com/addons/wow/quick-talents http://wow.gamepedia.com/World_of_Warcraft_API#Talent_Functions https://github.com/tomrus88/BlizzardInterfaceCode/blob/master/Interface/FrameXML/TalentFrameBase.lua ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/5589-hostile-unit-near-in-lua/ TITLE: "Hostile Unit Near" in Lua? ---------------------------------------------------------------------------------------------------- Unknown Hello, as title says, is there a way, a command, to include in a lua script that Wrobot function? Its useful to check when to do AoE spells and other things. Thanks let me know =) ---------------------------------------- Unknown Hello, no you cannot use this in lua. Where do you want use your script? ---------------------------------------- Unknown Actually I wanted to add this feature to a pve pqr rotation for AoE spells like hurricane, mind sear. By the way I don't understand exactly one thing in wrobot classfight, when I set for example "1" unit and radius "5" (equal or bigger), the "equal or bigger" is refered to radius or to the units? ---------------------------------------- Unknown it's referring to units including the target. ---------------------------------------- Unknown Alright, so I scripted correctly Howl of Terror (Hostile Unit Near 1, radius 5, Bigger or Equal) and set maximum priority, but doesnt Fear, specially when I have a lot of people near, it prefers doing the other spells and ignoring the Fear which would be a lot better and less bot-like, since its guaranteed a warlock or a priest will first fear when multiple enemies are near. On 1v1 it works great, I can't explain why when i have more people it doesn't do anything. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/5764-hearthstone-for-multi-language/ TITLE: Hearthstone for Multi-language? ---------------------------------------------------------------------------------------------------- Unknown Will this code work for Multi-language to check where a Hearthstone is set? Lua . LuaDoString ( "bindlocation = GetBindLocation(); return bindlocation;" ) == "Trade District" ---------------------------------------- Unknown Hello, no ---------------------------------------- Unknown Droidz is it possible to add a HearthstoneAreaId to WRobot? ---------------------------------------- Unknown chain-related ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/5978-checking-seal-of-command-proc/ TITLE: Checking Seal of Command proc ---------------------------------------------------------------------------------------------------- Unknown Dear Wrobot. How would i go about checking for a seal of command proc, and then execute seal of blood at the same time the proc happens? ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/6765-preventing-an-istant-spell-to-be-casted-unit_spellcast_sent/ TITLE: Preventing an istant spell to be casted (UNIT_SPELLCAST_SENT) ---------------------------------------------------------------------------------------------------- Unknown Hello, I was messing around with the even handler in lua and I was wondering if there is a way to cancel the spell after you pressed it. The best result i've achieved is when I try to cast a certain spell (for example: Bloodlust), and the script will SpellStopCasting(), blocking immediately the cast as soon as it starts. basically making me unable to cast it. But when the spell is not a cast, and it's an istant spell (for example: Riptide), the script freeze the game for a second, then unfreeze with the spell casted. Which is not what I wanted. In few words, can I stop an istant spell fired with UNIT_SPELLCAST_SENT? Or when that event starts, it's too late to block it? Thanks for reading :) ---------------------------------------- Unknown IMHO only the proper rotation with priority queue can make what you want and only method of prevention against casting spell is well not casting it at all. ---------------------------------------- Unknown Modify your event listener to check to see if the spell that is being casted has a cast time  less than or equal  0. I have no idea what SpellStopCasting() does, but the below should work. private void watchForCast () { EventsLuaWithArgs . OnEventsLuaWithArgs += ( LuaEventsId id , List args ) => { if ( id == wManager . Wow . Enums . LuaEventsId . UNIT_SPELLCAST_SENT ) { if ( instantCast ( new Spell ( args [ 1 ])) == false ) { SpellStopCasting (); } } }; } private bool instantCast ( Spell spell ) { return ( spell . CastTime <= 0 ); } ---------------------------------------- Unknown edited code above. Posting again so that you get a notification. ---------------------------------------- Unknown I forgot to mention I was writing that entirely on LUA and using pqr, so I can't put C code in it (at least i think). Also I'm not skilled enough on C language so I can't understand that code 100%. The reason of my question is because I came across a guy who claimed he has some pqr scripts that do certain things which seemed weird to me, and I wanted to try by myself if that could been done for real, I never thought about that: " [Hammer of Justice] : Will not be used if [Cloak of Shadows]/[Ice Block]/[Bladestorm]/[Spell Reflection] or any other spell that prevents you from landing it is up. This script will stop you from casting [Hammer of Justice] if any of the spells stated above are up." This is what he wrote. I mean I can understand a SpellStopCasting() when there is Spell Reflection up and you are casting so you avoid being reflected, it's not hard its like 2 rows of code... but how can a script prevent you from casting an istant spell, like Hammer of Justice? So there are two ways: 1) The script has an automatic Hammer of Justice cast (which is completely idiot imho, what's the point?), and before casting it, it checks target's buffs. 2) The script blocks you from manually casting Hammer of Justice by mistake, like target with Cloak of Shadows. If its the first option well it's the worst script ever for sure and I don't see how can people find that useful, if it's the second, that would be actually a good script for pvp (even if it's not hard to check target buffs before using a certain spell on it..) but it's still interesting code talking. ---------------------------------------- Unknown check the casttime of all spells before they are casted. If the cast time is greater than 0, then stop casting. If it's 0, then cast. And I'm the opposite :D. I can read LUA, but it's definitely not my forte. ---------------------------------------- Unknown I think you meant if cast time < or = 0 then stop casting (you said: cast). But that's not the point I think..Because as already said, I tried with random spell casts and it successfuly stops them at like 0,01 sec of cast time, preventing them from landing. But when it's an istant spell, it can't cancel it, it's like i'm trying to stop a ball after it gets kicked really hard. Like in reality, I can stop the football player running towards the ball from distance and charging his feet, but once he kicks the ball there's nothing I can do to freeze the ball on the ground. What I'm trying to do is make the ball attached to the ground so it can't move despite being kicked. ---------------------------------------- Unknown In my C# example, it would be Cast.. because the event triggers based upon the spell beginning to cast. So, once the bot sees that it's a spell that has a cast time, it will stop the cast. If your goal is to stop casting based on some sort of 'event'/'trigger', then I agree that checking to see if it's an instant cast/not one is irrelevant. I re-read your message, and I see that i completely glossed over your actual question. My mistake. I think it is too late to block the spell.  I think the best thing to do is to check your condition before casting anything. ---------------------------------------- Unknown Oh i see, I was thinking in a lua way ;) Well idk how to explain.. basically the "UNIT_SPELLCAST_SENT" is the request you send to the server to launch a spell, and assuming conditions are true (target is in line of sight, in range...) then it triggers immediately SPELL_CAST_START (means the server accepted your request and the spell is going to land). So when this happens, the istant spell lands succesfully in a matter of milliseconds, while the spell with a cast time instead, begins to cast, and that's why I can stop this and not the other one. So I want to have the request denied from the server, blocking me from doing that spell. Like having a message "is out of range" "not in the line of sight", something like this. It's just curiosity, since that guy wrote that thing about the hammer of justice I was curious how it could even work. ---------------------------------------- Unknown It may be possible. I may even be wrong about something i said above. Hopefully someone else can chime in on this. ---------------------------------------- Unknown I would pay his stupid script just to see how he wrote that HoJ thing, really. His "rotations" are really bad and cheap but that function bothers me so much ahah :) Makes me think that the HoJ is automated (like target: low health) but won't be casted in certain conditions (ice block)..which is a joke to script honestly. ---------------------------------------- Unknown It's easy enough. All spells the client casts through the interface inevidbly go through CastSpellByName() (in Lua). Therefore, you can overwrite CastSpellByName with your own function, do a condition for HoJ and just make it do nothing if target has CoS etc. Do I think that guy is actually doing it that way? Probably not. He's likely just boasting/lying about something he has done in a way more simplistic way. ---------------------------------------- Unknown That's exactly my thoughts. doing the override just makes more sense here. ---------------------------------------- Unknown That's interesting, I need to work on this then, thanks for the suggestions ! ---------------------------------------- @scripterx Hello, @scripterx i really recommend to use c#. Pqr / only lua is limited in many ways. According to your posts, i guess you only want to cast specific spells by a button press only if x condition is met. So in this case you could do it like this in a plugin(i know it could be better > copy-pasta from my other posts): using System ; using wManager . Plugin ; using wManager . Wow . Class ; using wManager . Wow . ObjectManager ; public class Main : IPlugin { public void Initialize () { robotManager . Helpful . Logging . Write ( "Register OnEventsLuaWithArgs" ); wManager . Wow . Helpers . EventsLuaWithArgs . OnEventsLuaWithArgs += delegate ( wManager . Wow . Enums . LuaEventsId id , System . Collections . Generic . List args ) { if ( id != wManager . Wow . Enums . LuaEventsId . EXECUTE_CHAT_LINE || ObjectManager . Me . IsStunned ) return ; var toCast = new Spell ( "Riptide" ); if ( args [ 0 ]. ToUpper (). Equals (( "/cast @target " + toCast . Name ). ToUpper ()) && ObjectManager . Me . TargetObject . HealthPercent <= 90 ) { toCast . Launch ( false , false , false , "target" ); } if ( args [ 0 ]. ToUpper (). Equals (( "/cast @player " + toCast . Name ). ToUpper ()) && ObjectManager . Me . HealthPercent <= 95 ) { toCast . Launch ( false , false , false , true ); } }; } public void Dispose () { } public void Settings () { } } In-game you can just create a macro like this: #showtooltip Riptide /cast @target riptide So it will only cast the spell, if target is under 95% health. More related stuff can be found here . Otherwise you can do it on an automatic way in a rotation: using System ; using System . Threading ; using System . Windows . Forms ; 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 => 30f ; private bool _isLaunched ; public Spell Riptide = new Spell ( "Riptide" ); public void Initialize () // When product started, initialize and launch Fightclass { _isLaunched = true ; Logging . Write ( "[My fightclass] Is initialized." ); while ( _isLaunched ) { try { if (! Products . InPause && ! ObjectManager . Me . IsDeadMe ) { Pulse (); } } catch ( Exception e ) { Logging . WriteError ( "[My fightclass] ERROR: " + e ); } Thread . Sleep ( 10 ); // Pause 10 ms to reduce the CPU usage. } } public void Dispose () // When product stopped { _isLaunched = false ; Logging . Write ( "[My fightclass] Stop in progress." ); } public void ShowConfiguration () // When use click on Fight class settings { MessageBox . Show ( "[My fightclass] No setting for this Fight Class." ); } public void Pulse () { if ( ObjectManager . Me . Target != 0 && Riptide . IsSpellUsable && Riptide . IsDistanceGood && Riptide . KnownSpell && ObjectManager . Me . TargetObject . HealthPercent <= 95 ) { Riptide . Launch (); } } } You can also combine them & use settings for automatic / manual usage and do whatever you want: The possibilities are endless. Using a state engine is also possible. More informations can be found here . If you need help, feel free to ask. ---------------------------------------- Unknown @reapler Very much appreciated, that was too much actually, I am not so familiar with C and my question was made just out of curiousity but thanks for the help! ---------------------------------------- Unknown Alright I'm very close to the solution (even if I realize it's kinda useless)..I'm glad that I can made it work, and yes thanks to your support and suggestions obviously. Basically there is a command "hooksecurefunc" which pretty much does the job. I redirect the CastSpellByName and also CastSpellByID (just in case) with a function and it's ok, the weird part is: I tested with a Priest just the istant spells, it blocks for example the Shadowform, Dispersion, almost everything. But doesn't block Holy Nova, Prayer of Mending. So I said, maybe it doesnt block Holy spells, but guess what, Power Word: Shield is blocked..I mean what's the difference between PW:S and Holy Nova? I don't get it. if the command stop almost every istant spell why does it let me cast Holy nova and not PW:S? Talking about spell with cast time, it doesn't block them at all. I don't know why? Not a big deal, but the thing that blocks only some spell and other not its really really weird I can't understand ---------------------------------------- Unknown EDIT: Found out it blocks only spells that are macroed. So if I press any spell not-macroed, doesn't work and the spell starts. ---------------------------------------- ScripterQQ Actionbuttons use the function "UseAction" as far as I'm aware. Could try hooking that. I'm not entirely sure how buttons cast the spell internally, but I know it goes through that function at some point. ---------------------------------------- ScripterQQ Technically Holy Nova is a Holy spell and PW:S is a discipline spell :) SO THERE'S A DIFFERENCE!!! ---------------------------------------- Avvi Will try this ! :) Ya actually there is :P ---------------------------------------- Unknown "UseAction" works perfect, 100% blocks both macros and normal spells. Thanks! Case solved, that's cool. ---------------------------------------- Unknown | 2017-08-26T14:56:11Z Can you post your code here so that others can see? (myself included :)) Edited August 26, 2017 by avvi ---------------------------------------- Avvi Sure (this is the basic code just for test, there are no conditions added so it blocks every kind of action, even using trinkets. hooksecurefunc("UseAction", function(...) return true end) UseAction = function(...) print("UseAction Stopped") end ---------------------------------------- Unknown The "hooksecurefunc" is not necessary in that case I think, since every action is replaced by a simple "print" (just for test). I need to add conditions like for example, block spell cast if spell = "Deep Freeze" and target has buff = "Icebound Fortitude", something like that..That posted code it's a very cheap base to start working on. Maybe I will complete it, will update in case :) ---------------------------------------- Avvi Ok so there is no actual needing of "hooksecurefunc", it also needs a /reload to "unhook" so I don't think it's a good idea to use that command, but I may be wrong.. By the way, this is the script I wrote, tested, working. Very basic script, it stops you from casting Psychic Horror on a target with Cloak of Shadows buff. local spellnametoblock = "Psychic Horror" local spellidtoblock = 64044 -- Psychic Horror local bufftoavoid = "Cloak of Shadows" UseAction = function ( slot , tar ) -- print ( "Slot: " .. slot ) -- print ( "Target: " .. tar ) local type , id , subtype , spellID = GetActionInfo ( slot ) if type == "spell" then -- print ( "Attempting to Cast Spell ID: " .. spellID ) -- Get the ID of the Spell you want to block if spellID == spellidtoblock and UnitBuff ( "target" , bufftoavoid ) then print ( "You can't cast " .. spellnametoblock .. " if Target has " .. bufftoavoid .. "!" ) else CastSpellByID ( spellID , tar ) end elseif type == "macro" then -- print ( "Macro ID: " .. id ) local macrospellname , macrospellrank , macrospellID = GetMacroSpell ( id ) if macrospellname == spellnametoblock and UnitBuff ( "target" , bufftoavoid ) then print ( "You can't cast " .. spellnametoblock .. " if Target has " .. bufftoavoid .. "!" ) else RunMacro ( id ) end end end You just need to change the first 3 lines, put the exact name of the spell to check, its ID (there is a print option to get the ID once you press the Spell) and the debuff to check. The reason because you need both spell name and ID is because this is the onyl way to make it work with both normal spells and macroed spells. There is only one problem at the moment: not tested but pretty sure it can't prevent you from casting a macroed spell on a custom unit. For example, if you have macroed Psychic Horror on Focus, and Focus has CoS, and you press that macro, script won't work. I don't think there is a way to see what is the target of your macroed Spell. And viceversa, if you want to Psychic Horror your focus who has no CoS, but your target HAS CoS, the script will probably stop the spell, because it "sees" you are trying to cast Psychic Horror on a CoS target. So yea the macro part it's kinda tricky, not sure if it's possible to add all these checks and make a perfect script. Well my main goal was achieved, not complaining, and this idea was funny to do...but not sure if I will work on it again, because of all these limitations, I don't see the potential in LUA to make a perfect script actually. ---------------------------------------- Unknown Great post. Thank you for sharing your findings!! ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/6765-preventing-an-istant-spell-to-be-casted-unit_spellcast_sent/?&page=2 TITLE: Preventing an istant spell to be casted (UNIT_SPELLCAST_SENT) ---------------------------------------------------------------------------------------------------- Avvi Ok so there is no actual needing of "hooksecurefunc", it also needs a /reload to "unhook" so I don't think it's a good idea to use that command, but I may be wrong.. By the way, this is the script I wrote, tested, working. Very basic script, it stops you from casting Psychic Horror on a target with Cloak of Shadows buff. local spellnametoblock = "Psychic Horror" local spellidtoblock = 64044 -- Psychic Horror local bufftoavoid = "Cloak of Shadows" UseAction = function ( slot , tar ) -- print ( "Slot: " .. slot ) -- print ( "Target: " .. tar ) local type , id , subtype , spellID = GetActionInfo ( slot ) if type == "spell" then -- print ( "Attempting to Cast Spell ID: " .. spellID ) -- Get the ID of the Spell you want to block if spellID == spellidtoblock and UnitBuff ( "target" , bufftoavoid ) then print ( "You can't cast " .. spellnametoblock .. " if Target has " .. bufftoavoid .. "!" ) else CastSpellByID ( spellID , tar ) end elseif type == "macro" then -- print ( "Macro ID: " .. id ) local macrospellname , macrospellrank , macrospellID = GetMacroSpell ( id ) if macrospellname == spellnametoblock and UnitBuff ( "target" , bufftoavoid ) then print ( "You can't cast " .. spellnametoblock .. " if Target has " .. bufftoavoid .. "!" ) else RunMacro ( id ) end end end You just need to change the first 3 lines, put the exact name of the spell to check, its ID (there is a print option to get the ID once you press the Spell) and the debuff to check. The reason because you need both spell name and ID is because this is the onyl way to make it work with both normal spells and macroed spells. There is only one problem at the moment: not tested but pretty sure it can't prevent you from casting a macroed spell on a custom unit. For example, if you have macroed Psychic Horror on Focus, and Focus has CoS, and you press that macro, script won't work. I don't think there is a way to see what is the target of your macroed Spell. And viceversa, if you want to Psychic Horror your focus who has no CoS, but your target HAS CoS, the script will probably stop the spell, because it "sees" you are trying to cast Psychic Horror on a CoS target. So yea the macro part it's kinda tricky, not sure if it's possible to add all these checks and make a perfect script. Well my main goal was achieved, not complaining, and this idea was funny to do...but not sure if I will work on it again, because of all these limitations, I don't see the potential in LUA to make a perfect script actually. ---------------------------------------- Unknown Great post. Thank you for sharing your findings!! ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/6842-lua-not-working-in-fight-class-editor/ TITLE: Lua not working in fight class editor ---------------------------------------------------------------------------------------------------- Unknown Hey all I tried to make an in-game frame using lua just the way i would with lua in-game in any other way (macros etc). So in the "spellname" area in the creator i wrote in my code, and i set it to "not spell, is lua script" Ending up with this: if not FrameCreated then FrameCreated = true StatusFrame = CreateFrame("Frame") StatusFrame:ClearAllPoints() StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",}) StatusFrame:SetBackdropColor(0,0,0,.4) StatusFrame:SetHeight(60) StatusFrame:SetWidth(122) StatusFrame:SetPoint("TOPLEFT",ChatFrame1, 0,90) StatusFrame:SetMovable(true) StatusFrame:EnableMouse(true) StatusFrame:RegisterForDrag("LeftButton") StatusFrame:SetScript("OnDragStart", frame.StartMoving) StatusFrame:SetScript("OnDragStop", frame.StopMovingOrSizing) StatusFrame:Show() end Is there any reason why this does not work? Note: I did try removing the StatusFrame : SetBackdrop ({ bgFile = "Interface\\Buttons\\WHITE8X8" ,}) In case it just couldn't find the BgFile, no difference. :) Also tried writing it like this: StatusFrame : SetBackdrop ({ bgFile = [[ Interface \Buttons\WHITE8X8 ]],}) Any help would be appreciated cheers! :) This is a copy paste from my other post, since i realized that i posted i the wrong forum. :) Edit: I even tried changing it to use lua script as a condition and then just leave the spellname empty liket his: if not FrameCreated then StatusFrame=CreateFrame("Frame"); StatusFrame:ClearAllPoints(); StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",}); StatusFrame:SetBackdropColor(0,0,0,.4); StatusFrame:SetHeight(60); StatusFrame:SetWidth(122); StatusFrame:SetPoint("TOPLEFT",ChatFrame1, 0,90); StatusFrame:SetMovable(true); StatusFrame:EnableMouse(true); StatusFrame:RegisterForDrag('LeftButton'); StatusFrame:SetScript('OnDragStart', frame.StartMoving); StatusFrame:SetScript('OnDragStop', frame.StopMovingOrSizing); FrameCreated = true end ---------------------------------------- Unknown After hours and hours of doing this and that, i finally figured the error lies within wrobot. Apparently it dones't translate \\ into / So as soon as i changed StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",}); into StatusFrame:SetBackdrop({bgFile = "Interface/Buttons/WHITE8X8",}); Everything worked. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/6845-how-to-make-new-lines-in-lua-script/ TITLE: How to make new lines in lua script? ---------------------------------------------------------------------------------------------------- Unknown Apparently \n doesn't work for new lines. Is there any other way to make new lines? "I am".."\n".."not".."\n".."Alone?" ---------------------------------------- Unknown So yeah on WRobot you need to use \\ instead of \ :P So my example: I am not Alone? Would be "I am".."\\n".."not".."\\not".."Alone?" ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/6854-can-i-set-the-timer-with-lua/ TITLE: Can i set the 'timer' with lua? ---------------------------------------------------------------------------------------------------- Unknown Hey all! Is there any way that i can set the "timer" for an ability with lua? Example: I want to be able to change the timer on steady shot, so it matches gun/bow/crossbow speed. Instead of having to adjust the Class Profile, i'd like to make it so you can set your speed with lua. Now this can be edited in many ways an example could be if i set the timer as a variable: timer = WeaponSpeed Then one would be able to change the weapon speed in-game with /run WeaponSpeed = 3.5 ---------------------------------------- Unknown CS rotation only perhaps. Some kind of pseudo code ( to prevent double cast of immolate in this example ) public long immolate_StartTime ; public bool immolate_ResetTimer = true ; public bool immolate_CanCast = true ; public long immolate_Time = 1500 ; ..... wManager . wManagerSetting . CurrentSetting . EventsLuaWithArgsWaitTime = 1 ; EventsLuaWithArgs . OnEventsLuaWithArgs += ( id , args ) => { if ( id == wManager . Wow . Enums . LuaEventsId . UNIT_SPELLCAST_START ) { if ( args . Count >= 2 && args [ 0 ] == "player" && args [ 1 ] == "Immolate" ) { if ( immolate_ResetTimer == true ) { immolate_StartTime = GetTime (); immolate_ResetTimer = false ; } } } if (( GetTime () - immolate_StartTime ) > immolate_Time ) { immolate_CanCast = true ; immolate_ResetTimer = true ; } else { immolate_CanCast = false ; } public long GetTime () { long startTick = DateTime . Now . Ticks / TimeSpan . TicksPerMillisecond ; return startTick ; } In this example the immolate will be casted again only after 1500 ms ( and this is preventing to overcasting ) To check when something start and count the time to push the event again. Well. IDK :) Or maybe its not about that at all :) ---------------------------------------- Unknown Thank you for the quick answer! If i use lua script to cast my spell with SpellInfo, couldn't i in theory also use the GetTime in lua to achieve this? :) ---------------------------------------- Ordush if vUAflag == nil then vUAflag = 0 end ; -- If we 're CURRENTLY casting UA and the timestamp isn' t already set ... if ({ UnitCastingInfo ( "player" )})[ 1 ]== "Unstable Affliction" and vUAts == nil then -- Record that UA is being cast and record the time at which we observed the ongoing cast . -- Setting the flag to 1 will prevent UA from being cast again . vUAflag = 1 vUAts = GetTime () end ; -- If the flag is set ... but the time at which it was set was more than 2 seconds ago ... if vUAflag == 1 and GetTime ()- vUAts > 2 then -- Reset the flag and timestamp to allow UA again . vUAflag = 0 vUAts = nil end Ripped example - here you see how to cast Unstable Affliction when the time difference between start and now is > 2. If vUaFlag=0 then cast ---------------------------------------- Unknown Perfect! Thank you so much! <3 ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/6855-can-we-use-savedvariables/ TITLE: Can we use savedVariables? ---------------------------------------------------------------------------------------------------- Unknown Since we're not making an addon, but we're making lua in the bot and the filename changes all the time (ghuheu38.lua) we can't make a side addon  with the toc for the savedvariable Is there some other smart way to do it with wrobot? :) ---------------------------------------- Ordush I only use macro ingame to pass the value to the wrobot cs rotation. You can create a global variable assign a value to that variable and read it in wrobot. Lua.LuaDoString(@"SLASH_HELLOWORLD1, SLASH_HELLOWORLD2 =  ""/Lux"",""/lux""; local function handler(msg, editbox)  setglobal( ""Lux"", msg ) end SlashCmdList[""HELLOWORLD""] = handler; "); In that example when user in game write : /lux 1 the global value Lux will be set to 1 and then inside the cs you can read the value in something like that: var Lux = Lua.LuaDoString("value = Lux;", "value"); Of course if you make an addon which is setting the certain globals in certain way you will be able then to read the values from inside the wrobot. So something like that is possible and it was done in pqr with pqi. ---------------------------------------- Unknown Of course, why didn't i think of that? Thanks a ton mate! I used to use PQR for WOTLK, where i made an in-game addon INSIDE pqr, i did exactly that to save my variables, i just totally forgot that i had done it, since it was ages ago. Thank you for the response! <3 ---------------------------------------- Unknown Var.SetVar Var.GetVar ---------------------------------------- Unknown So i've tested this out, and ofc. it works fine it remembers the variables i set. The problem is that it does actions based on those variables which are blocked by blizzard. So the first thing that happens when i do anything using those variables i have saved in my ToC (SavedVariables) blizzard blocks my addon. Is there not any way to save lua variables without using SavedVariables in-game? Since addons are also checked for secure usage. ---------------------------------------- Unknown Var.SetVar Var.GetVar its a internal wrobot dictionary, no relation to toc or blizzard. its used as wrobot cache, you can save, modify and delete this variables while wrobot run. if wrobot closed -> all var data lost/cleared. OR when wrobot starts, its create this cache/dictionary from scratch. dunno what variable you talking about ---------------------------------------- Unknown Yeah the problem here is exactly that it's cleared. The reason i was using an addon instead was because i want it to save my variables between game sessions. When you close the game and wrobot, from what i understand Var.SetVar and Var.GetVar clears and then we're back to default, thereby losing the saved data? ---------------------------------------- Unknown then make your own settings and save to file robotManager.Helpful.Settings ---------------------------------------- Unknown Can i do that combined with Lua? if so, would you explain it to me? Cheers! ---------------------------------------- Unknown | 2017-09-07T14:35:20Z lemme give you world most superior advice at all time. "use search, young padawan" here is quick jedi trick http://lmgtfy.com/?q=site%3Awrobot.eu+"robotManager.Helpful.Settings" Edited September 7, 2017 by camelot10 ---------------------------------------- Unknown No reason to be rude. I always search every bit of the internet before i begin asking quetions. I will try see if i can figure it out. Thanks. ---------------------------------------- Unknown | 2017-09-07T14:38:32Z im not rude. i prefer to learn fly other peoples, not to carry them by myself at all time. maybe my english no so good. sorry ps. i put correct link above. Edited September 7, 2017 by camelot10 ---------------------------------------- Unknown And i allrdy did google it before you linked the "how to google" guide.. If you click your own link you will see there are 6 links, and none of them has any info on how to use robotManager.Helpful.Settings ---------------------------------------- Unknown now i can be rude, but i must say that: seems like you can't search correctly in the internet, first link in my search have partial code of robotManager.Helpful.Settings and lead to http://lmgtfy.com/?q=site%3Awrobot.eu+"AdviserFilePathAndName" ---------------------------------------- Unknown | 2017-09-07T15:12:57Z What is wrong with you? There is NO reason at all to be rude at all... Being arrogant and rude has no place in a public debate area. Clearly i can't seem to get where you want me to go, you could just point me directly to where you want me to go instead of making rude gestures and posting links to a "how to use google" site. I am not being rude to you in any way. Your behavior is so weird... If anyone asks a question on this forum and i know the answer, i will answer the question, and i will point to where people can find the help they need if i know where. Edit: In short: Can you just tell me weather robotManager.Helpful.Settings Can work with lua or not? If you don't know, that is fair enough. Edited September 7, 2017 by Ordush ---------------------------------------- Unknown god, why so agressive? there is a small bits of information on this forum, i just whant to explain you how you can solve 99% of wrobot problems by your own. but lazy and agressive peoples like you, prefer to ask questions whats required a 5 minutes of time and brain working. my second link, first google link lead to there is everything you need for saving and loading data/params between wrobot sessions. second google link gives complete info too. whats wrong with you? if you can't search internet and im trying to help, why you aggroed? since 24 aug, im only one who helping with answers in this topic. sorry if i hurt your feelings in any way. i hope you understand how to search strict string on current site and follow the trail to get answers in 5-10 mins and dont wait 3 weeks for "kind stranger" ---------------------------------------- Unknown And i appreciate any help i can get, but i don't understand why you have to be rude about it? Yes it took you 5 minutes to get how to use C# for saving/loading data/params. What i asked was if/how i can use lua to do it. The reason i ask for lua is because i write my fightclasses in lua not C#. Without any reason at all you keep telling me how much i suck at using google etc. I am not being aggressive, quite the opposite, i am being defensive because you keep being rude to me instead of just telling me: "I don't know if you can do it in lua". ---------------------------------------- Unknown its a very bad practice to save variables between sessions like "c# -> wrobot -> lua -> wow -> addon -> disk" for wrobot and vice versa to load it. you can load wrobot settings and set lua vars after load for your lua-fightclass. this allow you to skip dependancy from wow addon and store everything you need for fightclass ---------------------------------------- Unknown Thank you for giving me a straight answer! It's very appreciated. If i understand you right, i should be able to set lua vars using C#. I am obviously not very good at C#. I will give it a try looking through the code that people used to make settings (the links you lastly provided). And see if i can figure out how to use that to set lua vars. That was all i asked for mate. Thanks ---------------------------------------- Ordush #if VISUAL_STUDIO using robotManager . Helpful ; using System ; using System . Collections . Generic ; using System . Linq ; using System . Text ; using System . Threading ; using System . Threading . Tasks ; using wManager . Wow . Bot . Tasks ; using wManager . Wow . Class ; using wManager . Wow . Helpers ; using wManager . Wow . ObjectManager ; using wManager . Wow . Enums ; using System . Configuration ; using System . ComponentModel ; using System . IO ; #endif [ Serializable ] public class TestSettings : Settings { [ Setting ] [ DefaultValue ( true )] [ Category ( "GHOST WOLF SETTINGS" )] [ DisplayName ( "Ghost Wolf" )] [ Description ( "Use Ghost Wolf" )] public bool UGW { get ; set ; } [ Setting ] [ DefaultValue ( 4 )] [ Category ( "GHOST WOLF SETTINGS" )] [ DisplayName ( "Use after X secondes" )] [ Description ( "Use Ghost Wolf after X secondes out of combat" )] public int TGW { get ; set ; } public static TestSettings CurrentSetting { get ; set ; } public TestSettings () { } public bool Save () { try { return Save ( AdviserFilePathAndName ( "CustomClass_Shaman" , ObjectManager . Me . Name + "." + Usefuls . RealmName )); } catch ( Exception e ) { Logging . WriteError ( "CustomClass_ShamanSettings > Save(): " + e ); return false ; } } public static bool Load () { try { if ( File . Exists ( AdviserFilePathAndName ( "CustomClass_Shaman" , ObjectManager . Me . Name + "." + Usefuls . RealmName ))) { CurrentSetting = Load < TestSettings >( AdviserFilePathAndName ( "CustomClass_Shaman" , ObjectManager . Me . Name + "." + Usefuls . RealmName )); } else { CurrentSetting = new TestSettings { UGW = true , TGW = 4 , }; } CurrentSetting . PushToLua (); return true ; } catch ( Exception e ) { Logging . WriteError ( "CustomClass_ShamanSettings > Load(): " + e ); } return false ; } void PushToLua () { UGW = Lua . LuaDoString ( "return luaVar" ); } void FetchFromLua () { Lua . LuaDoString ( "UGW = " + UGW ); } } quick and dirty example ---------------------------------------- Unknown Cheers! Makes sense! ---------------------------------------- Unknown I hit a roadblock here It does change the setting if i click settings based on what i set HuntersMarkDisabled to in-game, but in-game doesn't change based on what it's set to in the settings (So it saves to settings, but doesn't load from settings) [Serializable] public class HunterBeastmasterSettings : Settings { [Setting] [DefaultValue(true)] [Category("Combat Spells - Hunter Abilities")] [DisplayName("Hunter's Mark Disabled")] [Description("Is Hunter's Mark Disabled?")] public bool HuntersMark { get; set; } [Setting] [DefaultValue(true)] [Category("Combat Spells - Hunter Abilities")] [DisplayName("Steady Shot")] [Description("Is Hunter's Mark Disabled?")] public bool SteadyShot { get; set; } public static HunterBeastmasterSettings CurrentSetting { get; set; } private HunterBeastmasterSettings() { } public bool Save() { try { return Save(AdviserFilePathAndName("CustomClass-HunterBeastmaster", ObjectManager.Me.Name + "." + Usefuls.RealmName)); } catch (Exception e) { Logging.WriteError("HunterBeastmasterSettings > Save(): " + e); return false; } } public static bool Load() { try { if (File.Exists(AdviserFilePathAndName("CustomClass-HunterBeastmaster", ObjectManager.Me.Name + "." + Usefuls.RealmName))) { CurrentSetting = Load (AdviserFilePathAndName("CustomClass-HunterBeastmaster", ObjectManager.Me.Name + "." + Usefuls.RealmName)); } else { CurrentSetting = new HunterBeastmasterSettings { HuntersMark = false, SteadyShot = false, }; } CurrentSetting.PushToLua(); return true; } catch (Exception e) { Logging.WriteError("HunterBeastmasterSettings > Load(): " + e); } return false; } void PushToLua() { HuntersMark = Lua.LuaDoString ("return HuntersMarkDisabled"); } void FetchFromLua() { Lua.LuaDoString("HuntersMarkDisabled = " + HuntersMark); } } I tried adding CurrentSetting.FetchFromLua(); to the "try" under load. Do i need to rewrite the load, like the save has been rewritten for it to work? :) ---------------------------------------- Unknown oh god. whats your C# knowledge level ? ---------------------------------------- Unknown | 2017-09-07T20:08:32Z My C# Knowledge level is almost non existent, which is why i've written my fightclass in lua. This is also why i was asking if anyone knew of a way to do this with lua. :) Edit: When it comes to C# I can read examples and modify them for my needs. Edited September 7, 2017 by Ordush ---------------------------------------- Unknown I just went into the shower, while there i think i figured it out. If i write the code you see above, and then start my fight class with a c# code (using the editor) And i in that code write the following: if (Updateloaded != true) { Updateloaded = true FetchFromLua(); } Then it should update my variables before displaying/using them for the rest of the fight class right? Meaning that would be how i load them form last session? :) ---------------------------------------- Unknown So yeah, another problem. The CurrentSetting.PushToLua(); Overwrites the settings and sets everything to what default is, because it loads the settings before it does FetchFromLua. I tried doing try { if ( File . Exists ( AdviserFilePathAndName ( "CustomClass-HunterBeastmaster" , ObjectManager . Me . Name + "." + Usefuls . RealmName ))) { CurrentSetting = Load & lt ; HunterBeastmasterSettings & gt ;( AdviserFilePathAndName ( "CustomClass-HunterBeastmaster" , ObjectManager . Me . Name + "." + Usefuls . RealmName )); if ( Updateloaded ) { CurrentSetting . PushToLua (); } return true ; } CurrentSetting = new HunterBeastmasterSettings (); } catch ( Exception e ) { Logging . WriteError ( "HunterBeastmasterSettings > Load(): " + e ); } return false ; So it would first push the lua after it had loaded the settings, but that did not work. apparently i can't make an if there. Any help would be appreciated. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/6855-can-we-use-savedvariables/?&page=2 TITLE: Can we use savedVariables? ---------------------------------------------------------------------------------------------------- Unknown So yeah, another problem. The CurrentSetting.PushToLua(); Overwrites the settings and sets everything to what default is, because it loads the settings before it does FetchFromLua. I tried doing try { if ( File . Exists ( AdviserFilePathAndName ( "CustomClass-HunterBeastmaster" , ObjectManager . Me . Name + "." + Usefuls . RealmName ))) { CurrentSetting = Load & lt ; HunterBeastmasterSettings & gt ;( AdviserFilePathAndName ( "CustomClass-HunterBeastmaster" , ObjectManager . Me . Name + "." + Usefuls . RealmName )); if ( Updateloaded ) { CurrentSetting . PushToLua (); } return true ; } CurrentSetting = new HunterBeastmasterSettings (); } catch ( Exception e ) { Logging . WriteError ( "HunterBeastmasterSettings > Load(): " + e ); } return false ; So it would first push the lua after it had loaded the settings, but that did not work. apparently i can't make an if there. Any help would be appreciated. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/7513-lua-retval-int/ TITLE: LUA retval INT ---------------------------------------------------------------------------------------------------- Unknown Hello everybody, im new here and im trying to convert my LUA Fightclasses in the right way to make it work with the Bot Core. function isFrencyStack5 () luacode = "francymax = 0; for i=1,40 do local _,_,_,c,_,_,_,_,_,_,s = UnitAura('player',i); if s==19615 and c==5 then francymax = 1 break end end" if tonumber ( WowLuaDoLocalizedString ( luacode , 'francymax' ))== 1 then return true else return false end end How do you guys inject that string code and get a retval to get that function to work? Greez  Galvanar ---------------------------------------- BetterSister ObjectManager.Me.BuffStack(12345) >= 5 ---------------------------------------- Unknown | 2017-11-01T11:41:27Z tonumber ( WowLuaDoLocalizedString ( luacode , 'francymax' ))== 1 then To Lua . DoString ( luacode , "francymax" ) == 1 then Since you are just looking for a boolean you also could make it like this function isFrencyStack5 () luacode = "francymax = 0; for i=1,40 do local _,_,_,c,_,_,_,_,_,_,s = UnitAura('player',i); if s==19615 and c==5 then francymax = 1 break end end" return Lua . DoString ( luacode , "francymax" ) == 1 ; // Or as bool since its 0 or 1 return Lua . DoString ( luacode , "francymax" ); end Edited November 1, 2017 by iMod ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/7522-avoid-falling-damage/ TITLE: avoid falling damage ---------------------------------------------------------------------------------------------------- Unknown Some classes has spells to avoid falling damage. For example, priest has "Levitate". Problem is to detect when this spell required 1) declare global LUA variable in additional C# code string fallTime=Lua.LuaDoString("fallTime=nil","fallTime"); 2) add spell "Levitate", with options: Can move during cast = Yes; Cast if mounted = true; Cast spell on = player; Combat only = false 3) add conditions for this spell: - Buff (Name=Levitate, Need=false) - Lua script, with return var "falling" and return value research "ok" falling="no" if(IsFalling()) then if (fallTime==nil) then fallTime=GetTime() elseif (GetTime()-fallTime>=1) then falling="ok" end else fallTime=nil end Thats all. When priest falls more than 1 second, bot automatically buffs him. Now you can queue Arathi Basin and go def LM But not all Spoiler Other classes has chance too. Go to Gatzetdan and buy a lot of Noggenfogger Elixir . And now is time to hack it 1) first step is the same 2) Instead "Levitate" add LUA code, with the same options and timer=3000 UseItemByName("Noggenfogger Elixir") 3) Use the same conditions, and 1 more. This is LUA script with return var "need" and return value research "y": need="y" for i=1,40 do local n,_,_,_,_,_,x,_,_,_,id=UnitBuff("player",i) if n and id==16593 and x>1 then need="n" fallTime=nil break end end Now you have 33% chance to survive. Or acquare strange look. Or both ---------------------------------------- y2krazy ObjectManager.Me.IsFalling ObjectManager.Me.IsFallingFar ---------------------------------------- Unknown It would be nice to have C# conditions in fight class editor, but for now there is only LUA. Of course, in C# fight class ObjectManager.Me.IsFallingFar is the best choice ---------------------------------------- y2krazy You can use C# with the condition name "C Sharp Code" ---------------------------------------- Unknown Indeed. So, no need for 1), and for 3) C# conditions are ObjectManager.Me.IsFallingFar && !Me.HaveBuff("Levitate") // for levitate or some other levitate spells/trinkets ObjectManager.Me.BuffTimeLeft(new List {16593}) < 1000 // for Noggenfogger Elixir ---------------------------------------- Unknown tested: IsFallingFar triggers too fast. Bot uses spell almost immediately (and dismount). So, solution with ~1 second delay after fall start is better ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/7729-global-lua-api/ TITLE: Global Lua API ---------------------------------------------------------------------------------------------------- Unknown Hey yall Anyone knows if there is a link to the global lua api for any wow versions? A document where all the global functions are in. i.e. The game has the function UnitRace() or the function IsSpellKnown Reason i want to find this is because i want to add some of these functions added to the gamer after 2.4.3 into my fight class. I have already added some of those that i could figure out how were made like: print, UnitBuffName, cdRemains, IsSpellUsable etc. But i can not for the life of me guess what the code is for IsSpellKnown. I need to have this function in order to be able to use spell id's instead of spell names (thereby making it possible to make my fightclass multi-language supported). Does the WRobot api have a way to determine spell by ID instead of name? Would be easy if i only needed to be level 70 spells. But if i want to make it available for leveling, i'd need a way to check if a spell is known. Example: public Spell SerpentSting = new Spell("Serpent Sting"); If i wanted to add this as a spell ID then i could do this in Lua: SerpentSting = "false" if SpellIsKnown(27016) then -- Rank 10 SerpentSting = 27016 elseif SpellIsKnown(25295) then -- Rank 9 SerpentSting = 25295 end if not SerpentSting == "false" then CastSpellByName (GetSpellInfo(SerpentSting) end With this i can define spellname id based on what rank you have available. :) ---------------------------------------- Unknown IsSpellKnown is super easy. Just call GetSpellInfo("spellName") It will only give you shit from your spell book. Or here's my vanilla implementation: public bool IsKnown () { //not a great runtime solution, but spellbook should get updated on newly learned spells //this SHOULD check if we have the rank available string luaString = @ " local i = 1 while true do local spellName , spellRank = GetSpellName ( i , BOOKTYPE_SPELL ); if not spellName then break ; end -- use spellName and spellRank here if ( spellName == "" { 0 } "" and spellRank == "" Rank { 1 } "" ) then -- DEFAULT_CHAT_FRAME : AddMessage ( spellName .. '(' .. spellRank .. ')' ); return true ; end i = i + 1 ; end return false ; "; return Lua . LuaDoString ( string . Format ( luaString , Name , GetRank ())); } ---------------------------------------- Unknown | 2017-11-19T17:25:16Z Yeah, but the problem is that you can do GetSpellInfo and get the info on a spell even if you don't know the spell. Edited November 19, 2017 by Ordush ---------------------------------------- Unknown Not in TBC it doesn't. If you use the name, NOT THE ID, then it will ONLY return info if you have it in your spell book. I've been using this for months... ---------------------------------------- Unknown | 2017-11-19T17:45:24Z Yeah, and that takes me nowhere, when i want to make my fightclase multi-language. :) My point was exactly that i wanted to use ID instead of name, so that example french players don't have to use English client. :) try and check id 1234, just an example. :) But thank you for the tip mate! :) Edited November 19, 2017 by Ordush ---------------------------------------- Ordush So basically: return GetSpellInfo ( GetSpelInfo ( 1234 )) ~= nil ; get name by id, then use name to check if it's in spell book... ---------------------------------------- Unknown LOL Doh... Why did i not think of that? Thank you mate! much appreciated! <3 ---------------------------------------- @Matenia @Matenia I figured why this method doesn't work well. It sure does work cross language, but you won't be able to rank check with this. If you have rank 1 of an ability, it will never do nil no matter what ID you use, be it rank 1 or rank 5 of a spell. Reason this has a consequence: Say i want it to buy mats for buffs. Then i won't be able to specify what mats to buy based on what rank is available. I could go the long way and check what rank the player has as max (which this will always post if it's not nil). Then set to nil if the known rank (google) for a spell does not mach the rank of the players spell. However, it would be a lot easier if i had the wow api function from wotlk+. So if anyone knows a way to get the functions from the wow api. (the whole code) please let me know. :) ---------------------------------------- Unknown So you are wanting to input a spell id and return the max rank of that spell if it isknown or nil if it is not known...am i understanding correctly? ---------------------------------------- Unknown | 2017-11-20T16:17:44Z I want to input spell id, then i want it to return true if the player has that spell and nil if the player doesn't. If you do GetSpellInfo("AnyID") it will always just post the info in that table no matter if you know the spell or not. If you do GetSpellInfo(GetSpellInfo("AnyID")) then IF you know the spell (no matter what rank you have) it will post the table for the highest rank of the spell that spell in your spellbook. (Because you basicly search for name instead of ID). What is to check SpellID if player has that spell WITH the rank that follows with the ID then return true else return nil, even if it has the Spell but in a lower rank. Hope it makes sense. :) So in short, not the max rank the player has, that's easy just do GetSpellInfo(GetSpellInfo("AnyID")) I want to check for the rank that comes with the ID. Edited November 20, 2017 by Ordush ---------------------------------------- Unknown So you simply want a function like this if (HasSpell(56342)) { //dosomething ---------------------------------------- Unknown Here is EXACTLY what i want to do using my old PQR shadow priest (WOTLK) example. :) -- Prayer of Fortitude local POFortitude = false local POFMat = false -- Rank 4 if IsSpellKnown ( 48162 ) then POFortitude = 48162 POFMat = "DevoutCandles" -- Rank 3 elseif IsSpellKnown ( 25392 ) then POFortitude = 25392 POFMat = "SacredCandles" -- Rank 2 elseif IsSpellKnown ( 21564 ) then POFortitude = 21564 POFMat = "SacredCandles" -- Rank 1 elseif IsSpellKnown ( 21562 ) then POFortitude = 21562 POFMat = "HolyCandles" end So i want to check if the player has a spell in a certain rank by ID As you can see here: If the player doesn't have Prayer of Fortitude at all, it will make POFortitude false If the player does have Prayer of Fortitude rank 2 it will make POFortitude that rank Then later when i tell it to cast spell by ID (I cast by ID to make it multi-lang). It will check the bag if it has mat based on POFMat >5 (So it only casts prayer if it has more than 5 mats). ---------------------------------------- Unknown now i understand give me a second ---------------------------------------- Unknown public bool HasSpellId(int spellId) { return SpellManager.SpellBook().Any(spell => spell.Id == spellId); } The smart way to do this is make an array of the shit u wanna check and checkit onload and whatever is to add it to a new array and use that new array for what u need to do to minimize the loop thi does, then register an lua event ontrained spell(w/e the name is) and anytime it called update ur local array ---------------------------------------- Unknown Awesome mate, so it checks the spellbook if it has a spell with given spellid. But this is in C#. Is there any way to do this in Lua? (My druid is not made in CS): =/ I know it can be done in Lua, because blizzard themselves implemented it in WOTLK with the IsSpellKnown Function Which is the one i'm trying to get. :) ---------------------------------------- Unknown | 2017-11-20T16:43:46Z Spell spellName = new Spell ( NameOrID ); if ( spellName . KnownSpell ()) { // Do something.... } Edited November 20, 2017 by iMod ---------------------------------------- Unknown Oh didnt know u needed it in lua um let me lookup the api on that if i can do it in vanilla i can do it in tbc im sure ---------------------------------------- Unknown would it help u any if i could return the name and rank of only known spells? ---------------------------------------- Unknown Hehe, that's what i wrote above. Also easy local name, rank = GetSpellInfo("spellID") The thing is, i'm a pretty advanced Lua programmer, but the IsSpellKnown is function is what is tricking me. I could make it myself and manually add every spellid, then compare the given rank by ID with rank from GetSpellInfo. This will take ages, which is why i'm trying to find out how Blizz did it. :) ---------------------------------------- Unknown No i mean i can simply return u a table containing only "known" spell ranks and names but not the id ---------------------------------------- Unknown Hmm, i guess i could do that to compare the content with the spell id with a foreach, but that would mean i'd have to assign a rank to all id's which is the same problem as before :/ ---------------------------------------- Unknown What are u doing by the way executing an entire lua script in c# in a loop? ---------------------------------------- Unknown Well, not exactly. :) Some of it is looped, if it needs to be. Where others aren't. :) ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/9836-can-not-get-lua-hearthstone-to-work/ TITLE: Can not get LUA Hearthstone to work ---------------------------------------------------------------------------------------------------- Unknown Hey guys, I've found some old code in the forum and tried to bring it back to life. Unfortunately this is my first experience with lua. var bindLocation = Lua . LuaDoString ( "hearth=GetBindLocation();" , "hearth" ); var position = new Vector3 ( -407.123 f , 1633.99 f , -4439.37 f , 15.43328 ); int npcEntryId = 6929 ; while ( bindLocation != "Orgrimmar" ) { wManager . Wow . Bot . Tasks . GoToTask . ToPositionAndIntecractWithNpc ( position , npcEntryId ); Lua . LuaDoString ( "GossipTitleButton1:Click();" ); Lua . RunMacroText ( "/click StaticPopup1Button1" ); } I get this lua error: http://prntscr.com/kai2uj Probably a simple thing that I am just overlooking. Appreciate any help. Greetings ---------------------------------------- Bambo https://wrobot.eu/forums/topic/5764-hearthstone-for-multi-language/?page=0#comment-26212 ---------------------------------------- Unknown I know this thread already. As I stated. My Lua knowledge is very limited for now. I wanna fix the syntax of the code posted above. Or is it completely wrong and will not work? Thanks for sending the link anyway. ---------------------------------------- Bambo I'm trying to point out where you need to put return at. ---------------------------------------- Unknown Will try out, immediately. ---------------------------------------- Unknown Now I dont get the error anymore, ty. Still doesn't work at all though xD just skips to next pulse var bindLocation = Lua . LuaDoString ( "hearth=GetBindLocation(); return bindLocation;" , "hearth" ); var position = new Vector3 ( -407.123 f , 1633.99 f , -4439.37 f , 15.43328 ); int npcEntryId = 6929 ; while ( bindLocation != "Orgrimmar" ) { wManager . Wow . Bot . Tasks . GoToTask . ToPositionAndIntecractWithNpc ( position , npcEntryId ); Lua . LuaDoString ( "GossipTitleButton1:Click();" ); Lua . RunMacroText ( "/click StaticPopup1Button1" ); } Thanks alot for the help. ---------------------------------------- Bambo Delete bindlocation; ", " You need it to be return hearth;" ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/9842-how-do-i-get-into-lua/ TITLE: How do i get into lua ---------------------------------------------------------------------------------------------------- Unknown where do I start with lua? I have a rogue and I wish to look cleaner like apply poisins, vanish at 20 percent reset from fight then regen, and range pulling certain targets with melee classes that have range weapons. SHOW ME THE WAY COMMANDER. SOMEONE BE THE COMMANDER O.O ---------------------------------------- Unknown I Know for sure the way to try harding in botting is knowing lua programming and that's the best way to make it somewhat more lifelike and have more features than the base purchase bot you make. ---------------------------------------- Unknown Hello, about how to apply poisons search on the forum and look existing fightclasses, about change regen system in BG you need good programming skill and you need to know WRobot API. ---------------------------------------- Unknown Can also be modified to use Regeneration in Battlegrounder. For things like vanishing in combat and staying in stealth to regen you need C# to subscribe to fight events and block the bot's main thread to stop it from engaging in combat (really advanced - better start slow). ---------------------------------------- Unknown where can I start at? any suggestions? anything would be much appreciated. ok I get it now. I am looking into C# now ---------------------------------------- Unknown Look at the other fightclasses and check for simple numbers at first near spells names to get an idea of what it's doing. eg. Most fight classes will have ObjectManager.Me.HealthPercent which is a check to see if your health is greater or less than a certain threshold. "If health less than 70%, cast renew" Start tweaking numbers to change what percentage what spells trigger, if you don't want it to do a spell, comment it out by placing '//' infront of the lines of code. if ( RaptorStrike . KnownSpell && ObjectManager . Target . GetDistance < 8 ) { RaptorStrike . Launch (); } change to if ( RaptorStrike . KnownSpell && ObjectManager . Target . GetDistance < 8 ) { //RaptorStrike.Launch(); } Here's a more complex line that is almost human readable, hopefully the fightclasses you download were written well: if ( ObjectManager . Me . HealthPercent <= 40 && FlashHeal . KnownSpell && ! ObjectManager . Me . HaveBuff ( "Shadowform" ) && ObjectManager . Me . ManaPercentage > 15 ) { FlashHeal . Launch (); } "If my health is less than 40% and I know flash heal, I'm not in shadowform (the ! means inverse) and I have some mana" ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/1435-can-you-tell-me-why-this-isnt-working/ TITLE: Can you tell me why this isnt working? ---------------------------------------------------------------------------------------------------- Unknown Remember Im a novice at LUA. So please give me a detailed explanation so I can learn more. See Im still not sure how to through code together. So im finding other code and editing it to see if I can make it work for what im wanting to do. This is going to be a Disease Manager for DKs. Once the Disease get to 3 sec left of its target debuff then the DK will recast the move according to the disease to reapply it. if not (UnitIsDead("target")) and not (IsFlying("player")) and not (IsResting("player")) and not (UnitIsAFK("player")) then --[[ refresh the Diseases on the target if there are less then 3 sec left (to be sure that it dont run out while a fight ]] local timeLeftToCastAgain = 3; local idDiseases={59879,59921} --[[             Blood Plague,Frost Fever ]] idDiseases[1]={59879,59921} --[[             Outbreak,Plague Strike ]] idDiseases[2]={77575,45462} --[[             Outbreak,Icy Touch ]] idDiseases[3]={77575,45477} local now=GetTime(); for i=("1,2"),#idDiseases do local spell=""; local DiseaseFound=() for j=1,#idDiseases do spellname=GetSpellInfo(idDiseases [j]) local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = UnitBuff("target",spellname); if (name==spellname) then local expireTimeLeft = expirationTime-now; DiseasesFound=idDiseases [j] if (expireTimeLeft < timeLeftToCastAgain) then if (IsUsableSpell(spellname)) then local start, duration, enable = GetSpellCooldown(spellname) if (duration==3) then CastSpellByName(spellname); spell=spellname; end end end break; end end if (DiseasesFound==0) then for j=("1,2"),#idDeases do local spellname=GetSpellInfo(idDeases [j]) if (IsUsableSpell(spellname)) then local start, duration, enable = GetSpellCooldown(spellname) if (duration==0) then CastSpellByName(spellname); spell=spellname; break; end end end end if not (spell=="") then print("Diseases: "..spell) result=true break; end end end result=(diseased>0) ---------------------------------------- Bear T.O.E. local DiseasesFound = 0; if not (UnitIsDead("target")) and not (IsFlying("player")) and not (IsResting("player")) and not (UnitIsAFK("player")) then --[[ refresh the Diseases on the target if there are less then 3 sec left (to be sure that it dont run out while a fight ]] local timeLeftToCastAgain = 3; local idDiseases={59879,59921} --[[ Blood Plague,Frost Fever ]] idDiseases[1]={59879,59921} --[[ Outbreak,Plague Strike ]] idDiseases[2]={77575,45462} --[[ Outbreak,Icy Touch ]] idDiseases[3]={77575,45477} local now=GetTime(); for i=1,3,1 do local spell=""; --[[local DiseaseFound=() NOT USED ]] for j=1,2,1 do spellname=GetSpellInfo(idDiseases[i][j]) local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = UnitBuff("target",spellname); if (name==spellname) then local expireTimeLeft = expirationTime-now; DiseasesFound=idDiseases[i][j] if (expireTimeLeft < timeLeftToCastAgain) then if (IsUsableSpell(spellname)) then local start, duration, enable = GetSpellCooldown(spellname) if (duration==3) then CastSpellByName(spellname); spell=spellname; end end end break; end end if (DiseasesFound==0) then for j=1,2,1 do local spellname=GetSpellInfo(idDiseases[i][j]) if (IsUsableSpell(spellname)) then local start, duration, enable = GetSpellCooldown(spellname) if (duration==0) then CastSpellByName(spellname); spell=spellname; break; end end end end if not (spell=="") then print("Diseases: "..spell) result=true break; end end end result=(DiseasesFound>0) --[[ replace result=(diseased>0)]] Try it ---------------------------------------- Droidz Im going to try this today. And TY for the help. Ill edit this post to let you know if it is working. ---------------------------------------- Unknown Well it seems to work right Im doing some extended teasting. So I will be bck again if I find out it isnt working in the manner Im needing it to. ---------------------------------------- Unknown OK Driodz is not casting Plague Strike to put Blood Plague on the target. Its not doing (1,2,1 do) meaning that --[[ Outbreak , Plague Strike ]] idDiseases [ 2 ]={ 77575 , 45462 } Isnt being used for some reason or kept up on the target. But --[[ Outbreak , Icy Touch ]] idDiseases [ 3 ]={ 77575 , 45477 } Is being kept up on the target. is there a reason why bot spells aren't being fires consecutively??? to keep the debuffs up on the target? ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/1473-how-do-i-make-a-fightclasses-into-c-code-scripting/ TITLE: How do I make a Fightclasses into C code Scripting? ---------------------------------------------------------------------------------------------------- Unknown I am wondering how to make any fightclass into C Code Scripting so I can Program them a lot easier. And is there a way to Make C code Fightclasses into LUA Scripting? ---------------------------------------- Bear T.O.E. Hello, You cannot use C but you can use C#.net or VB.net for code FightClass. You can found sample here: For use lua, you need to use Lua.LuaDoString("COMMAND", "VAR WITH RETURN VALUE"): string money = Lua.LuaDoString("money = GetMoney()", "money"); For an best sample of  fightclass you can look this code: Tnb_CombatClass.zip (it is thenoobbot fightclass, no wrobot, but code is similary). ---------------------------------------- Unknown Thanks Driodz. ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/1483-totem-manager/ TITLE: Totem manager?? ---------------------------------------------------------------------------------------------------- Unknown Ok I just through this together Im not sure if it will work can someone look at this code and tell if there is something wrong with it. I need it to check for Fire Elemental totem and Not cast if this totem is up. Im not sure how to do that. Then I can edit it to do the same thing for Magma totem. I also need this one to recast after it have run for almost a minute, say at 10 second left on the timer. if (GetUnitSpeed("player") == 0) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player")) and not (UnitAffectingCombat("player")) and not (IsMounted())  and not (IsFlying())  and not (IsFalling())  and not (IsResting())  and not (UnitIsAFK("player")) then local timeLeftToCastAgain = 10*60; local idTotem={3599} --[[             Searing Totem ]] idTotem[1]={3599} local now=GetTime(10); for i=1,#idTotem do local TotemFound=0 spellname=GetSpellInfo(idTotem ) local haveTotem, totemName, startTime, duration = GetTotemInfo(1); if (haveTotem) then local expireTimeLeft = expirationTime-now; TotemFound=idTotem if (expireTimeLeft < timeLeftToCastAgain) then if (IsUsableSpell(spellname)) then local start, duration, enable = GetSpellCooldown(spellname) if (duration==0) then CastSpellByName(spellname); spell=spellname; end end end break; end end ---------------------------------------- Unknown Hi, I cannot test but try this code I have correct some errors. if (GetUnitSpeed("player") == 0) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player")) and not (UnitAffectingCombat("player")) and not (IsMounted()) and not (IsFlying()) and not (IsFalling()) and not (IsResting()) and not (UnitIsAFK("player")) then local timeLeftToCastAgain = 10*60; --[[ Searing Totem ]] local idTotem={3599} for i=1,#idTotem do local spellname=GetSpellInfo(idTotem[i]) for totemIndex=1,4 do local haveTotem, totemName, startTime, duration = GetTotemInfo(totemIndex); if (haveTotem and spellname == totemName) then local timeLeft = startTime+duration-GetTime(); if (timeLeft < timeLeftToCastAgain) then if (IsUsableSpell(spellname)) then local start, duration, enable = GetSpellCooldown(spellname) if (duration==0) then CastSpellByName(spellname); end end end break; end end end end ---------------------------------------- Unknown Ok so is this how I get it to fire??? with the research needed? if (GetUnitSpeed("player") == 0) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player")) and not (UnitAffectingCombat("player")) and not (IsMounted()) and not (IsFlying()) and not (IsFalling()) and not (IsResting()) and not (UnitIsAFK("player")) then local timeLeftToCastAgain = 10*60; --[[ Searing Totem ]] local idTotem={3599} for i=1,#idTotem do local spellname=GetSpellInfo(idTotem[i]) for totemIndex=1,4 do local haveTotem, totemName, startTime, duration = GetTotemInfo(totemIndex); if (haveTotem and spellname == totemName) then local timeLeft = startTime+duration-GetTime(); if (timeLeft < timeLeftToCastAgain) then if (IsUsableSpell(spellname)) then local start, duration, enable = GetSpellCooldown(spellname) if (duration==0) then CastSpellByName(spellname); end end end break; end end end end result = (HaveTotem = 0) ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/1511-holy-power/ TITLE: Holy Power ---------------------------------------------------------------------------------------------------- Unknown Ok check this out... I haven't tested it but I think shit will cause Inquisition to fire if its buff is ( Not there = 0 ) and or at full power 5 stacks. name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, spellId = UnitBuff("player","SPELL_POWER_HOLY_POWER = 5"); GetTime(Inquisition = "0, 30"); if (Inquisition <= 30) then retV = "1";else retV = "0";end If not please fix and tell me why this wont work. Also if the small code doesn't work then what about this one. if (GetUnitSpeed("player") == 0) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player")) and not (UnitAffectingCombat("player")) and not (IsMounted())  and not (IsFlying())  and not (IsFalling())  and not (IsResting())  and not (UnitIsAFK("player")) then local timeLeftToCastAgain = 30*120; --[[             Inquisition ]] local idspell={84936} for i=1,#idspell do local spellname=GetSpellInfo(idspell ) for spellIndex=1,4 do local havespell, spellName, startTime, duration = GetspellInfo(spellIndex); if (havespell and spellname == spellName) then local timeLeft = startTime+duration-GetTime(); if (timeLeft < timeLeftToCastAgain); minModifier = GetSpellBonusDamage(2) then if (IsUsableSpell(spellname)) then local start, duration, enable = GetSpellCooldown(spellname) if (duration==30) then CastSpellByName(spellname); end end end break; end end end end result =( Holy_Power > 5 ) ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/1522-brewmaster-statue-help/ TITLE: BrewMaster Statue Help...... ---------------------------------------------------------------------------------------------------- Unknown Ok so I'm trying to figure out how to do this in a LUA Script. /cast Summon Black Ox Statue /tar Summon Black Ox Statue /cast Provoke /targetlasttarget This macro is what Im trying to do with LUA Scripting. And I have no idea how to start this off cause of the Targeting stuff..... HELP!!!! ---------------------------------------- Unknown Hello, You can use http://www.wowwiki.com/API_RunMacroText: RunMacroText("/cast Summon Black Ox Statue") RunMacroText("/tar Summon Black Ox Statue") RunMacroText("/cast Provoke") RunMacroText("/targetlasttarget") Or use full lua code: CastSpellByName("Summon Black Ox Statue") RunMacroText("/tar Summon Black Ox Statue") CastSpellByName("Provoke") TargetLastTarget() ps: I think you need to use RunMacroText("/tar Black Ox Statue") not RunMacroText("/tar Summon Black Ox Statue") ---------------------------------------- Unknown Right now I am running this code in my Fight Class. But Im looking to reduce the amount of actual stings the fight class is to execute so that the fight class will react faster to maximize the rotation and DPS. I have found that to many items in the fight classes move list will slow down the characters reaction time on health based or other power based moves that need to be cast out side the rotation. So reducing the number of strings in the list is more effective to the total DPS of healing done. That is how I have been making my good and okay fight classes that I have released. Hence why Im wanting to make a LUA Script to have this done in one more on the fight classes list of moves to fire. Summon Black OX Statue IsSpellUsable Summon Black OX Statue true TargetDistance SmallerOrEqual 40 HaveTarget true HostileUnitNear 1 SmallerOrEqual 8 34 30000 true RunMacroText("/tar Black Ox Statue") HostileUnitNear 1 SmallerOrEqual 8 33 30000 Provoke TargetDistance SmallerOrEqual 40 32 30000 RunMacroText("/targetlasttarget") HaveTarget true TargetDistance SmallerOrEqual 40 31 30000 ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/1685-alternate-to-buff-condition/ TITLE: Alternate to buff condition ---------------------------------------------------------------------------------------------------- Unknown Sometimes buff checks don't work (Crimson Scourge for Blood DKs and Dream of Cenarious for Druids). Here is a workaround that fixes that.. Instead of using a buff condition, use LUA script. name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId= UnitAura("player", "BUFF_NAME");retV = count; Return value var needs to be retV and return value research needs to be 1. Simple as that. ---------------------------------------- Unknown discupe my question, but could you give me an example of how serious a skill ? That is, a "Alternate to buff" Functional ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/1695-spell-charges/ TITLE: Spell Charges ---------------------------------------------------------------------------------------------------- Droidz Working on the new Destruction Warlock fight class, I only wanted Conflagrate to fire if you had 2 charges saved up. Which got me doing some research, after about 15 minutes of finding work arounds, I found a much more simple way. currentCharges, maxCharges, cooldownStart, cooldownDuration = GetSpellCharges(spellId or "Conflagrate") Works perfect, currently haven't ran into any other times I'd want to use this, but it will definitely come in handy again. ---------------------------------------- Unknown can you help me out with this please: - as enh shaman, i want to cast only 1 Lava lash from 2, how can i achieve this? thanks ---------------------------------------- Unknown public string LastCast {get; set; } if (LastCast != "Lava Lash" ..... And put everywhere in your spells : LastCast = spell.name; ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/2088-select-from-a-list-of-targets/ TITLE: Select from a list of targets ---------------------------------------------------------------------------------------------------- Unknown Since Droidz did such a fabulous job in helping me put together a healing profile that would heal my bodyguard (/focus), I was wondering if anyone knew a way to select from a list of "possible" targets and set the one it found to the focus? Here is what I am striving for: if exists (Aeda Brightdawn, Defender Illona, Delvar Ironfist, Leorajh, Talonpriest Ishaal, Tormmok, Vivianne) Set Focus then /targetlasttarget As I do not know programming, I thought I would post my thought here and see if anyone knows a way to do this? Thanks! ---------------------------------------- Unknown Better is, to use the npcid instead of name, because not all use an english client ---------------------------------------- Unknown Hello, When Bugreporter have say, you cannot share your fightclass because you use unit and spell name (this don't works on wow french client by sample). local npcFollowers={"Aeda Brightdawn", "Defender Illona", "Delvar Ironfist", "Leorajh", "Talonpriest Ishaal", "Tormmok", "Vivianne"} for key,value in pairs(npcFollowers) do RunMacroText("/target " .. value) local targetName = UnitName("target") if targetName == value then CastSpellByName("Flash of Light" , "TARGET") TargetLastTarget() return end end You can also try this code (but not safe): local targetName = UnitName("target") TargetNearestFriend() local targetNameSecond = UnitName("target") if not (targetName == targetNameSecond) then CastSpellByName("Flash of Light" , "TARGET") TargetLastTarget() end ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/2095-iron-trap-how-to-use-it/ TITLE: Iron Trap (How to use it) ---------------------------------------------------------------------------------------------------- Droidz It works fine in wrotation, but not in grinder, because the mobs mostly doesn't stand still in the trap (i.e. Talbuks) You need the barn in your Garrison It's optional and off by default You need to add the ID of the mobs you want to catch to the Variable KillBeast. ( wowhead.com and the Development tools/Target Info will help) This  code enable the Iron Trap in your Fightclass. Happy farming --Iron Trap LuaScript local function UseContainerItemByName(search) --[[ needed below ]] local found=nil; for bag = 0,4 do for slot = 1,GetContainerNumSlots(bag) do local item = GetContainerItemLink(bag,slot) if (item and item:find(search)) then if (GetContainerItemCooldown(bag,slot)==0) then UseContainerItem(bag,slot) found=1; end end end end return found; end if not (IsStealthed()) and UnitExists("target") and not UnitIsFriend("player", "target") then local guid=UnitGUID("target"); local type, zero, serverId, instanceId, zoneId, npcId, spawnUid = strsplit("-",guid); npcId=tonumber(npcId); --[[ Add your Mob-IDs to the list ]] local KillBeast="87021,87020" --[[ list of ID's of Mobs to trap, comma seperated ]] local maxHealth=95; --[[ start Trap at 95% of health for non-elite Mobs ]] if (UnitClassification("target") == "elite") then maxHealth=55 --[[ start Trap at 55% of health if it is an Elite Mob ]] end if not (UnitIsPVP("target")) and ((UnitHealth("target") / UnitHealthMax("target") * 100) < maxHealth ) and (string.find(','..KillBeast..',',','..npcId..',')) then if (UnitName("player")==UnitName("targettarget")) then --[[ no Ninjaing, my Mob, my target, my trap ]] result=true if not (UseContainerItemByName(":115010:")) then --[[ Level 3 Trap must be equiped and ready]] if not (UseContainerItemByName(":115009:")) then --[[ Level 2 Trap .. ]] if not (UseContainerItemByName(":113991:")) then --[[ Level 1 Trap .. ]] result=false end end end else --[[ the fight is over, or another User Fight to them ]] ClearTarget(); end end end result true 99 false false true true ---------------------------------------- Unknown hi, thanks for the code! can you tell me where i need to copy it? thanks you! ---------------------------------------- Unknown Into your xml FightClass. ---------------------------------------- Unknown i wanna Breezestrider Talbuk but i cant figure id out. where is it? http://www.wowhead.com/npc=78278/breezestrider-talbuk#drops ---------------------------------------- Unknown Take a look at the URL , you posted: www.wowhead.com/npc= 78278/.... ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/2834-command-to-party-by-party-chat/ TITLE: Command to party By Party Chat ---------------------------------------------------------------------------------------------------- Unknown Hello how can i make a spell run after Party1 say "TEXT01" in party chat this action run spell Thanks ---------------------------------------- Unknown this would be useful for using hearthstone etc ---------------------------------------- Unknown for example yes Garisson abilty Healing Macro etc ---------------------------------------- saleh Hello, http://wrobot.eu/files/file/650-party-chat-command/ ---------------------------------------- Unknown ohhhhh , Thanks Droidz you make my day :) ---------------------------------------- Unknown Can we add the Garison abilty :) small help to use the plugin :) ---------------------------------------- Unknown it's easy to edit the plugin after the base is done ---------------------------------------- Unknown ok , can you show me how to make a command to run /use Banner of Cooperation ---------------------------------------- saleh To add/edit commands, in "Plugins" tab, select "Party chat command.cs" and click on button "Settings for selected plugin" and: ---------------------------------------- Unknown Thankssssss ---------------------------------------- Unknown Please is there a command (C ) to Interact with NPC ? ---------------------------------------- Unknown I think you can use the interact method in c# ---------------------------------------- Unknown i try this code not work , ---------------------------------------- Unknown Hello, To interact with current target of party leader use csharp code: if ( wManager . Wow . Helpers . Party . IsInGroup ()) { wManager . Wow . Helpers . Interact . InteractGameObject ( new wManager . Wow . ObjectManager . WoWPlayer ( wManager . Wow . ObjectManager . ObjectManager . GetObjectByGuid ( wManager . Wow . Helpers . Party . GetPartyLeaderGUIDHomeAndInstance ()). GetBaseAddress ). TargetObject . GetBaseAddress ); } To interact with nearest npc: if ( wManager . Wow . Helpers . Party . IsInGroup ()) { wManager . Wow . Helpers . Interact . InteractGameObject ( wManager . Wow . ObjectManager . ObjectManager . GetNearestWoWUnit ( wManager . Wow . ObjectManager . ObjectManager . GetObjectWoWUnit ()). GetBaseAddress ); } ---------------------------------------- Unknown doens't work for me on wotlk. None of my bots in party do anything when i say any command that is configurated like "gohome", "pause" ---------------------------------------- Unknown I have tested the two codes and this works on wotlk. ---------------------------------------- Unknown nothing works for me not even the custom codes :/ probably doing something wrong ---------------------------------------- Unknown Does it have to be enabled on the player that says commands to other bots? ---------------------------------------- Unknown Umm... my main character that yells commands won't make bots do anything but character that has the plugin on can control other bots ---------------------------------------- Unknown i test the code and it work ---------------------------------------- Unknown Try having bot in party and nonbot character tells commands. Doesn't work for me atleast ---------------------------------------- Unknown hello i have a qustion about this plugin how can i use /w to give slave toon command not Party chat ? Thanks ---------------------------------------- saleh Edit "Party chat command.cs" with notepad and replace (line 35): ( int ) msg . Channel == 49 || msg . Channel == ChatTypeId . PARTY by msg . Channel == ChatTypeId . WHISPER ---------------------------------------- Unknown Thanks ---------------------------------------- Unknown How can i make the salve toon use a portal or collect healthstone or collect food  [Conjure Refreshment Table] ? Thanks ---------------------------------------- Unknown This is also not working for me on 3.3.5a. i tried the 2 custom commands and the gohome, stay, etc and nothing works at all. would be great if this did. ---------------------------------------- Unknown can you share the snsp shot or party comand setting file and which chat chanel you use it is for party chat /p ---------------------------------------- Unknown so i did what the directions said and put it in the plugin folder and it shows up in wrobot and its all default settings... shouldnt it work in party chat? do you have to set what channel its supposed to be in? ((int)msg.Channel == 49 || msg.Channel == ChatTypeId.PARTY)) this is in Party chat commands.cs I notice if i say it in party chat on one of the bots it works, but if i say it on my non bot wow it doesnt work. I have 4 bots making a dungeon grp with me and I'd like to be able to tell them to stop or pause while i go pull but if i have to switch over to a bot wow and say stop then, its kinda silly. EDIT: ok so if im not the party leader the chat commands work. so its something to do with the prefix in chat maybe? if i pass lead to a bot and say gohome all the bots hearth. glad we figured this out. ---------------------------------------- Unknown It is warmanes server related problem. Bot doesn't know how to read the party leader channel properly. I found the same issue a while back ---------------------------------------- dirtyjobs After "var msg = chat.ReadMsg();" (line 34) you can add this line: Logging . Write ( "Channel = " + (( int ) msg . Channel ) + " (message: " + msg . Msg + ")" ); (this line writte in log tab the channel number, when you get channel number, you can remplace 49 in "(int)msg.Channel == 49" by your channel number) ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/2834-command-to-party-by-party-chat/?&page=2 TITLE: Command to party By Party Chat ---------------------------------------------------------------------------------------------------- Unknown This is also not working for me on 3.3.5a. i tried the 2 custom commands and the gohome, stay, etc and nothing works at all. would be great if this did. ---------------------------------------- Unknown can you share the snsp shot or party comand setting file and which chat chanel you use it is for party chat /p ---------------------------------------- Unknown so i did what the directions said and put it in the plugin folder and it shows up in wrobot and its all default settings... shouldnt it work in party chat? do you have to set what channel its supposed to be in? ((int)msg.Channel == 49 || msg.Channel == ChatTypeId.PARTY)) this is in Party chat commands.cs I notice if i say it in party chat on one of the bots it works, but if i say it on my non bot wow it doesnt work. I have 4 bots making a dungeon grp with me and I'd like to be able to tell them to stop or pause while i go pull but if i have to switch over to a bot wow and say stop then, its kinda silly. EDIT: ok so if im not the party leader the chat commands work. so its something to do with the prefix in chat maybe? if i pass lead to a bot and say gohome all the bots hearth. glad we figured this out. ---------------------------------------- Unknown It is warmanes server related problem. Bot doesn't know how to read the party leader channel properly. I found the same issue a while back ---------------------------------------- dirtyjobs After "var msg = chat.ReadMsg();" (line 34) you can add this line: Logging . Write ( "Channel = " + (( int ) msg . Channel ) + " (message: " + msg . Msg + ")" ); (this line writte in log tab the channel number, when you get channel number, you can remplace 49 in "(int)msg.Channel == 49" by your channel number) ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/2869-lua-drink-function-request/ TITLE: Lua drink function (request) ---------------------------------------------------------------------------------------------------- Unknown Hello, I'm having issues with the Conjured Mana Strudel being spammed when the bot needs to drink, so I thought of a workaround in Lua, but unfortunately I'm very unfamiliar with Lua to put it into effect myself. My request here is that someone could write a short Lua code for 1) Use Conjured Mana Strudel 2) Sleep until a % of Mana is reached 3) Interrupt sleep if attacked This should be relatively simple(?). Thanks in advance. :) ---------------------------------------- Unknown Hello, can you send me screenshot of your current regen settings please. Do you use last WRobot version? ---------------------------------------- Unknown https://gyazo.com/403709f562648609d9f81fff52b0feea This here is what my food/drink settings look like. I use the latest WRobot version for private server. ---------------------------------------- BetterSister Ok, wait next update, problem is probably caused by your server (in official wow server, this item use buff http://www.wowhead.com/spell=167152/refreshment , private server seem use http://www.wowhead.com/spell=434/food and http://www.wowhead.com/spell=430/drink ) ---------------------------------------- ==================================================================================================== TOPIC: https://wrobot.eu/forums/topic/3028-fight-class-check-for-item-in-bag/ TITLE: [Fight Class] Check for Item in bag ---------------------------------------------------------------------------------------------------- Unknown I want to check if an item is in my bag (in this case Soul Chard ) and let the variable "ret" be setted to "true". This is the code I come up with: local itemID = 6265 ret = false for i = 0, NUM_BAG_SLOTS do for z = 1, GetContainerNumSlots(i) do if GetContainerItemID(i, z) == itemID then ret = true break end end end In the development tool it returns "true" if i got the item in back and false if I don't (like it should). But when I insert it as a LUA-condition into the fight class it always return false and will not use my spell How do I have to change my code? ---------------------------------------- dida1990 Hello, why not use http://wowwiki.wikia.com/wiki/API_GetItemCount like this: ret = GetItemCount(6265) > 0; You use it like this in your fightclass: ---------------------------------------- dida1990 You can also use condition "Item Count": ---------------------------------------- Unknown ah, nice :) and I did so much work, getting into bag and so on :D But thanks, it is working :) ---------------------------------------- ####################################################################################################