Aramel2010-12-11 00:25:52
Why not use if not thisthing = true then xyz?
Vadi2010-12-11 00:28:22
You can use 'if not thing then' as well.
Trinit2010-12-11 02:11:48
How would I make this:
do
QUOTE
person enters your demesne.
do
QUOTE
clt Person has entered my demesne
Lorina2010-12-11 02:16:03
(\\w+) enters your demesne.
demesne_enter = matches
send("clt " .. demesne_enter .. " has entered my demesne")
demesne_enter = matches
send("clt " .. demesne_enter .. " has entered my demesne")
Lorina2010-12-11 02:16:04
Double Post, ignore.
Neos2010-12-11 03:16:14
QUOTE (Lorina @ Dec 10 2010, 09:16 PM) <{POST_SNAPBACK}>
^(\\w+) enters your demesne\\.$
demesne_enter = matches
send("clt " .. demesne_enter .. " has entered my demesne")
demesne_enter = matches
send("clt " .. demesne_enter .. " has entered my demesne")
fixed.
But mines is totally cooler, only announces enemies, and accounts for when a large group enters.


Sylphas2010-12-11 03:31:12
QUOTE (Lorina @ Dec 10 2010, 09:16 PM) <{POST_SNAPBACK}>
(\\w+) enters your demesne.
demesne_enter = matches
send("clt " .. demesne_enter .. " has entered my demesne")
demesne_enter = matches
send("clt " .. demesne_enter .. " has entered my demesne")
If you're doing something that simple, you can skip assigning the variable and just do send("clt " .. matches .. " has entered my demesne"). You only need to store the name if you're scripting something else with it.
Lorina2010-12-11 04:26:24

