Mudlet rift mapper 1 1

From Mortal Realms Mud
Revision as of 13:06, 23 October 2022 by Atari (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.001">
	<TriggerPackage>
		<TriggerGroup isActive="no" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
			<name>Rift Mapper</name>
			<script></script>
			<triggerType>0</triggerType>
			<conditonLineDelta>0</conditonLineDelta>
			<mStayOpen>0</mStayOpen>
			<mCommand></mCommand>
			<packageName></packageName>
			<mFgColor>#ff0000</mFgColor>
			<mBgColor>#ffff00</mBgColor>
			<mSoundFile></mSoundFile>
			<colorTriggerFgColor>#000000</colorTriggerFgColor>
			<colorTriggerBgColor>#000000</colorTriggerBgColor>
			<regexCodeList />
			<regexCodePropertyList />
			<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
				<name>Get Character Name</name>
				<script>if CaptureCharacterName == "True" then
  RiftingCharacter = tostring(matches[2])
  CaptureCharacterName = "False"
end</script>
				<triggerType>0</triggerType>
				<conditonLineDelta>0</conditonLineDelta>
				<mStayOpen>0</mStayOpen>
				<mCommand></mCommand>
				<packageName></packageName>
				<mFgColor>#ff0000</mFgColor>
				<mBgColor>#ffff00</mBgColor>
				<mSoundFile></mSoundFile>
				<colorTriggerFgColor>#000000</colorTriggerFgColor>
				<colorTriggerBgColor>#000000</colorTriggerBgColor>
				<regexCodeList>
					<string>\| (\w+)</string>
				</regexCodeList>
				<regexCodePropertyList>
					<integer>1</integer>
				</regexCodePropertyList>
			</Trigger>
			<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
				<name>Get Max Mana</name>
				<script>MaxMana = tonumber(matches[3])</script>
				<triggerType>0</triggerType>
				<conditonLineDelta>0</conditonLineDelta>
				<mStayOpen>0</mStayOpen>
				<mCommand></mCommand>
				<packageName></packageName>
				<mFgColor>#ff0000</mFgColor>
				<mBgColor>#ffff00</mBgColor>
				<mSoundFile></mSoundFile>
				<colorTriggerFgColor>#000000</colorTriggerFgColor>
				<colorTriggerBgColor>#000000</colorTriggerBgColor>
				<regexCodeList>
					<string>Mana: (\d+)/(\d+)</string>
				</regexCodeList>
				<regexCodePropertyList>
					<integer>1</integer>
				</regexCodePropertyList>
			</Trigger>
			<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
				<name>Check Mana</name>
				<script>CurrentMana = tonumber(matches[3])
if sleeping == "True" then
  if CurrentMana == MaxMana then
    send("wake")
    send("c feast")
    --send("eat turkey")
    --send("drink water")
    sleeping = "False"
    if CastingRift == "True" then
      send("c rift "..StartRift)
    elseif CastingRip == "True" then
      send("c rip")
    end
  end
end</script>
				<triggerType>0</triggerType>
				<conditonLineDelta>0</conditonLineDelta>
				<mStayOpen>0</mStayOpen>
				<mCommand></mCommand>
				<packageName></packageName>
				<mFgColor>#ff0000</mFgColor>
				<mBgColor>#ffff00</mBgColor>
				<mSoundFile></mSoundFile>
				<colorTriggerFgColor>#000000</colorTriggerFgColor>
				<colorTriggerBgColor>#000000</colorTriggerBgColor>
				<regexCodeList>
					<string><(\d+)hp (\d+)m (\d+)mv (\d+)g></string>
				</regexCodeList>
				<regexCodePropertyList>
					<integer>1</integer>
				</regexCodePropertyList>
			</Trigger>
			<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
				<name>Rip Made</name>
				<script>CastingRip = "False"
RipDir = matches[2]
if RipDir == "above" then
  RipDir = "up"
elseif RipDir == "below" then
  RipDir = "down"
end
send(RipDir)
send("c rift " .. StartRift)
CastingRift = "True"</script>
				<triggerType>0</triggerType>
				<conditonLineDelta>0</conditonLineDelta>
				<mStayOpen>0</mStayOpen>
				<mCommand></mCommand>
				<packageName></packageName>
				<mFgColor>#ff0000</mFgColor>
				<mBgColor>#ffff00</mBgColor>
				<mSoundFile></mSoundFile>
				<colorTriggerFgColor>#000000</colorTriggerFgColor>
				<colorTriggerBgColor>#000000</colorTriggerBgColor>
				<regexCodeList>
					<string>You create a room of haven to the (\w+)!</string>
					<string>You create a room of haven (\w+) you!</string>
				</regexCodeList>
				<regexCodePropertyList>
					<integer>1</integer>
					<integer>1</integer>
				</regexCodePropertyList>
			</Trigger>
			<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
				<name>Rift Made</name>
				<script>CastingRift = "False"
RiftDir = matches[2]
if RiftDir == "above" then
  RiftDir = "up"
elseif RiftDir == "below" then
  RiftDir = "down"
end

send(RiftDir)
CaptureRoomName = "True"</script>
				<triggerType>0</triggerType>
				<conditonLineDelta>0</conditonLineDelta>
				<mStayOpen>0</mStayOpen>
				<mCommand></mCommand>
				<packageName></packageName>
				<mFgColor>#ff0000</mFgColor>
				<mBgColor>#ffff00</mBgColor>
				<mSoundFile></mSoundFile>
				<colorTriggerFgColor>#000000</colorTriggerFgColor>
				<colorTriggerBgColor>#000000</colorTriggerBgColor>
				<regexCodeList>
					<string>You cause space and time to warp irreparably to the (\w+)!</string>
					<string>You cause space and time to warp irreparably (\w+) you!</string>
				</regexCodeList>
				<regexCodePropertyList>
					<integer>1</integer>
					<integer>1</integer>
				</regexCodePropertyList>
			</Trigger>
			<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="yes" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="yes" isColorTriggerFg="no" isColorTriggerBg="no">
				<name>Get Room Name</name>
				<script>--showMultimatches()
if CaptureRoomName == "True" then
  NameOfRoom = multimatches[1][1]
  --echo("\nName of Room: " .. NameOfRoom)
  GetAreaName = "True"
  CaptureRoomName = "False"
  send("who " .. RiftingCharacter)
end</script>
				<triggerType>0</triggerType>
				<conditonLineDelta>0</conditonLineDelta>
				<mStayOpen>0</mStayOpen>
				<mCommand></mCommand>
				<packageName></packageName>
				<mFgColor>#ff0000</mFgColor>
				<mBgColor>#ffff00</mBgColor>
				<mSoundFile></mSoundFile>
				<colorTriggerFgColor>#ff0000</colorTriggerFgColor>
				<colorTriggerBgColor>#000000</colorTriggerBgColor>
				<regexCodeList>
					<string>FG3BG-2</string>
					<string>^(.+)$</string>
				</regexCodeList>
				<regexCodePropertyList>
					<integer>6</integer>
					<integer>1</integer>
				</regexCodePropertyList>
			</Trigger>
			<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
				<name>Get Area Name</name>
				<script>NameLength = tonumber(string.len(RiftingCharacter))
NameCheck = string.sub(tostring(matches[6]), 1, NameLength)

if NameCheck == RiftingCharacter and sleeping == "False" and GetAreaName == "True" then
  GetAreaName = "False"
  RiftArea = matches[7]
  --echo("\n" .. RiftArea)
  if RiftDir == "up" then
    OppRiftDir = "down"
  elseif RiftDir == "down" then
    OppRiftDir = "up"
  elseif RiftDir == "west" then
    OppRiftDir = "east"
  elseif RiftDir == "east" then
    OppRiftDir = "west"
  elseif RiftDir == "north" then
    OppRiftDir = "south"
  elseif RiftDir == "south" then
    OppRiftDir = "north"
  end
  send(OppRiftDir)
  send("c rip")
  CastingRip = "True"
  WriteRiftList(StartRift,NameOfRoom,RiftArea)
  StartRift = StartRift + 1
end</script>
				<triggerType>0</triggerType>
				<conditonLineDelta>0</conditonLineDelta>
				<mStayOpen>0</mStayOpen>
				<mCommand></mCommand>
				<packageName></packageName>
				<mFgColor>#ff0000</mFgColor>
				<mBgColor>#ffff00</mBgColor>
				<mSoundFile></mSoundFile>
				<colorTriggerFgColor>#000000</colorTriggerFgColor>
				<colorTriggerBgColor>#000000</colorTriggerBgColor>
				<regexCodeList>
					<string>\[(\d+) (\w+) (\w+)]-\<(\w+)> (.{47})(.+)$</string>
				</regexCodeList>
				<regexCodePropertyList>
					<integer>1</integer>
				</regexCodePropertyList>
			</Trigger>
			<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
				<name>OoM</name>
				<script>if PsiGuild == "True" then
  send("regen & regen")
else
  send("sleep")
end
tempTimer(30, [[ manatimer() ]])
sleeping = "True"</script>
				<triggerType>0</triggerType>
				<conditonLineDelta>0</conditonLineDelta>
				<mStayOpen>0</mStayOpen>
				<mCommand></mCommand>
				<packageName></packageName>
				<mFgColor>#ff0000</mFgColor>
				<mBgColor>#ffff00</mBgColor>
				<mSoundFile></mSoundFile>
				<colorTriggerFgColor>#000000</colorTriggerFgColor>
				<colorTriggerBgColor>#000000</colorTriggerBgColor>
				<regexCodeList>
					<string>You don't have enough mana.</string>
					<string><(\d+)hp (\d+)m (\d+)mv (\d+)g>You don't have enough mana.</string>
				</regexCodeList>
				<regexCodePropertyList>
					<integer>3</integer>
					<integer>0</integer>
				</regexCodePropertyList>
			</Trigger>
			<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
				<name>Non-Nec Guildhall</name>
				<script>NameOfRoom = "Non-Nec Practice Room"
RiftArea = "Unknown"
WriteRiftList(StartRift,NameOfRoom,RiftArea)
StartRift = StartRift + 1
send("c rift " .. StartRift)</script>
				<triggerType>0</triggerType>
				<conditonLineDelta>0</conditonLineDelta>
				<mStayOpen>0</mStayOpen>
				<mCommand></mCommand>
				<packageName></packageName>
				<mFgColor>#ff0000</mFgColor>
				<mBgColor>#ffff00</mBgColor>
				<mSoundFile></mSoundFile>
				<colorTriggerFgColor>#000000</colorTriggerFgColor>
				<colorTriggerBgColor>#000000</colorTriggerBgColor>
				<regexCodeList>
					<string>You don't belong in there!</string>
				</regexCodeList>
				<regexCodePropertyList>
					<integer>3</integer>
				</regexCodePropertyList>
			</Trigger>
			<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
				<name>Failed Rift</name>
				<script>NameOfRoom = "Failed to Open"
RiftArea = "Failed to Open"
WriteRiftList(StartRift,NameOfRoom,RiftArea)
StartRift = StartRift + 1
send("c rift " .. StartRift)</script>
				<triggerType>0</triggerType>
				<conditonLineDelta>0</conditonLineDelta>
				<mStayOpen>0</mStayOpen>
				<mCommand></mCommand>
				<packageName></packageName>
				<mFgColor>#ff0000</mFgColor>
				<mBgColor>#ffff00</mBgColor>
				<mSoundFile></mSoundFile>
				<colorTriggerFgColor>#000000</colorTriggerFgColor>
				<colorTriggerBgColor>#000000</colorTriggerBgColor>
				<regexCodeList>
					<string>You failed to open a rift using that wrinkle in this room.</string>
				</regexCodeList>
				<regexCodePropertyList>
					<integer>3</integer>
				</regexCodePropertyList>
			</Trigger>
			<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
				<name>Fighting</name>
				<script>send("flee")
send("flee")
send("flee")
send("c rip")</script>
				<triggerType>0</triggerType>
				<conditonLineDelta>0</conditonLineDelta>
				<mStayOpen>0</mStayOpen>
				<mCommand></mCommand>
				<packageName></packageName>
				<mFgColor>#ff0000</mFgColor>
				<mBgColor>#ffff00</mBgColor>
				<mSoundFile></mSoundFile>
				<colorTriggerFgColor>#000000</colorTriggerFgColor>
				<colorTriggerBgColor>#000000</colorTriggerBgColor>
				<regexCodeList>
					<string>No way! You are still fighting!</string>
					<string><(\d+)hp (\d+)m (\d+)mv (\d+)g>No way! You are still fighting!</string>
				</regexCodeList>
				<regexCodePropertyList>
					<integer>3</integer>
					<integer>1</integer>
				</regexCodePropertyList>
			</Trigger>
			<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
				<name>Psi Ring Check</name>
				<script>PsiGuild = "True"
--echo("\nPsiGuild = True")</script>
				<triggerType>0</triggerType>
				<conditonLineDelta>0</conditonLineDelta>
				<mStayOpen>0</mStayOpen>
				<mCommand></mCommand>
				<packageName></packageName>
				<mFgColor>#ff0000</mFgColor>
				<mBgColor>#ffff00</mBgColor>
				<mSoundFile></mSoundFile>
				<colorTriggerFgColor>#000000</colorTriggerFgColor>
				<colorTriggerBgColor>#000000</colorTriggerBgColor>
				<regexCodeList>
					<string>A Psionicist's ring</string>
				</regexCodeList>
				<regexCodePropertyList>
					<integer>0</integer>
				</regexCodePropertyList>
			</Trigger>
		</TriggerGroup>
	</TriggerPackage>
	<TimerPackage />
	<AliasPackage />
	<ActionPackage>
		<ActionGroup isActive="yes" isFolder="yes" isPushButton="no" isFlatButton="no" useCustomLayout="no">
			<name>MR</name>
			<packageName></packageName>
			<script></script>
			<css></css>
			<commandButtonUp></commandButtonUp>
			<commandButtonDown></commandButtonDown>
			<icon></icon>
			<orientation>0</orientation>
			<location>0</location>
			<posX>0</posX>
			<posY>0</posY>
			<mButtonState>1</mButtonState>
			<sizeX>0</sizeX>
			<sizeY>0</sizeY>
			<buttonColumn>1</buttonColumn>
			<buttonRotation>0</buttonRotation>
			<buttonColor>#ffffff</buttonColor>
			<Action isActive="yes" isFolder="no" isPushButton="no" isFlatButton="no" useCustomLayout="no">
				<name>Rift Mapper</name>
				<packageName></packageName>
				<script>if RiftMapperOn == "False" then
  echo("Rift Mapping On")
  enableTrigger("Rift Mapper")
  CaptureCharacterName = "True"
  StartRift = 1
  RiftMapperOn = "True"
  CaptureRoomName = "False"
  GetAreaName = "False"
  CastingRip = "True"
  send("vt102 off")
  send("color on")
  send("color 6 1 0")
  send("prompt $hhp $mm $vmv $gg")
  send("alias regen rest & regenerate")
  send("eq")
  send("sc")
  send("c rip")
  CastingRift = "False"
elseif RiftMapperOn == "True" then
  disableTrigger("Rift Mapper")
  echo("Rift Mapping Off")
  RiftMapperOn = "False"
  send("color 6 7 0")
  --send("color off")
  --send("vt102 on")
  --send("prompt !YOUR PROMPT SETTINGS HERE!")
end</script>
				<css></css>
				<commandButtonUp></commandButtonUp>
				<commandButtonDown></commandButtonDown>
				<icon></icon>
				<orientation>1</orientation>
				<location>0</location>
				<posX>0</posX>
				<posY>0</posY>
				<mButtonState>1</mButtonState>
				<sizeX>0</sizeX>
				<sizeY>0</sizeY>
				<buttonColumn>1</buttonColumn>
				<buttonRotation>0</buttonRotation>
				<buttonColor>#ffffff</buttonColor>
			</Action>
		</ActionGroup>
	</ActionPackage>
	<ScriptPackage>
		<Script isActive="yes" isFolder="no">
			<name>RiftMapper</name>
			<packageName></packageName>
			<script>-- Atari's RiftMapper v1.1
-- Probably the final version. This does everything you need it to with a button click.
-- 10/23/22

RiftMapperOn = "False"
PsiGuild = "False"
sleeping = "False"
GetAreaName = "False"



function WriteRiftList(number, room, area)
  RiftFileName = tostring(RiftingCharacter .. "_Rifts.txt")
  --echo("\n" .. RiftFileName)
  rifts_file = io.open(RiftFileName, "a")
  io.output(rifts_file)
  io.write(number.."        "..room.."        "..area.."\n")
  io.close(rifts_file)
end


function manatimer()
  if sleeping == "True" then
    send("l")
    send("drool")
    --These commands are just here to avoid the void in a rip while waiting for mana. 
    --You can switch them to whatever doesn't disturb your rest.
    tempTimer(30, [[ manatimer() ]])
  end
end</script>
			<eventHandlerList />
		</Script>
	</ScriptPackage>
	<KeyPackage />
	<VariablePackage>
		<HiddenVariables />
	</VariablePackage>
</MudletPackage>