Unknown2005-05-13 16:01:01
I'm in the process of writing a defences script to manage defence status variables, deffing up, etc. One portion of this script is a replacement for the DEFENCES command. How it works is pretty straightforward, just read the comments in the code. All you have to do is type "def" and it does it's thing.
I logged in quick so I could copy an example of what it outputs here. Although it only appears black and white here, in the game the labels are bright cyan, defences that are up are dark yellow, and defences that are down are bright yellow (these colors are easily changed in the script).
I'm pretty sure I'll have the entire defences script done later today, I'll post it when it's ready.
sample output:
the code:
I logged in quick so I could copy an example of what it outputs here. Although it only appears black and white here, in the game the labels are bright cyan, defences that are up are dark yellow, and defences that are down are bright yellow (these colors are easily changed in the script).
I'm pretty sure I'll have the entire defences script done later today, I'll post it when it's ready.
sample output:
QUOTE
Defences Up:
- lich
- lichseed
Defences Down:
- acquisitio
- autumn
- adrenaline
- blue
- circle
- breathe
- combatstyle
- constitution
- deathsense
- draconis
- flex
- fortuna
- grip
- insomnia
- nightsight
- orange
- populus
- putrefaction
- red
- resistance
- rubeus
- selfishness
- serpent
- stance
- thirdeye
- vitality
- weathering
- yellow
You are protected by 2 defences.
- lich
- lichseed
Defences Down:
- acquisitio
- autumn
- adrenaline
- blue
- circle
- breathe
- combatstyle
- constitution
- deathsense
- draconis
- flex
- fortuna
- grip
- insomnia
- nightsight
- orange
- populus
- putrefaction
- red
- resistance
- rubeus
- selfishness
- serpent
- stance
- thirdeye
- vitality
- weathering
- yellow
You are protected by 2 defences.
the code:
CODE
;;; reset defence status variables
;;; syntax: /defences_reset_status_variables
/def defences_reset_status_variables = \\
; Â ;;; athletics
  /set defences_adrenaline=0 %; \\
  /set defences_breathe=0 %; \\
  /set defences_constitution=0 %; \\
  /set defences_flex=0 %; \\
  /set defences_resistance=0 %; \\
  /set defences_vitality=0 %; \\
  /set defences_weathering=0 %; \\
; Â ;;; combat
  /set defences_stance_arms=0 %; \\
  /set defences_stance_chest=0 %; \\
  /set defences_stance_gut=0 %; \\
  /set defences_stance_head=0 %; \\
  /set defences_stance_left=0 %; \\
  /set defences_stance_legs=0 %; \\
  /set defences_stance_lower=0 %; \\
  /set defences_stance_right=0 %; \\
; Â ;;; discernment
  /set defences_deathsense=0 %; \\
  /set defences_nightsight=0 %; \\
  /set defences_thirdeye=0 %; \\
; Â ;;; discipline
  /set defences_insomnia=0 %; \\
  /set defences_selfishness=0 %; \\
; Â ;;; knighthood
  /set defences_combatstyle_aggressive=0 %; \\
  /set defences_combatstyle_concentrated=0 %; \\
  /set defences_combatstyle_defensive=0 %; \\
  /set defences_combatstyle_lightning=0 %; \\
  /set defences_grip=0 %; \\
; Â ;;; lowmagic
  /set defences_autumn=0 %; \\
  /set defences_blue=0 %; \\
  /set defences_circle=0 %; \\
  /set defences_orange=0 %; \\
  /set defences_red=0 %; \\
  /set defences_serpent=0 %; \\
  /set defences_yellow=0 %; \\
; Â ;;; rituals
  /set defences_acquisitio=0 %; \\
  /set defences_draconis=0 %; \\
  /set defences_fortuna=0 %; \\
  /set defences_populus=0 %; \\
  /set defences_rubeus=0 %; \\
; Â ;;; necromancy
  /set defences_putrefaction=0 %; \\
  /set defences_lich=0 %; \\
  /set defences_lichseed=0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;             defences command             ;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; generate defences command highlights
