<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
 
<!-- Saved on Monday, June 01, 2009, 6:10 PM -->
<!-- MuClient version 4.37 -->
 
<!-- Plugin "Tattooer" generated by Plugin Wizard -->
 
<muclient>
<plugin
   name="Tattooer"
   author="Baatti Rousseau"
   id="53233b5dc56335602a96d7f8"
   language="Lua"
   purpose="Tattoo self and others with ease"
   save_state="y"
   date_written="2009-06-01 18:06:18"
   requires="4.37"
   version="1.0"
   >
 
<description trim="y">
 
<![CDATA[
 
INK <tattooname> <person to tattoo on>      
       -inks the tattoo on the person
TATTOO RESET
       -resets the tattoo system variables
IAWAY
       -stuffs away all inks
 
 
This script will outr all the inks required for the tattoo selected.
It will also find the first open spot the person's body. The order it
will check in is: head, torso, right arm, left arm, right leg, left leg.
 
 
SPECIAL THANKS:
 
I'd like to thank Soludra for helping me troubleshoot this and give me
some great advice on syntax. And also, even though Trevize didn't
specifically help me on this plugin, he's helped me greatly in all the
scripts I've done before and I wouldn't have a clue how to even begin
going about making a plugin if it weren't for him.
 
Thanks so much to both of you.
 
If you experience any bugs or issues with this plugin, just MSG BAATTI
about your issues with as much detail as possible and I'll fix it as
quickly and efficiently as I can.  Enjoy guys. And long live MUSHclient!!!
]]>
 
</description>
 
 
 
</plugin>
 
 
<aliases>
 <alias
  enabled="y"
  match="^\s*tattoo\s+reset\s*$"
  ignore_case="y"
  regexp="y"
  script="tattoos_reset"
  sequence="100"
 >
 </alias>
 
 <alias
  enabled="y"
  match="^\s*ink\s+(\w+)\s+(\w+)\s*$"
  ignore_case="y"
  regexp="y"
  script="inkperson"
  sequence="100"
 >
 </alias>
 
 <alias
  enabled="y"
  match="^\s*iaway\s*$"
  ignore_case="y"
  regexp="y"
  script="iaway_begin"
  sequence="100"
 >
 </alias>
 
</aliases>
 
<triggers>
 
 
 <trigger
  enabled="n"
  group="INKING"
  match="^(?:You gather together the inks that are needed)"
  regexp="y"
  sequence="100"
  send_to="12"
 >
   <send>
     EnableTrigger("prompt", false)
   </send>
 </trigger>
 
 <trigger
  enabled="n"
  group="INKING"
  match="^As the (\w+) tattoo\'s shape is codified\, the last of the ink"
  regexp="y"
  script="tattoos_reset"
  sequence="100"
 >
 </trigger>
 
 <trigger
  enabled="n"
  group="INKING"
  omit_from_output="y"
  match="^You cannot hold any more tattoos on your (.+)\.$"
  regexp="y"
  script="bodypartfull"
  sequence="100"
 >
 </trigger>
 
 <trigger
  enabled="n"
  group="INKING"
  omit_from_output="y"
  match="^(.+) cannot hold any more tattoos on (his|her)"
  regexp="y"
  script="bodypartfull"
  sequence="100"  
 >
 </trigger>
 
 <trigger
  enabled="n"
  group="INKAWAY"
  match="^You store (\d+) (red|yellow|blue|green|purple|gold) ink\, bringing the total to (\d+)\.$"
  regexp="y"
  script="iaway"
  sequence="100"
 >
 </trigger>
 
 <trigger
  enabled="n"
  group="INKAWAY"
  match="^You see no ink in your inventory\.$"
  regexp="y"
  script="iaway_finish"
  sequence="100"
 >
 </trigger>
 
 <trigger
  enabled="n"
  group="INKING"
  match="^(?:As the (\w+) tattoo\'s shape is codified\, the last of the ink|As the inking process is ruined\, the ink dissipates into the surrounding air\.|You do not possess the ink that is required to create a (\w+) tattoo\.)"
  regexp="y"
  script="tattoos_reset"
  sequence="100"
 >
 </trigger>
 
</triggers>
 
