Description: This script has nothing to do with fishing.
The script creates a list of flags, then allows you to list those flags, and finally allows you to test and compare the flag text with user inputted text to see if they match.
Useful for sanity checking a players input before using that players text in a command.
Feel free to use borrow or steal this script.
# This script has nothing to do with fishing. The script creates a list of flags,# Then allows you to list those flags, and finally allows you to test and compare# the flag text with user inputted text to see if they match.# Useful for sanity checking a players input before using that players text in a command. # Feel free to use borrow or steal this script.## FishFlagTest.yml# Author: PrimerBlock# For: Denizen 0.8.8# Date: Apr12 2013
"The Fish":
type: assignment
interact scripts:
- 10 I Love Fish
- 20 Match The Fish
actions:
on assignment:
- trigger name:chat toggle:true
- trigger name:click toggle:true
- lookclose toggle:true
"I Love Fish":
type: interact
steps:
'FishyMenu*':
click trigger:
script:
- chat "What do you want to do?"
- chat "<red>Set <white>the fishy flags? <red>(Run First to set flags)"
- chat "<light_purple>List <white>the fish?"
- chat "<light_purple>Match <white>a fish?"
chat trigger:
'ChooseAClass':
trigger: "/List/ the fish."
script:
- chat "OK here you go<&co>
- runtask 'loop through' "context:ListFISH|fishies|global"
'FishyFlags':
trigger: "/Set/ me my fishy flags!"
script:
- chat "OK lets set those flags!<&co>"
- runtask script:SetupFishyFlags
'MatchTheFish':
trigger: "I want to try /match/ing the fish."
script:
- chat "OK give me a fish to match"
- flag player 'AllAccessMatchFishPass:true'
'CatchAll':
trigger: /REGEX:\w+/
script:
- chat "Opps! I did not quite understand you."
- chat "<white>You said <light_purple><&dq><player.chat_history><&dq> <white>did you want to do a fish match?"
- chat "<white>To start matching type <light_purple>match<white> first or click me for more help."
"Match The Fish":
type: interact
requirements:
mode: all
list:
- FLAGGED player 'AllAccessMatchFishPass:true'
steps:
'MatchingFishNames*':
chat trigger:
'TestAFishName':
trigger: /REGEX:\w+/
script:
- flag player 'AllAccessMatchFishPass:!'
- chat "OK lets see if <player.chat_history> exists"
# Does the fish name exist in the list? If it does do something.
- if <flag.g:fishies.aslist> contains '<player.chat_history>'
runtask "script:Yes That Fish Does Exist"
else
chat "Nope, can<&sq>t find <player.chat_history> fish"
- zap "step:FishyMenu" "script:I Love Fish"
# Could have left this short script in the if command
"Yes That Fish Does Exist":
type: task
script:
- chat "Yes, <player.chat_history> fish does exist"
- chat "Anything Else?"
"ListFISH":
type: task
context: fish
script:
- narrate "<context.fish> fish"
"SetupFishyFlags":
type: task
script:
- chat "fishy, fishy, FISHY!."
- flag global "fishies:->:red"
- flag global "fishies:->:blue"
- flag global "fishies:->:one"
- flag global "fishies:->:two"
- chat "done."