ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: nordby21 on January 11, 2013, 07:37:17 AM
-
ok so im making a stealth script..or atleast tryin but im having a semi basic issue i hope
im trying to make the character move north 5 tiles then south 5 tiles
event macro 5 1 mixed with event macro 5 5...well just doesnt cut it as im sure are there any tutorials on movement and how to use your xpos ypos to make movement more fluent and simplified for me
ive also tried move..not sure what the parameters mean there but it seems to just have a constant loop of walking northwest
any advice would help this is what i have so far...please dont crucify me :/
go sub setupmove
;***************Hiding Sub***************
;----------------------------------------
sub hide
If H notIn #charStatus
{
event macro 13 21
go sub stealth
}
;----------------------------------------
;****************Movement****************
sub setupmove
set %x1 #charposx
set %x2 #charposy
wait 5s
event macro 5 1
event macro 5 1
event macro 5 1
event macro 5 1
event macro 5 1
event macro 5 1
wait 5s
set %x2 #charposx
set %y2 #charposy
event macro 5 5
event macro 5 5
event macro 5 5
event macro 5 5
event macro 5 5
event macro 5 5
go sub hide
}
;----------------------------------------
i know its messed up im just trying to get movement down before i input for skill checks and a cleaner nicer looking code
-
Have you considered using event pathfind instead?
set %startX 1044 ; starting #charPosX position
set %startY 944 ; starting #charPosY position
set %endX 1048 ; ending x position
set %endY 944 ; Y position doesn't change cause I'm staying on the same plane
repeat
event pathfind %startX %startY
wait 20
event pathfind %endX %endY
wait 20
until #false
Will walk you (if your mouse is near your character) or run you (mouse away from char) from one spot to another.
-
Your using subs wrong .. a sub should exit via the return command. You call a sub via gosub not 'go sub' ... let fix that in your code for you as an example
repeat
gosub hide ; first hide
gosub stealth ; initiailze stealthing
gosub setupmove ; do movement
until #clilogged <> 1 ; reapeat until not logged in.
halt
;***************Hiding Sub***************
;----------------------------------------
sub hide
If H notIn #charStatus
{
event macro 13 21
}
return
sub stealth
; code
return
;----------------------------------------
;****************Movement****************
sub setupmove
; set %x1 #charposx <-- this does nothing for you
; set %x2 #charposy
wait 5s
event macro 5 1
event macro 5 1
event macro 5 1
event macro 5 1
event macro 5 1
event macro 5 1
wait 5s
; set %x2 #charposx
; set %y2 #charposy
event macro 5 5
event macro 5 5
event macro 5 5
event macro 5 5
event macro 5 5
event macro 5 5
return
;----------------------------------------
-
Also, Use cheffes move command when stealthing