Need help with raze check

Post Reply
Eidolon
Posts: 15
Joined: Sun Sep 18, 2011 3:35 am

Need help with raze check

Post by Eidolon »

I'm trying to create a simple raze check for my bashing alias but I can't seem to find what I'm doing wrong.

For the alias I've this:

^ff$
if shielded then
send("raze " .. target)
end
else
send("swing " .. target)
send("swing " .. target)
end

As far as triggers are concerned:
^Eyes glowing red, (.+) bellows and a shield of protection flickers into view around (his|her) form\.$

shielded=true

I'm needing to know the coding I am missing to make that alias work properly for bashing.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Need help with raze check

Post by Jor'Mox »

Your structure for the "if/else" statement is wrong, it should be like this:
Code: [show] | [select all] lua
if shielded then
   send("raze " .. target)
else
   send("swing " .. target)
   send("swing " .. target)
end
Also, you may want to set shielded to false after sending the "raze" command, unless you have some second trigger that detects when the shield drops that does this. And I don't see target being set anywhere, so that could potentially be a source of errors with this alias.

Eidolon
Posts: 15
Joined: Sun Sep 18, 2011 3:35 am

Re: Need help with raze check

Post by Eidolon »

Actually I've a second trigger that catches when it is down.
^You raze (.+)'s magical shield with an adamant hammer of truth\.$
You raze (.+)'s aura of rebounding with an adamant hammer of truth\.$

shielded=false
for that one.
As far as target setting, I'm not sure what do you mean by that.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Need help with raze check

Post by Jor'Mox »

The variable "target" needs to be provided a value somewhere. It isn't being set in the bit of code you sent, so how you are determining what value to use for it?

If you intend that to be provided when you type in the alias, such as "ff bear", then you need to change your pattern to: ^ff (.*)$ (or something similar), and then put this at the beginning of your script: target = matches[2]

Eidolon
Posts: 15
Joined: Sun Sep 18, 2011 3:35 am

Re: Need help with raze check

Post by Eidolon »

hm...... well my target script is like:


^x (.*)$
target = matches[2]

where I just do x dog
and it'll be the set target .

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Need help with raze check

Post by Jor'Mox »

So, are you sure that your triggers are firing successfully? If you aren't completely sure, you can add in an echo so that there will be text displayed when the triggering text is seen. And, once you know all the triggers are doing the right thing, then what does the code you have in your alias do? Is there an error occurring? Or does it "work" without errors but still doesn't do what you want?

Post Reply