ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Crisis on July 14, 2020, 10:16:49 AM

Title: event pathfind
Post by: Crisis on July 14, 2020, 10:16:49 AM
Code: [Select]
   event pathfind xxxx yyy
  until #charposx = xxxx && #charposy = yyy
  wait 20


EDIT: I may have figured out the answer to question 1 using Z axis but I will have to test it. I am still really interested in slowing down the path finding so I can stay stealthed.
Title: Re: event pathfind
Post by: gimlet on July 14, 2020, 11:20:16 AM
The key is to keep the cursor close to your character. If it is on your toon he will always walk slow. The further away he may run and break stealth.
Title: Re: event pathfind
Post by: MeWonUo on July 14, 2020, 11:38:17 AM
I used to use event macro to force the character to walk in a specific direction.

Movement
Param 1   Param 2   Param 3   Description
5   0      Walk North West
5   1      Walk North
5   2      Walk North East
5   3      Walk East
5   4      Walk South East
5   5      Walk South
5   6      Walk South West
5   7      Walk West

Sorry for the quick copy/paste as I'm at work currently.  Hope it helps.
Title: Re: event pathfind
Post by: Gaderian on July 14, 2020, 12:05:11 PM
There is a client option (your character will always run) that needs to be off.
As said the mouse can't be far away. The HW Quester forces this by keeping the mouse cursor on or near your character while it runs the rail.
MeWonUO's suggestion works too. Now for a rail version of that, I have been using EN's rail code for all my stuff. It includes a parameter for how "slow" to walk. So it can run moderately quickly (maybe not a full run, but faster than walking), but I often have it walk a bit slower. You can slow it down severely so just about force walking if the above options are taken care of as well.

Gaderian
Title: Re: event pathfind
Post by: Crisis on July 14, 2020, 12:06:22 PM
The key is to keep the cursor close to your character. If it is on your toon he will always walk slow. The further away he may run and break stealth.

This is scripted though using path finding. When he starts path finding, he sometimes speeds up breaking stealth, other times walks perfect and keeps stealth from the gate to the house teleporter. The Z axis fixed the circling around on the teleporter, just trying to keep him slow moving not to break stealth until inside.


I used to use event macro to force the character to walk in a specific direction.

Movement
Param 1   Param 2   Param 3   Description
5   0      Walk North West
5   1      Walk North
5   2      Walk North East
5   3      Walk East
5   4      Walk South East
5   5      Walk South
5   6      Walk South West
5   7      Walk West

Sorry for the quick copy/paste as I'm at work currently.  Hope it helps.

I will have to look into that to see how to use it to make him walk to where I need him to be. Thanks for the idea!
Title: Re: event pathfind
Post by: Crisis on July 14, 2020, 12:07:36 PM
There is a client option (your character will always run) that needs to be off.
As said the mouse can't be far away. The HW Quester forces this by keeping the mouse cursor on or near your character while it runs the rail.
MeWonUO's suggestion works too. Now for a rail version of that, I have been using EN's rail code for all my stuff. It includes a parameter for how "slow" to walk. So it can run moderately quickly (maybe not a full run, but faster than walking), but I often have it walk a bit slower. You can slow it down severely so just about force walking if the above options are taken care of as well.

Gaderian

I have not messed with rails in many many years but that seems like it might be good too.
Title: Re: event pathfind
Post by: Crisis on July 14, 2020, 02:39:03 PM
I was experimenting with the move command but not sure it works anymore. My character never moved an inch. http://wiki.easyuo.com/index.php?title=Move
Title: Re: event pathfind
Post by: gimlet on July 14, 2020, 04:48:30 PM
Another thing: If it is having a hard time getting on to your steps, break up the rail into 2 parts. First part to get close to steps and then a second to go to the tile.
Title: Re: event pathfind
Post by: MeWonUo on July 14, 2020, 05:58:13 PM
Ok, got home and took a look at one of my old scripts.   I used the move command:

Code: [Select]
move xxxx yyyy 0 10
The zero is how many squares away you want to be, the 10 is how many seconds before it times out.

Adjust as needed.

This will keep you walking all the time unless you have always run on, or tap/hold your control key for some reason.  :)
Title: Re: event pathfind
Post by: The Ghost on July 15, 2020, 09:07:11 PM
You can only walk 10 step at the time while in stealth..  You need to take break and start walking again.    \If you pay attention you will gett he msg every thing the skill is active.
Title: Re: event pathfind
Post by: Crisis on July 15, 2020, 10:28:54 PM
You can only walk 10 step at the time while in stealth..  You need to take break and start walking again.    \If you pay attention you will gett he msg every thing the skill is active.

