Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Triggers/Alias

Triggers/Alias

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Assassin   (73 posts)  Bio
Date Fri 29 Oct 2004 07:25 PM (UTC)
Message
If im using an alias to speedwalk to a place, how can i
setup a trigger to interupt it.

Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Fri 29 Oct 2004 10:31 PM (UTC)
Message
what do you want it to do?
Make the speedwalk stop? Or just send something immediately (bypassing the queue)?

If it were the first, you'd use "DiscardQueue"
If it is the latter, you'd use "SendImmediate" (sendimmediate "immedate command")

So, assuming you were in VBScript, youd put that (whichever it was) in your send text and then send to:script.

More information:
http://www.gammon.com.au/scripts/function.php?name=DiscardQueue
and
http://www.gammon.com.au/scripts/function.php?name=SendImmediate

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Assassin   (73 posts)  Bio
Date Reply #2 on Fri 29 Oct 2004 10:41 PM (UTC)
Message
The trigger doesnt fire until the speedwalk has finished,
so what im looking at is the trigger to fire at a certain
point, it doesnt matter about the speedwalk after that, as
long as the trigger fires when i need it.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #3 on Sat 30 Oct 2004 (UTC)

Amended on Sat 30 Oct 2004 12:01 AM (UTC) by Flannel

Message
Oh. You'll need to Queue the speedwalk, rather than sending it all in one burst.

Since, after you evaluate the speedwalk (such as /w3n2e, or whatever) mushclient sends that to the server, and after that you cant 'take back' those commands.
You see this:
[Output from the server]
[your speedwalk commands, such as...
n
n
w
w
s
s
e
e
e]
[and then the output from the server, starting with the first n]

So youll have to use the Speedwalk Queue for your speedwalks, then they are stored clientside (and sent one at a time), which allows you to stop and do other things.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Assassin   (73 posts)  Bio
Date Reply #4 on Sat 30 Oct 2004 12:59 AM (UTC)
Message
Can you give us an idea on how its done please Flannel.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #5 on Sat 30 Oct 2004 09:17 AM (UTC)

Amended on Sat 30 Oct 2004 09:19 AM (UTC) by Flannel

Message
make an alias (since I assume you're just typing the speedwalk in?) and have it send this:
queue evaluatespeedwalk ("%1"), true
to script. Obviously, %1 is wildcard for the speedwalk.
(That command was straight from the list of functions and the examples that come with them.)

That will queue whatever speedwalk string you want (make sure you have the speedwalk delay and stuff set up, you can change them through scripting too if you so desire).

And then you'll be able to use discardqueue or sendimmediate with that queue.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Scypio   Poland  (50 posts)  Bio
Date Reply #6 on Sat 30 Oct 2004 09:48 AM (UTC)
Message
Check your SpeedWalkDelay. If it's 0, the DiscardQueue won't work at all. If it's higher then 0, but low, the stopping trigger could fire too late, i.e. stopping you five or 10 rooms after the monster. So, try experimenting with SpeedWalkDelay and see if it helps.

Also:
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4724&page=999999
Top

Posted by Assassin   (73 posts)  Bio
Date Reply #7 on Sat 30 Oct 2004 05:01 PM (UTC)
Message
I use a two letter alias to speedwalk to the path, the trigger fires but obviously at the end of the alias.

I'll alter delay to see if that helps

cheers

Top

Posted by Scypio   Poland  (50 posts)  Bio
Date Reply #8 on Sat 30 Oct 2004 05:20 PM (UTC)
Message
My setup for this is following:

<triggers>
<trigger
enabled="y"
expand_variables="y"
keep_evaluating="y"
match="(@!SW_pause_mon)\b"
regexp="y"
send_to="10"
sequence="100"
>
<send>pause</send>
</trigger>
</triggers>

<aliases>
<alias
name="SpeedWalkPause"
match="^pause$"
enabled="y"
echo_alias="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>dim speedwalkQueue
dim iCount
dim NewQueue

newQueue = &quot;&quot;
speedwalkQueue = World.GetQueue
world.discardqueue
If Not IsEmpty (speedwalkQueue) Then
for iCount = lbound (speedwalkQueue) to ubound (speedwalkQueue)
newQueue = newQueue &amp; speedwalkQueue(iCount) &amp; VBCrLf
setvariable &quot;QueueTemp&quot;, newQueue
next
End If
enablealias &quot;speedwalkresume&quot;, 1</send>
</alias>
</aliases>

<aliases>
<alias
name="SpeedWalkPause"
match="^pause$"
enabled="y"
echo_alias="y"
regexp="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>dim speedwalkQueue
dim iCount
dim NewQueue

newQueue = &quot;&quot;
speedwalkQueue = World.GetQueue
world.discardqueue
If Not IsEmpty (speedwalkQueue) Then
for iCount = lbound (speedwalkQueue) to ubound (speedwalkQueue)
newQueue = newQueue &amp; speedwalkQueue(iCount) &amp; VBCrLf
setvariable &quot;QueueTemp&quot;, newQueue
next
End If
enablealias &quot;speedwalkresume&quot;, 1</send>
</alias>
</aliases>

Plus I have a variable called SW_pause_mon which contains a list of names of mons that should cause a speedwalk pause. And as I said earlier, it only works if the SpeedWalkDelay is high enough.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #9 on Sat 30 Oct 2004 05:59 PM (UTC)
Message
His problem is he never queues the speedwalk.

Assassin, you cannot use the "speedwalk prefix" you instead need to use a custom alias (which could very well be remarkably similar to the original speedwalk prefix) to queue commands.

Speedwalking (via /w or whatever) is different than the speedwalk queue.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Assassin   (73 posts)  Bio
Date Reply #10 on Sat 30 Oct 2004 06:56 PM (UTC)
Message
Im reading up about queueing, unfortunately i havent got
a notion.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #11 on Sat 30 Oct 2004 07:34 PM (UTC)
Message
This should work for you:

<aliases>
<alias
match="stop"
enabled="y"
echo_alias="y"
send_to="12"
sequence="100"
>
<send>discardqueue</send>
</alias>
<alias
match="wk *"
enabled="y"
echo_alias="y"
send_to="12"
sequence="100"
>
<send>queue evaluatespeedwalk (&quot;%1&quot;), true</send>
</alias>
</aliases>

Mind you, thats an alias to stop, but you can just make a trigger that does the same thing.
And you can change your alias prefix (I use wk) for your actual movement alias.

Set your delay. And yes, you have to take into account latency (since the client just spews off commands every X ms, so if youve already sent two more directions by the time you get the response back to trigger the trigger, youre going to be in the wrong room).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Assassin   (73 posts)  Bio
Date Reply #12 on Sun 31 Oct 2004 10:48 AM (UTC)
Message
Cheers Guys, Im trying to get round what your alias does
Flannel, basically im trying to catch a mobile at a certain
point, and attack it, their was a recent post about this
so im having a look now, i use an alias 'mo' to do a route
from a-b which is fine, although the trigger to attack it
fires right at the end.

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.


31,959 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.