Ushaara2010-12-11 20:30:17
Is there already a function to search if a letter is contained within a particular string variable?
Unknown2010-12-11 20:32:44
string.find or string.match
Ushaara2010-12-11 20:34:19
Thank you!
james2010-12-12 17:06:58
Run-time error
World: Lua
Function/Sub: prompt called by trigger
Reason: processing trigger "prompt"
:1521: attempt to concatenate field 'script_wielded_left' (a nil value)
stack traceback:
:1521: in function 'checkRewield'
:3149: in function 'switches'
:2945: in function <:2669>
Error context in script:
1517 : temp.rewield = false;
1518 : if temp.fullrecovery == true and (temp.wielded_left == "" or temp.wielded_right == "") then
1519 : if variables.script_wielded_left == variables.script_wielded_right and temp.wielded_left == "" and temp.wielded_right == "" then
1520 : --EnableTrigger("wielded_pickup_gag", true);
1521*: SendNoEcho("get "..variables.script_wielded_left);
1522 : SendNoEcho("wield "..variables.script_wielded_left);
1523 : --temp.rewield = true; ended up using this for the initial call. If I add this check, need to rename it
1524 : --DoAfterSpecial (1, 'temp.rewield=false', sendto.script);
1525 : else
Am I missing a line?
EDIT: So sorry! I clicked the wrong thread
World: Lua
Function/Sub: prompt called by trigger
Reason: processing trigger "prompt"
:1521: attempt to concatenate field 'script_wielded_left' (a nil value)
stack traceback:
:1521: in function 'checkRewield'
:3149: in function 'switches'
:2945: in function <:2669>
Error context in script:
1517 : temp.rewield = false;
1518 : if temp.fullrecovery == true and (temp.wielded_left == "" or temp.wielded_right == "") then
1519 : if variables.script_wielded_left == variables.script_wielded_right and temp.wielded_left == "" and temp.wielded_right == "" then
1520 : --EnableTrigger("wielded_pickup_gag", true);
1521*: SendNoEcho("get "..variables.script_wielded_left);
1522 : SendNoEcho("wield "..variables.script_wielded_left);
1523 : --temp.rewield = true; ended up using this for the initial call. If I add this check, need to rename it
1524 : --DoAfterSpecial (1, 'temp.rewield=false', sendto.script);
1525 : else
Am I missing a line?
EDIT: So sorry! I clicked the wrong thread
Unknown2010-12-12 17:23:03
This is the Mudlet thread, and you're clearly using MUSHclient, but your problem lies in having an unset variables.script_wielded_left and not checking it for nil in your if statement.
james2010-12-12 20:18:38
How do I set timers for demesne effects?
Vadi2010-12-12 21:07:10
What client are you using, and do you know how to use timers in the client you're using?
Anisu2010-12-12 21:39:46
QUOTE (Tedd C. @ Dec 12 2010, 09:18 PM) <{POST_SNAPBACK}>
How do I set timers for demesne effects?
I like to use a demesne starter script that makes use of onefire timers where the script repeats the timer after each fire.
mudlet:
tempTimer( 10.0, ] )
tempTimer( 10.0, ])
mushclient:
DoAfterSpecial (10, 'mydemdeffunction()', sendto.script)
DoAfter(10, "aerocast stillwater demesne")
for example
QUOTE
function demdefaid()
if demesnefreeze == false and demesnestage == 0 then
send("aerocast northwind demesne")
tempTimer( 10.0, ] )
demesnestage = 1
elseif demesnefreeze == false and demesnestage == 1 then
send("aerocast thunderclouds demesne")
tempTimer( 10.0, ] )
demesnestage = 2
elseif demesnefreeze == false and demesnestage == 2 then
send("aerocast squalls demesne")
tempTimer( 10.0, ] )
demesnestage = 3
elseif demesnefreeze == false and demesnestage == 3 then
send("aerocast eastwind demesne")
tempTimer( 10.0, ] )
demesnestage = 4
elseif demesnefreeze == false and demesnestage == 4 then
send("aerocast blizzard demesne")
tempTimer( 10.0, ] )
demesnestage = 5
elseif demesnefreeze == false and demesnestage == 5 then
send("aerocast rainbowclouds demesne")
tempTimer( 10.0, ] )
demesnestage = 6
elseif demesnefreeze == false and demesnestage == 6 then
send("aerocast miasma demesne")
tempTimer( 10.0, ] )
demesnestage = 7
elseif demesnefreeze == false and demesnestage == 7 then
send("aerocast twister demesne")
tempTimer( 10.0, ] )
demesnestage = 8
elseif demesnefreeze == false and demesnestage == 8 then
send("aerocast swiftwind demesne")
tempTimer( 10.0, ] )
demesnestage = 9
elseif demesnefreeze == false and demesnestage == 9 then
send("aerocast airnet demesne")
tempTimer( 10.0, ] )
demesnestage = 10
elseif demesnefreeze == false and demesnestage == 10 then
send("aerocast southwind demesne")
tempTimer( 10.0, ] )
demesnestage = 11
elseif demesnefreeze == false and demesnestage == 11 then
send("aerocast illwind demesne")
tempTimer( 10.0, ] )
demesnestage = 12
elseif demesnefreeze == false and demesnestage == 12 then
send("aerocast westwind demesne")
cecho("demdef done\\n")
demesnestage = 0
demesnefreeze = true
elseif demesnefreeze == true and demesnestage ~= 0 then
cecho("Keeping demesne loop alive\\n")
tempTimer( 10.0, ] )
end
end
if demesnefreeze == false and demesnestage == 0 then
send("aerocast northwind demesne")
tempTimer( 10.0, ] )
demesnestage = 1
elseif demesnefreeze == false and demesnestage == 1 then
send("aerocast thunderclouds demesne")
tempTimer( 10.0, ] )
demesnestage = 2
elseif demesnefreeze == false and demesnestage == 2 then
send("aerocast squalls demesne")
tempTimer( 10.0, ] )
demesnestage = 3
elseif demesnefreeze == false and demesnestage == 3 then
send("aerocast eastwind demesne")
tempTimer( 10.0, ] )
demesnestage = 4
elseif demesnefreeze == false and demesnestage == 4 then
send("aerocast blizzard demesne")
tempTimer( 10.0, ] )
demesnestage = 5
elseif demesnefreeze == false and demesnestage == 5 then
send("aerocast rainbowclouds demesne")
tempTimer( 10.0, ] )
demesnestage = 6
elseif demesnefreeze == false and demesnestage == 6 then
send("aerocast miasma demesne")
tempTimer( 10.0, ] )
demesnestage = 7
elseif demesnefreeze == false and demesnestage == 7 then
send("aerocast twister demesne")
tempTimer( 10.0, ] )
demesnestage = 8
elseif demesnefreeze == false and demesnestage == 8 then
send("aerocast swiftwind demesne")
tempTimer( 10.0, ] )
demesnestage = 9
elseif demesnefreeze == false and demesnestage == 9 then
send("aerocast airnet demesne")
tempTimer( 10.0, ] )
demesnestage = 10
elseif demesnefreeze == false and demesnestage == 10 then
send("aerocast southwind demesne")
tempTimer( 10.0, ] )
demesnestage = 11
elseif demesnefreeze == false and demesnestage == 11 then
send("aerocast illwind demesne")
tempTimer( 10.0, ] )
demesnestage = 12
elseif demesnefreeze == false and demesnestage == 12 then
send("aerocast westwind demesne")
cecho("
demesnestage = 0
demesnefreeze = true
elseif demesnefreeze == true and demesnestage ~= 0 then
cecho("
tempTimer( 10.0, ] )
end
end
naturally you can also use a more permanent timer using the GUI to set it up, that way you can also use the timer to send attacks timed with your demesne.
Lilia2010-12-12 21:53:59
What's wrong with an alias that calls this?:
This is a serious question, since this doesn't seem to work properly. There's about a three second spread, and I can't predict where it will go wrong. I'm assuming it's lag occuring somewhere.
QUOTE
send("aerocast northwind demesne")
tempTimer( 10, ])
tempTimer( 20, ])
tempTimer( 30, ])
tempTimer( 40, ])
tempTimer( 50, ])
tempTimer( 60, ])
tempTimer( 70, ])
tempTimer( 80, ])
tempTimer( 90, ])
tempTimer( 100, ])
tempTimer( 110, ])
tempTimer( 10, ])
tempTimer( 20, ])
tempTimer( 30, ])
tempTimer( 40, ])
tempTimer( 50, ])
tempTimer( 60, ])
tempTimer( 70, ])
tempTimer( 80, ])
tempTimer( 90, ])
tempTimer( 100, ])
tempTimer( 110, ])
This is a serious question, since this doesn't seem to work properly. There's about a three second spread, and I can't predict where it will go wrong. I'm assuming it's lag occuring somewhere.
Anisu2010-12-12 22:08:24
QUOTE (Lilia @ Dec 12 2010, 10:53 PM) <{POST_SNAPBACK}>
What's wrong with an alias that calls this?:
This is a serious question, since this doesn't seem to work properly. There's about a three second spread, and I can't predict where it will go wrong. I'm assuming it's lag occuring somewhere.
This is a serious question, since this doesn't seem to work properly. There's about a three second spread, and I can't predict where it will go wrong. I'm assuming it's lag occuring somewhere.
are you basing that spread on a timeindex provided by the client when you send the command, or on the time noted in 'demesne'?
if it is in the demesne command you may just have a really sucky connection right now. I can't see any other problem with it.
Also by using such an alias you are commited for 2 minutes. While this is perfect for when you have that much time (like when you can do it at guards) it would be better to implement an interrupt so you can switch to fighting/retreating before continueing.
Lilia2010-12-12 22:33:29
QUOTE (Anisu @ Dec 12 2010, 04:08 PM) <{POST_SNAPBACK}>
are you basing that spread on a timeindex provided by the client when you send the command, or on the time noted in 'demesne'?
I have on idea what that means. That's the script in the alias. There's no function or anything.
Furien2010-12-13 03:22:29
CODE
send("aerocast northwind demesne")
tempTimer(5.0, ])
tempTimer(10.0, ])
tempTimer(15.0, ])
tempTimer(20.0, ])
tempTimer(25.0, ])
--tempTimer(30.0, ])
tempTimer(40.0, ])
tempTimer(50.0, ])
tempTimer(60.0, ])
tempTimer(70.0, ])
tempTimer(80.0, ])
tempTimer(81.0, ])
tempTimer(5.0, ])
tempTimer(10.0, ])
tempTimer(15.0, ])
tempTimer(20.0, ])
tempTimer(25.0, ])
--tempTimer(30.0, ])
tempTimer(40.0, ])
tempTimer(50.0, ])
tempTimer(60.0, ])
tempTimer(70.0, ])
tempTimer(80.0, ])
tempTimer(81.0, ])
This is what I use. Nevermind the excessive Thunderclouds thing that I haven't retimed/compressed yet, it all works. I'm guessing you need the '.0'.
I should point out while I'm at it: Aeromancy has several effects that you don't need to time at all. Rainbowclouds doesn't need to be timed, Airnet doesn't even need to be used, you don't need to time westwind and swiftwind (simply having them up is good - it's your offense that needs to be timed) and it's debatable about whether or not you should time twister, since so long as it hits it'll do its job. (And by simply being in your demesne people will assume it's up, so they won't fly anyways. And if they did, Airnet would stop them. Yay redundancy.)
Heck, you can basically not use: twister, airnet, squalls, rainbowclouds, illwind, swiftwind and you will generally not be inhibited in your overall offensive capability. For defense, though, the whole ensemble is nice, especially if you have time to set up.