Mudlet Help Desk

1235710

Comments

  • NalorNalor UKPosts: 774Member ✭✭✭
    edited June 2014
    function echoChat(channel)
    local str = string.title(channel) or "All"
    selectString(line,1)
    local er,eg,eb = getBgColor()
    local tflag = false
    if er == 0 and eg == 0 and eb == 0 then
    setBgColor(0,0,0)
    tflag = true
    end
    copy()
    if str ~= "Shouts" then
    appendBuffer("GUI.chat.All")
    end
    if str ~= "All" then appendBuffer("GUI.chat." .. str) end
    if tflag then
    setBgColor(0,0,0)
    end

    GUI[str.. "tab"]:flash(1.5)
    end
    ----------------------------------------------------------
    @Irruel‌
    Is the script I use the GUI stuff is my design/chat window .. that and 6 lines of code to capture from GMCP in a script with event handler
    Mudlet Bashing System for sale. Message if interested
  • IrruelIrruel Posts: 650Member ✭✭✭✭
    Hrm. Thanks for the reply.

    I can see that, with the getBgColor() func (though, shouldn't it be getFgColor()?)
    I'm not convinced that there isn't an easier way to figure the colour from the raw ansi.

    string.match on the 32m bit, then compare the result to a table that converts it to a colour name, perhaps.

    I'll test it out next time I get the chance, in a couple of day.
  • NalorNalor UKPosts: 774Member ✭✭✭
    @Irruel well that works of GMCP and it shows in the correct color as what you see in the main window.
    Mudlet Bashing System for sale. Message if interested
  • SampSamp Posts: 110Member ✭✭✭
    edited June 2014
    Sorry for the delay- Yes I did, @Irruel and am now doing the whole let's-unicorns-everything-up-and-see-what-happens point :P Thanks for all your help so far.

    Here's a question:
    ^\((.+)\): (\w+) says?, "(.+)(\.|\?|!|\)|\()"$
    I'm using that to capture messages over channels. My thought is to store all the messages into a table, but I'm worried that after being online for a while that it'll become a huge table. Is there a general best practice for the amount of string data to put in a table, or the amount of complexity/levels a table should hold before Mudlet starts to get angry with me?

    edit lrn2moregoogle: Miniconsoles sound like exactly what I want: [Miniconsoles are] very efficient as well, so you can have many miniconsoles, even in spam, not lag you down.
    Post edited by Samp on
    I once killed a humgii, y'know.

    JSYK she/her pronouns!
  • SheirosiaSheirosia Sheffield, UK.Posts: 109Member ✭✭✭
    With regards to parsing the ANSI string, while in theory it is possible, I have not bothered owing to what seems like a Mudlet bug.

    To reproduce, copy the string then echo() it out. Mudlet will break. Not sure what's causing it at this stage.
  • IrruelIrruel Posts: 650Member ✭✭✭✭
    I've been breaking mudlet just by copy/pasting the raw ansi - it seems to interpret part of the control codes as <- left arrow symbols, and once I try to paste that into the command line and send it to the mud (as a clan tell to KLL in this instance) I broke mudlet.

    I'm 95% sure I have the solution I need for my script though (and if not I'll just copy Nalor's). It'll have to wait for Monday morning though, as that is the next moment I will have to spend coding anything.
    Sheirosia
  • NalorNalor UKPosts: 774Member ✭✭✭
    edited June 2014
    Can someone tell me whats wrong with this
    Nalor said:


    function downloaded_file(_, filename)
    if filename:match("votePage", 1, true) then
    cecho(".")
    io.input(filename)
    local s = io.read("*all")
    local pzzzqaaz = string.match(s,'')
    cecho(".")
    local votehash = string.match(s,'')
    cecho(".")
    local mudid = string.match(s,'')
    cecho(".")
    local votestring = "http://www.topmudsites.com/vote.php?" .. "&do=in" .. "&pzzzqaaz=" .. pzzzqaaz .. "&mudid=" .. mudid .. "&votehash=" .. votehash
    cecho(".")
    downloadFile(getMudletHomeDir().."/voteDone.html", votestring)
    elseif filename:match("voteDone", 1, true) then
    cecho("Successful!)\n")
    send("voted", false)
    end
    end


    its giving an error on this line

    local votestring = "http://www.topmudsites.com/vote.php?" .. "&do=in" .. "&pzzzqaaz=" .. pzzzqaaz .. "&mudid=" .. mudid .. "&votehash=" .. votehash

    and error is

    <[string "function downloaded_file(_, filename)..."]:12: attempt to concatenate local
    'pzzzqaaz' (a nil value)>



    And IT was working til the other day and it suddenly stopped. Ive not edited it since I put it in my system months ago.
    Mudlet Bashing System for sale. Message if interested
  • SheirosiaSheirosia Sheffield, UK.Posts: 109Member ✭✭✭
    local pzzzqaaz = string.match(s,'')

    I'm assuming '' is two single quotes, but if so, why?

    Also, read it by line with *l rather than *all and see if that yields the results you desire.
  • NalorNalor UKPosts: 774Member ✭✭✭
    edited June 2014
    IT used to work, Ive not changed any code in that and all of a sudden it doesnt work.. So unsure why that change would all of a sudden make it work :/

    I trie *l before and it didnt do what it does/ did now before it stopped working
    Mudlet Bashing System for sale. Message if interested
  • KaeusKaeus Posts: 209Member ✭✭✭
    edited June 2014
    Nalor said:

    IT used to work, Ive not changed any code in that and all of a sudden it doesnt work.. So unsure why that change would all of a sudden make it work :/

    I trie *l before and it didnt do what it does/ did now before it stopped working

    Looks like the changed the voting form, so the parse doesn't work anymore.

    For anyone on TW, you can replace the vote_page_download script with the following and it should work.

    HALP CODE FORMATTING

    function vote_page_download(_, filename) local ohRex = [[name="oldhash" type="hidden" value="(%x+)"]] local thRex = [[name="testid" type="hidden" value="(%x+)"]] local miRex = [[type="hidden" name="mudid" value="(%d+)"]] local vhRex = [[type="hidden" name="votehash" value="(%x+)"]] tmp.oldhash = nil tmp.testid = nil tmp.mudid = nil tmp.votehash = nil if filename == tostring(tmp.vote_page) then for line in io.lines(filename) do if line:find([[type="hidden"]]) then if string.match(line, ohRex) then tmp.oldhash = string.match(line, ohRex) end if string.match(line, thRex) then tmp.testid = string.match(line, thRex) end if string.match(line, miRex) then tmp.mudid = string.match(line, miRex) end if string.match(line, vhRex) then tmp.votehash = string.match(line, vhRex) end end end if tmp.oldhash and tmp.mudid and tmp.votehash and tmp.testid then tmp.votePhP = string.format("http://www.topmudsites.com/vote.php?do=in&oldhash=%s&mudid=%s&votehash=%s&temphash=%s", tmp.oldhash, tmp.mudid, tmp.votehash, tmp.testid) info("Calling " .. tmp.votePhP) info("Vote has been cast!") downloadFile(tmp.voted_page, tmp.votePhP) end elseif filename == tostring(tmp.voted_page) then send("voted", false) end end
  • NalorNalor UKPosts: 774Member ✭✭✭
    Thanks @Kaeus
    Mudlet Bashing System for sale. Message if interested
  • SampSamp Posts: 110Member ✭✭✭

    {
    name = "Someperson",
    channels = {
    "the Clan of The Crafting Guild of Sapience"
    }
    },
    {
    name = "Someperson#2",
    channels = {
    "the City of Spinesreach",
    "the Clan of The Crafting Guild of Sapience",
    "crafts"
    }
    },
    {
    name = "Someperson#3",
    channels = {
    "the City of Spinesreach",
    "crafts"
    }
    }
    Kind of a general GMCP question/even more general question, but wasn't sure where to put this.

    So what's the differences between crafts and the Clan of The Crafting Guild of Sapience? Crafts doesn't show up in Comm.Channel.List.

    Thanks!
    I once killed a humgii, y'know.

    JSYK she/her pronouns!
  • IrruelIrruel Posts: 650Member ✭✭✭✭
    The one that isn't a clan, is a channel for the crafters able to approve designs. If it doesn't show in the comm channel, it is probably an oversight because it is a unique org.

    The other one is just an ordinary clan.
    Samp
  • SampSamp Posts: 110Member ✭✭✭
    Thanks! So at one point, my gmcp table was capturing the ANSI escape characters of the channel. I was using a yellow FG at the time, I've since switched it back to white FG/black BG, and my gmcp table quit showing ANSI code. I'm assuming that default coloring doesn't warrant one. On one of my other channels though, where I still have yellow FG/black BG, the ANSI code evolved into this instead of just the escape characters:
    text = "[0;1;33m([4zCOLOR [4zSEND HREF=\"channelinfo
    ct\"Spinesreach[4z/SEND[4z/COLOR): Faerah says, \"Mmhm.\"[0m[0;37m",
    The left-arrow symbols and some other ones aren't copying into my browser, and the COLOR and SEND HREF are confusing me. Earlier it was just the simple code [#;#;#m stuff that I knew what meant. I'm also assuming ANSI/ASCII are sufficient and I won't need unicode to capture all the characters?
    I once killed a humgii, y'know.

    JSYK she/her pronouns!
  • IrruelIrruel Posts: 650Member ✭✭✭✭
    I used (at another's advice) string.sub to remove the ansi stuff.
    Look at the mudlet help forum for more details:
    http://forums.mudlet.org/viewtopic.php?f=9&t=4545&sid=0bdd74a40cdcf92829330925c89e46e1
    Samp
  • SampSamp Posts: 110Member ✭✭✭
    edited June 2014
    Thanks for the link! Sub seems like a good way to separate it all out, also convenient that they already made the table. *yoink*

    I imagine I'll eventually make a thing to parse all the ANSI so that my channel capture can use whatever colors are configured in the game, but all the SEND and HREF stuff isn't ANSI, and that's what I'm confused about.

    Mine was showing things like this
    [0;32m(Dark Fire): You say, \"Test.\"[0m[0;37m
    but now it has way more symbols and also the SEND and HREF business which wasn't originally coming up when I looked in the GMCP table. Is your GMCP table also showing the left arrows and other things?
    I once killed a humgii, y'know.

    JSYK she/her pronouns!
  • SampSamp Posts: 110Member ✭✭✭
    edited June 2014
    Just occurred to me it might also be the font I'm using that's contributing to some of the characters I've never seen associated with ANSI. I'm using Bitstream Vera Sans Mono which I think is the Mudlet default but can't remember. How about you?

    edit: Too weird, so I reset the CONFIG COLOR back to white fg/black bg then back to yellow fg/black bg and now the ANSI looks normal again:
    "Message: [0;1;33m(Market): Plato says, "Looking for a team to do the safari
    game with."[0m[0;37m"
    The left arrows still don't copy into the browser, but I imagine I can just put the whole thing through a regex and find which ANSI character is representing them.
    I once killed a humgii, y'know.

    JSYK she/her pronouns!
  • IrruelIrruel Posts: 650Member ✭✭✭✭
    edited June 2014
    The left arrow is an escape symbol of some sort - ignore it.
    As for the table: you're welcome.

    I made a new post to the thread with the working script in it. The table changed a bit and the subbing etc is worked out.

    If you prefer hastebin to the mudlet forum:
    http://hastebin.com/kulebibuga.js

    Edit:
    Also, this evening I hope to post the fortress gui xml so you can have a look at the rest of the code as well, if anyone is interested. It's still a work in progress as I want to match the 'config colour' stuff rather than defining a second table, but aside from that I'm really happy about how it turned out.
    Samp
  • SampSamp Posts: 110Member ✭✭✭
    edited June 2014
    Forum was fine for grabbing the code, it's just the weird SEND and HREF and non-ANSI code I'm trying to figure out.

    edit: Sorry for being vague and difficult, here's a screenshot:

    image
    I once killed a humgii, y'know.

    JSYK she/her pronouns!
  • IrruelIrruel Posts: 650Member ✭✭✭✭
    When you do:
    display(gmcp.Comm.Channel.Text.text)
    do you see that weird stuff there?

    Or is it only when you copy/paste it elsewhere?

    I ask because you may have done 'copy html' by mistake.
  • SampSamp Posts: 110Member ✭✭✭
    edited June 2014
    Here are the two ways I'm looking at it:

    1. I have an alias that just does a simple
    display(gmcp)
    2. I have an event handler for gmcp.Comm.Channel.Text
    function gmcp_Comm_Channel_Text_Handler()
    display("\n")
    display("Channel: ".. gmcp.Comm.Channel.Text.channel)
    display("Character: ".. gmcp.Comm.Channel.Text.talker)
    display("Message: ".. gmcp.Comm.Channel.Text.text)
    display("\n")
    end
    I added a screencap in an earlier post, and that was shown using display(gmcp), but it looks identical to gmcp.Comm.Channel.Text.text. It also doesn't consistently do it, just when I start configuring colors IG.
    I once killed a humgii, y'know.

    JSYK she/her pronouns!
  • IrruelIrruel Posts: 650Member ✭✭✭✭
    Dunno mate, I haven't seen it happen myself.
  • SampSamp Posts: 110Member ✭✭✭
    edited June 2014
    Strange! Maybe it's time to restart Mudlet. Sometimes it's normal though:

    image

    Thanks for all the help :]

    UPDATE: The problem seems to go away when I also set the BG color using CONFIG COLOR. That is, if I only set the FG color (even though there is a default BG) it sends me weird stuff, so I'm just making sure to set the BG to black every time now. (psst @Irruel)
    Post edited by Samp on
    I once killed a humgii, y'know.

    JSYK she/her pronouns!
  • SampSamp Posts: 110Member ✭✭✭
    edited June 2014
    So here was my solution.

    Where codez is gmcp.Comm.Channel.Text.text that I'm passing through an alias for debugging purposes.

    I don't know how much work string.match is, but it's only 2 string functions instead of 4. I do know pattern matching like this is tedious in general, so even if this is fewer string functions I can still see this being less efficient than your method. I'll have to run a thousand strings and find out some other time.

    edit: That solution didn't work I found out. So far this this one is holding.
    Post edited by Samp on
    I once killed a humgii, y'know.

    JSYK she/her pronouns!
  • SampSamp Posts: 110Member ✭✭✭
    Whenever I connect to my Aetolia profile on Mudlet and then login on a character, there is a period where Mudlet almost threatens to go non-responsive. I don't think it actually is, but I blame windows 7 for displaying it as such. Sometimes the whole client even goes grey. Today, before I logged in I turned on the debugger to see what was holding it up.
    07:33:59.980 [TIMER EXECUTES]: 5 fired. Executing command= and executing script:
    07:34:08.756 LUA OK anonymous Lua function ran without errors
    07:34:08.765 new line arrived:Please remember to Vote for Aetolia every day at http://www.aetolia.com/vote!
    So it's happening right when these timers are going off. I then opened up my timers, and tried to find the culprit, but the only one I have (as in, I don't have 5 timers) is for the mudlet mapper's auto-update. That one goes off every hour I'm logged in, and if it's to blame it never lags me out the next time it fires. Is this a known Mudlet issue? Are there timers Mudlet doesn't give the user access to?

    Thanks!
    I once killed a humgii, y'know.

    JSYK she/her pronouns!
  • RiluoRiluo The DoctorPosts: 821Member ✭✭✭✭
    Anyone good with TW I need to add this line but I seem to have lost my mind and can not solve the problem.
    The Adder rises up from behind (\w+), (\w+) dripping from its fangs. With a sudden lurch, it clamps its jaw tightly onto (\w+)'s neck and pumps .+ with the venom.
    Original line:
    The Adder rises up from behind Lim, curare dripping from its fangs. With a sudden
    lurch, it clamps its jaw tightly onto Bob's neck and pumps his with the venom.
    The adder gives different venom types when used, so it needs to detect this.

    I tried to use this but it is wrong.
    addEAff(matches[4], pvp.venoms.list[matches[3]],"Adder card")

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

  • KaeusKaeus Posts: 209Member ✭✭✭
    Riluo said:

    Anyone good with TW I need to add this line but I seem to have lost my mind and can not solve the problem.

    The Adder rises up from behind (\w+), (\w+) dripping from its fangs. With a sudden lurch, it clamps its jaw tightly onto (\w+)'s neck and pumps .+ with the venom.
    Original line:
    The Adder rises up from behind Lim, curare dripping from its fangs. With a sudden
    lurch, it clamps its jaw tightly onto Bob's neck and pumps his with the venom.
    The adder gives different venom types when used, so it needs to detect this.

    I tried to use this but it is wrong.
    addEAff(matches[4], pvp.venoms.list[matches[3]],"Adder card")
    Not sure why it doesnt work. You can try the trigger by using ` before the original line you pasted (get rid of the line return since mudlets returns arent part of the matching). It seems to be fine for me.
  • TozToz Posts: 2,164Member ✭✭✭✭✭
    Do you have your wrapwidth set right? I ran into that problem a few days ago on a new character on a different game, completely forgot about it..
    (Oasis): Azzello says, "I'll still never forget the first time I saw Toz throwing hammers."
    (Oasis): Azzello says, "I freaked out and thought they had somehow managed to pull me into them."
    (Oasis): Azzello says, "So I tumbled away from my team and into theirs."


  • IshinIshin Retired Lurker VirginiaPosts: 1,750Member, Guildmaster ✭✭✭✭✭
    You tilt your head back and deeply inhale any scents from the air.
    Avani: 12655 Central Basilica
    Milian: 14507, 28060 Arcan Antiquities
    Ensal: 26928, 25504, 24355A cozy livingroom
    Didi: 11939 Through the farmlands
    Parker: 13032 The Gemini
    Noelle: 11708, 53303 The Inner Gate of Spinesreach
    Aren: 26928, 25504, 24355A cozy livingroom
    Rilee: 14481 Fountain in a frozen courtyard
    Faerah: 11708, 53303 The Inner Gate of Spinesreach
    Argolis: 11708, 53303 The Inner Gate of Spinesreach
    Balance Used: 2.32 seconds

    The numbers show up in this horribly hard to read blue. Is there -any- way I can change it to a lighter shade of blue? It's like, literally, almost impossible for me to read the blue it's in now against the black background.
    Tell me and I forget, teach me and
    I remember, involve me and I
    learn.
    -Benjamin Franklin
  • SheirosiaSheirosia Sheffield, UK.Posts: 109Member ✭✭✭
    Serenity issue, bro. Message me and I'll fix later.
    Ishin
Sign In or Register to comment.