Anisu2011-04-16 19:22:16
is there a way to find out a path to a profile for plugins? Something like getMudletHomeDir() but than more specific. Or is the only option to prompt a select folder window?
on a related note, is filepath a mudlet library or a lua library. (either way a link to some information about it would be appreciated)
and lastly would something like this work or would I have to download them one by one?
on a related note, is filepath a mudlet library or a lua library. (either way a link to some information about it would be appreciated)
and lastly would something like this work or would I have to download them one by one?
CODE
function iff_importfromealhdun()
downloadFile(getMudletHomeDir() .. "/iff-hallifax.txt", "http://www.ealhdun.be/lusternia/iff-hallifax.txt")
downloadFile(getMudletHomeDir() .. "/iff-gaudiguch.txt", "http://www.ealhdun.be/lusternia/iff-gaudiguch.txt")
downloadFile(getMudletHomeDir() .. "/iff-celest.txt", "http://www.ealhdun.be/lusternia/iff-celest.txt")
downloadFile(getMudletHomeDir() .. "/iff-magnagora.txt", "http://www.ealhdun.be/lusternia/iff-magnagora.txt")
downloadFile(getMudletHomeDir() .. "/iff-serenwilde.txt", "http://www.ealhdun.be/lusternia/iff-serenwilde.txt")
downloadFile(getMudletHomeDir() .. "/iff-glomdoring.txt", "http://www.ealhdun.be/lusternia/iff-glomdoring.txt")
end
function iff_downloadcomplete()
-- place in own script with event handler sysDownloadDone
if filepath:find("iff-hallifax.txt", 1, true) then
  table.load(filepath, OrgMemberHallifax)
  os.remove(filepath)
elseif filepath:find("iff-gaudiguch.txt", 1, true) then
  table.load(filepath, OrgMemberGaudiguch)
  os.remove(filepath)
elseif filepath:find("iff-celest.txt", 1, true) then
  table.load(filepath, OrgMemberCelest)
  os.remove(filepath)
elseif filepath:find("iff-magnagora.txt",1,true) then
  table.load(filepath, OrgMemberMagnagora)
  os.remove(filepath)
elseif filepath:find("iff-serenwilde.txt", 1, true) then
  table.load(filepath, OrgMemberSerenwilde)
  os.remove(filepath)
elseif filepath:find("iff-glomdoring.txt", 1, true) then
  table.load(filepath, OrgMemberGlomdoring)
  os.remove(filepath)
end
end
downloadFile(getMudletHomeDir() .. "/iff-hallifax.txt", "http://www.ealhdun.be/lusternia/iff-hallifax.txt")
downloadFile(getMudletHomeDir() .. "/iff-gaudiguch.txt", "http://www.ealhdun.be/lusternia/iff-gaudiguch.txt")
downloadFile(getMudletHomeDir() .. "/iff-celest.txt", "http://www.ealhdun.be/lusternia/iff-celest.txt")
downloadFile(getMudletHomeDir() .. "/iff-magnagora.txt", "http://www.ealhdun.be/lusternia/iff-magnagora.txt")
downloadFile(getMudletHomeDir() .. "/iff-serenwilde.txt", "http://www.ealhdun.be/lusternia/iff-serenwilde.txt")
downloadFile(getMudletHomeDir() .. "/iff-glomdoring.txt", "http://www.ealhdun.be/lusternia/iff-glomdoring.txt")
end
function iff_downloadcomplete()
-- place in own script with event handler sysDownloadDone
if filepath:find("iff-hallifax.txt", 1, true) then
  table.load(filepath, OrgMemberHallifax)
  os.remove(filepath)
elseif filepath:find("iff-gaudiguch.txt", 1, true) then
  table.load(filepath, OrgMemberGaudiguch)
  os.remove(filepath)
elseif filepath:find("iff-celest.txt", 1, true) then
  table.load(filepath, OrgMemberCelest)
  os.remove(filepath)
