autosting in mush

by Unknown

Back to Mechanic's Corner.

Unknown2007-08-21 09:45:44
Hi.

So for awhile now I've had a really ghetto sting trigger. Oh, for those that don't know I'm talking about: a skill in Nihilism called Barbedtail. It allows me to sting a target about every six-seven seconds. It has it's own balance and can be used off balance and eq. Anyways, check it:


custom_colour="13"
enabled="y"
expand_variables="y"
match="Your tail is poised high above your head, ready to strike."
omit_from_output="y"
regexp="y"
sequence="100"
>
sting @target



Well isn't that a lol. I've been just autostinging with no regard for my shielding or rebounding. Silly me! But I've made due...until now. I'm sick of it! With the guidance and help of my friend Deimos we've tried to make a new stinging system that will detect and stop if I'm aeoned, shielded, or have rebounding up.

For now I need help with this trigger, been getting this error and I don't know how to deal with it. Something is out of place. If I switch to "End" i will get another error message saying: Expected "End if"

Expected 'End'
Line in error:
End if

And the trigger.


custom_colour="13"
enabled="y"
expand_variables="y"
match="Your tail is poised high above your head, ready to strike."
regexp="y"
send_to="12"
sequence="100"
>
if getvariable("stingcheck") = 1 AND getvariable("affliction_aeon") = 0 AND getvariable("boundb") = 1 OR getvariable("pentagramb") = 1 then
send "sting @target"

Else
if getvariable("stingcheck") = 0 AND getvariable("stingstatus") = 0 then
send " "
End if




Meh, what is out of place?
Unknown2007-08-21 11:02:12
QUOTE(B_a_L_i @ Aug 21 2007, 11:45 AM) 435034

custom_colour="13"
enabled="y"
expand_variables="y"
match="Your tail is poised high above your head, ready to strike."
regexp="y"
send_to="12"
sequence="100"
>
if getvariable("stingcheck") = 1 AND getvariable("affliction_aeon") = 0 AND getvariable("boundb") = 1 OR getvariable("pentagramb") = 1 then
send "sting @target"

Else
if getvariable("stingcheck") = 0 AND getvariable("stingstatus") = 0 then
send " "
End if




Basically the problem is that you create two if statements, which both would have to be closed by an End If statement.

So what your code looks like:
CODE
if condition1 then
   dosomething()
else
   if condition2 then
      dosomething()
   end if // Closes the second if statement, but not the first.


While what you probably want is:
CODE
if condition1 then
   dosomething()
elseif condition2 then
   dosomething()
end if // Now there is only one if statement, which is closed.


Basically "elseif" is not equal to "else if". Then space or return makes all the difference between having one continuous if statement, or two different if statements.
Unknown2007-08-21 11:32:01
Not sure why you need the second if statement, though, since you're not actually doing anything inside of it. Why send a blank command when you could just not send a command at all?
Unknown2007-08-21 11:37:21
QUOTE(Zarquan @ Aug 21 2007, 04:32 AM) 435054
Not sure why you need the second if statement, though, since you're not actually doing anything inside of it. Why send a blank command when you could just not send a command at all?


Ah, we had some kooky reason for it. Deimos would know (when he gets around to reading this).