casting fireball/arrow on hotkey "D" to last uo-client target. immediately recasting, if disturbed.
codice:
;---------Setup------------
set %HotKey d ; hotkey to cast fireball/arrow
;--------------------------
event SysMessage AK-47 1.0
event SysMessage exceptionally crafted by Sledge Hammer
set #lpc 5000
set %nextArrowNotBall #systime
while #true
{
sleep 1
onhotkey %HotKey
gosub fireballarrow #ltargetid
}
sub fireballarrow
if #systime >= %nextArrowNotBall
{
gosub CastTarget 15 4 1700 %1
if #result
set %nextArrowNotBall #systime + 600
}
else
gosub CastTarget 15 17 2200 %1
return
sub CastTarget
finditem %4 G_10
if #findkind = -1
return #false
if #targcurs = 1
key esc
set %CastTarget %4
event macro %1 %2
gosub waitforcurs %3
if #targcurs = 1
{
set #ltargetid %CastTarget
set #ltargetkind 1
event macro 22 0
return #true
}
return #false
sub waitforcurs
set %param 150
set %param2 %1
set %jindex2 #jindex + 1
set %waitforcursor #systime + %param
set %finishwaitforcursor #systime + %param2
set %paralread #false
while #systime < %finishwaitforcursor
{
set %nextjinedxend2 #jindex
if %jindex2 <= %nextjinedxend2
{
for %ji2 %jindex2 %nextjinedxend2
{
scanjournal %ji2
if ( casting in #journal || You_cannot_move in #journal || disturbed IN #journal || recovered IN #journal || reagents IN #journal || mana IN #journal ) && : notin #journal
{
set %paralread #true
break
}
}
set %jindex2 %nextjinedxend2 + 1
}
if #systime > %finishwaitforcursor || %paralread
break
if #targcurs = 1 && #systime >= %waitforcursor
break
sleep 10
}
if %paralread
return #false
if #targcurs = 1
return #true
return #false
