ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: warrenotto on September 04, 2013, 05:28:16 PM
-
can anyone tell me or show me where i can learn or read about how to block a spell casting during character movement. that would be awesome thanks.
im having fun with this scripting stuff.
-
I have a sub in my CLAw that monitors movement to prevent looting while you're wandering. Same principle really.
-
cool think i found it. i will try to integrate it into my script when i get home tonight. thanks man!
two thumbs up for this forum. you guys are really helpful!
-
Should be this sub here:
sub StandingStill
namespace push
namespace local STILL
set !newpos #CHARPOSX , #CHARPOSY , #CHARPOSZ
if !newpos <> !oldpos || !move_timer = N/A
{
set !delay 1 ; adjust this value for more delay
set !oldpos !newpos
set !still #FALSE
set !move_timer #SCNT + !delay
}
if #SCNT > !move_timer
{
if !oldpos = !newpos
{
set !still #TRUE
}
else
{
set !oldpos !newpos
set !move_timer #SCNT + !delay
}
}
set #RESULT !still
namespace pop
return #RESULT
Then you just use it like this:
gosub StandingStill
if #RESULT = #TRUE
{
; do your stuff here.
}
Note you can modify the value of !delay to add more delay. It's already delaying the least amount (1 second)
-
cool. that's the one i though it was. looked through the whole script then realized its right there at the top. haha. i didn't get a chance to try it out last night cause i had to work late. ill give it a go tonight and let you know when i get it working. thanks again. much appreciated.
-
At the beginning of your script, if you put this:
set #LPC 100
That will increase the responsiveness of the function without impacting overall performance. Just don't make it very large because it will cause a slowdown of your client and other scripts running in parallel.