if check before executing an alias command

Post Reply
dhzion
Posts: 1
Joined: Fri Sep 08, 2017 9:51 pm

if check before executing an alias command

Post by dhzion »

I'm quite green when it comes to this stuff, so forgive any ignorance please.

What I'm trying to do is create a check before executing an alias command to see if part of it even needs to be executed.

i.e. I need to hold certain totems to cast. As it stands now I use an alias that executes remove any totem.....hold correct totem.....cast. It's often the case that I'm already holding the correct totem though. Is there a way to first do an if check to see if I'm holding the correct totem so as to not waste time unnecessarily swapping?

Thanks in advance!!!

Saros
Posts: 12
Joined: Sat Oct 15, 2016 10:10 pm

Re: if check before executing an alias command

Post by Saros »

I am green too! But..
You would create triggers to track your current totem.
Then, modify your alias to check your current totem and execute the correct commands.

Example:

Triggers for tracking totems:

Pattern: ^You hold the totem of awesomeness.$
Script: currentTotem = "awesomeness"

Pattern: ^You remove the totem of awesomeness.$
Script: currentTotem = "none"

Alias with check for totem:
Script:

Code: Select all

if not currentTotem == "awesomeness" then
  send("blah, blah, commands here")
end
This is a basic example that could be refactored to handle a wider variety of inputs/outputs. If you provide the scripts/pattern for your current alias, I will show you what I mean.

Post Reply