Author Topic: Trouble with manual 'move' commands  (Read 3484 times)

0 Members and 1 Guest are viewing this topic.

Offline NObamaTopic starter

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Trouble with manual 'move' commands
« on: April 03, 2009, 11:39:26 PM »
0
Salutations!

I've been modifying one of TM's magnificant farming scripts to help my character get to and from the bank from Ilshenar.  I went through a great deal of painstaking manual entry of X/Y coords to craft a path for my toon to follow.

It was clunky, but it worked very well transitioning between several areas and using moongates.  Then, suddenly, it stopped working.  None of my coded coordinates changed, but after a day or so my toon would get stuck in various places.  I changed from event pathfind commands to move commands, and that seemed to solve the problem for a while - but now it's back.

I've run the modified script on several different systems with the same cascading failures after time passes.  Obviously, there is something simple I'm not seeing...but I'm compelled to ask:

Why does a "move x y" command work find one hundred times, then screw up the 101st?

Eventually, I'll figure out how to incorporate the rail engine but that's calculus to my multiplication tables at the moment.

Thanks!


Offline rana70

  • Elite
  • *
  • *
  • Posts: 294
  • Activity:
    0%
  • Reputation Power: 5
  • rana70 has no influence.
  • Gender: Male
  • Respect: +37
  • Referrals: 2
    • View Profile
    • MyScripts
Re: Trouble with manual 'move' commands
« Reply #1 on: April 04, 2009, 05:13:36 AM »
0
Hi,

best guess so far .... for trouble with move command
- update of the mapfile
- blocking items/NPC/Monters
- lag

I have done only one scripts with walking movement
(Miasma Support), I did it like that ...
give the char time to walk, wait and make sure it
reached the place... if yes go on
if no try to findpath a way again...

maybe it would be possible the help if you post the script ?

cu

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Trouble with manual 'move' commands
« Reply #2 on: April 04, 2009, 10:06:10 AM »
0
Don't forget the two other arguments for the command:

Code: [Select]
move 1234 1234 2 3s

The "2" gives you a range +/- that you require your character to walk.
The "3s" is just the amount of time your willing to let the command try before it gives up.

Also be careful if you have updated your movement keys within UO.  Since the move command uses those keys, if your macros have been changed/corrupted, you won't move like you expect.  More likely possibility is that you have duplicate macros, one for movement and one for something else.

Best thing you can do when everything seems to break is just come up with some test code to see if you basics still work.  Like try to walk in a rectangle in the open.  Then expand from there.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline NObamaTopic starter

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: Trouble with manual 'move' commands
« Reply #3 on: April 04, 2009, 11:00:53 AM »
0
Thanks for the encouraging words!

I went back and changed the move commands to event pathfind, which once again seemed to fix the problem for a bit.  It appears that neither move or pathfind are precise (hence the need for the 3rd parameter, I'm learning!) and my movement routines require very precise geocoords to make it through portals.

I don't think there is anything "wrong" with my coding - since why would it work several times before breaking? - I think my overall approach is flawed.  For example:

Code: [Select]
sub return_to_portal
move 1541 1340
wait 1s
move 1544 1334
wait 2s
move 1537 1327
wait 2s
move 1529 1325
wait 2s
move 1526 1325
wait 1s
move 1510 1325
wait 1s
move 1486 1323
wait 1s
move 1457 1330
wait 1s
move 1458 1328
wait 1s
key left
wait 1s
key left
wait 1s
return

Here I left out the 3rd and 4th parameters, which may have been causing some of my issues.  Last night, I changed all of the 'moves' back to event pathfind and included the Z-axis coordinates as well.  That seemed to 1) reduce some of the random thrashing about as my toon attempted to follow the path and 2) increase the speed of the script.  Speaking of speed, I also took into consideration my rather short wait times and lengthened them a few seconds.

The "key" commands were my brute force attempt to transition from one area to the next.  I can get the character to the threshold, but I can't make him cross without hard-coding a couple keystrokes.  This is where I encounter my greatest difficultly.  As the script misses each spot by a square or two, sometimes I'm not in exactly the right place to force the transition.

Really, I need help understanding how to call TM's rail engine to run the rail I made with his outstanding rail generator.  I tried backward-engineering from the heartwood script, but I'm still rather flummoxed.  It seems like it should be easy, I'm just not up to that level yet...

Any suggestions?

Cheers!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Trouble with manual 'move' commands
« Reply #4 on: April 04, 2009, 01:31:20 PM »
0
If you have specific questions regarding the rail engine/developer, lemme know what those are.  It's meant to be pretty straightforward, but the initial code might need some further explanation.

The best thing I can recommend is to take the basic test code I provided and just try and make it work.  From there you can add onto it to have a fully articulate script.

Please read the ScriptUO site RULES
Come play RIFT with me!

Offline rana70

  • Elite
  • *
  • *
  • Posts: 294
  • Activity:
    0%
  • Reputation Power: 5
  • rana70 has no influence.
  • Gender: Male
  • Respect: +37
  • Referrals: 2
    • View Profile
    • MyScripts
Re: Trouble with manual 'move' commands
« Reply #5 on: April 04, 2009, 01:48:07 PM »
0
Hi,

if you need to reach an exact location I would recommand a SUB like this,
the rail has to be set in an other SUB before.
Basicly the first SUB loads the location x,y
position in two vars so that it can be worked thru by increment
the index in the walking SUB.

Code: [Select]
; SUB to Load the Rail Data
GoSUB SUB LoadRailtoLocation

GoSUB WalkFullRailForward
HALT

; Walk Rail
;-------------------------------------------------------------
SUB WalkFullRailForward
  ;Start Rail with first loaded Data Var
  Set %Index 1   
  Repeat
    ; Set Data for Railpoint
    Set %x %moveX . %Index
    Set %y %moveY . %Index
   ; This while Loop will go on until you reach your exact location
    While %x <> #CHARPOSX || %y <> #CHARPOSY
     {
      Move %x %y 0 3s
     }
    Set %Index %Index + 1
  Until %Index > %rail
Return

SUB LoadRailtoLocation
  Set %MoveX1 330
  Set %MoveY1 1973
  Set %MoveX2 335
  Set %MoveY2 1971
  Set %MoveX3 339
  Set %MoveY3 1967
  Set %MoveX4 345
  Set %MoveY4 1961
  Set %MoveX5 345
  Set %MoveY5 1954
  Set %rail 5
RETURN


Tags: