Aff trackers
I figure we may as well have a thread for these.
I started rewriting my system a while ago (calling what I currently have a system is probably insulting), but I realised a little ways in that just because its ugly and would probably get me fired if my employer ever saw the state of it, doesn't mean it needs replacing (right Microsoft?)
The tracker (or the general framework of one) is all I got done, but maybe someone will find it useful, so I'll throw it up here as well. Its for mushclient (in python). It definitely will not work out of the box and there are some slightly advanced concepts, but someone may be interested.
5
Comments
--The collection timer removes unaltered tracker profiles
for k,v in pairs (sys.tracker) do
if k ~= "curebuffer" and k ~= "aff" and k ~= "me" then
sys.tracker[k].collect = sys.tracker[k].collect + 1
if sys.tracker[k].collect == 2 then
sys.tracker[k] = nil
end
end
end
I suck at this or something. I'll export a cleaner xml when I go through and finish some major updates I have planned (and fix a myriad collection of awfully done things).
(Ring): Lartus says, "Then it exploded."
(Ring): Zsetsu says, "Everyone's playing checkers, but Theophilus is playing chess."
(Ring): Lartus says, "Then it exploded."
(Ring): Zsetsu says, "Everyone's playing checkers, but Theophilus is playing chess."
3p messages here: http://forums.imperian.com/discussion/comment/23393/#Comment_23393
I've helped a surprising amount of people learn to code things in this game! Hell, my free MM2k system from back in the day was the start of a surprising amount of fighters.
My priority list in doing so looks kind of like this:
"On the battlefield I am a god. I love war. The steel, the smell, the corpses. I wish there were more. On the first day I drove the Northmen back alone at the ford. Alone! On the second I carried the bridge! Me! Yesterday I climbed the Heroes! I love war! I… I wish it wasn’t over."
(Ring): Lartus says, "Then it exploded."
(Ring): Zsetsu says, "Everyone's playing checkers, but Theophilus is playing chess."
I don't have multiline triggers, either, and I have developed a few ugly workarounds.
Curing butisol with kelp looks like this....
Ultrix quickly eats a piece of kelp.
Ultrix's skin color returns to normal and her sweating subsides.
H:520/520 M:480/480 B:1 <e- pp> <db> D:0 F:0 K:0
Since I can't multiline trigger that, my triggers would probably go something like this...
/action {Ultrix quickly eats a piece of kelp.} {kelpeaten = 1}
/action {Ultrix's skin color returns to normal and her sweating subsides } {if (kelpeaten) {kelpeaten = 0}; target_cure(butisol) }
/action {H:520/520 M:480/480 B:1 <e- pp> <db> D:0 F:0 K:0} {/if (kelpeaten) {<do non-butisol/hemotoxin shit here>; kelpeaten = 0} }
The problem with relying on this is that you end up doing a whole lot of crap on your prompt, so I'd gate that with one check that you set along with kelpeaten and the like so that you don't run a ton of checks constantly.
"On the battlefield I am a god. I love war. The steel, the smell, the corpses. I wish there were more. On the first day I drove the Northmen back alone at the ford. Alone! On the second I carried the bridge! Me! Yesterday I climbed the Heroes! I love war! I… I wish it wasn’t over."
First, with the code you provided after Mathiaus helped you cut down on conditionals. If you have a common condition(the stricmp portion), instead of checking it on each elseif, nest your ifs:
%2
quickly eats a piece of kelp.=#if ((stricmp(target,"%2") == 0) {#if (merc = 1){#set merc = 0};#elseif (ethe = 1){#set ethe = 0};#elseif (arse = 1){#set arse = 0};#set brom = 0}
In lieu of multiline triggers, you could have triggers that enable/disable each other actively. I don't really know if that's doable in AL either.
Most barebones way I can think to handle it would be doing something like:
%2 quickly eats a piece of kelp.
#if ((stricmp(target,"%2") == 0) {
#set herb = "kelp"
}
%2's colour returns to %3 face.
#if ((stricmp(target,"%2") == 0) {
#set aff = "hemotoxin"
}
<whatever your prompt trigger looks like>
#if ((stricmp(herb, "kelp") == 0){
#if ((stricmp(aff, "hemotoxin") == 0){
#set hemo = 0
};#elseif ((strcmp(aff, "butisol") == 0){
#set buti = 0
};#else{
#if (merc = 1) {
#set merc = 0
};#elseif (ethe = 1){
#set ethe = 0
};#elseif (arse = 1){
#set arse = 0
};
#set brom = 0
};
};
Oh, and if you're looking to do any significant coding, you'll have a much easier time in a more modern client like MUSH or Mudlet. The above code would take the following in Mudlet; note the significantly improved readability:
On a multiline trigger that matches the following:
^(\w+) quickly eats (?:a|an|some) (.*)\.$
1 line spacer
^(.+)$
local name = multimatches[1][2]
local herb = multimatches[1][3]
local secondLine = multimatches[3][1]
local aff
if not name:matches(target) then return end --stops the trigger right here on non-targets.
if secondLine:match("colour returns to") then
aff = "hemotoxin"
elseif secondLine:match("sweating subsides") then
aff = "butisol"
end
if aff then
t[aff] = false
else
if herb:match("kelp") then
if t["weariness"] then
t["weariness"] = false
elseif t["clumsiness"] then
t["clumsiness"] = false
elseif t["asthma"] then
t["asthma"] = false
end
end
end
I think there are two of us holdouts left. The other guy lives in a capitalistic third-world country, so he has a built-in excuse
stuff that happened before prompt = {
"envenom aconite",
"I dsl baasche",
"baasche shrug"
"envenom hemotoxin",
"I dsl baasche",
"baasche herb kelp",
"baasche 3p hemotoxin",
}
That's going to be just as accurate in the end, I just really don't like doing things that way. =P
if prompt[target.." 3p hemotoxin"] then
afflictions["hemotoxin"] = false
end
or something like that set in the prompt script would do it, especially since dsl is so spammy with extra things you can't assume you have all the multilines captured.
(In Mudlet)
(Ring): Lartus says, "Then it exploded."
(Ring): Zsetsu says, "Everyone's playing checkers, but Theophilus is playing chess."
You slash Iniar -> afflict1 = get_aff(aconite)
You slash Iniar -> afflict1 = get_aff(aconite)
"On the battlefield I am a god. I love war. The steel, the smell, the corpses. I wish there were more. On the first day I drove the Northmen back alone at the ford. Alone! On the second I carried the bridge! Me! Yesterday I climbed the Heroes! I love war! I… I wish it wasn’t over."
E: that's not entirely true either.
One thing that AL client has taught me is that you don't need anything fancy to make anything work, you just need to think around it.
The simplest trick of doing this is to set a "dummy aliases" where your code runs. Simply, once you get to some part of your elseif statements, simply end with an "else" statement that activates an alias like "Afftrackingpart2" which will contain the next portion of your code.
Not only does this help ease the stress on AL Client itself, but it portions out your code to make debugging way easier.
(Ring): Lartus says, "Then it exploded."
(Ring): Zsetsu says, "Everyone's playing checkers, but Theophilus is playing chess."