Mudlet Help Desk

14567810»

Comments

  • TirriaTirria Member Posts: 19
    Thanks!
  • MjollMjoll Member Posts: 120 ✭✭✭
    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.
  • EvalyneEvalyne A CoffinMember Posts: 138 ✭✭✭
    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 CoffinMember Posts: 138 ✭✭✭
    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?
  • MjollMjoll Member Posts: 120 ✭✭✭
    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 :)
    Post edited by Mjoll on
  • MykellahMykellah EnorianMember Posts: 69 ✭✭✭
    Theres the right way and then theres the mudlet way, unfortunately
  • BelgarionBelgarion Member Posts: 42 ✭✭
    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



  • XeniaXenia Member Posts: 1,076 ✭✭✭✭✭
    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
  • TozToz Member Posts: 2,491 ✭✭✭✭✭
    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 = [[BALEQ]] })

    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 unicorns awfulness Toz
    XeniaAlexsandor
  • ArosAros Member Posts: 4
    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 SchoolMember Posts: 2,277 ✭✭✭✭✭
    edited August 4
    @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
    Post edited by Haven on
    ¤ Si vis pacem, para bellum. ¤
    Someone powerful says, "We're going to have to delete you."
    havenbanner2
  • EvalyneEvalyne A CoffinMember Posts: 138 ✭✭✭
    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.
  • ArosAros Member Posts: 4
    edited August 4
    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?
    Post edited by Aros on
  • EvalyneEvalyne A CoffinMember Posts: 138 ✭✭✭
    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.
Sign In or Register to comment.