elseif filepath:find("iff-magnagora.txt",1,true) then
  table.load(filepath, OrgMemberMagnagora)
  os.remove(filepath)
elseif filepath:find("iff-serenwilde.txt", 1, true) then
  table.load(filepath, OrgMemberSerenwilde)
  os.remove(filepath)
elseif filepath:find("iff-glomdoring.txt", 1, true) then
  table.load(filepath, OrgMemberGlomdoring)
  os.remove(filepath)
end
end
Vadi2011-04-16 21:20:55
1) all things are embedded in one profile xml, so that wouldn't make sense
2) filepath? your iff_downloadcomplete is wrong by the way, should be function iff_downloadcomplete(_, filepath)
3) it'd work
2) filepath? your iff_downloadcomplete is wrong by the way, should be function iff_downloadcomplete(_, filepath)
3) it'd work
Lilia2011-04-17 01:08:31
QUOTE (Vadi @ Apr 16 2011, 03:20 PM) <{POST_SNAPBACK}>
1) all things are embedded in one profile xml, so that wouldn't make sense
Um, not true. There is a folder for each profile that holds files like saved variables, map information, any tables you might have saved, all the m&m stuff, AND the actual xmls for the profile.
Vadi2011-04-17 11:31:05
Yeah. Anisu knows about that though. The actual 'plugin' code is embedded in the xmls.
Dynami2011-04-20 20:04:55
Trigger:
Send:
What am I doing wrong...?
QUOTE
You sniff the card of the Soulless, and sense it has been imprinted upon (\\w+) (\\d+) times.
Send:
QUOTE
matches = soullesstarget
matches = rubnumber
cecho("\\n|<<=============================" .. string.upper(rubnumber) .. " RUBS ON " .. soullesstarget .. "|>>=============================")
matches = rubnumber
cecho("\\n
What am I doing wrong...?
Ytran2011-04-20 20:11:00
Assignment works right to left, not left to right.
soullesstarget = matches
rubnumber = matches
soullesstarget = matches
rubnumber = matches
Dynami2011-04-20 20:29:37
QUOTE
cecho("\\n|<<=============================" .. string.upper(rubnumber) .. " RUBS ON " .. string.upper(soullesstarget) .. "|>>=============================")
cecho("\\n|<<=============================" .. string.upper(rubnumber) .. " RUBS ON " .. string.upper(soullesstarget) .. "|>>=============================")
cecho("\\n
When the trigger procs, the two echoes above show up but they don't show up on seperate lines. How can I make sure they are on seperate lines?
Ytran2011-04-20 20:34:03
They should be showing up on separate lines, since both begin with a newline, and it works fine when I test it. Are you sure that's exactly what you have for your code?
Dynami2011-04-20 22:30:46
QUOTE (Ytran @ Apr 20 2011, 04:34 PM) <{POST_SNAPBACK}>
They should be showing up on separate lines, since both begin with a newline, and it works fine when I test it. Are you sure that's exactly what you have for your code?
This is what the whole entire trigger looks like:
QUOTE
deleteLine()
soullesstarget = matches
rubnumber = matches
cecho("\\n|<<=============================" .. string.upper(rubnumber) .. " RUBS ON " .. string.upper(soullesstarget) .. "|>>=============================")
cecho("\\n|<<=============================" .. string.upper(rubnumber) .. " RUBS ON " .. string.upper(soullesstarget) .. "|>>=============================")
soullesstarget = matches
rubnumber = matches
cecho("\\n
cecho("\\n
Neos2011-04-20 22:44:22
QUOTE (Dynami @ Apr 20 2011, 06:30 PM) <{POST_SNAPBACK}>
This is what the whole entire trigger looks like:
check for errors on the error view. Red exclamation button in the trigger/alias/scripts/etc window.
Razenth2011-04-20 22:45:48
So efficient, tracking rubs internally.
I just spam RUBS :|
I just spam RUBS :|
Dynami2011-04-20 22:55:03
QUOTE (AquaNeos @ Apr 20 2011, 06:44 PM) <{POST_SNAPBACK}>
check for errors on the error view. Red exclamation button in the trigger/alias/scripts/etc window.
There are no errors that come up. The problem is(as stated in my last post) that the echoes won't stay on the same line. It looks something like this:
QUOTE
=============================|<<1 RUBS ON
SAOIRSE|>>=============================
=============================|<<1 RUBS ON SAOIRSE|>>=============================
SAOIRSE|>>=============================
=============================|<<1 RUBS ON SAOIRSE|>>=============================
Lilia2011-04-20 23:09:30
My guess would be that you have too many characters in the echo, so the word wrapping is doing strange things. Try deleting some of the =
Dynami2011-04-20 23:12:58
QUOTE (Lilia @ Apr 20 2011, 07:09 PM) <{POST_SNAPBACK}>
My guess would be that you have too many characters in the echo, so the word wrapping is doing strange things. Try deleting some of the =
You will receive your cookie points in the mail! >.>
Unknown2011-04-21 14:11:56
What am I doing wrong that cecho is adding some whitepace before (?) a colour change?
If I have:
cecho("statuswindow", "A ")
cecho("statuswindow", "B ")
cecho("statuswindow", "C \\n")
they're not evenly spaced. I want "A B C " in the correct colours as I'm trying to use them as traffic lights. Currently they jump about as the colours change, like "A B........C". They're only evenly spaced when they're all the same colour.
Am I better just using labels?
If I have:
cecho("statuswindow", "
cecho("statuswindow", "
cecho("statuswindow", "
they're not evenly spaced. I want "A B C " in the correct colours as I'm trying to use them as traffic lights. Currently they jump about as the colours change, like "A B........C". They're only evenly spaced when they're all the same colour.
Am I better just using labels?
Vadi2011-04-21 16:17:42
cecho("statuswindow", "A B C\\n")
?
?
Unknown2011-04-21 22:26:05
That works fine in the main window thanks, but it still has the odd spacing in the miniconsole.
The miniconsole is just created with:
createMiniConsole("battcap",674,470,300,120)
setBackgroundColor("battcap",0,0,30,0)
setWindowWrap("bbattcap",55)
The miniconsole is just created with:
createMiniConsole("battcap",674,470,300,120)
setBackgroundColor("battcap",0,0,30,0)
setWindowWrap("bbattcap",55)
Vadi2011-04-22 12:57:37
That's a different console name there though.
Lehki2011-04-23 21:39:29
Which would be more efficient.
This: ^suffering from a broken (chest|jaw|nose)\\.$
Or splitting it into a chain head with 3 children?
^suffering from a broken
chest\\.$
jaw\\.$
nose\\.$
They'd be doing the same thing except the first would be using matches.
This: ^suffering from a broken (chest|jaw|nose)\\.$
Or splitting it into a chain head with 3 children?
^suffering from a broken
chest\\.$
jaw\\.$
nose\\.$
They'd be doing the same thing except the first would be using matches.
Vadi2011-04-23 22:27:47
Doesn't matter in that case. Though "suffering from a broken" w/ begin of line substring would be faster than a regex. (I'd use the first one for legibility though).
Chains shine when you'd want to do completely different logic depending on the outcome, but have a similar start - so you can optimize the initial match from many to one, and then still split up your script logic nicely in triggers instead of having to stuff them into one. ie, my kata throw has the initial throw msg as a gate and then all of the different effects that can happen as child trigs (although this example is multiline instead of one line like yours, I hope you get the idea).
Chains shine when you'd want to do completely different logic depending on the outcome, but have a similar start - so you can optimize the initial match from many to one, and then still split up your script logic nicely in triggers instead of having to stuff them into one. ie, my kata throw has the initial throw msg as a gate and then all of the different effects that can happen as child trigs (although this example is multiline instead of one line like yours, I hope you get the idea).