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 ➜ Autosipper

Autosipper

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


Posted by Sredmon   (13 posts)  Bio
Date Thu 10 Jan 2008 04:13 AM (UTC)
Message
Been toying with Mush trying to learn what I can by reading and playing around but I got kind of snagged up...

I am trying to make an auto sipper for my monk on Achaea so I don't have to try to attack and sip at the same time...

My prompt looks like this:

Quote:
3368h, 1995m, 15740e, 12194w cexkdb-


The trigger I am using, if it is even right is ^(\\d+)h, (\\d+)m, (\\d+)e, (\\d+)w$

However, I haven't quite figured out how to get it to store my max health of 3368 and then how to get it to trigger off balance when my health drops say 30% or when it hits like below 2800 health.

An idea I had is to set a trigger that when I have balance...to do an if/then statement...something like this...


You may drink another health or mana elixir.

if @health < 2800 then
    sip health
end


or something like that...really new to this and reading all the posts has kind of confused me more...any help is greatly appreciated.

Thanks.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 10 Jan 2008 04:39 AM (UTC)
Message
Quote:

The trigger I am using, if it is even right is ^(\\d+)h, (\\d+)m, (\\d+)e, (\\d+)w$


I would only use a single backslash for a start. \d+ matches digits, but \\d+ would match a backslash followed by one or more of "d".

Next I would get rid of the final $ because that means that has to be the end of the line, whereas your example had:

3368h, 1995m, 15740e, 12194w cexkdb-

Note how the "w" is not at the end of the line?

You are on the right general track with your script, but you need to indicate the difference between script commands, and what you want to send, like this:


if @health < 2800 then
    Send ("sip health")
end


- Nick Gammon

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

Posted by Sredmon   (13 posts)  Bio
Date Reply #2 on Thu 10 Jan 2008 04:48 AM (UTC)
Message
So to track my health from the prompt...using the trigger I would need to send it to a variable correct? Hence the @health?

In order to do that I would need to take the (\+d)h part and have it do something like


SetVariable ("health") %1


Or is there something I am missing?

I mean it would be that or would I do it like my target one which is set up as


t *

%1


that is set to send to variable and in variable I have target. So would do that with the (\+d)h, part of the trigger and have it set to send to variable and in variable type in health?
Top

Posted by Sredmon   (13 posts)  Bio
Date Reply #3 on Thu 10 Jan 2008 04:53 AM (UTC)
Message
Also, just did the code you gave me for the trigger off the regaining sipping balance and got this error...

Quote:

Compile error
World: Achaea
Immediate execution
[string "Trigger: "]:1: unexpected symbol near '@'


Can you break that down and explain it to me so I can understand it and be able to know what to do in the future?

Thank you
Top

Posted by Mccane   (28 posts)  Bio
Date Reply #4 on Thu 10 Jan 2008 05:11 AM (UTC)
Message
Did you check the box that says 'Expand variables'? Otherwise the script won't know to check for the variable name when it sees the @ symbol.
Top

Posted by Sredmon   (13 posts)  Bio
Date Reply #5 on Thu 10 Jan 2008 05:16 AM (UTC)

Amended on Thu 10 Jan 2008 05:26 AM (UTC) by Sredmon

Message
I knew I forgot something...thank you. Will do that and see what happens.

Okay expanding the variable did work. Thanks. Now I just need to figure out how to track my health from the trigger I made for the prompt. Time to tinker...
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #6 on Thu 10 Jan 2008 11:54 PM (UTC)
Message
best way to do that is to set it via the score command so its automatic, or you'll have to set it manually each time you level up.

Everything turns around in the end
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #7 on Fri 11 Jan 2008 04:15 AM (UTC)
Message
Quote:

In order to do that I would need to take the (\+d)h part and have it do something like


SetVariable ("health") %1



Try looking at the help for SetVariable and following the examples. You are mucking around with the syntax there a bit. It would be more like:


SetVariable ("health",  "%1")

- Nick Gammon

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

Posted by Shadoweave   (42 posts)  Bio
Date Reply #8 on Fri 11 Jan 2008 08:42 AM (UTC)

Amended on Fri 11 Jan 2008 08:43 AM (UTC) by Shadoweave

Message
Here is where you will find a free system in Lua: http://tsunami.gautama.googlepages.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.


25,797 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.