ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Ketchup on September 20, 2015, 07:32:00 AM
-
I'm having an issue when calling this sub for the 2nd time in my script, firstly it runs to my first rail great, runs to bank, deposits and then upon calling the rail sub for the second time it does nothing, anyone have an idea why?
without adding my whole script this is what it looks like
This is my little call for subs in my checkweight sub, why would the 2nd call not work? any help appreciated!
gosub runrail RailOne
wait 2s
gosub recall_to_bank
wait 1s
gosub deposit_items
wait 1s
gosub recall_to_dungeon
wait 1s
gosub runrail RailTwo
;--------------------------------------------------------------
;--------------------------------------------------------------
sub runrail
msg Dungeon Despise$
wait 2s
namespace push
namespace local MR , #systime
set !Cnt %1 , Cnt
set !Cnt % . !Cnt
set !SX %1 , X
set !SY %1 , Y
for !i 1 !Cnt
{
set !nX !SX , !i
set !nY !SY , !i
set !nX % . !nX
set !nY % . !nY
move !nX !nY 0 5s ;you might have to adjust timeout depending on move length
}
namespace clear
namespace pop
return
-
First, does the sub work on his own. If yes, then you can try adjusting the wait time.
I use this to quickly change them.
set %swait 20 <--- increase the number as u see fit.
-
the sub works on it's own yes, when I call gosub runrail RailOne, it works fine but upon the call of the gosub runrail RailTwo it says the dungeon part but then doesn't move, I cannot work out why
-
Not sure but maybe it miss a 1
namespace push
namespace local MR , #systime
set !Cnt %1 , Cnt
set !Cnt %[font=Verdana]1[/font] . !Cnt < ------ should be a 1 there by any chance
set !SX %1 , X
set !SY %1 , Y
for !i 1 !Cnt
-
thanks for your replies ghost I'll give that a try and see if it makes a difference and let you know
-
Adding the number 1 made the first run rail not even attempt to move, so I feel it's not because of that
-
My move sub! I would make sure you've named the rail properly. Like makes ure it is %RailTwoX1 and %RailTwoX2 not like %RailtwoX1 or something, caps matter.
Otherwise add
display ok !nX , #spc !nY
right before the move line, and see if those are coming up correctly.
-
I rename the railTwo and got it to work. I PM him the right systax
-
Ghost, thanks for your reply but it didn't work, anyway, Kali, I tried it and when it gets to rail two it says RailTwoX N/A RailTwoY N/A
-
in the PM with both rail that have the same location. In that PM just copy and paste that railtwo into your build.
-
The N/A means that the locations aren't set. Which either means you forgot to initialize the variable values, or the name is incorrect. Since ghost is saying that he fixed it by adjusting the rail name, I think it is the latter.
-
Ghosts fix does not work for me
-
Let try this again. after you use the command Dungeon XXXXXXX , you have issue with running rail two to get to your destination. Correct
-
okay, rail 2 gets me out of the dungeon before recalling to the bank, rail 1 takes me into the dungeon before killing
-
Okay, there can be a problem. If it is running to the door and then doing funny things, that is because the inside of the dungeon and the outside of the dungeon are non-contiguous in the UO world coordinate system. Look at automap or something. What happens in X,Y cooridnates is this:
X: 100 Y: 100
X: 104 Y: 100
X: 108 Y: 100 ;Last outside tile
X: 504 Y: 200 ;First inside tile
X: 508 Y: 200
So your character hits that last tile that you marked outside and b-lines right for the other tile in some strange direction and not into the dungeon. You have to insert an x,y value that is like 1 tile into the 'black area' of the dungeon tile or something.
-
sadly I don't think that is the problem either, it uses the dungeon portal and then just sits still, the tile it should be going to is not through a dungeon entrance as he's already in there, it just stops dead