Autosipper

Posted by Sredmon on Thu 10 Jan 2008 04:13 AM — 9 posts, 34,357 views.

#0
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.
Australia Forum Administrator #1
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

#2
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?
#3
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
#4
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.
#5
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...
Amended on Thu 10 Jan 2008 05:26 AM by Sredmon
USA #6
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.
Australia Forum Administrator #7
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")
#8
Here is where you will find a free system in Lua: http://tsunami.gautama.googlepages.com/.