March 12, 201313 yr Can't figure out how to add a lua script to the ability list, the tip says "put the script lua in the spell name", is this a location of a .lua file? Or where would the lua script be?
March 12, 201313 yr Hi,I have moved your topic in help and support forum.And put the script, no the file path (not with "/" as you use in wow chat, it is full lua code) two samples:
March 12, 201313 yr Author ok, well, I am not sure I understand... Here is what I want to run... CastSpellByName("Misdirection"); SpellTargetUnit("pet"); Because I'm not sure how to set a target for a spell besides my main target... when I made that statement as the spell name, i got a big long half kanji error msg that I couldn't read. Does the LUA have to be an unsecured function? Another thing I'm trying to do is set a spell to do /PetAttack but only if the pet is not already attacking, here is the xml code (since it's maintenance, and I can't start up WRobot in edit only mode... <FightClassSpell> <SpellName>PetAttack()</SpellName> <FightClassConditions> <FightClassCondition> <ContionType>LuaScript</ContionType> <Param xsi:type="FightClassConditionLua"> <LuaScript>retValue = IsPetAttackActive()</LuaScript> <VarRet>retValue</VarRet> <ValueRet>False</ValueRet> </Param> </FightClassCondition> </FightClassConditions> <Priority>56</Priority> <NotSpellIsLuaScript>true</NotSpellIsLuaScript> </FightClassSpell> any advice on how I could make this work would be appreciated. I'm waiting for a bit more knowledge to release my FightClass's.
March 12, 201313 yr Try this code for Misdirection:ClearTarget(); CastSpellByName("Misdirection"); SpellTargetUnit("pet"); TargetLastTarget();IsPetAttackActive return bool and fight class read only string.You need to use this code:retValue = "False"; if IsPetAttackActive() then retValue = "True" end
March 12, 201313 yr Author I was under the impression that SpellTargetUnit(unit) was a way to set a unit as the target of the spell, without having to actually target it, kind of like when you click misdirection, it beings up a pointer that you can just click on the unit you want to misdirect to. As opposed to just SpellTarget(). The second part, what I was having a problem with was having PetAttack() as the spell name, i think, but it's hard to tell, cuz the error msg in debug was kanji. thanks for helping.
March 13, 201313 yr Author I tried the Misdirection code you posted, but it seems if I use a " in the spell name, I get a big ugly long error msg... I can post a log, but it basically looks like this[Error] 07:37 - Compilator Error : c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(177,19) : warning CS0436: The type 'HunterSettings' in 'c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs' conflicts with the imported type 'HunterSettings' in 'c:\Users\tonyd\AppData\Local\Temp\jzn5utd4.dll'. Using the type defined in 'c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs'. c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(51,63) : error CS1026: ) expected c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(51,66) : error CS1003: Syntax error, ',' expected c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(51,139) : error CS1003: Syntax error, ',' expected c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(51,139) : error CS1525: Invalid expression term ')' c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(51,140) : error CS1002: ; expected c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(51,140) : error CS1525: Invalid expression term ',' c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(51,141) : error CS1002: ; expected c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(51,141) : error CS1514: { expected c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(54,9) : error CS1525: Invalid expression term '}' c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(74,9) : warning CS0436: The type 'HunterSettings' in 'c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs' conflicts with the imported type 'HunterSettings' in 'c:\Users\tonyd\AppData\Local\Temp\jzn5utd4.dll'. Using the type defined in 'c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs'. c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(199,26) : warning CS0436: The type 'HunterSettings' in 'c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs' conflicts with the imported type 'HunterSettings' in 'c:\Users\tonyd\AppData\Local\Temp\jzn5utd4.dll'. Using the type defined in 'c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs'. c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs(203,34) : warning CS0436: The type 'HunterSettings' in 'c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs' conflicts with the imported type 'HunterSettings' in 'c:\Users\tonyd\AppData\Local\Temp\jzn5utd4.dll'. Using the type defined in 'c:\Users\tonyd\AppData\Local\Temp\zcc3x2i1.0.cs'.is there a way to escape the character? edit: used \ and escaped the "s, doesn't error out anymore, but now it stops after it successfully casts the misdirection...
March 13, 201313 yr Author Wow, that post got messed up. Anyways, I mostly hacked my way thru it, still seems inconsistent in the results, but I think i'll play with it for a bit. A few questions, tho are the spell conditions inclusive or exclusive? Like, AND or OR? In the lua script condition,can i use AND and OR in the "return value research"? Say If the script returns anything except 0 or nil i want it to activate.
March 14, 201313 yr Fightclass use "AND" for spell conditions. Yes I have fixed " problem for lua script. For the return value in lua you need to manage it in your script lua.
March 14, 201313 yr I have tried this code works fine for change target:ClearTarget(); TargetUnit("pet"); CastSpellByName("Misdirection"); TargetLastEnemy();(you can try lua script in: "General Settings" > "Others" tab > "Development Tools" (put lua script in textbox and launch script with button "Lua ..."
March 14, 201313 yr Author I have tried this code works fine for change target: ClearTarget(); TargetUnit("pet"); CastSpellByName("Misdirection"); TargetLastEnemy(); (you can try lua script in: "General Settings" > "Others" tab > "Development Tools" (put lua script in textbox and launch script with button "Lua ..." Got that working with just CastSpellByName("Misdirection"); SpellTargetUnit("pet"); it was just the "'s that were giving me errors earlier. Is there a way to make Conditions OR besides making 2 copies of the spell? Also, would it be possible to add a debugging type option, to make the log show decisions it made in a lot more detail? Would help a lot for troubleshooting profiles, cuz i'm having some difficulty figuring out why a few conditions are firing off irregularly.
March 14, 201313 yr For OR conditions there is no other solution than to make a spell copy (I don't view how I can add "OR" condition without adding difficulty for create fightclass). And I'll add debug mode in fightclass (I'll add more log in this mode). You can also convert your fightclass in C# for more flexibility (and debug).
Create an account or sign in to comment