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 ➜ Speedwalking Script Solution for Lag?

Speedwalking Script Solution for Lag?

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


Pages: 1  2 

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #15 on Sat 26 Jul 2008 08:53 AM (UTC)
Message
I can't quite see what is wrong here. Can you post the whole alias? See:

http://mushclient.com/copying

Also paste the MUD output around when all this goes wrong.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by DungBeetle   (3 posts)  Bio
Date Reply #16 on Sat 26 Jul 2008 05:27 PM (UTC)

Amended on Sat 26 Jul 2008 05:39 PM (UTC) by DungBeetle

Message
<aliases>
<alias
match="!*"
enabled="y"
send_to="12"
sequence="100"
>
<send>require "wait" -- load wait.lua

wait.make (function () --- coroutine below here

local lines = {}

sw = EvaluateSpeedwalk ("%1")

-- check for valid speedwalk

if string.sub (sw, 1, 1) == "*" then
ColourNote ("white", "red", string.sub (sw, 2))
return
end -- if

rex.new ("(.+)"):gmatch (sw,

-- build speedwalk lines into a table

function (m)
table.insert (lines, m)
end)

-- iterate the table, sending each line to the MUD

for i, line in ipairs (lines) do

-- send the speedwalk

Send (line)

-- now wait for an appropriate response

line, wildcards = wait.regexp ("^(A dog is here\.|A man is here\.|Obvious exits:)$")

-- check we didn't get told it was impossible

if string.sub (line, 3, 5) == "dog" then

Send ("kill dog")
line, wildcards = wait.regexp ("^(.* is DEAD!)$")

end -- if

if string.sub (line, 3, 5) == "man" then

Send ("kill man")
line, wildcards = wait.regexp ("^(.* is DEAD!)$")

end -- if


end -- of iterating through each speedwalk line

-- all done!


end) -- end of coroutine</send>
</alias>
</aliases>


It will move into the room with the mob and send the kill command. Then, while I'm approaching it to attack the next direction command is sent. It's like the "* is DEAD!"-wait doesn't matter.


I think the issue is right here:

Obvious exits:
sw
North - Too dark to tell
Southwest - Too dark to tell
A dog is here.
kill dog
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #17 on Sat 26 Jul 2008 10:29 PM (UTC)
Message
OK I see it now.


Obvious exits:
sw
North - Too dark to tell
Southwest - Too dark to tell
A dog is here.
kill dog


As soon as it sees "Obvious exits:" it sends "sw", as you can see, as the script tells it to do.

Later it notices the dog - too late, as it has already moved.

I think you have to restructure a bit - the test for "A dog is here\.|A man is here\.|Obvious exits:" is all done after you have just sent the speedwalk. So you are pretty-much guaranteed that you have moved before you notice the dog.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by DungBeetle   (3 posts)  Bio
Date Reply #18 on Sun 27 Jul 2008 06:19 PM (UTC)
Message
argh, I had it working to an extent by switching the wait trigger from 'Obvious exits' to 'Health:', but that was with just one mob. As soon as I put in the other types I might encounter the script died and sends a only one command.

Could you show me how to make it "A * is standing here" and then make the if trigger off of wildcard [1] and Send ("kill" wildcards [1]? I've been messing with it but I can't seem to get the right syntax.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #19 on Sun 27 Jul 2008 08:37 PM (UTC)
Message
It sounds very much to me like you are writing a bot, which most MUDs frown on.

I think I'll have to let you work out the details yourself here, but suffice to say that you need to make the script do what you, as a human would. That is, let the whole room description, including exits and list of mobs appear, and *then* work out whether to move on or kill something.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


66,692 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

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.