<script>
<![CDATA[
 
require "wait"
 
--Tattoo Database
 
tattoos = { firefly = {{1, 'yellowink'}},
           moss = {{1, 'blueink'}, {1, 'redink'}, {1, 'yellowink'}},
          feather = {{2, 'blueink'}, {1, 'redink'}},
          shield = {{1, 'greenink'}, {2, 'redink'}},
           mindseye = {{2, 'blueink'}, {1, 'greenink'}},
           hammer = {{1, 'purpleink'}, {2, 'redink'}},
          cloak = {{3, 'blueink'}},
           bell = {{3, 'blueink'}, {2, 'redink'}},
           crystal = {{1, 'greenink'}, {1, 'purpleink'}, {1, 'yellowink'}},
           moon = {{1, 'blueink'}, {1, 'redink'}, {1, 'yellowink'}},
           starburst = {{1, 'blueink'}, {1, 'goldink'}, {1, 'greenink'}, {1, 'purpleink'}, {1, 'redink'}, {1,
 
'yellowink'}},
           boar = {{1, 'purpleink'}, {2, 'redink'}},
           web = {{1, 'greenink'}, {1, 'yellowink'}},
           tentacle = {{2, 'greenink'}, {1, 'purpleink'}},
           hourglass = {{1, 'blueink'}, {2, 'yellowink'}},
          brazier = {{2, 'redink'}, {2, 'yellowink'}},
           prism = {{1, 'blueink'}, {1, 'greenink'}, {1, 'purpleink'}, {1, 'redink'}, {1, 'yellowink'}},
           tree = {{5, 'greenink'}},
           megalith = {{2, 'goldink'}},
           ox = {{1, 'goldink'}, {1, 'redink'}, {1, 'yellowink'}, {1, 'blueink'}},
           chameleon = {{1, 'goldink'}, {1, 'purpleink'}, {1, 'yellowink'}},
         }
 
-- Body Part Database
body = {}
body['head'] = true
body['torso'] = true
body['right arm'] = true
body['left arm'] = true
body['right leg'] = true
body['left leg'] = true
 
tattoo = ''
target = ''
 
function inkperson(name,output,wildcs)
       tattoo = wildcs[1]
        if (tattoos[tattoo] == nil) then
                return
        end
 
       target = wildcs[2]
       EnableTriggerGroup('INKING',true)
 
       for _,v in pairs(tattoos[wildcs[1]]) do
               Send('outr '.. v[1] ..' '.. v[2])
       end
 
        if (target:lower() ~= "me") then
                wait.make(function()
                        Send('say '.. target ..', hold still!')
                        wait.time(2.5)
                        ink(tattoo,target)
                end)
        else ink(tattoo,target)
        end
 
end
 
function ink(tattoo,person)
       local part = 'no'
 
       if(body['head']) then part = 'head'
       elseif(body['torso']) then part = 'torso'
       elseif(body['right arm']) then part = 'right arm'
       elseif(body['left arm']) then part = 'left arm'
       elseif(body['right leg']) then part = 'right leg'
       elseif(body['left leg']) then part = 'left leg'
       end
 
       if part == 'no' then Note('Too many tattoos')
        else Send('ink ' .. tattoo .. ' on ' .. part .. ' of ' .. person)
        end
end
 
function bodypartfull()
       if(body['head']) then
               body['head'] = false
       elseif(body['torso']) then
               body['torso'] = false
       elseif(body['right arm']) then
               body['right arm'] = false
       elseif(body['left arm']) then
               body['left arm'] = false
       elseif(body['right leg']) then
               body['right leg'] = false
       elseif(body['left leg']) then
               body['left leg'] = false
               tattoos_reset()
               EnableTriggerGroup('INKING',false)
               Note('Too Many Tattoos')
 
                return
       end
 
        ink(tattoo,target)
end
 
function tattoos_reset()
       target = ''
       tattoo = ''
 
        for k,_ in pairs(body) do
                body[k] = true
        end
 
       EnableTriggerGroup('INKING',false)
       Execute('iaway')
 
       Note('Finished Tattooing')
end
 
function iaway_begin()
      EnableTriggerGroup('INKAWAY',true)
      iaway()
end
 
function iaway_finish()
       EnableTriggerGroup('INKAWAY',false)
       Note('All inks stuffed away.')
end
 
function iaway()
       SendNoEcho('inr all ink')
end
 
]]>
</script>
 
 
 
 
<!--  Get our standard constants -->
<include name="constants.lua"/>
 
<!--  Plugin help  -->
<aliases>
  <alias
   script="OnHelp"
   match="\s*tattoo\s+help\s*"
   ignore_case="y"
   regexp="y"
   enabled="y"
  >
  </alias>
</aliases>
 
<script>
 
<![CDATA[
function OnHelp ()
        world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
        Send() -- for prompt
end
]]>
 
</script>
</muclient>