hrm, just a question, but does MUSH support 'or' in vb script? If not, whats the equivalent?
Ex:
if newhp = oldhp or newsp = oldsp then
Just wondering
Ex:
if newhp = oldhp or newsp = oldsp then
Just wondering
This forum is a read-only archive of the Gammon Software forum (2000–2026). No new posts can be made. Search the archive.
Posted by Neverwhere on Thu 26 Jun 2003 08:05 AM — 24 posts, 78,722 views.
a = "22"
b = "123"
if a < b then
note "22 is less than 123"
else
note "123 is less than 22"
end if
Sub OnNewHp(strAliasName, strOutput, arrWildCards)
dim spchange, hpchange, hpsign, spsign
newhp = world.getvariable ("newhp")
newsp = world.getvariable ("newsp")
oldsp = world.getvariable ("oldsp")
oldhp = world.getvariable ("oldhp")
totalhp = world.getvariable ("totalhp")
totalsp = world.getvariable ("totalsp")
if newhp = oldhp then \
setvariable "oldhp", newhp \
end if \ See
if newsp = oldsp then / Below
setvariable "oldsp", newsp /
end if /
hpchange = oldhp - newhp
spchange = oldsp - newsp
if hpchange >= "0" then
hpsign = "+"
else
hpsign = "-"
hpchange = abs(hpchange)
end if
if spchange >= "0" then
spsign = "+"
else
spsign = "-"
spchange = abs(spchange)
end if
if spchange + hpchange then
World.Send "ps Hp: " & newhp & "(" & totalhp & ") " & hpsign & hpchange & " Sp: "_
& newsp & "(" & totalsp & ") " & spsign & spchange & ""
end if
world.setvariable "oldhp",newhp
world.setvariable "oldsp",newsp
end sub
<!DOCTYPE muclient [
<!ENTITY NoteColour "#FF64B9" >
<!ENTITY NamePrefix "AOD_MON:" >
<!ENTITY Prompt "(?:> )*" >
]>
<!-- ===== Monitor Health Status =================================== -->
<triggers>
<trigger
enabled="y"
match="^&Prompt;HP\: \[(.*?)\/(.*?)\] CONC\: \[(.*?)\/(.*?)\]$"
name="MONITOR_Health_Status"
regexp="y"
script="Get_Health_Status"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^&Prompt;HP\: \[(.*?)\/(.*?)\] CONC\: \[(.*?)\/(.*?)\] OPPONENT\: (.*?)$"
name="MONITOR_Health_Status_InCombat"
regexp="y"
script="Get_Health_Status"
sequence="100"
>
</trigger>
</triggers>
<aliases>
<alias
name="MON_TickInfo"
script="Toggle_TickInfo"
match="^TickInfo(?:[ ]+(.*))?$"
enabled="y"
regexp="y"
ignore_case="y"
>
</alias>
<alias
name="Display_TickInfo"
script="Display_TickInfo"
match="^tick$"
enabled="y"
regexp="y"
ignore_case="y"
>
</alias>
</aliases>
<script>
<![CDATA[
Dim HPc_Full, HPc_Current, HPc_Percent, CPc_Full, CPc_Current, CPc_Percent
Dim HPp_Full, HPp_Current, HPp_Percent, CPp_Full, CPp_Current, CPp_Percent
Dim HPp2_Full, HPp2_Current, HPp2_Percent, CPp2_Full, CPp2_Current, CPp2_Percent
Sub InCombat_False (TriggerName, TriggerLine, arrWildcards)
World.SetVariable "InCombat", vbsFalse
World.SetVariable "InCombatStatus", "Peace."
World.CallPlugin "5c582b1da52fd6a9d5d912a8", "AddString", "19_InCombatStatus" & _
Chr(10) & World.GetVariable("InCombatStatus")
If ThankHealer Then Send_Thank_Healer
End Sub
Sub InCombat_True (TriggerName, TriggerLine, arrWildcards)
World.SetVariable "InCombat", vbsTrue
World.SetVariable "InCombatStatus", "Combat!"
World.CallPlugin "5c582b1da52fd6a9d5d912a8", "AddString", "19_InCombatStatus" & _
Chr(10) & World.GetVariable("InCombatStatus")
If ThankHealer Then Send_Thank_Healer_InCombat
End Sub
Sub Get_Health_Status (TriggerName, TriggerLine, arrWildcards)
Dim StatusLineText
HPp2_Current = HPp_Current
HPp2_Full = HPp_Full
HPp2_Percent = HPp_Percent
CPp2_Current = CPp_Current
CPp2_Full = CPp_Full
CPp2_Percent = CPp_Percent
HPp_Current = HPc_Current
HPp_Full = HPc_Full
HPp_Percent = HPc_Percent
CPp_Current = CPc_Current
CPp_Full = CPc_Full
CPp_Percent = CPc_Percent
HPc_Current = CStr(CInt(arrWildcards(1)))
HPc_Full = CStr(arrWildcards(2))
HPc_Percent = CStr(Round(((CInt(HPc_Current) / CInt(HPc_Full)) * 100)))
CPc_Current = CStr(arrWildcards(3))
CPc_Full = CStr(arrWildcards(4))
CPc_Percent = CStr(Round(((CInt(CPc_Current) / CInt(CPc_Full)) * 100)))
If World.GetVariable("TickInfo") Then Display_TickInfo "Get_Health_Status", TriggerLine, arrWildcards
StatusLineText = "HP: " & HPc_Percent & "% CP: " & CPc_Percent & "%"
World.CallPlugin "5c582b1da52fd6a9d5d912a8", "AddString", "12_HealthStatus" & _
Chr(10) & StatusLineText
If CStr(arrWildcards(5)) <> Empty Then
InCombat_True "Get_Health_Status", TriggerLine, arrWildcards
Else
InCombat_False "Get_Health_Status", TriggerLine, arrWildcards
End If
End Sub
Sub Display_TickInfo (AliasName, AliasLine, arrWildcards)
World.ColourNote NoteColour, "", "HP: " & _
PadLeft(CStr(CInt(HPc_Current) - CInt(HPp_Current)), Len(HPc_Current) + 1) & _
PadLeft("CONC: ", Len(HPc_Full) + 10) & _
PadLeft(CStr(CInt(CPc_Current) - CInt(CPp_Current)), Len(CPc_Current) + 1)
End Sub
Sub TickInfo_On
World.SetVariable "TickInfo", True
World.SetVariable "TickInfoStatus", "TickInfo: On"
World.ColourNote NoteColour, "", World.GetVariable("TickInfoStatus")
End Sub
Sub TickInfo_Off
World.SetVariable "TickInfo", False
World.SetVariable "TickInfoStatus", "TickInfo: Off"
World.ColourNote NoteColour, "", World.GetVariable("TickInfoStatus")
End Sub
Sub Toggle_TickInfo (AliasName, AliasLine, arrWildcards)
Dim Argument
Argument = Trim(LCase(arrWildcards(1)))
If (Argument = "on") or (Argument = "yes") or (Argument = "true") Then Argument = "y"
If (Argument = "off") or (Argument = "no") or (Argument = "false") Then Argument = "n"
If Argument = "y" Then
TickInfo_On
ElseIf Argument = "n" Then
TickInfo_Off
Else
If World.GetVariable("TickInfo") Then
TickInfo_Off
Else
TickInfo_On
End If
End If
End Sub
]]>
</script>
<!-- ===== Thank Healer ============================================ -->
<aliases>
<alias
name="MON_AutoThank"
script="Toggle_AutoThank"
match="^(?:athank|autothank)(?:[ ]+(.*))?$"
enabled="y"
regexp="y"
ignore_case="y"
>
</alias>
</aliases>
<triggers>
<trigger
enabled="y"
match="^&Prompt;(\w*) lets (?:his|her) healing powers flow through the world\.$"
name="MONITOR_Heal_The_World"
regexp="y"
script="Set_Healer_To_Thank"
sequence="100"
>
</trigger>
</triggers>
<script>
<![CDATA[
Dim ThankHealer, ThankHealerName
Sub Set_Healer_OptOut
End Sub
Sub Set_Healer_To_Thank (TriggerName, TriggerLine, arrWildcards)
ThankHealerName = CStr(arrWildcards(1))
ThankHealer = vbsTrue
If CInt(HPp_Percent) = 100 Then ThankHealer = vbsFalse
End Sub
Sub Send_Thank_Healer
Dim Message
ThankHealer = vbsFalse
If World.GetVariable("AutoThank") Then
' Message = " HP: [" & HPp2_Current & "/" & HPp2_Full & "] - to -> HP: [" & HPp_Current & "/" & HPp_Full & "]"
Message = " for " & CStr(HPp_Current - HPp2_Current) & " HP's worth of healing"
World.LogSend "thank " & ThankHealerName & Message
End If
End Sub
Sub Send_Thank_Healer_InCombat
Dim Message
ThankHealer = vbsFalse
If World.GetVariable("AutoThank") Then
' Message = " HP: [" & HPp_Current & "/" & HPp_Full & "] - to -> HP: [" & HPc_Current & "/" & HPc_Full & "]"
Message = " for " & CStr(HPc_Current - HPp_Current) & " HP's worth of healing"
World.LogSend "thank " & ThankHealerName & Message
End If
End Sub
Sub AutoThank_On
World.SetVariable "AutoThank", True
World.SetVariable "AutoThankStatus", "AutoThank: On"
World.ColourNote NoteColour, "", World.GetVariable("AutoThankStatus")
End Sub
Sub AutoThank_Off
World.SetVariable "AutoThank", False
World.SetVariable "AutoThankStatus", "AutoThank: Off"
World.ColourNote NoteColour, "", World.GetVariable("AutoThankStatus")
End Sub
Sub Toggle_AutoThank (AliasName, AliasLine, arrWildcards)
Dim Argument
Argument = Trim(LCase(arrWildcards(1)))
If (Argument = "on") or (Argument = "yes") or (Argument = "true") Then Argument = "y"
If (Argument = "off") or (Argument = "no") or (Argument = "false") Then Argument = "n"
If Argument = "y" Then
AutoThank_On
ElseIf Argument = "n" Then
AutoThank_Off
Else
If World.GetVariable("AutoThank") Then
AutoThank_Off
Else
AutoThank_On
End If
End If
End Sub
]]>
</script>