Common functions: Moveto.iss

don'tdoit

Active Member
This script contains two main subroutines: moveto and movetoobject. Since these are common functions, you might want to create a "common" folder in your scripts directory and include it.

example:
Code:
#include ./common/moveto.iss

function main()
{
       ;typically you only want to use one of these at a time

       ;Gets an NPC's ID number, then moves to within 5 feet but not closer than 2 feet.
	call movetoobject ${Pawn[npc].ID} 5 2
       ; moves to the below X,Y location with a precision of 100
	call moveto 19230 -45205 100
}
See the script itself for more info. There's quite a bit of debug echos in there that are commented out. This is still a work in progress, but from all the testing I've done it works great, including obstacle detection.

Credits (from the script):
Code:
/* credits:
	This script has been written, rewritten, and contributed to by many people.
	Most notably by Fippy, scubaski, and don'tdoit.  Not possible without Lax and Amadeus.  <3
	Get Innerspace: www.lavishsoft.com
	Get ISXVG: www.isxgames.com
	Feel free to use and redistribute in a non-commercial manner as long as you keep the above (and add to them when necessary) in place.
	If you remember working on this (from wowhunter days or before), let me know and i'll change my credits lines.
*/
Version info (in script):
Code:
/* Version:
	v1.0 - Initial Release
	v1.1 - Fixed a bug with a ' instead of a ;
*/
 

Attachments

Last edited:

Kram337

Active Member
Releasing Movement Keys

If you're using moveto.iss and your script is ended while you're in motion, the movement keys wont be released and you'll continue to run in whatever direction you were last running.

The following code, placed in an 'atexit' function will release these keys and give you back full control.

Code:
function atexit()
{
	;Script has been ended, release the movement keys
	VG:ExecBinding[moveforward,release]
	VG:ExecBinding[movebackward,release]

}
 

aChallenged1

Active Member
Kram337 said:
If you're using moveto.iss and your script is ended while you're in motion, the movement keys wont be released and you'll continue to run in whatever direction you were last running.

The following code, placed in an 'atexit' function will release these keys and give you back full control.

Code:
function atexit()
{
	;Script has been ended, release the movement keys
	VG:ExecBinding[moveforward,release]
	VG:ExecBinding[movebackward,release]

}
Kram, is this supposed to go in the moveto.iss, or the script using it?

I've been out of the loop for a long time.
 

Shaba

Active Member
aChallenged1 said:
Kram, is this supposed to go in the moveto.iss, or the script using it?

I've been out of the loop for a long time.
Either one, although I would suggest putting it in moveto.iss, so that it affects all scripts that use this include.
 
Top Bottom