Difference between revisions of "DeleteFull"

From Mudlet
Jump to navigation Jump to search
Line 9: Line 9:
 
         deleteLine()
 
         deleteLine()
 
         end]])
 
         end]])
 +
end
 +
 +
 +
-- This function is made to work with Achaea's 'ship prompt', deleting that as well as the normal prompt,
 +
-- or just the normal prompt if the ship prompt does not exist
 +
 +
function deleteLineP()
 +
  deleteLine()
 +
  tempLineTrigger(1,1, [==[ if isPrompt() then
 +
      deleteLine()
 +
  elseif string.match(line, "^= %[Sail %w+%%?%] %[Hull%] %[Crew End: %d+%%%] %[Wind: %w+@%d+ kts%] %[Crs/Spd: %w+@%d+%] %[Seas: %w+%]%s?")
 +
            or string.match(line, "^= Sl %w+%%? %- hp %w+%%?,Hl: %w+%%?,CEnd %d+%%,Wd %w+@%d+kts,Cr/Sp %w+@%d+,Sea %w+")
 +
            or string.match(line, "^= S..@h..,H..,CE%d+%%,W<%-%w+@%d+kts,C/S%->%w+@%d+,%w+") then
 +
      deleteLine()
 +
      tempLineTrigger(1,1, [[ if isPrompt() then deleteLine() end ]])
 +
  end]==])
 +
end
 +
 
</lua>
 
</lua>
 +
 +
 
[[Category:Snippets]]
 
[[Category:Snippets]]

Revision as of 20:56, 10 March 2013

<lua>

--This function was made by random mudlet users. It works to delete the line, as well as the next line, if the next line is a prompt. --It works using the isPrompt() function built in to mudlet.

function deleteFull()

       deleteLine()
       tempLineTrigger(1,1,[[if isPrompt() then
       deleteLine()
       end]])

end


-- This function is made to work with Achaea's 'ship prompt', deleting that as well as the normal prompt, -- or just the normal prompt if the ship prompt does not exist

function deleteLineP()

  deleteLine()
  tempLineTrigger(1,1, [==[ if isPrompt() then
     deleteLine()
  elseif string.match(line, "^= %[Sail %w+%%?%] %[Hull%] %[Crew End: %d+%%%] %[Wind: %w+@%d+ kts%] %[Crs/Spd: %w+@%d+%] %[Seas: %w+%]%s?") 
            or string.match(line, "^= Sl %w+%%? %- hp %w+%%?,Hl: %w+%%?,CEnd %d+%%,Wd %w+@%d+kts,Cr/Sp %w+@%d+,Sea %w+")
            or string.match(line, "^= S..@h..,H..,CE%d+%%,W<%-%w+@%d+kts,C/S%->%w+@%d+,%w+") then
     deleteLine()
     tempLineTrigger(1,1, if isPrompt() then deleteLine() end )
  end]==])

end

</lua>