gomisensei 11 Posted March 12, 2013 Share Posted March 12, 2013 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? Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/ Share on other sites More sharing options...
Droidz 2738 Posted March 12, 2013 Share Posted March 12, 2013 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: Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1279 Share on other sites More sharing options...
gomisensei 11 Posted March 12, 2013 Author Share Posted March 12, 2013 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. Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1289 Share on other sites More sharing options...
Droidz 2738 Posted March 12, 2013 Share Posted March 12, 2013 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 Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1290 Share on other sites More sharing options...
gomisensei 11 Posted March 12, 2013 Author Share Posted March 12, 2013 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. Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1291 Share on other sites More sharing options...
gomisensei 11 Posted March 13, 2013 Author Share Posted March 13, 2013 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... Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1345 Share on other sites More sharing options...
Loki 47 Posted March 13, 2013 Share Posted March 13, 2013 Add your full log as attachment please mate. Makes out job easier :) Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1347 Share on other sites More sharing options...
gomisensei 11 Posted March 13, 2013 Author Share Posted March 13, 2013 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. Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1348 Share on other sites More sharing options...
Droidz 2738 Posted March 13, 2013 Share Posted March 13, 2013 Update wrobot and say me if problem is fixed Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1350 Share on other sites More sharing options...
gomisensei 11 Posted March 13, 2013 Author Share Posted March 13, 2013 which problem, needing to escape the " ? Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1351 Share on other sites More sharing options...
Droidz 2738 Posted March 14, 2013 Share Posted March 14, 2013 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. Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1374 Share on other sites More sharing options...
Droidz 2738 Posted March 14, 2013 Share Posted March 14, 2013 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 ..." Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1375 Share on other sites More sharing options...
gomisensei 11 Posted March 14, 2013 Author Share Posted March 14, 2013 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. Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1377 Share on other sites More sharing options...
Droidz 2738 Posted March 14, 2013 Share Posted March 14, 2013 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). Link to comment https://wrobot.eu/forums/topic/193-fightclass-lua-script/#findComment-1392 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now