ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: vanzelus on January 08, 2014, 05:56:03 PM
-
Hi,
This is my followup from the last thread on the cure sub but it's a different issue so I went ahead and make a new thread. Thank you to all those who helped me in that thread.
Anyway, I have my cure sub as follow, which is called from the health check sub:
Sub Cast_Cure
Repeat
If C In #Charstatus && G Notin #Charstatus && #Mana >= 25 && %Cast_Wait_Timer <= #sCnt2
{
Event macro 15 201 ; cast Chiv spell cleanse by fire
Target 5s
Event macro 23 0 ; target self
Set %Cast_Wait_Timer #sCnt2 + 20
}
Until C Notin #Charstatus || Finditem %KILLS G_8
Return
So the gist of it is that once the char is out of combat and is poisoned, the sub will try to cure repeatedly (especially if it's deadly poison or failed, but I have protection on so the second issue is not a problem). Now, what am trying to do is have the sub exit out when the script scans and finds a mob, which is defined by Finditem %kills G_8 where %kills is the variable where all the mob types are defined. My question is, is the last part written as it is will allow me to exit out of the sub when the mob is found even if my char is not cured?:
Until C Notin #Charstatus || Finditem %KILLS G_8
Return
He's a sampire and I only worry about cure poison (deadly specifically because vampire form doesn't auto cure) when he's out of combat and not leeching health, hence the cure sub and the need to exit out of the cure sub when mob respawns. Thank you for your inputs
-
Sub Cast_Cure
Repeat
If C In #Charstatus && G Notin #Charstatus && #Mana >= 25 && %Cast_Wait_Timer <= #sCnt2
{
Event macro 15 201 ; cast Chiv spell cleanse by fire
Target 5s
Event macro 23 0 ; target self
Set %Cast_Wait_Timer #sCnt2 + 20
Finditem %Kills G_ 8 ;-- Scans for Monsters of type defined by %Kills withing 8 tiles on Ground.
}
Until C Notin #Charstatus || #Findcnt > 0 ;--- #findcnt updates to the info from the above "finditem" and if something is found the "Until" Exits...
Return
-
:o ah that's what it is, no wonder why it was not working when I test it. Thanks alpha :).
-
Some other things that always helped me figure out what was going on in a script...
1) Set up your own variable list... aka... Select Tools --> Manage Variable list or simply Variable Dump if you want to see the state of your variables at the time of the dump... I often insert a pause at the appropriate place and then do a Var dump to check a certain variable. With "Manage Variable list" I'll do something like
\USER which creates your own little "USER" section on the right panel of EUO window where all the variables are.. and then I'll simply add what variables I'm interested in...
\USER
%A
%B
%TEST
etc.....
2) F7 !!! Single stepping through a script. I'll use a pause so that in longer scripts I can simply click play and it will pause at the right spot and then I can single step through stuff with F7 to see what's going on. Hope that helps some if you already didn't know.
-
Will have to try Select Tools really soon and learn how to use it.
-
Some other things that always helped me figure out what was going on in a script...
1) Set up your own variable list... aka... Select Tools --> Manage Variable list or simply Variable Dump if you want to see the state of your variables at the time of the dump... I often insert a pause at the appropriate place and then do a Var dump to check a certain variable. With "Manage Variable list" I'll do something like
\USER which creates your own little "USER" section on the right panel of EUO window where all the variables are.. and then I'll simply add what variables I'm interested in...
\USER
%A
%B
%TEST
etc.....
2) F7 !!! Single stepping through a script. I'll use a pause so that in longer scripts I can simply click play and it will pause at the right spot and then I can single step through stuff with F7 to see what's going on. Hope that helps some if you already didn't know.
Now I do, thanks :)