Mudlet Questions

by Rika

Back to Mechanic's Corner.

Lorina2011-08-07 01:01:20
I am having issues with correctly labeling everything so the trigger captures it...

The max/current ego strength of Lorina: 5000/5000

‎^The max\\/current ego strength of (\\w+)\\: (\\d+)\\/(\\d+)$

if tonumber(matches) / tonumber(matches) <= 0.5
then mm.doadd("psi super mindburst " .. matches)
else mm.doadd("psi super psychicvampirism " .. matches)
end
Lilia2011-08-07 01:09:21
What exactly is the problem? I pasted exactly what you had, and it worked fine.
Lorina2011-08-07 01:11:25
Hmm well that is weird. I cannot get it to work for me sad.gif
Ytran2011-08-07 01:43:06
Are you using the regular expression trigger option?
Ardmore2011-08-13 16:42:03
Is there a way to sort a Lua table by value rather than key?
Ilyarin2011-08-14 20:02:39
Is there a way to limit the number of backups that Mudlet can make for a single profile? At 3mb each, and with more than 150, I'm relatively concerned about space issues. If there was a way to limit each profile to x backups, that would be amazing. biggrin.gif Alternatively, if you could just specify a maximum space for backups that would be nice, too.
Ardmore2011-08-14 20:07:11
I guess the quick fix is to go and manually delete all the old ones you don't need.
Lilia2011-08-14 20:14:40
I just delete all but the most recent five or so every now and then.
Unknown2011-08-15 09:14:19
I've played other Mud's before and used zMud as my primary client when doing so. Mudlet is by far faster and better though so when I came to Lusternia I switched to that. But what I can do with Mudlet at this time is severly limited though.

I used to have the most awesome thing set up for elixlist/potionlist that really helped me sort my vials. And it seems that my old setup has spoiled me. I'm having a really hard time getting used to the way just doing PL shows it.

This is what my setup made it look like:



Does anyone have something similar? And if not could someone give me detailed information about how to proceed in making it?
Unknown2011-08-15 09:52:50
Well, there is this. You also have access to POTIONLIST SHORT (PL SHORT) in game.

Hope that helps some.
Vadi2011-08-15 10:05:21
Profile snapshot management: http://forums.mudlet.org/viewtopic.php?f=7&t=2325

@StarHawk: that's very possible to do in Mudlet, sure.
Calixa2011-08-15 12:19:49
What is the correct way to clear a table of its values? Setting it to {} or nil seems to maintain the values in it, somehow. Do I have to go through it and clean out all the rows or something?
Neos2011-08-15 12:32:57
QUOTE (Calixa @ Aug 15 2011, 08:19 AM) <{POST_SNAPBACK}>
What is the correct way to clear a table of its values? Setting it to {} or nil seems to maintain the values in it, somehow. Do I have to go through it and clean out all the rows or something?

table(remember to never use table as a table name) = {}
that should do it
Unknown2011-08-15 16:06:57
From experience, I have found it better to just do myTable = nil rather than explicitly declare an empty table. You can just declare again when needed.
Calixa2011-08-16 13:02:01
Ok, I am confused then. The following piece of code is part of an experience counter I'm working on. For some reason, it only starts to show data on the third mob slain. And I have no idea why it behaves like that o_o

If anyone savvy with maths / code could also check if this is in fact calculating correctly and if there aren't any other glaring errors in it that'd be lovely too.

To get this to work: Send QSC on "You have slain" and make that a gate. Trigger for 15 more lines. Have the child trigger work on this regexp: ^\\*| Level : (\\d+) \\( ?(\\d+).(\\d+)%\\)

QUOTE
deleteFull() --if xp_table == nil then xp_table = {} end

xp_table = xp_table or {}

local tablesize = #xp_table

oldxp = newxp

newxp = tonumber(matches) + (matches/100)

diffxp = newxp - oldxp

levelxp = (100 - newxp)/diffxp

oldtime = newtime

newtime = os.time()

difftime = newtime - oldtime

local thiskill = {

diffxp = diffxp,

difftime = difftime,

}

if #xp_table >= 10 then

