Small Coding Questions

12467

Comments

  • DhraenDhraen UKMember Posts: 59 ✭✭
    It warms my heart everytime I read this thread to see constant support. That said, might I offer an alternative to table.concat() that will look much better when used with the above loop...

    function concand(t)
        if #t == 0 or t == nil then return "Empty" end

        return #t == 1
        and t[1]
        or table.concat(t, ", ", 1, #t - 1) .. " and " ..t[#t]
    end

    Simply replace table.concat() with concand() and you can also safely remove the second arg from concat.

    Essentially, your code will now be: send("wt Haven is in Nirvana. (Company: " .. concand(company.list) .. ")")

    This will, rather than display: (Web): Haven is in Nirvana. (Company: Kaeus, Omei)
    Display: (Web): Haven is in Nirvana. (Company: Kaeus and Omei)

    This obviously works for more than two values.

    (Tripwire users already have this available, by the way).
    Systems and scripting support: [email protected]
    Advanced HTML logging: http://www.logsty.net
    Anything else? http://www.google.com
    Haven
  • TeaniTeani Evening Sky SwedenMember Posts: 2,073 ✭✭✭✭✭
    Not sure if this is a -small- coding question or not, but I'm looking for someone who could perhaps help me code up some form of visualization of limb damage for Mudlet. It doesn't have to be fancy at all, just boxes that change color depending on the level of damage to each limb, head and torso.

    I'd also like some form of timer that ticks down second by second in a separate little UI container. Something I could connect to for example howls or holocaust bombs, so it counts down until the next one is set off.

    Any help would be appreciated. Just contact me. :)



  • MoireanMoirean Chairmander PortlandMember, Newbie Helper, Guildmaster Posts: 5,612 ✭✭✭✭✭
    Is there a way to force gmcp to update?
    The Divine voice of Razmael echoes in your head, "God of imps."
    Eugenides says to you, "Imp, Are you sure you were not born a Troll?"
    The Divine voice of Arion echoes in your head, "Every time I try to punish you for being so flippant, I find Myself laughing instead."
    Hugo has expressed his esteem of you for the following reason: Being a badass leader.
    image
  • DaskalosDaskalos Credit Whore Extraordinare Rolling amongst piles of credits.Member, Guildmaster Posts: 1,515 ✭✭✭✭✭
    I think you can request GMCP data, but I've never been able to figure out cmud's #SENDGMCP stuff.

    image

    image


    Message #17059 Sent By: Oleis           Received On: 1/03/2014/17:24
    "If it makes you feel better, just checking your artifact list threatens to crash my mudlet."

  • MoireanMoirean Chairmander PortlandMember, Newbie Helper, Guildmaster Posts: 5,612 ✭✭✭✭✭
    Well I got it to send stuff. Now Aetolia is yelling at me in red text.  >_>
    The Divine voice of Razmael echoes in your head, "God of imps."
    Eugenides says to you, "Imp, Are you sure you were not born a Troll?"
    The Divine voice of Arion echoes in your head, "Every time I try to punish you for being so flippant, I find Myself laughing instead."
    Hugo has expressed his esteem of you for the following reason: Being a badass leader.
    image
    Lin
  • DhraenDhraen UKMember Posts: 59 ✭✭
    What are you trying to get an update for, specifically? A lot of GMCP packets are sent on each prompt.
    Systems and scripting support: [email protected]
    Advanced HTML logging: http://www.logsty.net
    Anything else? http://www.google.com
  • MoireanMoirean Chairmander PortlandMember, Newbie Helper, Guildmaster Posts: 5,612 ✭✭✭✭✭
    Info in a room. In particular, mobs.
    The Divine voice of Razmael echoes in your head, "God of imps."
    Eugenides says to you, "Imp, Are you sure you were not born a Troll?"
    The Divine voice of Arion echoes in your head, "Every time I try to punish you for being so flippant, I find Myself laughing instead."
    Hugo has expressed his esteem of you for the following reason: Being a badass leader.
    image
  • DhraenDhraen UKMember Posts: 59 ✭✭
    Oh, just use the Items.Update event for that. Here's what I use, regardless: http://paste.pharanyx.com/lepekimudo.lua
    Systems and scripting support: [email protected]
    Advanced HTML logging: http://www.logsty.net
    Anything else? http://www.google.com
  • MoireanMoirean Chairmander PortlandMember, Newbie Helper, Guildmaster Posts: 5,612 ✭✭✭✭✭
    I use cmud, but thanks, I'll play around with that. I wasn't sure if there were particular ways to get stuff. Using items.list wasn't updating unless I did QL.
    The Divine voice of Razmael echoes in your head, "God of imps."
    Eugenides says to you, "Imp, Are you sure you were not born a Troll?"
    The Divine voice of Arion echoes in your head, "Every time I try to punish you for being so flippant, I find Myself laughing instead."
    Hugo has expressed his esteem of you for the following reason: Being a badass leader.
    image
  • IrruelIrruel Member Posts: 670 ✭✭✭✭
    Mudlet specific:
    I want to write a script which will feed mudlet a bucketload of lines of text, and measure how quickly it parses them.

    In other words, I want to simulate cmud's ctrl+k test.

    If I can do this, I will be able to track down problematic triggers/scripts better, and hopefully get on top of this 'lag in group combat' rubbish.
    Riluo
  • DaskalosDaskalos Credit Whore Extraordinare Rolling amongst piles of credits.Member, Guildmaster Posts: 1,515 ✭✭✭✭✭
    edited April 2014
    Irru -- sent you messages IG. As for the CTRL K test... even that's highly susceptible to CPU  load that affects the reliability. I don't even look at that test anymore because of that.

    image

    image


    Message #17059 Sent By: Oleis           Received On: 1/03/2014/17:24
    "If it makes you feel better, just checking your artifact list threatens to crash my mudlet."

  • AshmerAshmer Barefoot Adventurer LifeMember Posts: 1,095 ✭✭✭✭✭

    @Irruel, poke me in-game, and I might be able to go through a few ways to have triggers and functions run more quickly. Some of it might be raw latency, in which case there's nothing really to be done but find ways to improve your connection, but sometimes it's Mudlet catching way too many things. If you're using Tripwire, I have a suspicion that that will have something to do with it.


    There are ways to make triggers concat faster and functions be lighter, though!

    the way she tells me I'm hers and she is mine

    open hand or closed fist would be fine

    blood as rare and sweet as cherry wine

  • IrruelIrruel Member Posts: 670 ✭✭✭✭
    edited April 2014
    Hi @ashmer
    I'm aware of how to optimise scripts and, in particular, triggers. I've offered to update all of TW's triggers with non-regex trigger gates (and for the hell of it, optimise some of the regex patterns while at it) but Kaeus says it is more likely the scripts they run than the patterns themselves, so he would prefer me to just point out the problem scripts and let him optimise them.

    Having said that, thankyou for the offer and if I do manage to narrow down a specific script I may well take you up on that offer.

    I got a surprising answer on the Mudlet forum overnight. Someone called Fetaera suggested repeating my tests with MCCP turned off. I just did this, and it is hugely better.
    http://forums.mudlet.org/viewtopic.php?f=9&t=4494&p=20799#p20799

    If anyone is interested in the details of my testing and how I was doing it, the above link has more details.

    I'll have to wait for a team fight before I know whether I still need to do some optimising or not, but for anyone that has seen that scrambled text/raw gmcp look while in intense spam (following mudbotters that move especially quick - looking at you @teani - managed to do it to me.)

    Open up preferences (alt+p) click on the 'special options' tab, and select the 'force compression off' checkbox. Save prefs, close mudlet (save) and return.
    Riluo
  • RiluoRiluo The DoctorMember Posts: 821 ✭✭✭✭
    edited April 2014

    This issue of lag is stupendous at times, to the point I have entered a room and froze up so badly that before the system can heal one thing I have fallen behind by several afflictions. There is something causing it and I am not smart enough in this area to figure it out. If you figure it out please let us know so it can be addressed.

    I did the 'force compression off' thing. What is it for? and cheers.

    Abhorash says, "Ve'kahi has proved that even bastards can earn their place."

  • IrruelIrruel Member Posts: 670 ✭✭✭✭
    I noticed an improvement with that freezy behaviour you described. It still happened to me earlier in a 4 vs 5 I was part of, but not to the point of ruining the fight for me as has happened before.

    I imagine that a large team fight will still be a pointless exercise.
  • MoireanMoirean Chairmander PortlandMember, Newbie Helper, Guildmaster Posts: 5,612 ✭✭✭✭✭
    Irruel said:
    Hi @ashmer
    I'm aware of how to optimise scripts and, in particular, triggers. I've offered to update all of TW's triggers with non-regex trigger gates (and for the hell of it, optimise some of the regex patterns while at it) but Kaeus says it is more likely the scripts they run than the patterns themselves, so he would prefer me to just point out the problem scripts and let him optimise them.

    Having said that, thankyou for the offer and if I do manage to narrow down a specific script I may well take you up on that offer.

    I got a surprising answer on the Mudlet forum overnight. Someone called Fetaera suggested repeating my tests with MCCP turned off. I just did this, and it is hugely better.
    http://forums.mudlet.org/viewtopic.php?f=9&t=4494&p=20799#p20799

    If anyone is interested in the details of my testing and how I was doing it, the above link has more details.

    I'll have to wait for a team fight before I know whether I still need to do some optimising or not, but for anyone that has seen that scrambled text/raw gmcp look while in intense spam (following mudbotters that move especially quick - looking at you @teani - managed to do it to me.)

    Open up preferences (alt+p) click on the 'special options' tab, and select the 'force compression off' checkbox. Save prefs, close mudlet (save) and return.
    I see the raw gmcp stuff sometimes on CMUD. It's not a mudlet exclusive problem.
    The Divine voice of Razmael echoes in your head, "God of imps."
    Eugenides says to you, "Imp, Are you sure you were not born a Troll?"
    The Divine voice of Arion echoes in your head, "Every time I try to punish you for being so flippant, I find Myself laughing instead."
    Hugo has expressed his esteem of you for the following reason: Being a badass leader.
    image
  • IrruelIrruel Member Posts: 670 ✭✭✭✭
    Seems to have something to do with MCCP.
    I turned it off and haven't been able to make it bug out like that again.
    There is an option to toggle it off in cmud as well.
  • MoireanMoirean Chairmander PortlandMember, Newbie Helper, Guildmaster Posts: 5,612 ✭✭✭✭✭
    edited April 2014
    Ok, me again with my gmcp question. QL is spammy and I don't like it. After much google-fu, I've discovered that the command "gmcp.Char.Items.room" exists to let me make gmcp update for what's in the room - but how do I use that command, on CMUD? #sendgmcp char.items.room is not updating the table.

    Edit: Ok. Figured this out. For any future CMUD dinosaurs like me, to make #SENDGMCP work, you need to send a db var (even if it's blank) with the request. Here's a code snippet that easily works:

    $db.group = "" 
    #SENDGMCP Char.Items.Room $db

    Just plug that in where you want to force the gmcp to update the room items and you're good to go!
    Post edited by Moirean on
    The Divine voice of Razmael echoes in your head, "God of imps."
    Eugenides says to you, "Imp, Are you sure you were not born a Troll?"
    The Divine voice of Arion echoes in your head, "Every time I try to punish you for being so flippant, I find Myself laughing instead."
    Hugo has expressed his esteem of you for the following reason: Being a badass leader.
    image
    Riluo
  • SaybreSaybre Member Posts: 283 ✭✭✭
    Trying to figure out this GMCP.Communication bit, since the new Vox stuff it makes it a pain to capture. Tried to do an ANSI wildcard, and it just trigger loops all the time. Since there's a Start, and an end, not certain how to grab the information to my Channels window.

    I use CMUD like a dinosaur too. >.>

    Any help is much appreciated.
    http://www.ironrealms.com/gmcp-doc

    Is where I tried to start to interpret..but not sure how to capture? Do you trigger the GMCP off of ^Comm.Channel.End or do a database thing like the item capture..?

    Such confuse. Much crazy. Wow.
    image
  • NalorNalor UKMember Posts: 774 ✭✭✭
    Someone wont like this but this is from Imperian @Saybre‌


    Comm.Channel.Text
    #WIN Communication %gmcp.Comm.Channel.Text.text


    Info that is sent:

    %gmcp.Comm.Channel.Text.channel - This is the title on the channel such as Antioch, Market, Newbie, Say, Tell, etc
    %gmcp.Comm.Channel.Text.talker - Who is talking - Jeremy, Garryn, etc
    %gmcp.Comm.Channel.Text.text - The whole unedited line.
    Mudlet Bashing System for sale. Message if interested
  • MoireanMoirean Chairmander PortlandMember, Newbie Helper, Guildmaster Posts: 5,612 ✭✭✭✭✭
    edited May 2014
    Yeah, I saw that post, but I can't make it work. Trying to echo back anything from Comm.Channel is just producing blank stuff, even if I trigger on every gmcp event. CMUD just isn't getting any info from Aetolia under Comm.Channel.whatever
    The Divine voice of Razmael echoes in your head, "God of imps."
    Eugenides says to you, "Imp, Are you sure you were not born a Troll?"
    The Divine voice of Arion echoes in your head, "Every time I try to punish you for being so flippant, I find Myself laughing instead."
    Hugo has expressed his esteem of you for the following reason: Being a badass leader.
    image
  • SheirosiaSheirosia Sheffield, UK.Member Posts: 109 ✭✭✭
    You need to actually request support from the server first. Not sure how in CMUD, but in Mudlet, I do sendGMCP('Core.Supports.Add ["Comm.Channel 1"]')
  • NalorNalor UKMember Posts: 774 ✭✭✭
    edited May 2014
    Moirean said:

    Yeah, I saw that post, but I can't make it work. Trying to echo back anything from Comm.Channel is just producing blank stuff, even if I trigger on every gmcp event. CMUD just isn't getting any info from Aetolia under Comm.Channel.whatever

    You have to go into the properties? Cant remember the correct thing.. to set it ... @Moirean‌


    Edited: Options, General, Protocols (general tab)

    add-- Comm 1
    or-- Comm.Channel 1

    ^ I loaded up cmud to check

    Mudlet Bashing System for sale. Message if interested
  • MoireanMoirean Chairmander PortlandMember, Newbie Helper, Guildmaster Posts: 5,612 ✭✭✭✭✭
    edited May 2014
    Yeah I know. I already added it there before I even posted.
    The Divine voice of Razmael echoes in your head, "God of imps."
    Eugenides says to you, "Imp, Are you sure you were not born a Troll?"
    The Divine voice of Arion echoes in your head, "Every time I try to punish you for being so flippant, I find Myself laughing instead."
    Hugo has expressed his esteem of you for the following reason: Being a badass leader.
    image
  • SaybreSaybre Member Posts: 283 ✭✭✭
    Same here, tried multiple versions of trying to capture, the protocols are there, still nothing.

    Unhappy face.
    image
  • NalorNalor UKMember Posts: 774 ✭✭✭
    did you both @Moirean and @Saybre set the trigger to GMCP?
    Mudlet Bashing System for sale. Message if interested
  • MoireanMoirean Chairmander PortlandMember, Newbie Helper, Guildmaster Posts: 5,612 ✭✭✭✭✭
    Yes.
    The Divine voice of Razmael echoes in your head, "God of imps."
    Eugenides says to you, "Imp, Are you sure you were not born a Troll?"
    The Divine voice of Arion echoes in your head, "Every time I try to punish you for being so flippant, I find Myself laughing instead."
    Hugo has expressed his esteem of you for the following reason: Being a badass leader.
    image
  • NalorNalor UKMember Posts: 774 ✭✭✭
    hmm unsure then as I got it working earlier after I seen your last post :/
    Mudlet Bashing System for sale. Message if interested
  • SaybreSaybre Member Posts: 283 ✭✭✭
    Yeah, had it set as GMCP, even flipped through a few of the #s, nothing. Darn Vox things are the reason this is such a pain in the rear.
    image
  • SaybreSaybre Member Posts: 283 ✭✭✭
    @Moirean - I think it's Mudbot that is the issue, I just loaded a naked Aet and put in the protocols and the trigger from Jeremy...works great.
    image
Sign In or Register to comment.