[Mudlet] Tab Targetting

Hello! I'm completely new to Mudlet and have been playing Achaea for only 2 weeks. I recently switched from using nexus to mudlet and am in general completely new to scripting, triggers and alias.  So far I know super, super basics. I have the psion svo and Ashlia GUI (I tried ZulahGUI 2.0, but the gear never would show up.). 

What I want to do at this point is be able to tab target. I'm not interested in auto-targeting, just tabbing between targets like I did with nexus. Is there a script in order to do that?

Comments

  • edited May 2020
    Shouldn't be too hard to script. The only problem I see is actually using TAB as a key (without alt, ctrl, etc.), which I can't get to work with Mudlet (on OS X at least).

    I have no experience with Nexus so I'm not entirely sure how it works there. I assume you hit tab (or some other key) and it cycles your target between any denizen (and player?) in a room?
  • Yes, cycling it through any target in the room. Scripting confuses me so I was hoping to grab scripting to use. 
  • This is kinda crude, but should work with AshilaGUI_v2...just set it to any keybind/alias you like.

    https://wiki.mudlet.org/w/Manual:Introduction#Keybindings

    local d = {}
    
    for k,v in pairs(roomInvTable) do
      if v:match('%<green%>') then
        local t = {id=k,name=v}
        table.insert(d,t)
      end
    end
    
    if not tabtargetindex then tabtargetindex = 1 end
    if tabtargetindex < 1 then tabtargetindex = 1 end
    if tabtargetindex > table.size(d) then tabtargetindex = 1 end
    
    if table.size(d) > 0 then
      target = d[tabtargetindex].id
      cecho('\nTargetting: '..d[tabtargetindex].name)
      send('SETTARGET '..target,false)
    else
      cecho('\n<red>Nothing to Target!')
    end
    
    tabtargetindex = tabtargetindex + 1
  • Thank you! That worked wonderfully!!!
  • I'm having difficulty setting this up. When I enter the above script into a keybinding, Mudlet tells me there's an error in the code.

    The exact message I'm getting is:

    Lua syntax error:[string "Key: Targetting"]:12: 'then' expected near '&'

    Any ideas what' I'm doing wrong? All help will be very warmly received ☺️

  • Lua syntax error:[string "Key: Targetting"]:12: 'then' expected near '&'

    @Aiwendil That would be because new forums messed up the code blocks. Ping @Thaisen for the original code.

    Disappearing from Achaea for now. See you, space cowboy.


    smileyface#8048 if you wanna chat.

  • That makes sense. Thank you 😊

  • Yikes, looks like it messed up the greater than and less than signs.

    Basically wherever you see "&gt;" replace it with ">" and wherever you see "&lt;" replace it with "<".

  • Awesome. Thanks for responding so quickly, I'll make the changes now.

  • Any chance someone could make this work with Zulah's new GUI? https://forums.achaea.com/discussion/7391/mudlet-4-9-gui

Sign In or Register to comment.