At the most it moves 13 steps all together but I have it broken into 4 groups of 3 steps with a wait after each one. The problem is when it starts out, sometimes it moves fast like it is running and sometimes slow and does not break stealth. Gim was telling me I need to use CLICK to keep mouse cursor close to my character. I will have to look into how to use it.
Title: Re: event pathfind
Post by: Gaderian on July 16, 2020, 03:06:30 AM
I thought stealth was 2 steps walking for each 10 skill points??? I think that changed from 1 step/10 skill points - when you no longer had to use the stealth skill to keep stealthing. Then you get less if you run. Docs say you will be revealed after the run, but I have just waited out the time (you get half the steps running stealthed compared to walking stealth) and been able to continue successfully many times.

The mouse/click thing is to use calculate the click location based on screen resolution. You may need a slight offset from this, but it would look something like:
Code: easyuo
  1. set %HoverMouseX #clileft + #clixres / 2
  2. set %HoverMousey  #clitop + #cliyres / 2
  3. click %HoverMouseX %HoverMouseY MC N
  4. MOVE x y 0 10 ; or whatever your move statement looks like
  5.  
That needs the x and y of the move statement to be close so you keep resetting the mouse "click..." position so it doesn't get too far away.
Wreaks havoc if you are trying to do something else on the computer at the same time, but allows you to walk (assuming of course you have the "always run" option unchecked.

Gaderian
Title: Re: event pathfind
Post by: gimlet on July 16, 2020, 08:19:10 AM
Stealth (greater or equal to 75 with medable armor - I always use barbed leather (not studded)) you can stealth all day anywhere almost. Any non mage armor requires more skill.
Title: Re: event pathfind
Post by: gimlet on July 16, 2020, 08:21:49 AM
When i can i also use animal form (ninja) because you can run using stealth.
Title: Re: event pathfind
Post by: Endless Night on August 17, 2020, 01:28:10 PM
There is a client option (your character will always run) that needs to be off.
As said the mouse can't be far away. The HW Quester forces this by keeping the mouse cursor on or near your character while it runs the rail.
MeWonUO's suggestion works too. Now for a rail version of that, I have been using EN's rail code for all my stuff. It includes a parameter for how "slow" to walk. So it can run moderately quickly (maybe not a full run, but faster than walking), but I often have it walk a bit slower. You can slow it down severely so just about force walking if the above options are taken care of as well.

Gaderian

Gaderian,  which one of my rail systems do you use the one inside the character toolbox ?
Title: Re: event pathfind
Post by: Gaderian on August 17, 2020, 05:03:08 PM
Endless Night,
Yes, I use the rail system from the character toolbox. The only 'issue' is that it is limited to 26 steps in a direction - then it had a pause. If I could eliminate that pause, it would be perfect. As it is, it goes anywhere as I want. I used it to solve my Ant Colony movement quest with all the Z axis irregularities.

It solved my issues over failed moves because of the Z axis. It goes exactly where I want.

The one issue is if the #chardir (my character's direction) is aligned with the initial movement direction. It would take an extra step in that direction if I was aligned. I solved that external to the movement subroutines. I know there is code internal to the movement routines to try to handle that, but I suspect that is needs a longer wait around trying to change the direction. This may have changed since it was developed. It bothered me for a very long time (more than 1 year) and I just couldn't figure it out. Finally I realized it was a timing wait issue with my external routine. Now that I have added some short waits - it works flawlessly.

Gaderian
Title: Re: event pathfind
Post by: Endless Night on August 17, 2020, 06:44:02 PM
Endless Night,
Yes, I use the rail system from the character toolbox. The only 'issue' is that it is limited to 26 steps in a direction - then it had a pause. If I could eliminate that pause, it would be perfect. As it is, it goes anywhere as I want. I used it to solve my Ant Colony movement quest with all the Z axis irregularities.

The version in the character toolbox is an older version.  Their is a newer version in my Library files (http://www.scriptuo.com/index.php?topic=10609.0) that allows for 678 steps in a direction (26x26), and probably solves the others issues as well.   (in file Ens-Subs-RailSystems.txt)   Their are 2 other rail systems in that file as well that i used for different things.

It allows for 678 steps by utilizing 2 or 3 characters to represent movement, older version utilized just 2 ... ie  2A  = move 1 step in the 2 direction, 2AA = move 27 steps in the 2 direction. 3zz = move 678 steps in 3 direction   etc.