Looking for more active discussion? Join our Discord at https://discord.gg/x2s7fY6

Mudlet Help Desk

14567810»

Comments

  • Thanks!
  • edited March 2018
    So the mudlet manual says that script scripts are initialized when the profile is loaded, this however has not been my experience. For example I have various variable declarations in a script such as

    if generalDefs == nil then generalDefs = {} end

    But after opening mudlet and logging in I have to go into script scripts and click on every script to get my variables initialized, if I don't, my functions/aliases/trigger scripts that use these variables all error out.

    Easy fixes? Preferences checkbox I missed? Halp plz.
    Toz says, "Dishonor on you (Mjoll), dishonor on your family (Seirath), dishonor on your cow (Bulrok)"
  • EvalyneEvalyne A Coffin
    Sacrifice a goat to the mudlet gods, and hope that it actually loads all your modules properly. It's been the struggle of people trying to use my UI as well. Mudlet just drops thing sometimes.
    Mjoll
  • EvalyneEvalyne A Coffin
    More seriously, try doing it like this:

    generalDefs = generalDefs or {}

    That will initialize it as an empty table ONLY if it has a non-nil value, which I think is what you're trying to do?
  • edited March 2018
    That is what I want, yes! The if statement is how the manual suggested it be done, I'll try your suggestion, thanks!


    Edit: That seems to have done the trick! Thank you very much :)
    Toz says, "Dishonor on you (Mjoll), dishonor on your family (Seirath), dishonor on your cow (Bulrok)"
  • Theres the right way and then theres the mudlet way, unfortunately
  • Well, long time player, first time poster here..mostly cause I've never used mudlet in the rest of my time playing. I've got a million questions, but right now, my main question is...how would I got about making a button that would sit there, and if I have balance and eq, it would be colored one color, and it would color differently when I didn't. I'd love it if it had 4 colors. 1 for has eq and bal, 1 for has one but not the other, 1 for the other, and 1 for when i have none

    pretend my balance variable is Balance and for equilibrium it is EQ



  • Belgarion said:

    Well, long time player, first time poster here..mostly cause I've never used mudlet in the rest of my time playing. I've got a million questions, but right now, my main question is...how would I got about making a button that would sit there, and if I have balance and eq, it would be colored one color, and it would color differently when I didn't. I'd love it if it had 4 colors. 1 for has eq and bal, 1 for has one but not the other, 1 for the other, and 1 for when i have none

    pretend my balance variable is Balance and for equilibrium it is EQ


    Hey, so there are a few ways to tackle this. I don't know how good you are at learning off of examples but after playing around with the following pubilc scripts in Mudlet forums I was able to replicate something similar to what you wanted. If you install the UI package from this and then comb through to study how the healthbars use coloring, you can repurpose it based on a trigger. Additionally, look around on this UI layout and decide where you'd want your own info to be laid aout and play around as you construct your own UI.

    https://forums.mudlet.org/viewtopic.php?f=6&t=4098

    Good luck!

    Belgarion
  • Put this in a script, just by itself- it'll create the label for you on profile creation.
    baleq = Geyser.Label:new({ name = "baleq", x = "90%", y = "90%", width = "10%", height = "10%", fgColor = "black", color = "SeaGreen", message = [[<center>BALEQ</center>]] })

    Feel free to modify as needed- basically it puts it on the bottom right-hand corner of Mudlet.

    Then, you just change the background color:
    baleq:setColor("red")

    So you'd track on prompt (ugh I hate prompt triggers) for the easy mode, and use gmcp:
    if gmcp.Char.Vitals.balance == "1" and gmcp.Char.Vitals.equilibrium == "1" then baleq:setColor("red") elseif gmcp.Char.Vitals.balance == "0" and gmcp.Char.Vitals.equilibrium == "1" then baleq:setColor("green") elseif gmcp.Char.Vitals.balance == "1" and gmcp.Char.Vitals.equilibrium == "0" then baleq:setColor("pink") else baleq:setColor("blue") end

    Arbre-Today at 7:27 PM

    You're a vindictive lil unicorn
    ---------------------------

    Lartus-Today at 7:16 PM

    oh wait, toz is famous

    Karhast-Today at 7:01 PM

    You're a singularity of fucking awfulness Toz
    ---------------------------
    Didi's voice resonates across the land, "Yay tox."
    ---------------------------

    Ictinus11/01/2021

    Block Toz
    ---------------------------

    limToday at 10:38 PM


    you disgust me
    ---------------------------
    (Web): Bryn says, "Toz is why we can't have nice things."

    XeniaAlexsandor
  • So. I've got a queueing script that fires on my prompt. written in a bit for anti spam, but I've noticed that when my prompt fires multiple commands still get sent. Essentially, this script is firing at the same time, independently, when multiple prompts are given. Any ideas on how I can get around this?
    function spamCheck(spam)
    
    	if table.index_of(aros.Spam, spam) == nil then
    		return true
    	else
    		return false
    	end
    
    end
    
    function spamAdd(spams)
    
    	if table.index_of(aros.Spam, spams) == nil then
    		table.insert(aros.Spam, spams)
    		echo("Spam List: " .. spams)
    		tempTimer(.5, tempRegexTrigger("^H", table.remove(aros.Spam, table.index_of(aros.Spam, spams)), 1))
    	end
    
    function queueCall()
    	if aros.CanAct == true then
    		
    		if aros.Queues.none ~= nil then 
    			for i,v in ipairs(aros.Queues.none) do
    				if spamCheck("queuenone")and aros.Can.equilibrium == true and aros.Can.balance == true and aros.Can.writhing == false and table.index_of(aros.Afflictions.List, "paralysis") == nil then
    					if table.index_of(aros.Defences.Missing, v) ~= nil then
    						spamAdd("queuenone")
    						send(defenceLists.commands[v])
    						table.remove(aros.Queues.none, table.index_of(aros.Defences.Missing, v))
    					end
    				end
    			end
    		end
    				
    	end
    end

  • HavenHaven World Burner Flight School
    edited August 2019
    @Aros I usually add in another limiter that resets based on a timer before my system is allowed to try again. I'm not sure what the Mudlet equivalent is but for MUSHclient it looks like:

    if (limiter.herb == false and herb_bal == true) then limiter.herb = true DoAfterSpecial (.25 + RetardTimer, 'limiter.herb = false', sendto.script) Execute ("outc antipsychotic//eat antipsychotic") end
    ¤ Si vis pacem, para bellum. ¤
    Someone powerful says, "We're going to have to delete you."
    havenbanner2
  • EvalyneEvalyne A Coffin
    Best way on TF or mudlet is to timestamp your last command and compare time to the last sent command, if it has not exceeded that time, then queue the action.
  • edited August 2019
    Hrm. How would you go about time stamping your commands? And Haven, I think that's pretty well what I do with my spamCheck function. Thanks for the responses!

    Edit: I do recall seeing something recently about Mudlet introducing something like a #wait or #stop but I can't find where I wrote that. Anyone able to point me in the right direction?

  • EvalyneEvalyne A Coffin
    I'd save the results of date() on each command that goes through. There's probably better ways now than what Im familiar with from years ago, though.
  • So I've been delving into databases with mudlet here and I've encountered a curiosity or perhaps an oddity and I'm not sure if it's something I'm doing or a quirk of mudlet. 

    In every manner that I've tried for updating, deleting and changing both manually and using the automatic functions I cannot seem to get the database to write over an old line. I'll explain better with this example:

    I create a database where I keep track of enemies based on city etc.

    Each new person has their own line

    1: x
    2: y
    3: z

    however, if I modify in any way, delete and resubmit, etcetera (or when I have the database set as replace), if I try and update x's information it changes it to a new line each time. So I have a database that has 50 items in it yet they're on line 132, 133, 134 etcetera.

    Is there a way to get insert information in a database overtop of an existing line or will it forever create new ones?

  • I have a question about databases.

    I want to use a database to track afflictions:


    db:create("affdb", {afflist = {"curename", "affprio", "affname"}, _unique = { "affname" }})

    Curename's the name of the pill/poultice, affprio is the cure priority, and affname is the name of the affliction. The idea is th
    at I can pull the curename from a trigger and run through the affprio until I hit an affname that's on the table I use to track my target's afflictions so I can remove it.

    The database works fine when I test it out with basic commands like db:get_database, db:fetch, and db:eq. I can't get _unique and _index to work properly, but whatever. I can always use local variables.

    The real problem is that I cannot figure out how to get the affname that goes with the curename and affprio variables. As far as I can tell from the Mudlet wiki, I'm supposed to use db:fetch to create a table with the curename and affprio (this part works) and use the table's key to get the affname variable (this part does not work). Is there a better way to do this?


  • I am pretty sure tables do the same purpose for what you are looking for without the need for databases. You can populate a key/value table in mudlet 

    Then you can use table.index_of and table.contains and for statements to check for key value pairs in pairs and ipairs.

    From what I have noticed databases in mudlet act wonky and table functions work more accurately and smoothly. 

    I will add examples when I get home.

    Legyn
  • I started with lists at first, but I couldn't get Mudlet to recognize a variable as a table reference, so I couldn't successfully create a trigger that would automatically reference the Depressant table, for example. Using variables to reference indexes and values worked fine, so I hoped using a database would give an easier way to do it.



  • nameSpace.tableReference[thisIsAVariable] will spit out whatever the value of that table reference is.
    Toz says, "Dishonor on you (Mjoll), dishonor on your family (Seirath), dishonor on your cow (Bulrok)"
    Legyn
  • I'll try that and cross my fingers. Thanks!
  • BenedictoBenedicto Tentacles Errywhere!
    edited February 2022
    After Mudlet update, my chat capture UI seems to have stopped capturing Xterm colours but for the life of me I can't figure out why!

    Does anyone know what might have caused this/a potential fix for it?
    image
Sign In or Register to comment.