simple if/else in mudlet -- what did I do wrong?

JaxeusJaxeus Member Posts: 32 Novice
Just wondering what I did wrong here...

if taurianrage = 0 then

  send("beast order attack "..matches[2], false )

  expandAlias("do enrage self")

else

    send("beast order attack "..matches[2], false )

    send("jab "..matches[2], false )

end


Thank you!


Comments

  • KioKio Member Posts: 992 Mythical
    if needtaurianrage then
    send("beast order attack " .. matches[2], false)
    expandAlias("do enrage self")
    else
    send("beast order attack " .. matches[2], false)
    send("jab " .. matches[2]. false)
    end

    Instead of setting taurianrage = 0, change whatever you're using to set needtaurianrage = true
  • UshaaraUshaara Schrödinger's Traitor Member Posts: 1,274 Transcendent
    You can compare to a number if you need to, just be sure to use '==' for the check. So 'if taurianrage == 0 then...'
  • NeosNeos The Subtle Griefer Member Posts: 1,538 Transcendent
    Before seeking out help, always check the error console(exclamation point button) and it will tell you any errors that popped up, and if you still can't figure it out from the error console, paste both your code and any errors that popped up.
    Love gaming? Love gaming stuff? Sign up for Lootcrate and get awesome gaming items. Accompanying video.

     Signature!


    Celina said:
    You can't really same the same, can you?
    Zvoltz said:
    "The Panthron"
  • MalikaiMalikai Member Posts: 29 Novice
    edited August 2013
    Jaxeus said:
    Just wondering what I did wrong here...

    if taurianrage = 0 then

      send("beast order attack "..matches[2], false )

      expandAlias("do enrage self")

    else

        send("beast order attack "..matches[2], false )

        send("jab "..matches[2], false )

    end


    Thank you!




    yeah, for simple yes/no variables with no actual numeric values, set them to either true or false. I made the same mistake you did and that straightened it out. Afterwards, instead of doing taurianrage = 0 you can simply do 'if not taurianrage' or 'if taurianrage' instead of typing out the value of the variable
Sign In or Register to comment.