;;; syntax: defences_command_gentrig('','')
/def defences_command_gentrig = \\
  /if ({#} > 1) \\
    /def -mregexp -n1 -p150 -ag -t"%{2}" defences_command_highlight_%{1} = \\
      /set defences_%{1}=1 %%; \\
      /echol Cyellow 0 - %{1} %; \\
  /else \\
    /echol BCcyan 0 <<<< defences_command_gentrig error: incorrect arguments provided, must be,. %; \\
  /endif
;;; display a label if a list of defences are all down
;;; syntax: /defences_command_isdown ( | (
;;; syntax: /defences_reset_status_variables
/def defences_reset_status_variables = \\
; Â ;;; athletics
  /set defences_adrenaline=0 %; \\
  /set defences_breathe=0 %; \\
  /set defences_constitution=0 %; \\
  /set defences_flex=0 %; \\
  /set defences_resistance=0 %; \\
  /set defences_vitality=0 %; \\
  /set defences_weathering=0 %; \\
; Â ;;; combat
  /set defences_stance_arms=0 %; \\
  /set defences_stance_chest=0 %; \\
  /set defences_stance_gut=0 %; \\
  /set defences_stance_head=0 %; \\
  /set defences_stance_left=0 %; \\
  /set defences_stance_legs=0 %; \\
  /set defences_stance_lower=0 %; \\
  /set defences_stance_right=0 %; \\
; Â ;;; discernment
  /set defences_deathsense=0 %; \\
  /set defences_nightsight=0 %; \\
  /set defences_thirdeye=0 %; \\
; Â ;;; discipline
  /set defences_insomnia=0 %; \\
  /set defences_selfishness=0 %; \\
; Â ;;; knighthood
  /set defences_combatstyle_aggressive=0 %; \\
  /set defences_combatstyle_concentrated=0 %; \\
  /set defences_combatstyle_defensive=0 %; \\
  /set defences_combatstyle_lightning=0 %; \\
  /set defences_grip=0 %; \\
; Â ;;; lowmagic
  /set defences_autumn=0 %; \\
  /set defences_blue=0 %; \\
  /set defences_circle=0 %; \\
  /set defences_orange=0 %; \\
  /set defences_red=0 %; \\
  /set defences_serpent=0 %; \\
  /set defences_yellow=0 %; \\
; Â ;;; rituals
  /set defences_acquisitio=0 %; \\
  /set defences_draconis=0 %; \\
  /set defences_fortuna=0 %; \\
  /set defences_populus=0 %; \\
  /set defences_rubeus=0 %; \\
; Â ;;; necromancy
  /set defences_putrefaction=0 %; \\
  /set defences_lich=0 %; \\
  /set defences_lichseed=0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;             defences command             ;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; generate defences command highlights
;;; syntax: defences_command_gentrig('
/def defences_command_gentrig = \\
  /if ({#} > 1) \\
    /def -mregexp -n1 -p150 -ag -t"%{2}" defences_command_highlight_%{1} = \\
      /set defences_%{1}=1 %%; \\
      /echol Cyellow 0 - %{1} %; \\
  /else \\
    /echol BCcyan 0 <<<< defences_command_gentrig error: incorrect arguments provided, must be
  /endif
;;; display a label if a list of defences are all down
;;; syntax: /defences_command_isdown (
- ))
/def defences_command_isdown = \\
  /if ({#} > 0) \\
    /if ({#} == 1) \\
      /let defence_name=$ %;\\
      /let defence_value= %; \\
      /test defence_value:=%{defence_name} %; \\
      /if ({defence_value} == 0) \\
        /echol BCyellow 0 - %{1} %; \\
      /endif %; \\
    /else \\
      /let defence_label=%{1} %; \\
      /let defence_total= %; \\
      /shift %; \\
      /while ({#}) \\
        /let defence_name=$ %; \\
        /let defence_value= %; \\
        /test defence_value:=%{defence_name} %; \\
        /test defence_total += %{defence_value} %; \\
        /shift %; \\
      /done %; \\
      /if ({defence_total} == 0) \\
        /echol BCyellow 0 - %{defence_label} %; \\
      /endif %; \\
    /endif %; \\
  /else \\
    /echol BCcyan 0 <<<< defences_command_isdown error: incorrect arguments provided, must be
- . %; \\
  /endif
;;; list defences that are currently down
;;; syntax: /defences_command_list_down
/def defences_command_list_down = \\
  /echol BCcyan 0 Defences Down: %; \\
  /defences_command_isdown acquisitio %; \\
  /defences_command_isdown autumn %; \\
  /defences_command_isdown adrenaline %; \\
  /defences_command_isdown blue %; \\
  /defences_command_isdown circle %; \\
  /defences_command_isdown breathe %; \\
  /defences_command_isdown combatstyle combatstyle_aggressive combatstyle_concentrated combatstyle_defensive combatstyle_lightning %; \\
  /defences_command_isdown constitution %; \\
  /defences_command_isdown deathsense %; \\
  /defences_command_isdown draconis %; \\
  /defences_command_isdown flex %; \\
  /defences_command_isdown fortuna %; \\
  /defences_command_isdown grip %; \\
  /defences_command_isdown insomnia %; \\
  /defences_command_isdown lich %; \\
  /defences_command_isdown lichseed %; \\
  /defences_command_isdown nightsight %; \\
  /defences_command_isdown orange %; \\
  /defences_command_isdown populus %; \\
  /defences_command_isdown putrefaction %; \\
  /defences_command_isdown red %; \\
  /defences_command_isdown resistance %; \\
  /defences_command_isdown rubeus %; \\
  /defences_command_isdown selfishness %; \\
  /defences_command_isdown serpent %; \\
  /defences_command_isdown stance stance_arms stance_chest stance_gut stance_head stance_left stance_legs stance_lower stance_right %; \\
  /defences_command_isdown thirdeye %; \\
  /defences_command_isdown vitality %; \\
  /defences_command_isdown weathering %; \\
  /defences_command_isdown yellow
;;; reset defence status variables and obtain new values using DEFENCES
;;; syntax: /defences_command
/def defences_command = \\
  /defences_reset_status_variables %; \\
  /test defences_command_gentrig('acquisitio','^You are filled with the greed of Acquisitio\\\\.\\$') %; \\
  /test defences_command_gentrig('autumn','^You are followed by the autumn wind\\\\.\\$') %; \\
  /test defences_command_gentrig('adrenaline','^Your sense of time is heightened, and your reactions are speeded\\\\.\\$') %; \\
  /test defences_command_gentrig('blue','^You have empowered your blue chakra\\\\.\\$') %; \\
  /test defences_command_gentrig('circle','^You are surrounded by a nearly invisible magical shield\\\\.\\$') %; \\
  /test defences_command_gentrig('breathe','^Your body is prepared for a marathon workout\\\\.\\$') %; \\
  /test defences_command_gentrig('combatstyle_aggressive','^You are fighting with powerful blows\\\\.\\$') %; \\
  /test defences_command_gentrig('combatstyle_concentrated','^You are fighting with focused strikes\\\\.\\$') %; \\
  /test defences_command_gentrig('combatstyle_defensive','^You are fighting defensively\\\\.\\$') %; \\
  /test defences_command_gentrig('combatstyle_lightning','^You are fighting with headstrong speed\\\\.\\$') %; \\
  /test defences_command_gentrig('constitution','^You are using your superior constitution to prevent nausea\\\\.\\$') %; \\
  /test defences_command_gentrig('deathsense','^Your mind is sensing the death of others\\\\.\\$') %; \\
  /test defences_command_gentrig('draconis','^You are surrounded by numinous dragon scales\\\\.\\$') %; \\
  /test defences_command_gentrig('flex','^Your muscles are flexed for increased strength\\\\.\\$') %; \\
  /test defences_command_gentrig('fortuna','^You are reaping the gifts of Fortuna\\\\.\\$') %; \\
  /test defences_command_gentrig('grip','^Your hands are gripping your wielded items tightly\\\\.\\$') %; \\
  /test defences_command_gentrig('insomnia','^You have insomnia, and cannot easily go to sleep\\\\.\\$') %; \\
  /test defences_command_gentrig('lich','^You are a lich\\\\.\\$') %; \\
  /test defences_command_gentrig('lichseed','^Your body is prepared for lichdom when death comes for you\\\\.\\$') %; \\
  /test defences_command_gentrig('nightsight','^Your vision is heightened to see in the dark\\\\.\\$') %; \\
  /test defences_command_gentrig('orange','^You have empowered your orange chakra\\\\.\\$') %; \\
  /test defences_command_gentrig('populus','^You are filled with exuberance\\\\.\\$') %; \\
  /test defences_command_gentrig('putrefaction','^You are bathed in the glorious protection of decaying flesh\\\\.\\$') %; \\
  /test defences_command_gentrig('red','^The pull of the earth roots you more firmly to the ground\\\\.\\$') %; \\
  /test defences_command_gentrig('resistance','^You are resisting magical damage\\\\.\\$') %; \\
  /test defences_command_gentrig('rubeus','^You are filled with the wrath of Rubeus\\\\.\\$') %; \\
  /test defences_command_gentrig('selfishness','^You are feeling quite selfish\\\\.\\$') %; \\
  /test defences_command_gentrig('serpent','^You are standing within a prismatic barrier\\\\.\\$') %; \\
  /test defences_command_gentrig('stance_arms','^Your fighting stance is defending your arms\\\\.\\$') %; \\
  /test defences_command_gentrig('stance_chest','^Your fighting stance is defending your chest\\\\.\\$') %; \\
  /test defences_command_gentrig('stance_gut','^Your fighting stance is defending your gut\\\\.\\$') %; \\
  /test defences_command_gentrig('stance_head','^Your fighting stance is defending your head\\\\.\\$') %; \\
  /test defences_command_gentrig('stance_left','^Your fighting stance is defending your left side\\\\.\\$') %; \\
  /test defences_command_gentrig('stance_legs','^Your fighting stance is defending your legs\\\\.\\$') %; \\
  /test defences_command_gentrig('stance_lower','^Your fighting stance is defending your lower body\\\\.\\$') %; \\
  /test defences_command_gentrig('stance_right','^Your fighting stance is defending your right side\\\\.\\$') %; \\
  /test defences_command_gentrig('thirdeye','^You are viewing the world through the third eye\\\\.\\$') %; \\
  /test defences_command_gentrig('vitality','^You will call upon your fortitude in need\\\\.\\$') %; \\
  /test defences_command_gentrig('weathering','^Your body is weathering the storm of life a little better\\\\.\\$') %; \\
  /test defences_command_gentrig('yellow','^You have empowered your yellow chakra\\\\.\\$') %; \\
  /def -mregexp -n1 -p150 -F -aBCcyan -t"^You are protected by \\\\d+ defences\\\\.\\$" defences_command_end = \\
    /purge defences_command_highlight_* %%; \\
    /defences_command_list_down %; \\
  defences %; \\
  /echol BCcyan 0 Defences Up: %; \\
;;; DEFENCES command replacement
;;; syntax: def
/alias def /defences_command