Mudlet Questions

by Rika

Back to Mechanic's Corner.

Unknown2012-02-13 20:20:53
That way is great, Rika! Forums still won't let me attach anything... :cry:
Vadi2012-02-13 21:07:33
I think you can put the xml into a zip, and then it will let you.
Ytran2012-02-14 03:28:50
ForgotOldForumName:


I'm a code dummy.

I've been trying variations of the following, and nothing I try seems to work:

perl regex
^You have slain

tempTrigger("You have recovered equilibrium., ]")

What am I doing wrong?

Try

tempTrigger("You have recovered equilibrium.", ])


There are a couple things wrong with your first attempt. First, you never provided the closing quote for the string you were trying to match, so you sent tempTrigger a single argument of "You have recovered equilibrium., ]", which wasn't what you wanted. Second, the code you provide for the second argument is actual Lua code to be executed, so to send something to the mud you need to use the send() routine; your attempt, had to supplied the second quote in the right spot, would have tried to concatenate two variables "get" and "target", and then do nothing else.
Unknown2012-02-14 04:02:55
Thank you. That's getting much closer!

The trigger fires three times each time I regain eq, instead of once. I also only want it to fire after I get the line: You have slain

Is there a simple way to correct those two things?
Lilia2012-02-14 06:26:24
I've never used temp triggers before, but here's what I came up with by messing around. Seems temp triggers are only temporary in the sense that they don't persist through different sessions. They're not one off. So you'll need to get the id number when you create it, and kill it once it fires.
temp = tempTrigger("You have recovered equilibrium.", ])
Ytran2012-02-14 07:05:20
Ugh, seriously? At that point you're better off just using a normal trigger and toggling it on/off with enableTrigger and disableTrigger imo.
Naia2012-02-14 09:04:42
A regular trigger is fine.

If you use m&m:
^You have slain

mm.dofirst("get "..target")


Regular mudlet:
^You have slain
^You have recovered equilibrium.$

(check multiline / AND trigger)

send("get "..target)

(GMCP would be more efficient, I dunno how to use it outside of m&m though).

Set a button or alias to turn it on and off with enableTrigger() and disableTrigger()
Unknown2012-02-14 11:57:10
GMCP is -exactly- the same whether you are using m&m or not. :P

As for using it for picking up corpses, though, I think it's overkill. Nonetheless! I was bored. Something like this would work, I guess. (This code will NOT work as-is. It is merely for demonstration purposes.)

Create new script object.

Add user defined event handler. (This needs to be gmcp.Char.Items.Update)

Add this:
if sys.bashing == true then
local item = string.match(gmcp.Char.Items.Update, "The corpse of (+)")
if item then
temptr = tempRegexTrigger("^You have recovered (balance|equilibrium)( on all limbs)?\\.$", ])
item = nil
end
end
Unknown2012-02-15 18:11:20
Well the new SHOW commands will make it so you'll just about never need to capture and gag STAT, also there is SHOW PRESTIGE, but it is not in the list. I thought I'd post this here in case others have interest in the STAT gagging Starfire has.


o You can now SHOW WARMTH, SHOW ROOTING, SHOW SANITY, SHOW TOLERANCE,
SHOW SOBRIETY, SHOW HUNGER, and SHOW REST.
Unknown2012-02-16 02:42:37
Naia:

A regular trigger is fine.

If you use m&m:
^You have slain

mm.dofirst("get "..target")


Regular mudlet:
^You have slain
^You have recovered equilibrium.$

(check multiline / AND trigger)

send("get "..target)

(GMCP would be more efficient, I dunno how to use it outside of m&m though).

Set a button or alias to turn it on and off with enableTrigger() and disableTrigger()



Thanks so much for the help. Simple is better for someone like me, heh.
Sondayga2012-02-16 23:45:30
I cannot get a picture to load into a label I've tried a variety things here is what I have right now

mainContainer = Geyser.Container:new({x=0,y=0,width="100%",height="100%",name="mainContainer"})

mainPicture = Geyser.Label:new(
{ x = 0, y = 0,
width = "100%", height = "100%",
name = "mainPicture",})
setBackgroundImage("mainPicture", ])
mainPicture:setStyleSheet]
mainPicture:echo]


I've tried \\ instead of /, I've tried both the setBackgroundImage and the setStyleSheet way I tried moving the picture to the mudlet folder.

:(
Unknown2012-02-17 08:50:57
Make sure that the image dimensions do not exceed the label dimensions. I can see nothing syntactically wrong with what you have there, so suspect this may be the issue.
Vadi2012-02-17 09:10:50
Try seeing if .jpg works? Just out of the blue.
Sondayga2012-02-17 17:01:56
Yeah I've tried making the label unnecessarily large just in case and nothing, this happens to me in mushclient too, I have a feeling it has to do with the path but it is correct. le sigh no pretty pictures for me.

jpg didn't work either
Vadi2012-02-17 21:35:23
Well, the code worked, however if you have the echo there it replaces the picture.
Aldani2012-03-01 20:28:54
Vadi:


Is this still an issue?

News! Importing scripts still doesn't work, but the package manager has started working again. I don't know what changed, but I can use that to import scripts now.
Unknown2012-03-11 00:18:36
If I wanted to make a multi-line echo that displayed an amount of information, how would I go about doing so?

For example, if I wanted to quickly review a list of herbs or something and I wanted it to display on separate lines:

Allheale:
reishi 700
kombu 600
sargassum 500
etc etc.

I've been playing around trying to figure this out, but when I do it I end up with them all on the same line squished together.
Neos2012-03-11 00:21:30
\\n to get a new line in an echo
Unknown2012-03-11 00:22:08
AquaNeos:

\\n to get a new line in an echo


Thanks.

*crawls back into the noob corner and sucks on thumb*