lastLine, lineBefore, and duplicate line "+" echo

lastLine, lineBefore, and duplicate line "+" echo

Postby *juggleblood* » Thu Feb 25, 2016 10:44 pm

Here's a simple one that I like.
Define these vars in your definitions script:
lastLine=lastLine or ""
lineBefore=lineBefore or ""

Then make a new trigger and name it LAST LINE TRIGGER, or wutever
regex trigger:
(^[A-Z].*)

block:

if matches[2]==lastLine then
selectCurrentLine()
deleteLine()
cecho("<maroon>+<reset>")
end
lineBefore=lastLine
lastLine=matches[2]

------------
Now anytime you get a duplicate line from the mud, it will be deleted, and a maroon + will appear at the end of the preceeding line. Also now you can access the var lineBefore in your scripts which can be handy.
Talk to the clown.
User avatar
*juggleblood*
Hall of Fame Avatar Poster
 
Posts: 1304
Joined: Sun Jan 22, 2006 6:36 am
Location: Beyond Yonder
Status: Offline

Re: lastLine, lineBefore, and duplicate line "+" echo

Postby Madigan » Fri Feb 26, 2016 3:06 am

what's an example of when this would be handy?
Madigan
 
Posts: 30
Joined: Fri Sep 17, 2010 1:22 am
Status: Offline

Re: lastLine, lineBefore, and duplicate line "+" echo

Postby *juggleblood* » Sat Feb 27, 2016 12:01 am

You could add a check to the xp updater for example to see what lastLine is and you could track averages on the xp that your strikes or blasts were doing.
Talk to the clown.
User avatar
*juggleblood*
Hall of Fame Avatar Poster
 
Posts: 1304
Joined: Sun Jan 22, 2006 6:36 am
Location: Beyond Yonder
Status: Offline


Return to Mudlet - unlimited possibilities

Who is online

Users browsing this forum: No registered users and 4 guests