Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

Quick Coding Questions

1678911

Comments

  • KryptonKrypton shi-KhurenaPosts: 1,752 @@ - Legendary Achaean
    That's it! Thank you
    (Mhaldor): Herenicus says, "Apologies, I am in-and-out of hold with Verizon wireless customer service."
  • AhmetAhmet Wherever I wanna bePosts: 2,988 @ - Epic Achaean
    Oh in that case
    ^\[FW message\] ([^\(]+)$
    for everything up to the first (
    or
    ^\[FW message\] (.+) \($
    for everything up to the last (
    Huh. Neat.
    Krypton
  • AhmetAhmet Wherever I wanna bePosts: 2,988 @ - Epic Achaean
    Damn, ninjad on mobile.
    Huh. Neat.
  • KalilaKalila Posts: 86 ✭✭✭ - Distinguished
    Hi!

    How can I do something like.

    If var1 == true and either two of var2, var3 and var4 true, then do x?
  • AntoniusAntonius Posts: 3,879 @@ - Legendary Achaean
    edited April 13
    if var1 and (var2 and var3 or var3 and var4 or var2 and var4) then

    end

    assuming you're okay with it also running if var2 var3 and var4 are all true.
    Kalila
  • KalilaKalila Posts: 86 ✭✭✭ - Distinguished
    Antonius said:
    if var1 and (var2 and var3 or var3 and var4 or var2 and var4) then

    end

    assuming you're okay with it also running if var2 var3 and var4 are all true.
    Thanks, you have saved me from doing ugly nested if/else statements. Much appreciated!
  • AmerothAmeroth Posts: 21
    Bad argument to ipairs() table expected got function.

    How to fix

    Trying to do for k, v in ipairs(table1)

    If table.contains (table2, v) then

    End
  • AhmetAhmet Wherever I wanna bePosts: 2,988 @ - Epic Achaean
    table1 is a function. Dont pass a function to it!
    Huh. Neat.
  • AmerothAmeroth Posts: 21
    But I have it defined as a table, I'm confused D:
  • AhmetAhmet Wherever I wanna bePosts: 2,988 @ - Epic Achaean
    Then another part of your script (or another script you have installed) is redefining it as a function.
    Huh. Neat.
  • AmerothAmeroth Posts: 21
    I had a function with the same name D: thanks haha!
  • SobriquetSobriquet Posts: 1,301 @@ - Legendary Achaean
    Trying to find a stand alone chat window script to import. I have attempted to pull the script from Zulah's gui but can't get it to work, and all the forum searches seem to bring up out of date links.

    Do we have one somewhere?
    image
  • AccipiterAccipiter Posts: 219 ✭✭✭ - Distinguished
    I have a fairly basic one I could send you Sobby, no tabbed windows or anything, just sends all channel stuff to a different window.

    It is something I made though so there are a lot of better options out there :tongue:

  • RyzethRyzeth Posts: 984 ✭✭✭✭✭ - Grand Achaean
    edited April 20
    Sobriquet said:
    Trying to find a stand alone chat window script to import. I have attempted to pull the script from Zulah's gui but can't get it to work, and all the forum searches seem to bring up out of date links.

    Do we have one somewhere?
    This should work fine on import. Will just have to reload mudlet. Shouldn't be difficult to edit. Don't usually rip things straight from my gui, but I have all the different pieces split anyway.
  • SobriquetSobriquet Posts: 1,301 @@ - Legendary Achaean
    Ryzeth said:
    Sobriquet said:
    Trying to find a stand alone chat window script to import. I have attempted to pull the script from Zulah's gui but can't get it to work, and all the forum searches seem to bring up out of date links.

    Do we have one somewhere?
    This should work fine on import. Will just have to reload mudlet. Shouldn't be difficult to edit. Don't usually rip things straight from my gui, but I have all the different pieces split anyway.
    Can't seem to get this to work :/
    image
  • XadenXaden Posts: 1,641 @ - Epic Achaean
    Just google YATCO, Sobriquet. Have installed it on other peoples machines recently enough.
  • RyzethRyzeth Posts: 984 ✭✭✭✭✭ - Grand Achaean
    edited April 23
    Sobriquet said:
    Ryzeth said:
    Sobriquet said:
    Trying to find a stand alone chat window script to import. I have attempted to pull the script from Zulah's gui but can't get it to work, and all the forum searches seem to bring up out of date links.

    Do we have one somewhere?
    This should work fine on import. Will just have to reload mudlet. Shouldn't be difficult to edit. Don't usually rip things straight from my gui, but I have all the different pieces split anyway.
    Can't seem to get this to work :/
    Oh. Right. I forgot the other trigger... Should be good after fixing that... Save/reload mudlet after.

    Find whatever trigger you have that has 'Password correct. Welcome to Achaea.' in it, or 'Last login was from domain:' --just your login trigger basically-- then add in:
    sendGMCP('Core.Supports.Add ["Comm.Channel 1"]')
  • TalrothTalroth Posts: 15 ✭✭ - Stalwart
    edited April 23
    Quick question for the mapper, everytime I load up my profile to get it to work I have to click the Map Icon, it looks like there is some sort of trigger for the mapper on the login but it doesn't seem to do anything.

    After I've clicked the map icon and it says downloaded map etc, it works fine. Anyone know how to fix?

    Edit: @Ryzeth also interested in the chat window, made the change to the login trigger like you said and still can't get it to work.
  • AccipiterAccipiter Posts: 219 ✭✭✭ - Distinguished
    you need to make a window for the map to open in an open in in a script: GuAcci = GuAcci or {} GuAcci.Map = Geyser.Mapper:new({name = "GuAcci.Map", x="50%", y="50%", width="50%", height="50%"}, GuAcci.RightContainer)
    Talroth
  • SobriquetSobriquet Posts: 1,301 @@ - Legendary Achaean
    edited April 28
    edit - ignore for the moment, seen where I've gone wrong
    image
  • TalrothTalroth Posts: 15 ✭✭ - Stalwart
    edited April 28
    So not sure if this is a quick question or not, but I have started to try do a bit of sparring.

    The first thing I noted is that the window in the main display whirls way too fast for me to keep up, so I have created some separate windows to split things up a bit and gag a few lines here and there to make things a bit more manageable adding echoes etc.

    I am using Svof on Mudlet 3.0.

    One of my questions is if through my own added triggers I use the deleteLine() function, to remove what I deem as unnecessary, either because I don't think it's worthwhile or I have shifted it to another window.

    I then get left in some instances with double prompts.

    e.g.
    100%h, 84%m, 95%e, 100%w cexkdb- [none]
    100%h, 84%m, 95%e, 100%w cexkdb- [none]
    100%h, 84%m, 95%e, 100%w cexkdb- [none]

    Is there a quick and easy way to write something that will make it so I only ever get one prompt in a row? Ideally the last prompt that's come through.

    So let's say before I had
    100%h, 85%m, 95%e, 100%w cexkdb- [none]
    Tintin eats a gypsum crystal.
    100%h, 84%m, 95%e, 100%w cexkdb- [none]

    then I delete "Tintin eats a gypsum crystal."

    so now I have

    100%h, 85%m, 95%e, 100%w cexkdb- [none]
    100%h, 84%m, 95%e, 100%w cexkdb- [none]

    Is there an aftermarket way of then saying to Mudlet ok now delete the top line so I only see (ideally the most up-to-date of the prompts), bearing in mind it could be 2, 3 or even 4 in a row.

    100%h, 84%m, 95%e, 100%w cexkdb- [none]

    Just keen to cut down on the spam, very new to Svof so not sure if there's anything in built in for this?

    Would really appreciate some help :)


    EDIT: Oops I missed the very Clear function in the documentation svo.deleteLineP()

    Utianima
  • KlendathuKlendathu Eye of the StormPosts: 2,266 @@ - Legendary Achaean
    use svo.deleteLineP() instead of deleteLine()

    Tharos, the Announcer of Delos shouts, "It's near the end of the egghunt and I still haven't figured out how to pronounce Clean-dat-hoo."

    SobriquetUtianima
  • RenekRenek Posts: 64 ✭✭✭ - Distinguished
    edited April 28
    deleteFull() does the same thing and is built into Muldet for non svof 
    function deleteFull()
            deleteLine()
            tempLineTrigger(1,1,[[if isPrompt() then
            deleteLine()
            end]])
    end

    Utianima
  • RyzethRyzeth Posts: 984 ✭✭✭✭✭ - Grand Achaean
    Renek said:
    deleteFull() does the same thing and is built into Muldet for non svof 
    With SVO the prompt still shows with deleteFull() - If you're using a custom prompt, anyway. The one Klendathu posted stops svo from displaying that prompt as well. Not sure why he (Vadi) didn't just make his own deleteFull() function like Nemutaur did with wsys.
  • DurianDurian Posts: 102 ✭✭✭ - Distinguished
    deleteFull() deletes my svo custom prompts too.
    Renek
  • VallieVallie Posts: 183 ✭✭✭ - Distinguished
    How would I capture the next line after a specific line?

    For example, if I do farsee, and I want to report the location of where someone is, which is on the line after the farsee line.
  • NazihkNazihk Posts: 486 ✭✭✭✭ - Eminent
    Use a multiline trigger.
  • CooperCooper Posts: 3,796 @@ - Legendary Achaean
    That response is not too helpful for someone who doesn't know what a multi line trigger is. 

    Sobriquet
  • TalrothTalroth Posts: 15 ✭✭ - Stalwart


    @Vallie, this might be helpful. You tick multi-line / AND Trigger, then set the appropriate line delta.

    My regex stuff is terrible but you probably get the idea from this :)
    Cooper
  • JonathinJonathin A hole in the groundPosts: 3,022 @@ - Legendary Achaean
    You don't even need to make a multiline for farsight. I only use the second line and have not run into any issues at all.

    (Mudlet Clan): Nylian says, "Mosr's on the case. Fix incoming."

    Tutorials and scripts  The Repository

    Caelan
Sign In to Comment.