table.remove (xp_table, 1)

end

table.insert(xp_table, thiskill)

local totaldiffxp = 0

for _, v in ipairs (xp_table) do

totaldiffxp = totaldiffxp + v.diffxp

end

local totaldifftime = 0

for _, v in ipairs (xp_table) do

totaldifftime = totaldifftime + v.difftime

end

xpperhour = (totaldiffxp / totaldifftime)*60*60

timetolevel = (100 - newxp) / xpperhour

cecho("\\nYou have gained " .. string.format("%.2f",diffxp) .. "% experience. You need to slay " .. string.format("%.2f",levelxp) .. " more to level up.\\n" .. difftime .. " seconds passed since your last kill. You need to bash for " .. string.format("%.2f",timetolevel) .. " hours until level up and are gaining " .. string.format("%.2f",xpperhour) .. "% experience per hour.")
Shishi2011-08-16 14:57:26
I have some questions that I'm really confuzzled about but it's a lot more than I'd like to share with here, would anyone be willing to help me via forum pms?
Lilia2011-08-16 19:18:12
QUOTE (Calixa @ Aug 16 2011, 08:02 AM) <{POST_SNAPBACK}>
Ok, I am confused then. The following piece of code is part of an experience counter I'm working on. For some reason, it only starts to show data on the third mob slain. And I have no idea why it behaves like that o_o

If anyone savvy with maths / code could also check if this is in fact calculating correctly and if there aren't any other glaring errors in it that'd be lovely too.

To get this to work: Send QSC on "You have slain" and make that a gate. Trigger for 15 more lines. Have the child trigger work on this regexp: ^\\*| Level : (\\d+) \\( ?(\\d+).(\\d+)%\\)

I would probably need to look at it longer and see it in action to understand what all is going on here, but I did notice one thing. The first time the script runs, newxp and newtime don't exist yet, so oldxp and oldtime are being set to nil, meaning they don't exist either. This messes up your calculations.Why it waits until the third mob to work, I'm not sure, I would think it would work on the second. Checking qsc before you kill your first mob should fix that, but if you're triggering on the "You have slain" line, that will be difficult. Personally, I'd have the kill line turn on a trigger that matched on the first line of qsc, and then send qsc. Have the prompt turn the trigger back off. Make an alias, "start bashing", or something like that, that does the same thing the kill line does.
Unknown2011-08-16 23:58:47
QUOTE
Deleting old profiles. Files newer than 31 days and one profile for every month before that will be
kept.
Deletion complete. 709/914 files were removed successfully.


From running the backup deleter. Eesh.
Rivius2011-08-17 00:40:48
QUOTE (Zarquan @ Apr 5 2011, 01:30 PM) <{POST_SNAPBACK}>
GMCP gives you an area name which may differ from what's in the XML, but it also gives you the numeric area ID as part of a URL field (for most areas).

I think the area is also in the room coordinates?
Shishi2011-08-18 03:32:34
Alright I am still new to mudlet so I'm figuring things out quick, and the one thing I'm really missing before I can do combat reliably without thinking too much is pretty much this trigger. I would like to know why the below isn't working, what I'm doing wrong. I'm open to suggestions on how to do this better as well! Also what is that little bug that tells me my script won't work, is that a ladybug? It's really cool whatever it is, even though it kind of frustrates me.


This is the line I get from contemplating. I have perl regex selected

CODE
^(.*)'s mana stands at (\\d+)/(\\d+).$


This is in the Script box, and I have commented the Lua error I'm getting in the script.

CODE
--The below should do math to find the percentage it currently has
--Lua syntax error::3: '=' expected near '/'
Matches / matches = target_mana_percent
-- The below is an echo so I can see what percent anyone is at with contemplate
echo("target_mana_percent")
-- Below is if my target is the person I'm contemplating to do lash
if tar == matches then
    -- For if target is below 50% then I will toadcurse them
    if target_mana_percent < .5 then
        send("toadcurse " .. matches)
    -- If target isn't below 50% it will just Shadowdance lash them
    else
        send("shadowdance lash " .. matches)
    end
end