script help

Can anyone help me with a script I'm trying to create?

I want to be able to hit one buttom (alt+1 for example) and have it scroll through different abilities, let's say arash stance, mir stance and thyr stance.  Then I when it scrolls to say mir stance I want to be able to hit (ctrl+1) to activate that ability.

Anyone able to show me how I could create a script for this?

Comments

  • edited May 2014

    What client are you using? That makes a pretty substantial difference.

    General theory:

    Have a list (array) of commands you want to cycle through. Have a counter that keeps track of the current position in the list. Have your key combination move to the next entry in the list (accounting for rolling around to the start when necessary), display the command that will be executed. Have your other key combination (CTRL+1) send that command.

  • I'm on mudlet

  • JonathinJonathin Retired in a hole.
    edited May 2014

    I made a function specifically to cycle through table entries forward and backward. One sec and I'll find it.

    http://forums.achaea.com/discussion/1982/lua-table-function#latest


    Make a table:

    stanceTable = {"arash","mir","thyr","whatevertheotheroneis"}


    Then put this as your "alt-1" macro
    cycleTable("next",stanceTable)

    Then put this as your "ctrl-1" macro
    send(stanceTable[1])


    I am retired and log into the forums maybe once every 2 months. It was a good 20 years, live your best lives, friends.
Sign In or Register to comment.