|
Page 5 of 7
Dragonspeak triggers are, as the previous page said, the second biggest set of variables which the bot updates as part of the normal connection to the server. Which is one of the reasons you can disable the processing of DS triggers with the over ride flags. If you do disable the processor, the variables never get filled out either. Oh, a tad bit of an error, there's also another rich group of variables, but they are internally driven, the Date & Time variables.
Because the structure of the DS command from the server does not vary between the Six Trigger or the Seven Trigger, rather than waste space and duplicate the breakdown table, I'm going to combine them. For a recap of the format on the command:
7 XA YA XB YB L1 X1 Y1 L2 X2 Y2 L3 X3 Y3
And it's the same format when it's a Six Trigger, with the LXY(#) series continuing until you run out of data. Like all X values sent by the server, the value you see is 1/2 of what the dream editor would show for any particular position.
This section suddenly needed a rebuild due to the new processing of DS trigger events, mainly because of the recent fix where the server sets up the trigger string to include special handling for any trigger event 8000 and above. The fix is easy to understand, but becomes an issue with the old method of parsing the trigger for sub-triggers. The formatting of the trigger basically remains the same, that is (X1,Y1)(X2,Y2)(DSID)(X3,Y3), but what breaks the train is that if the DSID>7999, the format changes. The current position of DSID is still the same, but it will range in value from 8000-8999, and then there's a second Base95 number following that indicating the "true" 8000+ value of the trigger in increments of 1000. This, plus the original DSID-8000 will return the actual DSID of the event chunk.
Sample: (66,101)(66,101)[0-2827:(66,101)] [1-4890:(0,0)] [2-9258:(0,0)] <- 8258, 9000, 0, 0 [3-9495:(0,0)] <- 8495, 9000, 0, 0
So that means if you were to do this manually, you'd need to handle those instances where the primary DSID is 8000+, and do the math.
But with the new DsEvent Trigger Processor, you don't have to. You just need to access the functions which return the values you need and not worry about the math. So to scan for the presense of a particular trigger, there's a new Additional Condition which will handle it for you. And if you want to produce a DS scanner bot, the coding becomes real easy:
Trigger Name: DS Dream Trigger DS-trigger # is sent AND: if variable {[triggers]} is the same as {TRUE} (text comparison) $DATABASE: if there is not a record in table {masking} _
in database {1} where ID is {[DSID]} THEN: Store {{D} to variable {[whotrigger]} Execute Procedure {DS Trigger Detailer}

Trigger Name: DS Bot Trigger The bot triggers DS # AND: if variable {[triggers]} is the same as {TRUE} (text comparison) $DATABASE: if there is not a record in table {masking} _
in database {1} where ID is {[DSID]}
THEN: Store {{B} to variable {[whotrigger]} Execute Procedure {DS Trigger Detailer}

Trigger Name: DS Trigger Detailer Procedure No Additional Conditions. THEN: $ Begin Wolfscript: (1) &newvar #count &dscount() &newvar #triplet {($A,$B)/($C,$D)} &set #triplet &replace(#triplet {$A} &dsindex(0 x1)) &set #triplet &replace(#triplet {$B} &dsindex(0 y1)) &set #triplet &replace(#triplet {$C} &dsindex(0 x2)) &set #triplet &replace(#triplet {$D} &dsindex(0 y2)) &newvar #results &getvar(whotrigger) &join #results #count &join #results {: } &join #results #triplet &join #results {/ } &set #triplet {[0-$B:($X,$Y)]} &set #triplet &replace(#triplet {$B} &dsindex(0)) &set #triplet &replace(#triplet {$X} &dsindex(0 x3)) &set #triplet &replace(#triplet {$Y} &dsindex(0 y3)) &join #results #triplet &newvar #crlf {/ } &for #index=1 to #count &set #triplet {[$A-$B:($X,$Y)]} &set #triplet &replace(#triplet {$A} #index) &set #triplet &replace(#triplet {$B} &dsindex(#index)) &set #triplet &replace(#triplet {$X} &dsindex(#index x1)) &set #triplet &replace(#triplet {$Y} &dsindex(#index y1)) &join #results #crlf &join #results #triplet &set #work &mid(#work 7) &endfor &display #results $ End Wolfscript: (1)
And that's a wrap for dealing with DS triggers.
|