Need a simple alias

Post Reply
thaabit
Posts: 5
Joined: Tue Feb 05, 2013 12:31 pm

Need a simple alias

Post by thaabit »

I'm still taking my mudlet baby steps and need help.

I want to type mob and have it send 'setm '..currentMob... arg1 arg2.

Thanks!

Delrayne
Posts: 159
Joined: Tue Jun 07, 2011 7:07 pm
Contact:

Re: Need a simple alias

Post by Delrayne »

Alias: ^mob$

Code:
send("setm " .. currentMob .. " arg1 arg2)

Based on the information you've provided, that is how you would do that. However, it probably won't do what you want, since I assume arg1 and arg2 are things that will change based on what you want to do...If that's the case you need to provide a bit more info the args and we'll have to setup a function to handle that.

thaabit
Posts: 5
Joined: Tue Feb 05, 2013 12:31 pm

Re: Need a simple alias

Post by thaabit »

? huh

I thought it would be ridiculously simple.

mob gold 10
mob maxhit 5
mob armor 0

..i'll figure it out...

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Need a simple alias

Post by demonnic »

Pattern:
^mob (\w+) (\w+)$

Code:
Code: [show] | [select all] lua
send(string.format("setm %s %s %s", currentMob, matches[2], matches[3]))
--[[Alternately,
send("setm " .. currentMob .. " " .. matches[2] .. " " .. matches[3])
]]--

thaabit
Posts: 5
Joined: Tue Feb 05, 2013 12:31 pm

Re: Need a simple alias

Post by thaabit »

Ah sweet. I was just starting to understand this from the Yoda Speak example in the links.

Thx so much :)

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Need a simple alias

Post by demonnic »

'the links' would be what exactly?

thaabit
Posts: 5
Joined: Tue Feb 05, 2013 12:31 pm

Re: Need a simple alias

Post by thaabit »

i dunno why i said links. was reading: http://wiki.mudlet.org/w/Manual:Introduction

thaabit
Posts: 5
Joined: Tue Feb 05, 2013 12:31 pm

Re: Need a simple alias

Post by thaabit »

How would I make the aforementioned work with negative numbers. When I do mob armor -1, the trigger doesn't catch.

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Need a simple alias

Post by demonnic »

^mob (-?\w+) (-?\w+)$

Post Reply