The currently working version of Ratter for Achaea is:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE muclient >
<muclient>
<plugin name="Ratter" author="Keldar" language="vbscript" purpose="Display ratting info"
save_state="y" date_written="2003-11-15" date_modified="2004-06-06" requires="3.32" version="1.1"
id="152d7cdff704e856e0c00d58">
<description trim="y">
<![CDATA[
This simple plugin will display the basic statistics of your ratting. It
uses the Info bar for display, and can show either counts for each type
of rat you have slain so far, or their gold worths. The commands to use it
are:
ratter on|off - turn the Ratter on or off, turning it off resets the current count
ratter nums|gold - defines whether the plugin will display amounts or gold values
of rats
sr * - * stands for a ratman's name, sends 'sell rats to *'
]]>
</description>
</plugin>
<triggers>
<trigger
name="RatPickup"
enabled="n"
regexp="y"
match="^You have slain (?:a|an) (baby rat|young rat|rat|old rat|black rat), retrieving the corpse\.$"
script="CountRats"
group="RatTriggers"
keep_evaluating="y"
sequence="10"
></trigger>
<trigger
name="RatGiven"
enabled="n"
regexp="y"
match="^(?:.*?) gives you the corpse of (?:a|an) (baby rat|young rat|rat|old rat|black rat)\.$"
script="CountRats"
group="RatTriggers"
keep_evaluating="y"
sequence="10"
></trigger>
</triggers>
<aliases>
<alias
name="ratter_switch"
enabled="y"
regexp="y"
match="^ratter (on|off|nums|gold)$"
sequence="100"
script="Ratter"
/>
<alias
name="sellrats"
enabled="y"
match="sr *"
sequence="100"
><send>sell rats to %1</send></alias>
</aliases>
<variables>
</variables>
<script>
<![CDATA[
dim displayMode
displayMode = 1 '1 displays amounts, 2 - gold values
dim ratPrice(5) 'This array holds prices for different rats
ratPrice(0) = 7 'baby rat
ratPrice(1) = 14 'young rat
ratPrice(2) = 21 'rat
ratPrice(3) = 28 'old rat
ratPrice(4) = 35 'black rat
dim ratNums(5) 'This array holds the number of different rats you've killed
ratNums(0) = 0 'baby rats
ratNums(1) = 0 'young rats
ratNums(2) = 0 'rats
ratNums(3) = 0 'old rats
ratNums(4) = 0 'black rats
sub Ratter(name, output, wildcs)
select case wildcs(1)
case "on"
world.EnableTriggerGroup "RatTriggers", 1
DisplayInfo
world.Note "Ratter plugin is ON"
case "off"
world.EnableTriggerGroup "RatTriggers", 0
world.InfoClear
world.InfoBackground "lightgrey"
dim i
for i = 0 to ubound(ratNums)
ratNums(i) = 0
next
displayMode = 1
world.Note "Ratter plugin is OFF"
case "nums"
displayMode = 1
DisplayInfo
case "gold"
displayMode = 2
DisplayInfo
end select
end sub
sub CountRats(name, output, wildcs)
select case wildcs(1)
case "baby rat"
ratNums(0) = ratNums(0) + 1
case "young rat"
ratNums(1) = ratNums(1) + 1
case "rat"
ratNums(2) = ratNums(2) + 1
case "old rat"
ratNums(3) = ratNums(3) + 1
case "black rat"
ratNums(4) = ratNums(4) + 1
end select
DisplayInfo
end sub
sub DisplayInfo
world.InfoClear
world.InfoFont "FixedSys", 12, 0
world.InfoColour "white"
world.InfoBackground "black"
dim totalNums, totalGold, i
totalNums = 0
totalGold = 0
for i = 0 to ubound(ratNums)
totalNums = totalNums + ratNums(i)
next
if (displayMode = 1) then
world.Info "Total: " & cstr(totalNums) & " | "
world.Info "Baby rats: " & cstr(ratNums(0)) & " | "
world.Info "Young Rats: " & cstr(ratNums(1)) & " | "
world.Info "Rats: " & cstr(ratNums(2)) & " | "
world.Info "Old rats: " & cstr(ratNums(3)) & " | "
world.Info "Black rats " & cstr(ratNums(4))
elseif (displayMode = 2) then
for i = 0 to ubound(ratNums)
totalGold = totalGold + ratNums(i)*ratPrice(i)
next
world.Info "Total: " & cstr(totalGold) & "gp | "
world.Info "Baby rats: " & cstr(ratNums(0)*ratPrice(0)) & "gp | "
world.Info "Young Rats: " & cstr(ratNums(1)*ratPrice(1)) & "gp | "
world.Info "Rats: " & cstr(ratNums(2)*ratPrice(2)) & "gp | "
world.Info "Old rats: " & cstr(ratNums(3)*ratPrice(3)) & "gp | "
world.Info "Black rats " & cstr(ratNums(4)*ratPrice(4)) & "gp"
end if
end sub
]]>
</script>
</muclient>
They keep changing the kill messages all the time, so the plugin regularly stops working due to a single trigger. |