ratting script error

okay so i found this ratting script on the gammon forum, someone named keldar created it. it's for mushclient and i've figured out how to install it .. i just need to get it to work.

 i get this error: [Compile error
Plugin: ratter (called from world: Untitled world)
Immediate execution
[string "Plugin"]:152: unexpected symbol near '<'
Error context in script:
 148 :            
 149 : 
 150 :
 151 :
 152*: <?xml version="1.0" encoding="UTF-8" ?>
 153 : <!DOCTYPE muclient >
 154 :
 155 : <muclient>
 156 :    <plugin name="Ratter" author="Keldar" language="vbscript" purpose="Display ratting info"
[WARNING] C:\Program Files (x86)\MUSHclient\worlds\plugins\ratter.xml
Line   30: Error parsing script (Cannot load)

which i can't make heads or tails out of because i'm not good at scripting :( here's the script:

<?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>
(XXXX): Peak says, "You worry me."

Comments

  • ElazarElazar NC/Mhaldor
    edited October 2015
    The time itll take you to figure this out, you wont need to hunt rats anymore
  • It's showing an error on valid xml. However, it looks like the script parser is throwing the error - and there is no way the script parser should see the xml.

    You say you've figured out how to install it, but could you explain what you're doing precisely?

    Also, could you host the xml file somewhere so I can see it?
    Current scripts: GoldTracker 1.2, mData 1.1
    Site: https://github.com/trevize-achaea/scripts/releases
    Thread: http://forums.achaea.com/discussion/4064/trevizes-scripts
    Latest update: 9/26/2015 better character name handling in GoldTracker, separation of script and settings, addition of gold report and gold distribute aliases.
  • Trevize said:
    Also, could you host the xml file somewhere so I can see it?
    i copy-pasted the xml text into the script box of mushclient's plugin wizard and then used the plugin thing to load it. also, http://pastebin.com/rZ00PSa9
    Elazar said:
    The time itll take you to figure this out, you wont need to hunt rats anymore
    that's what i'm afraid of :(

    (XXXX): Peak says, "You worry me."
  • Alcaro said:
    Trevize said:
    Also, could you host the xml file somewhere so I can see it?
    i copy-pasted the xml text into the script box of mushclient's plugin wizard and then used the plugin thing to load it. also, http://pastebin.com/rZ00PSa9
    Elazar said:
    The time itll take you to figure this out, you wont need to hunt rats anymore
    that's what i'm afraid of :(

    It's been a while since I've  used MUSHclient, but that sounds like the problem. I don't know what you mean by the plugin wizard or script box, but that's not how plugins are installed.

    Here's the instructions from his forum:

    Copy the plugin text
    Open a text editor (such as Notepad) and paste the plugin into it
    Save to disk on your PC, preferably in your plugins directory, as <name>.xml
    Go to the MUSHclient File menu -> Plugins
    Click "Add"
    Choose the xml file you just saved
    Click "Close"
    Current scripts: GoldTracker 1.2, mData 1.1
    Site: https://github.com/trevize-achaea/scripts/releases
    Thread: http://forums.achaea.com/discussion/4064/trevizes-scripts
    Latest update: 9/26/2015 better character name handling in GoldTracker, separation of script and settings, addition of gold report and gold distribute aliases.
  • @Trevize, do you know of any ratting scripts for Mudlet, then?
    (XXXX): Peak says, "You worry me."
  • Alcaro said:
    @Trevize, do you know of any ratting scripts for Mudlet, then?
    I don't. Ratting just isn't very good gold.

    Do you know much about Lua? It wouldn't be too difficult to make one.
    Current scripts: GoldTracker 1.2, mData 1.1
    Site: https://github.com/trevize-achaea/scripts/releases
    Thread: http://forums.achaea.com/discussion/4064/trevizes-scripts
    Latest update: 9/26/2015 better character name handling in GoldTracker, separation of script and settings, addition of gold report and gold distribute aliases.
  • edited October 2015
    afraid not :(
     i can try and learn, though.
    (XXXX): Peak says, "You worry me."
  • Unless things have changed a lot, ratting is literally never worth it. You can make more gold basically any other way, including begging people (would not recommend this route though).
  • edited October 2015
    Alcaro said:
    afraid not :(
     i can try and learn, though.
    Well, you just need to capture each rat kill, and an alias to show it all.

    Trigger would go something like:

    pattern:
    You have slain a black rat.

    script:
    if blackrats == nil then blackrats = 0 end
    blackrats = blackrats + 1
    ratgold = ratgold + 35

    First line says if the variable doesn't exist, make it and set it to 0. Then add one to the variable. Do the same for all types of rats. Remember those variable names! You'll need them in the alias.

    Then your alias, let's say a pattern of:
    ^ratgold$
    (a caret, ^, means start of line and a dollar sign, $, means end of line)

    And a script of, say...

    (tip on what's next - two spaces adjacent means 'combine' for strings (text) - also, \n is a 'newline')

    echo ("Rat gold: " .. ratgold .. "\n")
    echo ("Black rats: " .. blackrats .. "\n")
    echo ("Old rats: " .. oldrats .. "\n")
    ...etc for each type of rat using the variables you made in the triggers

    Then you want an alias to reset it. Maybe ^ratreset$

    script is simple:

    echo ("Rat gold tracker reset!\n")
    ratgold = 0
    blackrats = 0
    oldrats = 0
    ...etc for each type of rat using the variables you made in the triggers

    Post here if you run into any trouble making this! It's a good start on learning lua. You could make it a lot shorter/better using things like tables and functions, but they're not necessary! Can learn them later.
    Current scripts: GoldTracker 1.2, mData 1.1
    Site: https://github.com/trevize-achaea/scripts/releases
    Thread: http://forums.achaea.com/discussion/4064/trevizes-scripts
    Latest update: 9/26/2015 better character name handling in GoldTracker, separation of script and settings, addition of gold report and gold distribute aliases.
  • Eep! I just noticed, that if blah==nil then blah=0 end? do that for ratgold as well as the rat type in each trigger.
    Current scripts: GoldTracker 1.2, mData 1.1
    Site: https://github.com/trevize-achaea/scripts/releases
    Thread: http://forums.achaea.com/discussion/4064/trevizes-scripts
    Latest update: 9/26/2015 better character name handling in GoldTracker, separation of script and settings, addition of gold report and gold distribute aliases.
  • Trevize said:
    Eep! I just noticed, that if blah==nil then blah=0 end? do that for ratgold as well as the rat type in each trigger.

    Thank you for your help <3 I'll definitely give it a try.
    (XXXX): Peak says, "You worry me."
  • AustereAustere Tennessee
    edited October 2015
    You can short hand check your variables and it look a lot cleaner:

    if blackrats == nil then blackrats = 0 end

    Should be

    blackrats = blackrats or 0

    Edit: aren't you html? Can you even use lua on html?
  • Alcaro said:
    Trevize said:
    Eep! I just noticed, that if blah==nil then blah=0 end? do that for ratgold as well as the rat type in each trigger.

    Thank you for your help <3 I'll definitely give it a try.
    Certainly. Let me know if any of the script I put there doesn't make sense, by the way. It's mostly just if statements and adding, plus some string concatenation (that's what combining strings is called, that's the double periods).
    Current scripts: GoldTracker 1.2, mData 1.1
    Site: https://github.com/trevize-achaea/scripts/releases
    Thread: http://forums.achaea.com/discussion/4064/trevizes-scripts
    Latest update: 9/26/2015 better character name handling in GoldTracker, separation of script and settings, addition of gold report and gold distribute aliases.
  • Austere said:
    You can short hand check your variables and it look a lot cleaner:

    if blackrats == nil then blackrats = 0 end

    Should be

    blackrats = blackrats or 0

    Edit: aren't you html? Can you even use lua on html?
    I'm *trying* to make the switch to Mudlet and/or MUSHclient.
    (XXXX): Peak says, "You worry me."
  • edited October 2015
    Alcaro said:
    I'm *trying* to make the switch to Mudlet and/or MUSHclient.
    I'd recommend Mudlet currently, partly because of the map, and partly because more use it so you'll get help easier than you would on MUSHclient.

    That said, both are solid, so whatever you prefer would work.

    Austere said:
    You can short hand check your variables and it look a lot cleaner:

    if blackrats == nil then blackrats = 0 end

    Should be

    blackrats = blackrats or 0

    Edit: aren't you html? Can you even use lua on html?
    While correct, I prefer starting simpler. Explaining what 'or' does is a little more difficult that if statements. Not a lot, but I usually start with basics.

    @Alcaro - What 'or' is doing is looking at the left side. If it's 'true' - which means anything but false or nil - then it returns that. If it is false or nil, it returns the right side instead.


    Current scripts: GoldTracker 1.2, mData 1.1
    Site: https://github.com/trevize-achaea/scripts/releases
    Thread: http://forums.achaea.com/discussion/4064/trevizes-scripts
    Latest update: 9/26/2015 better character name handling in GoldTracker, separation of script and settings, addition of gold report and gold distribute aliases.
  • AustereAustere Tennessee
    Alcaro said:
    Austere said:
    You can short hand check your variables and it look a lot cleaner:

    if blackrats == nil then blackrats = 0 end

    Should be

    blackrats = blackrats or 0

    Edit: aren't you html? Can you even use lua on html?
    I'm *trying* to make the switch to Mudlet and/or MUSHclient.
    Mudlet will change your life.  If you need any help, just ask around.  There are a ton of knowledgeable people.

    Mush: prepare to do a lot of stuff yourself. 
  • You're wasting too much time on a ratting script. Ratting is terrible gold.

  • edited October 2015
    Dude can enjoy any aspect of the game they damn well please. It will probably be a nifty little script project to get him introduced to mudlet style coding anyhow.
  • Tahquil said:
    Dude can enjoy any aspect of the game they damn well please. It will probably be a nifty little script project to get him introduced to mudlet style coding anyhow.
    Ratting script, not necessarily a waste, as long as you learn!

    Actually ratting... ouch. :(
    Current scripts: GoldTracker 1.2, mData 1.1
    Site: https://github.com/trevize-achaea/scripts/releases
    Thread: http://forums.achaea.com/discussion/4064/trevizes-scripts
    Latest update: 9/26/2015 better character name handling in GoldTracker, separation of script and settings, addition of gold report and gold distribute aliases.
  • Cooper said:
    You're wasting too much time on a ratting script. Ratting is terrible gold.
    *lowers voice* I also catch butterflies from time to time. Ssshh, don't tell anyone!

    On a serious note, I enjoy the ritual of ratting. If you catch enough, they add up and you don't have to wait for them to respawn. Plus you don't have to deal with anyone bashing on "your" territory.
    (XXXX): Peak says, "You worry me."
  • Hiya @Alcaro, I like sending people that are new to mudlet to the tutorial for a nice overview...

    http://wiki.mudlet.org/w/Manual:Introduction

    Ratting might not be great gold but it's a great project for a script!  Good luck!



  • I agree with ratting scripts making for a good introduction. But I cringe at the idea of ratting for gold (unless you just really love ratting for some reason).

    Assuming you kill a rat every 10 seconds on average*, then you'll be making about 6k gold per hour. You can get more than that in 5-10 minutes of questing in Ulangi (or several other areas, but Ulangi is the most popular and probably the easiest to learn. Actar is a good alternative if you're level 20-40ish and the animals on Ulangi are a little too strong for you).
    *You won't kill a rat every 10 seconds on average. Sometimes you won't even kill a rat every minute; you'll be wandering for 10 minutes, triple-checking to make sure you actually have rats on, and wondering if maybe the entire subdivision was already cleared out in the past hour.

    Butterflies are worse. Even if you had a room full of infinite red admiral butterflies, and you miraculously succeed on every attempt to catch one, you would only be able to get 12k gold per hour (around half of what Ulangi or similar gold-questing areas will get you). In reality though, you'll miss a lot (I'd very roughly estimate an average of around 2 attempts to catch a red admiral butterfly, more for the more valuable ones), and at least 70% of your time will be spent looking for butterflies rather than catching them, so you could probably manage 1k-2k gold per hour. As I've said before:
    Sena said:
    Laying in an alley and begging for spare change will probably be faster than chasing butterflies.
  • This is why I like stealing...people do all the hard work and I evade in to take it...

    Seriously though, it's a great start to scripting.  I Ratted for nearly 400 years, nothing wrong with it...10 rats = 1 mutton chop.  You do, what you need to do!

    Begging for spare change, @Sena...this is my new gold machine!

  • Sena said:
    I agree with ratting scripts making for a good introduction. But I cringe at the idea of ratting for gold (unless you just really love ratting for some reason).

    Assuming you kill a rat every 10 seconds on average*, then you'll be making about 6k gold per hour. You can get more than that in 5-10 minutes of questing in Ulangi (or several other areas, but Ulangi is the most popular and probably the easiest to learn. Actar is a good alternative if you're level 20-40ish and the animals on Ulangi are a little too strong for you).
    *You won't kill a rat every 10 seconds on average. Sometimes you won't even kill a rat every minute; you'll be wandering for 10 minutes, triple-checking to make sure you actually have rats on, and wondering if maybe the entire subdivision was already cleared out in the past hour.

    Butterflies are worse. Even if you had a room full of infinite red admiral butterflies, and you miraculously succeed on every attempt to catch one, you would only be able to get 12k gold per hour (around half of what Ulangi or similar gold-questing areas will get you). In reality though, you'll miss a lot (I'd very roughly estimate an average of around 2 attempts to catch a red admiral butterfly, more for the more valuable ones), and at least 70% of your time will be spent looking for butterflies rather than catching them, so you could probably manage 1k-2k gold per hour. As I've said before:
    Sena said:
    Laying in an alley and begging for spare change will probably be faster than chasing butterflies.
    can i have some spare change?
    (XXXX): Peak says, "You worry me."
Sign In or Register to comment.