|
Because someone was interested in how DMG does this. It's a combination of triggers, timers, and flags to enable a silver sponsor bot to clone people's colors when given a cookie. That there is a kicker of the trick, the bot won't be able to clone with this code unless it is also a sponsor.
First you will need two triggers, one for "loud" cookies, and one for silent cookies. Seeing as most of the code is the same for either cookie, we can put most of the code into a procedure and just use the trigger event to determine which sort of cookie it is. First, our procedure: Trigger Name: Cookie Action Procedure No Additional Conditions. THEN: Say {cookies-reject} Store {[word2]} to variable {[cookiedonor]} Store {TRUE} to variable {[validlook]} Set countdown timer {Cookie Look} to execute in {2} seconds Set countdown timer {UnBlind Bot} to execute in {900} seconds Say {Cookie!} First we need to ensure that the bot will not accept another cookie, store the name of the triggering furre to a variable for the look timer to use, and then set another timer to go off in 15 minutes (900 seconds) that will reset the bot's cookie accept status. Then we have the bot say Cookie!, purely a chrome event. That additional variable was put in when I was considering something else, and is still there, think I was taking a look at everyone who was coming into the dream for some sort of statistical reason. Now we construct two Emit Triggers to capture the cookie emits and convince the bot to react when the cookie is directed at it. Both cookie emits are basically the same, the difference being that one of them contains the bot's name, the other one is in the construction of the emit. Trigger Name: Spot Loud Cookies Stop Action Search if TRUE An emit is seen AND: if variable {[c2]} is the same as {%} (text comparison) if variable {[word5]} is the same as {Dream|Makers|Guild} (text comparison) THEN: Execute Procedure {Cookie Action)  Trigger Name: Spot Silent Cookies Stop Action Search if TRUE An emit is seen AND: if variable {[c2]} is the same as {%} (text comparison) if variable {[startingword3]} is the same as {just gave you a cookie!}
(text comparison) THEN: Execute Procedure {Cookie Action} Ta Da! We are now ready to address the first timer in this system. The madness for using the timer for the look is that there's a quirk in attempting three events within the same time frame, it just doesn't work for some reason. So using the timer ensures that we're a bit more quiet with what the bot is doing when we execute the look: Timer Name: Cookie Look When countdown timer event AND: if variable {[validlook]} is the same as {TRUE} (text comparison) THEN: Look at furre {[cookiedonor]} and set [desc] and [color] to contain his/her stats Now that we've executed the look, time to go back to triggers and take a look at what we're doing with it: Trigger Name: Grab Colors Desc and color trigger is activated AND: if variable {[validlook]} is the same as {TRUE} (text comparison) THEN: Say {#chcol t[color]} Store {[color]} to variable {[currentcolor]} Store {FALSE} to variable {[validlook]} There, we now have it, the bot will assume the colors, species, and gender of the furre who gave the cookie. The only thing left to detail is the means by which you need to reset the bot's status and permit it to accept cookes once again: Timer Name: UnBlind Bot When countdown timer event No Additional Conditions. THEN: Say {cookies-accept} Remove variable {[cookiedonor]} Also, another reason for the variable [cookiedonor] is that when DMG is "actively" holding colors for a cookie, it updates it's description to indicate this fact. And actually, there's a bit more to this code than what is revealed here, however, that's because, as those who visit the Guild know, the bot cycles colors. So I also have an additional variable in the mix which, when TRUE, keeps the bot from changing colors. But otherwise, if you're not doing that, this will work as is. |