(New message)
Subject review (reverse sequence)
Posted by
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator
Date
Sat 23 Jul 2011 12:15 AM (UTC) [ quote
]
Message
Yes, the FAQ point 50 describes exactly that.
- Nick Gammon
www.gammon.com.au, www.mushclient.com top
Posted by
Errigour
(16 posts) bio
Date
Fri 22 Jul 2011 12:22 PM (UTC) [ quote
]
Message
Thanks I wanted to intercept Null commands from the mud
itself so that help big time and also regular that regular
expression forum helped some.
Can I ask you if there is a way to configure mush client to not ignore aliases such as "heal *" when I only type "heal"
by itself. top
Posted by
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator
Date
Fri 22 Jul 2011 11:26 AM (UTC) [ quote
] Amended on Fri 22 Jul 2011 11:27 AM (UTC) by Nick Gammon
Message
Errigour said:
I used the code above and when I just type heal it would send
heal to to mud instead of sending Note("heal").
I expect that because your alias matches: heal<space><something> and typing "heal" does not have a space.
Errigour said:
... if I typed heal with a space "heal " or "heal " it sends an error message my way.
I expect that too. It replaces %1 by whatever you had after the space. So if there is nothing after the space it will have given you:
if > 0 then
for i = 1, do
Send("heal heal")
end
end
You really need to convert %1 to a number while it is in quotes. eg.
local count = tonumber ("%1")
if count then -- that is, if it is a number
for i = 1, count do
Send("heal heal")
end
else
Note ("heal")
end -- if
Also:
- Nick Gammon
www.gammon.com.au, www.mushclient.com top
Posted by
Errigour
(16 posts) bio
Date
Fri 22 Jul 2011 11:18 AM (UTC) [ quote
]
Message
alias:heal *
if tonumber("%1") then
if %1 > 0 then
for i = 1, %1 do
Send("heal heal")
end
end
else
Note("heal")
end
I used the code above and when I just type heal it would send
heal to to mud instead of sending Note("heal"). and if I typed heal with a space "heal " or "heal " it sends an error
message my way.
[string "Alias: "]:2: unexpected symbol near '>'
I want to send Send("heal %1") if %1 is a space or a character and it seems to me tonumber recognizes that %1 is a number even if its an empty space.
MUSHclient
It ignores the command all together if I type heal without an argument also and it works if its a character but not
when it's a blank space. So I used "heal*" to fix the ignoring script part and now it just gives me an error when I type heal by itself. I removed the if statement if %1 > 0
and i get this error when typing heal by itself.
[string "Alias: "]:2: unexpected symbol near 'do'
So The Above works accept it doesn't work when I just type heal and leave * null. Is there a better way to do what I am trying to do without sending me an error message when I type heal with a null %1 character? top
Posted by
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator
Date
Mon 18 Jul 2011 08:49 PM (UTC) [ quote
] Amended on Mon 18 Jul 2011 08:50 PM (UTC) by Nick Gammon
Message
Errigour said:
I also want to use AddAlias with more then one flag etc alias_flag.Enabled and alias_flag.eExpandVariables
You might find addxml easier to use:
http://www.gammon.com.au/forum/?id=7123
eg.
require "addxml"
addxml.alias {
match = "k",
enabled = true,
expand_variables = true,
send = "kick @target",
sequence = 100,
}
- Nick Gammon
www.gammon.com.au, www.mushclient.com top
Posted by
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator
Date
Mon 18 Jul 2011 08:33 PM (UTC) [ quote
]
Message
Posted by
Fiendish
USA (848 posts) bio
Global Moderator
Date
Mon 18 Jul 2011 06:28 PM (UTC) [ quote
] Amended on Mon 18 Jul 2011 06:29 PM (UTC) by Fiendish
Message
In reverse order...
if tonumber("%1") then
-- do stuff here if %1 is a number
else
-- do stuff here if %1 is not a number
end
Flags are just magic numbers staggered in such a way that they can be added together. So add them together.
I don't understand your question.
http://aardwolfclientpackage.googlecode.com/ top
Posted by
Errigour
(16 posts) bio
Date
Mon 18 Jul 2011 05:21 PM (UTC) [ quote
]
Message
I also wanna ask one more question here if it's ok.
I want to make an alias
heal *
and if %1 is a number then I want it
to execute a for loop and if %1 is
a word/character then I want it to
execute normaly top
Posted by
Errigour
(16 posts) bio
Date
Mon 18 Jul 2011 03:49 PM (UTC) [ quote
]
Message
I also want to use AddAlias with more then one flag etc alias_flag.Enabled and alias_flag.eExpandVariables top
Posted by
Errigour
(16 posts) bio
Date
Mon 18 Jul 2011 03:43 PM (UTC) [ quote
]
Message
I want the following code to use i inside the "" qoute marks instead of i.
for i= 1, 7 do
AddAlias("", "i", "cast '@castingspell' @target", alias_flag.Enabled, alias_flag.eExpandVariables, "")
end
top
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
1,355 views.
Reply to this subject
Start a new subject
  Refresh page
Go to topic:
(Choose topic)
Area Editor: Bug reports
Area Editor: General
Area Editor: News and updates
Area Editor: Suggestions
Area Editor: Tips and tricks
Dawn of Time: Administration
Dawn of Time: Configuration
Dawn of Time: Installing/compiling the server
Dawn of Time: New Dawn Muds Announcements
Dawn of Time: Playing
Dawn of Time: What is Dawn of Time (Dawn)?
Electronics: Microprocessors
Electronics: Operational Amplifiers
Forum: About
Forum: Announcements
Forum: Mailing other users
Forum: Problems
Forum: Registering
Forum: Searching
Forum: Subscribing
Forum: Suggestions
Forum: Test
Forum: Time zones / time display
Forum software: Administration
Forum software: Installation
MUDs: Announcements
MUDs: General
MUDs: MUD Design Concepts
MUSHclient: Announcements
MUSHclient: Beta testing
MUSHclient: Bug reports
MUSHclient: Development
MUSHclient: General
MUSHclient: Getting Started
MUSHclient: International
MUSHclient: Jscript
MUSHclient: Lua
MUSHclient: Miniwindows
MUSHclient: MXP and Pueblo
MUSHclient: Perlscript
MUSHclient: Plugins
MUSHclient: Python
MUSHclient: Suggestions
MUSHclient: Tips and tricks
MUSHclient: VBscript
MUSHclient: Wine
PennMUSH: Compiling the server
PennMUSH: Running the server
Programming: General
Programming: STL
Quilting: General
ROM: Compiling the server
ROM: Running the server
SMAUG: Commands
SMAUG: Compiling the server
SMAUG: Lua
SMAUG: Running the server
SMAUG: SMAUG coding
Search the forum
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )