ScriptUO
Ultima Online Fan Board => General UO Chat => Topic started by: NObama on March 18, 2012, 01:33:23 PM
-
Attempting to make myself a mobile RC casting bot. Intent is to dynamically target the square next to me every time I cast a Colossus. I'm using TM's awesome spellcast subs, but unfortunately I can't figure out how to get a square of ground into #ltargetid.
Help?
-
Here's a little script I wrote a long time ago that summons energy vortexes. Might be similarly useful:
set %targetx #CHARPOSX
set %targety #CHARPOSY - 5
;set %creature_type SY ; blade spirits
set %creature_type YI ; energy vortex
repeat
if #FOLLOWERS < 4
gosub Summon
until #FALSE
;-----------------------------------------------
sub Summon
; event macro 15 32 ; blade spirits
event macro 15 57 ; energy vortex
target 20s
set #LTARGETKIND 2
set #LTARGETX %targetx
set #LTARGETY %targety
event macro 22 0
wait 40
return
;-----------------------------------------------
sub Meditate
namespace push
namespace local MED
set !wait %1
set !thresh %2
gosub TM_SyncTextScan
set !mana_target #INT - !thresh
set !success #FALSE
med_loop1:
if #MANA > !mana_target
goto Meditate_skip
if !success = #FALSE
{
gosub TM_SyncTextScan
event macro 13 46
wait 20
}
gosub TM_FindValidTextNoAdvance you_enter_a_meditative_trance
if #RESULT = #TRUE
{
gosub TM_SyncTextScan
if !wait <> #TRUE
goto Meditate_skip
set !success #TRUE
}
gosub TM_FindValidTextNoAdvance you_stop_meditating
if #RESULT = #TRUE
{
gosub TM_SyncTextScan
set !success #FALSE
}
goto med_loop1
Meditate_skip:
namespace pop
return
;-------------------------------------------------------------------------------
; Brings !_jindex up to the most recent #journal entry
sub TM_SyncTextScan
namespace push
namespace local text
set !_jindex #jindex + 1
namespace pop
return
;-------------------------------------------------------------------------------
; %2, %3, %4, etc strings to match
; returns #TRUE for match, #FALSE for no match
; Will not advance !_jindex pointer to allow for scanning journal history for more than one search.
; Also searches for : , #SPC in journal entry to be sure someone isn't spamming the text
sub TM_FindValidTextNoAdvance
namespace push
namespace local text
set !temp_lpc #LPC
set #LPC 1000
set !num_args %0
set !first_arg 1
if !_jindex = N/A
set !_jindex #jindex
set !index !first_arg
repeat
set !temp_jindex !_jindex
set !text % . !index
while !temp_jindex <= #jindex
{
scanjournal !temp_jindex
if !text in #journal && :_ , !text notin #journal
{
set !temp_jindex !temp_jindex + 1
set #LPC !temp_lpc
namespace pop
return #TRUE
}
set !temp_jindex !temp_jindex + 1
}
set !index !index + 1
until ( ( !index - !first_arg ) > ( !num_args - 1 ) )
set #LPC !temp_lpc
namespace pop
If you want to use the spellcast subs, you'll need to change the #LTARGETKIND to 2 so the ground will be targeted.
Might be easier to just use the little snippet above.
-
If you are in SA, you may as well Give up! As far as I know anyways. I never could figure out how to even target snakes nests in SA, much less cast a rising.
Your best bet, would be to base what tile is immediately behind you or in front of you based on your #Chardir, and set a universal Click X Click Y For those two spots and once the target cursor comes up, you click the location.
-
Attempting to make myself a mobile RC casting bot. Intent is to dynamically target the square next to me every time I cast a Colossus. I'm using TM's awesome spellcast subs, but unfortunately I can't figure out how to get a square of ground into #ltargetid.
Help?
Scan all times around you and define "Good" and "Bad Tiles" then use the xyz for target on a good tile, did this many years ago with a hord of Mages doing afk Champs by casting nonstop energy vortex