ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: vanzelus on January 04, 2014, 05:28:02 PM
-
Hi,
Am trying to implement the chivalry cure poison spell into a script that I currently run for my sampire; I only want to use this spell when my character is not in combat and is poisoned. Is this the correct way to write it?
IF ( G Notin #charstatus ) && ( C In #charstatus ) && ( #mana >= 10) && ( %cast_wait_timer <= #scnt2 )
{
Event Macro 15 201
Target 5s
Event Macro 23 0
Set %cast_wait_timer #scnt2 + 20
Repeat
Until C Notin #charstatus Or G in #charstatus
}
Return
Thanks for the inputs.
-
You don't need the parens () unless you're grouping multiple criteria together:
for example
IF G Notin #charstatus && C In #charstatus && ( #mana >= 10 || %cast_wait_timer <= #scnt2 )
This treats whatever is within the () as a single qualifier for IF.
X
-
You don't need the parens () unless you're grouping multiple criteria together:
for example
IF G Notin #charstatus && C In #charstatus && ( #mana >= 10 || %cast_wait_timer <= #scnt2 )
This treats whatever is within the () as a single qualifier for IF.
X
That || symbol you used, can that be used to change the last line in my snippet
Until C Notin #charstatus Or G In #charstatus
to
Until C Notin #charstatus || G In #charstatus
Does that still accomplish the purpose that the char only casts cure when out of combat and if a new mob spawns, he'll stop casting even if still poisoned and attack the mob? The char has protection on so am not accounting for failure due to poison interruption.
-
Something like this is how I'd go about it... The Repeat loop only loops what's BETWEEN the Repeat / Until which is nada.
Sub Cast_Cure
set %Cast_wait_timer #Scnt2 + 20
CAST:
If G Notin #charstatus && C In #charstatus && #mana >= 10 && %cast_wait_timer <= #scnt2
{
Event Macro 15 201
Target 5s
Event Macro 23 0
wait 10 ;--- Clean by Fire actually takes time to cure AFTER Targetting Adjust as needed....
goto CAST
}
Return
-
Let's not forget parenthesis influence in order of operations... Caution should be executed when throwing them around :>
-
That || symbol you used, can that be used to change the last line in my snippet
Until C Notin #charstatus Or G In #charstatus
to
Until C Notin #charstatus || G In #charstatus
Their is no command "OR" in easyuo. The command for 'or' in easyuo is "||".
Therefor you have to do it your revised way .. Until C Notin #charstatus || G In #charstatus
but be carefull with your repeat loop your code WILL get stuck looping and doing nothing if your spell fails so instead of
Repeat
Until C Notin #charstatus || G in #charstatus
Maybe you should change your code to a structure such as this
Repeat
if blabla
caste spell
Until C Notin #charstatus || G in #charstatus
-
Thank you guys for your inputs :), it's clearer now what the code should be