Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Plugins ➜ Would like some help with a plugin

Would like some help with a plugin

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by DanaLea73   USA  (9 posts)  Bio
Date Mon 13 Jun 2011 08:38 PM (UTC)
Message
This is my first plugin.. I've gotten some help and that person said the code "looked solid". So now I'm trying to turn my code into an actual plugin. I created a blank plugin with the plugin wizard and added my code. can someone take a look and see if there's anything grossly wrong that I should fix before trying it in the real world? I don't want to break anything...

Thanks in advance..

http://pastebin.com/8DrebMYU

Yes I'm a girl. Yes I play muds. Get over it.
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #1 on Mon 13 Jun 2011 08:58 PM (UTC)
Message
Your help alias just won't work. You want


   script="OnHelp"
   match="ConHelp"


Your triggers block isn't terminated properly. You should end it with

</triggers>

Not

<triggers>


All of those "if blah = blah" should actually use == instead of =
= is for assignment
== is for comparison

Those changes will at least get the plugin to load. Though it looks like your trigger patterns are wrong, because they don't fire for me.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by DanaLea73   USA  (9 posts)  Bio
Date Reply #2 on Mon 13 Jun 2011 09:12 PM (UTC)

Amended on Mon 13 Jun 2011 09:16 PM (UTC) by DanaLea73

Message
I got this error after I made the changes and tried to reload it.


Compile error
Plugin: Consider_Replacements (called from world: Aardwolf)
Immediate execution
[string "Plugin"]:196: 'then' expected near '='
Error context in script:
 192 :   if name == "consider_annihilated" then
 193 :    ColourTell(consider_messages[name], "", "50+ levels higher than")
 194 :   elseif name == "consider_begone" then
 195 :     ColourTell(consider_messages[name], "", "41 to 50 levels higher than")
 196*:    elseif name = "consider_dance" then
 197 :     ColourTell(consider_messages[name], "", "is 32 to 41 levels higher than")
 198 :   elseif name == "consider_crush" then
 199 :     ColourTell(consider_messages[name], "", "21 to 32 levels higher than")
 200 :   elseif name == "consider_bravestupid" then
[WARNING] Z:\Applications\MUSHClient r992\worlds\plugins\Aard_Consider_Replacements.xml
Line  192: Error parsing script (Cannot load)



new pastebin for code...
http://pastebin.com/azKB5qFx


ack.. I missed a =... hold on please...

Yes I'm a girl. Yes I play muds. Get over it.
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #3 on Mon 13 Jun 2011 09:13 PM (UTC)
Message
You missed an instance of = that should have become ==

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #4 on Mon 13 Jun 2011 09:15 PM (UTC)
Message
Also, you need to add

enabled="y"

to all of the triggers. That will get them to start working.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by DanaLea73   USA  (9 posts)  Bio
Date Reply #5 on Mon 13 Jun 2011 09:16 PM (UTC)
Message
hmmm.. you mean I have to turn the triggers ON.. yes I think that would help...

heh

Yes I'm a girl. Yes I play muds. Get over it.
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #6 on Mon 13 Jun 2011 09:25 PM (UTC)
Message
Once you've got all of that done, I find this to be a bit cleaner...


consider_messages = {
	consider_annihilated = {"#FF0000","50+ levels higher than"},
	consider_begone = {"#FF4000","41 to 50 levels higher than"},
	consider_dance = {"#FF8000","32 to 41 levels higher than"},
	consider_crush = {"#FFC000","21 to 32 levels higher than"},
	consider_bravestupid = {"#FFFF00","16 to 21 levels higher than"},
	consider_runaway = {"#80FF00","8 to 16 levels higher than"},
	consider_chuckles = {"#00FF00","3 to 8 levels higher than"},
	consider_snickers = {"#00FFC0","2 to 3 levels higher than"},
	consider_fair = {"#00FF80","within 2 levels of"},
	consider_worried = {"#00C0FF","2 to 6 levels lower than"},
	consider_weak = {"#0080FF","6 to 9 levels lower than"},
	consider_workout = {"#0040FF","9 to 19 levels lower than"},
	consider_stomp = {"#0000FF","more than 19 levels lower than"},
	consider_walkallover = {"#0000FF", "more than 19 levels lower than"}
}


function consider_capture(name, line, wildcards)
    mob={}
    mob.name = wildcards.mob
    mob.auras = wildcards.auras

    if string.find(mob.auras, "%(R%)") or string.find(mob.auras, "%(Red Aura%)") then
        ColourTell("red", "", mob.name)
    elseif string.find(mob.auras, "%(G%)") or string.find(mob.auras, "%(Golden Aura%)") then
        ColourTell("yellow", "", mob.name)
    else
        ColourTell("white", "", mob.name)
    end

    ColourTell("white", "", " is ")
    ColourTell(consider_messages[name][1], "", consider_messages[name][2])
    ColourNote("white", "", " you.")
end

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by DanaLea73   USA  (9 posts)  Bio
Date Reply #7 on Tue 14 Jun 2011 12:35 AM (UTC)
Message
I agree that is cleaner, and probably just all around better... but it's working perfectly and I don't want to touch it. :p

Yes I'm a girl. Yes I play muds. Get over it.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


19,170 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.