ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Paulonius on October 13, 2009, 11:52:52 AM
-
Is there a way to detect the presence of a target cursor?
I would like to put together a target cursor check/wait sub to replace standard wait intervals before selecting a target and I need a way to know whether I have a target cursor or not. I have been reading up on it and I can't find anything on point.
Any help greatly appreciated!
-P
-
#targetcurskind or something close to that tells what kind of cursor.
-
if #targCurs = 1 ; active
if #targCurs = 0 ; inactive
Value Description
0 Cursor is a normal cursor.
1 Cursor is a target cursor.
#cursKind tells you where you are.
Value Description
0 Felucca
1 Trammel
2 Ilshenar
3 Malas
4 Tokuno
if #targCurs = 0 ; NOT a target cursor, so you can cast your spell
{
event macro 15 28
while #targCurse = 0 ; wait for target cursor to become a 1 or active
wait 0
event macro 23 0 ; target self
wait 10 ; or whatever your cast recovery is
}
-
Awesome, thanks for pointing that guys. Now I don't have to use a wait 10 or some such. I appreciate it.
-
Also, you can use
; This will pause the script until either the target cursor is displayed,
; or 3 seconds passes.
; Set the timout just over what you expect the delay to take, otherwise
; you may miss the target cursor and cause errors in your script.
target 3s
Which is what most people use.
All is in the docs over at easyuo ;)
-
Thanks guys. I am going to try using the following instead of the wait 10 after I hit something that should bring up a target cursor:
set %targetcursorwait 1
gosub WaitForTargetCursor
if ! #result
{
display -Target Cursor did not come up. [Bring up related cursor] and hit play
pause
}
;================== Wait for Target Cursor Sub======================
sub WaitForTargetCursor
set %timeout #scnt + 30
Repeat
wait %targetcursorwait
if #scnt > %timeout
return #false
Until #TARGCURS = 1
return #true
-
thank you cerv! I was at work and still am. I could not look in the variables to see it.