Using deleteLine() at the tail of other trigger processing

Post Reply
Slayd
Posts: 102
Joined: Mon Jul 25, 2011 4:57 am

Using deleteLine() at the tail of other trigger processing

Post by Slayd »

I'm trying to capture certain information on particular lines, then deleteLine().

It seems that the deleteLine() trumps all...the line is deleted but the previous actions on the trigger are ignored. Is that the way it's supposed to work?

Drevarr
Posts: 43
Joined: Tue Aug 06, 2013 12:07 am
Location: GA, USA

Re: Using deleteLine() at the tail of other trigger processi

Post by Drevarr »

I would suggest checking your logic without the deleteLine() to make sure you have things working appropriately.

I use deleteLine() a lot to remove text from the main window that I have routed to miniconsoles.

example:
Code: [show] | [select all] lua
if not string.starts(line, "Zone:") then
	if not string.starts(line, "Room:") then
		selectCurrentLine()
		copy()
		local lineLength = string.len(line)
		local repLength = (22-lineLength)/2
		local myString = string.rep(" ", repLength)
		echo("GUI.MapMini", myString)
		appendBuffer("GUI.MapMini")
		deleteLine()
	end
end

Slayd
Posts: 102
Joined: Mon Jul 25, 2011 4:57 am

Re: Using deleteLine() at the tail of other trigger processi

Post by Slayd »

I did remove deleteLine() as part of my debugging to see what was wrong. Everything worked without the deleteLine(). deleteLine() is the last command in my trigger script. I'm using captures, matches[2] and matches[3] off a perl regex pattern whereas you are using the mudlet system variable line. Could that be the difference?

Drevarr
Posts: 43
Joined: Tue Aug 06, 2013 12:07 am
Location: GA, USA

Re: Using deleteLine() at the tail of other trigger processi

Post by Drevarr »

Any chance you trigger is multi-line? or otherwise allowing the cursor to get beyond the line your wanting to delete?


Regarding you follow up, this works for me which uses matches[3]:
Pattern: (Head|Front|Back)\)\s(.*)$
Code: [show] | [select all] lua
local xName = string.trim(matches[3])
groupMate = xName
GroupCount = GroupCount +1
deleteLine()

Slayd
Posts: 102
Joined: Mon Jul 25, 2011 4:57 am

Re: Using deleteLine() at the tail of other trigger processi

Post by Slayd »

It's a single-line trigger

Post Reply