for one i see a typo on the word stabpercentage, should have been bashpercentage, and here is a plugin made in LUA that does the same things, plus a little more...
Quote:<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, September 26, 2006, 8:07 AM -->
<!-- MuClient version 3.74 -->
<!-- Plugin "Bash_Count" generated by Plugin Wizard -->
<muclient>
<plugin
name="Bash_Count"
author="Onoitsu2"
purpose="Aardwolf Character Remote Control"
id="ef7b51a530d14a60ff921054"
language="Lua"
save_state="y"
date_written="2006-9-26 7:05:07"
requires="3.74"
version="1.0"
>
<description trim="y">
<![CDATA[
Bash_Count Plugin LUA
bashcount - displays current sucessful bashes, missed bashes, total bashes attempted, and percentage landed
bashcount help - displays this help file
]]>
</description>
</plugin>
<!-- Get our standard constants -->
<include name="constants.lua"/>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="^By what name do you wish to be known\?$"
regexp="y"
script="bashreset"
send_to="12"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^Your bash at (.*?) sprawling\!$"
regexp="y"
script="landbash"
send_to="12"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^As (.*?) your bash\, you topple over and fall to the ground\!$"
regexp="y"
script="missbash"
send_to="12"
sequence="100"
>
</trigger>
</triggers>
<!-- Aliases -->
<aliases>
<alias
match="^bashcount$"
enabled="y"
group="bashcount"
regexp="y"
script="bashreport"
send_to="12"
omit_from_output="y"
ignore_case="y"
sequence="100"
>
</alias>
</aliases>
<!-- Plugin help -->
<aliases>
<alias
ignore_case="y"
script="OnHelp"
match="bashcount help"
enabled="y"
>
</alias>
</aliases>
<script>
<![CDATA[
function bashreport(sName,sLine,wildcards)
Note("This session you've landed " .. GetVariable("landbash") .. " out of " .. GetVariable("totalbash") .. " bashes (" .. GetVariable("bashpercentage") .. "% landed)")
Note("This session you've missed " .. GetVariable("missbash") .. " out of " .. GetVariable("totalbash") .. " bashes (" .. 100 - tonumber(GetVariable("bashpercentage")) .. "% missed)")
end -- bashreport
function bashreset(sName,sLine,wildcards)
SetVariable("landbash",0)
SetVariable("missbash",0)
SetVariable("totalbash",0)
SetVariable("bashpercentage",0)
SaveState()
end -- bashreset
function landbash(sName,sLine,wildcards)
local landedbashes
local totalbashes
landedbashes = tonumber(GetVariable("landbash")) + 1
totalbashes = tonumber(GetVariable("totalbash")) + 1
SetVariable("lansbash",landedbashes)
SetVariable("totalbash",totalbashes)
Note("This session you've landed " .. GetVariable("landbash") .. " out of " .. GetVariable("totalbash") .. " bashes (" .. GetVariable("bashpercentage") .. "% landed)")
end -- landbash
function missbash(sName,sLine,wildcards)
local missedbashes
local totalbashes
missedbashes = tonumber(GetVariable("missbash")) + 1
totalbashes = tonumber(GetVariable("totalbash")) + 1
SetVariable("missbash",missedbashes)
SetVariable("totalbash",totalbashes)
Note("This session you've missed " .. GetVariable("missbash") .. " out of " .. GetVariable("totalbash") .. " bashes (" .. GetVariable("bashpercentage") .. "% landed)")
end -- missbash
function OnPluginInstall()
OnHelp()
if GetVariable("landbash") == nil then
SetVariable("landbash",0)
end -- if
if GetVariable("missbash") == nil then
SetVariable("missbash",0)
end -- if
if GetVariable("totalbash") == nil then
SetVariable("totalbash",0)
end -- if
if GetVariable("bashpercentage") == nil then
SetVariable("bashpercentage",0)
end -- if
SaveState()
end
function OnHelp ()
world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
end
]]>
</script>
</muclient>
I know this could have been done a little simpler, with using inside trigger processing, and leaving out the help, and onplugininstall, but I have a standard plugin layout in all the plugins I create, they all typically use out of the trigger or alias functions, even if it is something simple like showing 2 notes, so I can easily replace it just by replacing the desired function.
Laterzzz,
Onoitsu2
|