Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FightClass lua script...

Featured Replies

  • 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.

  • 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.

  • 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...

  • 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.

  • 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.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.