Difference between revisions of "DeleteFull"

From Mudlet
Jump to navigation Jump to search
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
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.
+
[[Category:Mudlet Package Listing]]
It works using the '''isPrompt()''' function built in to mudlet.
+
{| class="wikitable" style="width: 70%;"
 +
|-
 +
| style="width: 10%" | Game || non-mud specific
 +
|-
 +
| By || Mudlet Community
 +
|-
 +
| Download || none
 +
|-
 +
| Dependencies || <!-- any package dependencies|mudlet version requirements --> Mudlet 4.17
 +
|}
  
  '''function''' deleteFull()
+
= Description =  
  deleteLine()
+
<!-- A description about what your script accomplishes. -->
  tempLineTrigger(1,1,[[if isPrompt() then
+
 
    deleteLine()
+
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.
  end]])
+
 
'''end'''
+
= Usage =
 +
 
 +
<syntaxhighlight lang="lua">
 +
function deleteFull()
 +
  deleteLine()
 +
  tempLineTrigger(1,1,[[if isPrompt() then
 +
    deleteLine()
 +
  end]])
 +
end
 +
</syntaxhighlight>
 +
 
 +
= Examples =
  
 
This function is made to work with Achaea's 'ship prompt', deleting that as well as the normal prompt,
 
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
 
or just the normal prompt if the ship prompt does not exist
  
'''function''' deleteLineP()
+
<syntaxhighlight lang="lua">
  deleteLine()
+
function deleteLineP()
  tempLineTrigger(1,1, [==[ if isPrompt() then
+
  deleteLine()
      deleteLine()
+
  tempLineTrigger(1,1, [==[ if isPrompt() then
      elseif string.match(line, "^= %[Sail %w+%%?%] %[Hull%] %[Wind: %w+@%d+ kts%] %[Crs/Spd: %w+@%d+%] %[Seas: %w+%]%s?")  
+
    deleteLine()
          or string.match(line, "^= Sl %w+%%? %- hp %w+%%?,Hl: %w+%%?,Wd %w+@%d+kts,Cr/Sp %w+@%d+,Sea %w+")
+
    elseif string.match(line, "^= %[Sail %w+%%?%] %[Hull%] %[Wind: %w+@%d+ kts%] %[Crs/Spd: %w+@%d+%] %[Seas: %w+%]%s?")  
          or string.match(line, "^= S..@h..,H..,W<%-%w+@%d+kts,C/S%->%w+@%d+,%w+") then
+
      or string.match(line, "^= Sl %w+%%? %- hp %w+%%?,Hl: %w+%%?,Wd %w+@%d+kts,Cr/Sp %w+@%d+,Sea %w+")
        deleteLine()
+
      or string.match(line, "^= S..@h..,H..,W<%-%w+@%d+kts,C/S%->%w+@%d+,%w+") then
        tempLineTrigger(1,1, <nowiki>[[if isPrompt() then deleteLine() end]]</nowiki>)
+
    deleteLine()
      end]==])
+
    tempLineTrigger(1,1, [[if isPrompt() then deleteLine() end]])
'''end'''
+
  end]==])
 
+
end
 
+
</syntaxhighlight>
[[Category:Snippets]]
 

Latest revision as of 02:20, 19 January 2024

Game non-mud specific
By Mudlet Community
Download none
Dependencies Mudlet 4.17

Description

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.

Usage

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

Examples

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