If I do that, I am looking at having to do something like this?
Next question would be, is the venom variable pulled at the point the trigger is made, or when it fires? Assuming it is the point in fires, I think I finally hit a wall in using timers of off a table.
With the way you have it set up, it would have the value at the point the timer fires used. To get it to be pulled when you create it, do something like this:
If I do that, I am looking at having to do something like this?
Next question would be, is the venom variable pulled at the point the trigger is made, or when it fires? Assuming it is the point in fires, I think I finally hit a wall in using timers of off a table.
With the way you have it set up, it would have the value at the point the timer fires used. To get it to be pulled when you create it, do something like this:
This still looks like it is pulling the variable at the end of the timer instead of when it is created. I couldn't find anything in the mudlet documentation involving any of this, so it is a bit difficult for me to debug. Any chance you can link me where it is spelled out at, or possibly have another idea?
As a heads up, I got this working. I don't know how, I don't know why, but it works. The best conclusion I can come to is that @Antonius is a coding god, sent from on high to answer my questions. Thank you!
I have a script written in Mudlet. The script works perfectly, except that when I close Mudlet and re-open it, the script will not function until I've opened the Scripts menu, manually selected it, and "saved" it. I don't have to make any changes, just the act of clicking "Save Item" makes it spring to life.
What could cause this, and how do I fix it?
-- Grounded in but one perspective, what we perceive is an exaggeration of the truth.
That sounds like it might be the case. What's a workaround for that. Is there a way to make the script load up after those variables or tables have been filled?
-- Grounded in but one perspective, what we perceive is an exaggeration of the truth.
That sounds like it might be the case. What's a workaround for that. Is there a way to make the script load up after those variables or tables have been filled?
I believe mudlet has an onconnect flag you can use. That way the script won't try to load before you are actually connected to the game. Think that will fix it. Either that or you can raise an event for when gmcp updates and connect it to that.
To be honest I can't remember how I worked around it. You could do something like this in a gmcp event script...
name: vitalsEvent event: gmcp.Char.Vitals script: function vitalsEvent() if myScript.isInit == false then myScript.init() else myScript.eventFired() end end
That sounds like it might be the case. What's a workaround for that. Is there a way to make the script load up after those variables or tables have been filled?
I believe mudlet has an onconnect flag you can use. That way the script won't try to load before you are actually connected to the game. Think that will fix it. Either that or you can raise an event for when gmcp updates and connect it to that.
Mudlet has an event for when scripts have finished loading (sysLoadEvent off the top of my head), but not for when you connect to the game.
Exactly how you'd go about fixing the problem depends on the script and which variables you're trying to use that don't exist yet. Events are generally how you'd delay it until you have what you need available, but the exact event you want will vary.
That sounds like it might be the case. What's a workaround for that. Is there a way to make the script load up after those variables or tables have been filled?
I believe mudlet has an onconnect flag you can use. That way the script won't try to load before you are actually connected to the game. Think that will fix it. Either that or you can raise an event for when gmcp updates and connect it to that.
Mudlet has an event for when scripts have finished loading (sysLoadEvent off the top of my head), but not for when you connect to the game.
Exactly how you'd go about fixing the problem depends on the script and which variables you're trying to use that don't exist yet. Events are generally how you'd delay it until you have what you need available, but the exact event you want will vary.
Not that it matters to me but I am pretty sure I read it before. This may or not be the case but they talk about the onConnect() function here. This may be a custom function, but I don't think so. Might not fix his problem though.
Exactly how you'd go about fixing the problem depends on the script and which variables you're trying to use that don't exist yet. Events are generally how you'd delay it until you have what you need available, but the exact event you want will vary.
function AutoEngage(event, balance) if event == "svo lost balance" then if balance == "balance" then if Combat and AutoEngage then if Engaged ~= true then if svo.bals.equilibrium then send("engage "..Target, false) end end end end end end
I'm assuming the culprit is either the svo.bals.equilibrium, or perhaps that the script is loaded when I open up my profile, but the mentioned variables aren't set until I actually log in.
Also, this puppy is ugly as sin. If there's a more streamlined way to do this, I wouldn't mind the critique.
-- Grounded in but one perspective, what we perceive is an exaggeration of the truth.
Also, for scripts that use gmcp, I have had decent luck out of defining the variables myself lately, though it wrecks my illusion script still. Here is a few examples, not sure how bad this is, but it works for me. Also note, I realize the last table is wrong, i was lazy.
gmcp = gmcp or {}
gmcp.Char = gmcp.Char or {}
gmcp.Char.Name = gmcp.Char.Name or "Austere"
Is there any way to check to see if a variable is a string or a table? I couldn't find anything last night, but I admit, it was 3 am...maybe I was just looking at it wrong.
I recently updated my mudlet to 3.0.0-delta and was having some issues with my mapper. It will not longer allow me to zoom using the mouse(or even click anywhere or anything on the map) I can't even click the bar that has the little arrow on it to expand the options. I am assuming that my mapper code has simply fallen out of favor for something better. I honestly, dunno. Any help would be great.
GUI.Map_Container = Geyser.Container:new({
name = "GUI.Map_Container",
x = 0, y = 0,
width = "100%",
height = "100%",
},GUI.Box1)
GUI.Mapper = Geyser.Mapper:new({
name = "GUI.Mapper",
x = 20, y = 20,
width = GUI.Map_Container:get_width()-40,
height = GUI.Map_Container:get_height()-40,
},GUI.Map_Container) GUI.Box1CSS = CSSMan.new(GUI.BoxCSS:getCSS())
GUI.Box1CSS:set("background-color", "black")
GUI.Box1:setStyleSheet(GUI.Box1CSS:getCSS())
Comments
Results of disembowel testing | Knight limb counter | GMCP AB files
Svof
Mudlet Discord join up
I have a script written in Mudlet. The script works perfectly, except that when I close Mudlet and re-open it, the script will not function until I've opened the Scripts menu, manually selected it, and "saved" it. I don't have to make any changes, just the act of clicking "Save Item" makes it spring to life.
What could cause this, and how do I fix it?
will break the script, since the gmcp table is empty, and you are attempting to dig into the table using a nil key.
Exactly how you'd go about fixing the problem depends on the script and which variables you're trying to use that don't exist yet. Events are generally how you'd delay it until you have what you need available, but the exact event you want will vary.
Results of disembowel testing | Knight limb counter | GMCP AB files
http://forums.mudlet.org/viewtopic.php?f=9&t=2160
GMCP is negotiated (activated) after you connect though.
Svof
Mudlet Discord join up
I'm assuming the culprit is either the svo.bals.equilibrium, or perhaps that the script is loaded when I open up my profile, but the mentioned variables aren't set until I actually log in.
Also, this puppy is ugly as sin. If there's a more streamlined way to do this, I wouldn't mind the critique.
returns the type as a string ("number","string","table","function","nil")
GMCP documentation: https://github.com/keneanung/GMCPAdditions
svof github site: https://github.com/svof/svof and documentation at https://svof.github.io/svof
http://pastebin.com/AuMRaEPB
http://pastebin.com/CLrG0i0k
and here is defences.
http://pastebin.com/JmMRP9Tg
How do I round that??
GMCP documentation: https://github.com/keneanung/GMCPAdditions
svof github site: https://github.com/svof/svof and documentation at https://svof.github.io/svof