Mudlet Questions

by Rika

Back to Mechanic's Corner.

Unknown2011-09-06 23:00:34
QUOTE (Stratas @ Aug 31 2011, 11:37 PM) <{POST_SNAPBACK}>
Okay, tried that, and now I'm getting the error: "Lua syntax error:... \\\\phpTables.lua:22: attempt to get length of global 'arg' (a nil value)"


He meant to literally replace table.getn(arg) with #arg

i.e. If our table is called 'foo' then rather than use table.getn(foo), you simply use #foo
Vadi2011-09-06 23:55:55
I think in that case he needed to use #{...}

Not sure though, didn't test
Calixa2011-09-07 15:06:11
QUOTE (Calixa @ Sep 5 2011, 12:53 AM) <{POST_SNAPBACK}>
Still can't get this to work for the XP counter:

I have the four output lines of QSC in a multi-line trigger. Or rather, three of them, as the line containing the XP information is used to take variables from. I want to gag the whole output of QSC, but it has to be done in such a manner that the script still gets the variables to work with. How do I do this without gagging each line individually, which leads to lines that appear elsewhere to be gagged too.

And on a related note, when I set a trigger to run for the next 99 lines, is there just no way to make it so that if it executes after 20 lines it stops triggering completely? It now continues happily on.


*bump* Anyone? sad.gif I checked the manual and all.
Reithiss2011-09-07 18:42:13
Does mudlet also save its crashes in a file?
Thing is now, Mudlet crashes on me as soon as I put in my login information so I cannot reach the errors menu and thus cannot see what's wrong. I've tried uninstalling packages too. :/
Lilia2011-09-07 19:14:36
QUOTE (Calixa @ Sep 4 2011, 05:53 PM) <{POST_SNAPBACK}>
Still can't get this to work for the XP counter:

I have the four output lines of QSC in a multi-line trigger. Or rather, three of them, as the line containing the XP information is used to take variables from. I want to gag the whole output of QSC, but it has to be done in such a manner that the script still gets the variables to work with. How do I do this without gagging each line individually, which leads to lines that appear elsewhere to be gagged too.

I'm just guessing here, but put all four lines in the same trigger, check multiline trigger, make the delta 4, and put deleteLine() as the first line of code. Gagging a line doesn't prevent information being captured from it. I think you'll need to use multimatches instead of matches.
QUOTE
And on a related note, when I set a trigger to run for the next 99 lines, is there just no way to make it so that if it executes after 20 lines it stops triggering completely? It now continues happily on.

setTriggerStayOpen("name of trigger", 0) will turn it off. I have this trigger on the prompt to close the gates of things that print out all at once, like your enemy list, or the powerlogs. You'll need to enableTrigger("name of trigger") for it start working again.
Vadi2011-09-07 20:28:04
Unknown2011-09-22 19:24:34
I'm trying to make a highlight script so that when I type at it adds a person to a list and whoever is on the list will be highlighted red. So far I'm only able to do this with my main target using the following:

QUOTE
Alias Pattern: ^t (.*)$

target = matches
echo (target)
if id then killTrigger(id) end
id = tempTrigger(target, ] .. target .. ])


Now how can I do it with more than one name at a time? Is it possible? Also how would I code it so I can remove names from it? Thanks!
Anisu2011-09-22 21:49:00
QUOTE (Xyas @ Sep 22 2011, 09:24 PM) <{POST_SNAPBACK}>
I'm trying to make a highlight script so that when I type at it adds a person to a list and whoever is on the list will be highlighted red. So far I'm only able to do this with my main target using the following:



Now how can I do it with more than one name at a time? Is it possible? Also how would I code it so I can remove names from it? Thanks!

use a table

name = string.title(string.lower(matches))
if Listtrigger == nil then
Listtrigger = tempTrigger(name, ] .. name .. ])
else
echo("name already added\\n")
end

listing of names
echo("the following are in the list: ")
for k,v in pairs(Listtrigger) do
echo(k .. " ")
end
echo("\\n")


for removal
name = string.title(string.lower(matches))
if Listtrigger ~= nil then
killTrigger(Listtrigger)
Listtrigger = nil
else
echo("Name is not in the list\\n")
end

(it is late and I'm ill so it is probably full of mistakes)
Unknown2011-09-22 22:16:23
So all that just goes into one script?
Lilia2011-09-22 22:22:35
No, that's the code for three separate aliases. You'll also need to initialize the table somewhere. A login trigger will work for that. I'd also add remember(Listtrigger) to the first alias, saveVars() to a logout trigger, and loadVars() to the login trigger.
Neos2011-09-22 22:31:15
QUOTE (Lilia @ Sep 22 2011, 06:22 PM) <{POST_SNAPBACK}>
No, that's the code for three separate aliases. You'll also need to initialize the table somewhere. A login trigger will work for that. I'd also add remember(Listtrigger) to the first alias, saveVars() to a logout trigger, and loadVars() to the login trigger.

remember("Listtrigger")*

Though there is a much better way to save it using table.save() and table.load().
Anisu2011-09-23 07:39:49
QUOTE (Lilia @ Sep 23 2011, 12:22 AM) <{POST_SNAPBACK}>
No, that's the code for three separate aliases. You'll also need to initialize the table somewhere. A login trigger will work for that. I'd also add remember(Listtrigger) to the first alias, saveVars() to a logout trigger, and loadVars() to the login trigger.

Saving can just be done after each add rather than logout. Much better for poweroutages, however he didn't specify that it needed to persist, if he wants that I believe there is a ready made script for that on the mudlet forums.
Unknown2011-09-23 12:45:01
^
Wow last question was in 2005. Anyway I just got Mushclient and I wanna know, how do I queue actions using Lua? In Nexus when I want to set up my defenses I just do "def 1" #wait "def 2". I'm wondering if there is a better way to do this or is there a #wait equivalent for Mush that I can use.

D
Unknown2011-09-23 13:32:21
A. This thread is about Mudlet, not MUSHclient.
B. It's better to store your list of wanted defenses in a list and pop them off as you recover balance/equilibrium than to use timers.
Unknown2011-09-23 16:31:21
oh, woops!

Pardon that. I am blind sometimes.

D
Unknown2011-09-25 22:35:17
I just re-installed the newest version of Mudlet onto Windows 7, and the "map" button is gone. How do you open the mapper now? O_o
Vadi2011-09-25 23:53:57
Unknown2011-10-01 04:21:34
Mudlet keeps crashing whenever I try opening the mapper. :c Anyone know why?
Vadi2011-10-01 05:30:24
sad.gif

Using latest?
Unknown2011-10-01 06:00:20
sad.gif Yes. It was working earlier, but when I uninstalled and deleted everything concerning mudlet off of the memory to fix m&m, it would crash everytime I tried opening it.