Mudlet Questions

by Rika

Back to Mechanic's Corner.

Israafiyl2012-06-30 23:25:36
Israafiyl:

when using booleans how would I table.remove(targetEffects, 1) I am trying to make it so the first thing on my table targetEffects that = true now = false when I get a trigger line to match


Guessing there is no way to do this, so does anyone know how I could make a timer so that when I see (\\w+) takes a drink from .*. and matches == combattarget I set targetAllheale = true and then after 19.5 seconds it = false?
Israafiyl2012-06-30 23:36:58
this is what I came up with:


if targetAllheale == false then
targetAllgheale = true
end
if matches == combattarget then
if targetEffects.powerspikes == true then
targetEffects.achromaticaura = false
targetEffects.egovice = false
targetEffects.manabarbs = false
end
end
if matches == combattarget then
if targetEffects.egovice == false and targetEffects.achromaticaura == false and targetEffects.manabarbs == false then
targetEffects.powerspikes = false
end
end
if matches == combattarget then
if targetEffects.powerspikes == false then
targetEffects.achromaticaura = false
targetEffects.egovice = false
targetEffects.manabarbs = false
end
end
targetAllheale_timer = tempTimer(19.5, ])
Israafiyl2012-06-30 23:54:39
or should I if targetAllheale == true then
targetAllheale_timer = tempTimer(19.5, ])
end
Lilia2012-07-01 03:58:10
Okay, a few things. These two blocks:

if matches == combattarget then
if targetEffects.powerspikes == true then
targetEffects.achromaticaura = false
targetEffects.egovice = false
targetEffects.manabarbs = false
end
end
if matches == combattarget then
if targetEffects.powerspikes == false then
targetEffects.achromaticaura = false
targetEffects.egovice = false
targetEffects.manabarbs = false
end
end

are exactly the same, except the first checks for powerspikes being false, and the second checks for it being true.

You're not checking if the person is your target in every block, but I think you mean to. It would be easier to just put 'if matches == combattarget then' as the first line, and all the rest of the code inside that. You should also create the timer in the same block that you change the variable, otherwise you're going to be making a timer everytime your target sips (or in your original code, everytime anyone sips), instead of when he sips AND the variable is false.

if matches == combattarget then
if targetAllheale == false then
targetAllgheale = true
targetAllheale_timer = tempTimer(19.5, ])
end
if targetEffects.powerspikes == true then
targetEffects.achromaticaura = false
targetEffects.egovice = false
targetEffects.manabarbs = false
end
if targetEffects.egovice == false and targetEffects.achromaticaura == false and targetEffects.manabarbs == false then
targetEffects.powerspikes = false
end
if targetEffects.powerspikes == false then
targetEffects.achromaticaura = false
targetEffects.egovice = false
targetEffects.manabarbs = false
end
end


Note that the above still has the two redundant blocks, since I have no idea what you're trying to do with those sections.
Calixa2012-07-01 19:40:57
Is there a reference somewhere when which GMCP information is received? Since stuff like "gmcp.Char.Skills.List" is being used as an event handler it would be handy to know how often to expect that to refresh.

Also I assume all code in a script registered to an event handler is executed every time that event fires? Because I don't want to be executing a huge complicated block of code every few seconds because that is how often the event fires :D
Rakor2012-08-02 13:59:14
So, Mudlet has crashed three times in the last 15 minutes after I upgraded m&m and got the latest mapper script. Anyone else having problems? Is there some way I can get a crash log?
Vadi2012-08-03 01:26:14
If you're on a Mac or Ubuntu, you can, but if you're on Windows then you're out of luck - Mudlet doesn't have anything built-in and Windows makes it ridiculously hard to get any useful information out of a crash.

Could you try to narrow down to what exactly causes it, and post a reproducible test case on Mudlet forums if you can?
Unknown2012-08-03 05:30:01
Super mudlet noob here with a question.

I've gotten the astrology plug-in and I've gotten the info-tabs plug-in. I managed to right-justify the tabs, but I can't get any information to appear in any of the tabs.

I'm guessing I broke it somehow, or haven't used it right yet, but some help would be awesome. Thanks in advance.

Edit: Do I need GMCP enabled in order to use it?

Edit2: And yes, I have the astrology skill.
Unknown2012-08-03 06:58:03
I've not used the latest version but if it's still the same you shouldn't need gmcp, it should trigger when you stargaze at an astrolabe.
Unknown2012-08-03 06:58:34

I've not used the latest version but if it's still the same you shouldn't need gmcp, it should trigger when you stargaze at an astrolabe.


Would be cool if it did, but it didn't. :(


Edit: Hours later, having turned off the computer and mudlet for the night, still no dice.

Edit2: Still didn't fix it, but I made another trigger that referenced the astrolabe inside of the guild instead of a non-existing handheld one. Now the astro tab displays text, but...

Unknown2012-08-04 00:00:24
Sorry for the double post, but I still haven't managed to get this to work right.
Unknown2012-08-05 08:25:36
I use my bloodhound (from the tracking skill) for almost everything. I would like to put an after my prompt for when my hound is following me, but the GMCP for that seems tricky, especially since there does not appear to be a GMCP for your entourage.

So my questions are this...

1. Anyone know if there's a GMCP or something like it for your entourage?

2. Is there an efficient way to have it scan the GMCP for what is in your room and tell you when the hound (which has an id # I can track) is in the room with you?
Unknown2012-08-05 08:50:25
1. No.

2. Yes. (Give me the name of your hound (as shown on INFO HERE) and also its id number.)

I'll get something coded up pretty quick.

Edit: Oh, and also your client. Might help :P
Unknown2012-08-05 08:51:08
I'm not the best coder but... gmcp.Room.Info has a list of what's in the room, it updates when you look (or enter a new room I think). I run through the table in that, comparing against ent numbers to track whether I've lost mine.

Edit: Ninja'd by someone much more competent!
Unknown2012-08-05 09:13:57
"hound95796" a bloodhound

I'm on mudlet so it would be in lua I guess :) Thanks dude!
Unknown2012-08-05 10:40:20
Sorry for the delay. Got a bit sidetracked. Here you go:

function track_beast()
for key, value in pairs(gmcp.Char.Items.List.items) do
if value.id == "12345" then -- change to the id number of your beast
return "H"
end
end
return ""
end


You can tag it onto your prompt quite simply with an echo. Just do:

echo(track_beast())

If your beast is in the room, it will echo "H" and if not, an empty string, ""
Unknown2012-08-05 12:19:25
Woo, thanks!!
Unknown2012-08-06 01:28:16
Anyone know what the r,g,b color parameters are of the dark green text in your health for when you have full or close to full health? I want to be able to match it exactly, it annoys me when it's a little bit off.
Ytran2012-08-06 03:11:31
Jello:

Anyone know what the r,g,b color parameters are of the dark green text in your health for when you have full or close to full health? I want to be able to match it exactly, it annoys me when it's a little bit off.

That depends on how the client interprets the ansi sequences used for colouring text. The default in Mudlet looks to be 0,179,0 (for my install, at least) - you can see the colours under Settings -> Colour View -> . However, this can vary depending on the client or terminal you use, since the ansi sequence doesn't define the colour itself.
Unknown2012-08-06 03:48:12
Interesting, thank you.