[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  Goto Coordinates

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Goto Coordinates

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Jcet   USA  (25 posts)  [Biography] bio
Date Tue 23 Apr 2002 03:39 PM (UTC)  quote  ]
Message
First of all, there's coords like 123.-24(Location: * *.*)
3rd and 4th are the coord wilcards
1st one really has no purpose just say northwest, northeast etc

Sub SetLoc (TriggerName, TriggerLine, AWC)
world.SetVariable "Loca", AWC (2)
world.SetVariable "Locb", AWC (3)
End Sub

That code is set on the location trigger to make the loca and locb
(hit like goto 23.87)
Sub GotoCoords (AliasName, AliasLine, AWC)
dim DesA
dim DesB
DesA = AWC(1)
DesB = AWC(2)

' E +, W -, N -, S


if world.getvariable ("Loca") > DesA then
world.send "west"
elseif world.getvariable ("Loca") < DesA then
world.send "east"
elseif world.getvariable ("Locb") > DesB then
world.send "north"
elseif world.getvariable ("Locb") < DesB then
world.send "south"



end if


end sub

thats the code, all i really need is to put a loop in it, so when Loca reaches DesA to stop, and Locb reaches DesB of course, stop.

not sure exactly how and where to put a loop in there.

-Jcet
See no good, hear no good, be no good, kill all good!
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 23 Apr 2002 09:55 PM (UTC)  quote  ]
Message
Do you mean to keep walking until you get there? In that case you don't really want a loop, you want to keep doing it until you are there.

There was a lengthy post a while back about a "wilderness walker" or something like that, that did something very similar.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


2,916 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]