Search found 176 matches

by Iocun
Wed Aug 31, 2011 9:17 pm
Forum: Help Forum
Topic: In need of a function
Replies: 3
Views: 3575

Re: In need of a function

For deleting lines previous to the current one, you can use moveCursor() though:
Code: [show] | [select all] lua
moveCursor(0,getLineCount()-1)
deleteLine()
moveCursor(0,getLineCount())
deleteLine()
The above would delete the previous and the current line, for instance.
by Iocun
Tue Aug 30, 2011 10:08 pm
Forum: Help Forum
Topic: FOR loop question
Replies: 3
Views: 3930

Re: FOR loop question

Take note that technically, the value is still stored in the variable with the name "_". So using the underscore instead of something like "k" or "key" or whatever has no effect on Lua by itself, but is simply a naming convention for a dummy variable you don't wish to f...
by Iocun
Tue Aug 30, 2011 9:58 pm
Forum: Help Forum
Topic: exact match or anchoring with regex
Replies: 5
Views: 3807

Re: exact match or anchoring with regex

I shield most of my regexes with multiline triggers and I've never noticed much trigger lag. And personally, I also prefer them visually, since you have the whole trigger patterns on the same page, without having to click on separate items to see the whole trigger. But I guess that's just a matter o...
by Iocun
Mon Jul 25, 2011 11:11 pm
Forum: Help Forum
Topic: remove multiple values from indexed table
Replies: 11
Views: 9770

Re: remove multiple values from indexed table

Hm, no, you'd be looping in another loop that removes entries from a different table. I'm not sure if your way will continue iterating properly... Correct me if I'm wrong, but I thought you meant something like: local bad_indices = {} for i,v in ipairs(mytable) do if v == "somevalueIdon'tlike&...
by Iocun
Mon Jul 25, 2011 9:47 pm
Forum: Help Forum
Topic: remove multiple values from indexed table
Replies: 11
Views: 9770

Re: remove multiple values from indexed table

I don't think so. You'd just remember all the indexes in another table and table.remove them in another loop. Well, but you'd run into the same problem with table.remove changing the indexes around then. Personally, I'd do it without ipairs() in the first place: for n=#mytable,1,-1 do if mytable[n]...
by Iocun
Mon Jul 18, 2011 1:23 pm
Forum: Mudlet Development
Topic: Profile Cleanup
Replies: 4
Views: 8726

Profile Cleanup

Vadi asked me to write a Lua function that automatically deletes old profiles/maps, to reduce the pile of snapshots that build up over time. I'm posting the package consisting of a function and an alias here instead of the "Scripts & Packages" forum, because it's still meant for testin...
by Iocun
Sun May 29, 2011 12:23 am
Forum: Help Forum
Topic: How to multitarget Achaea?
Replies: 4
Views: 3740

Re: How to multitarget Achaea?

Well, the GMCP would involve first activating your GMCP in the Mudlet settings, then creating a script to handle the "gmcp.Char.Items.List" event, check whether gmcp.Char.Items.List.location is "room", and if so, copy the table gmcp.Char.Items.List.items to another table you crea...
by Iocun
Sat May 28, 2011 10:16 am
Forum: Help Forum
Topic: How to multitarget Achaea?
Replies: 4
Views: 3740

Re: How to multitarget Achaea?

Easiest way is simply having two aliases. Alias on the pattern: ^tt (.+)$ that executes: target1 = matches[2] Alias on the pattern: ^ttt (.+)$ that executes: target2 = matches[2] Then your attack alias on the pattern: ^c$ that executes: sendAll("kill "..tostring(target1), "kill "...
by Iocun
Mon May 16, 2011 12:07 pm
Forum: Help Forum
Topic: Lua help: re-storing functions?
Replies: 3
Views: 3040

Re: Lua help: re-storing functions?

tempTimers can only call anonymous functions, so you have to put the myfunction() call within another, anonymous one: tempTimer(5, function() myfunction() end) Alternatively, I guess you could technically put the whole code of the function inside its return as a string: local function myfunction() l...
by Iocun
Mon Mar 28, 2011 9:47 am
Forum: General Forum
Topic: Mudlet-2.0 release candidates [latest: Mudlet 2.0 final]
Replies: 190
Views: 201238

Re: 2.0 snapshots

Rakon wrote: I can confirm this issue in my version of Mudlet on Linux as well.
Likewise (Mac OS X).