Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <module name="MoonServices" global="true" id="362">
- <uid>{E411E3A3-03A2-4474-BC2B-BB748CD6CA9C}</uid>
- <packages>English Directions|English Keypad|GCMPServices|Aardwolf</packages>
- <alias name="moonbot" id="363">
- <value>$slist = "inactive|active"
- $switch = %lower( %1)
- ;;
- $mid = "MoonBot: "
- $msg1 = "Moon Tracker Activated"
- $msg2 = "Moon Tracker Deactivated"
- $msg3 = "Moon Tracker is "
- $msg4 = "Invalid Option"
- ;;
- #SWITCH ($switch = "on") {
- configtab.moons = 1
- #T+ MoonTriggers
- #T+ moontrig1
- #T+ moontrig2
- #T+ mButton
- #CALL @commbt.setStatus(True)
- #CALL @commbt.setColors(%json( @mbtcolors))
- #WINDOW @hWind {%crlf@oc$mid@cw$msg1%crlf}
- mbtmdisp
- } ($switch = "off") {
- configtab.moons = 0
- #T- mButton
- #T- moontrig1
- #T- moontrig2
- #T- MoonTriggers
- #CALL @commbt.setStatus(False)
- #WINDOW @hWind {%crlf@oc$mid@cw$msg2%crlf}
- mbtmdisp
- }
- ($switch = "") {#WINDOW @hWind {%crlf@oc$mid@cw$msg3@cy%item( $slist, @testconfig( moons) + 1)%crlf}}
- {#WINDOW @hWind {%crlf@oc$mid@cw$msg4%crlf}}</value>
- </alias>
- <alias name="resetmbt" id="364">
- <value>#IF (@testconfig( moons) = 1) {#CALL @commbt.setStatus(True)}</value>
- </alias>
- <alias name="moons" id="365">
- <value><![CDATA[$disp = ""
- ;;
- #IF (@testconfig( moons) = 1)
- {
- $data = %json( %comget( commbt, getMoons))
- $bd = %switch( $data.black > 0, (@cy + "|ON"), $data.black < 0, (@cr2 + "|OFF"), true, (@cd + "|Undefined"))
- $gd = %switch( $data.grey > 0, (@cy + "|ON"), $data.grey < 0, (@cr2 + "|OFF"), true, (@cd + "|Undefined"))
- $wd = %switch( $data.white > 0, (@cy + "|ON"), $data.white < 0, (@cr2 + "|OFF"), true, (@cd + "|Undefined"))
- $bt = %switch( %abs( $data.black) != 1, " ticks ", %abs( $data.black) = 1, " tick ", true, "")
- $gt = %switch( %abs( $data.grey) != 1, " ticks ", %abs( $data.grey) = 1, " tick ", true, "")
- $wt = %switch( %abs( $data.white) != 1, " ticks ", %abs( $data.white) = 1, " tick ", true, "")
- $disp = @oc"MoonBot: "@cm"White Moon -> "$wd.1$wd.2%if( $data.white != 0, @cw" for "@cy%abs( $data.white)@cw$wt, "")@cm" Grey Moon -> "$gd.1$gd.2%if( $data.grey != 0, @cw" for "@cy%abs( $data.grey)@cw$gt, "")@cm" Black Moon -> "$bd.1$bd.2%if( $data.black != 0, @cw" for "@cy%abs( $data.black)@cw$bt, "")@clw
- }
- {$disp = @oc"MoonBot: "@cw"Moon Tracker is "@cy"inactive"@clw}
- ;;
- #WINDOW @hWind {%crlf$disp%crlf}]]></value>
- </alias>
- <var name="mbstate" type="Integer" id="366">1</var>
- <alias name="setmoons" id="367">
- <value>#IF (@testconfig( moons) = 1)
- {
- BlackMoon = @commbt.BlackMoon
- GreyMoon = @commbt.GreyMoon
- WhiteMoon = @commbt.WhiteMoon
- #IF (%trigger( @gmcpwin) = 1) {mbtmdisp}
- }</value>
- </alias>
- <alias name="mbtclear" id="368">
- <value>#T- moontrig1
- ;;
- #T- moontrig2</value>
- </alias>
- <class name="MoonTriggers" id="369">
- <trigger name="moontrig3" priority="12540" enabled="false" id="370">
- <pattern>^You disappear into the void</pattern>
- <value>afk
- ;;
- afk
- ;;
- #CALL @commbt.MoonTick()</value>
- </trigger>
- <trigger name="moontrig1" priority="12550" regex="true" enabled="false" id="371">
- <pattern>^You notice the (\w+) moon falling to the (?:east|west)\.$</pattern>
- <value>#CALL @commbt.moonFalling(%1)
- ;;
- #IF (@commbt.moonsAreDefined()) {mbtclear}</value>
- </trigger>
- <trigger name="moontrig2" priority="12560" regex="true" enabled="false" id="372">
- <pattern>You see the (\w+) moon rising in the (?:east|west)\.$</pattern>
- <value>#CALL @commbt.moonRising(%1)
- ;;
- #IF (@commbt.moonsAreDefined()) {mbtclear}</value>
- </trigger>
- </class>
- <var name="BlackMoon" id="373">
- <value><![CDATA[<color red>OFF</color><color white> for </color><color yellow>22</color><color white> ticks</color>]]></value>
- <json><color gray>Undefined</color></json>
- </var>
- <var name="GreyMoon" id="374">
- <value><![CDATA[<color red>OFF</color><color white> for </color><color yellow>22</color><color white> ticks</color>]]></value>
- <json><color gray>Undefined</color></json>
- </var>
- <var name="WhiteMoon" id="375">
- <value><![CDATA[<color "0x00FF00">ON</color><color white> for </color><color yellow>4</color><color white> ticks</color>]]></value>
- <json><color gray>Undefined</color></json>
- </var>
- <var name="mdata" type="Record" id="376">
- <value>grey=-22|black=-22|white=4</value>
- <json>{"white":4,"grey":-22,"black":-22}</json>
- </var>
- <var name="ldata" type="Record" id="377">
- <value>tickno=322|ticklen=7</value>
- <json>{"ticklen":7,"tickno":322}</json>
- </var>
- <var name="mbtcolors" type="Record" id="378">
- <value>white=yellow|grey=yellow|black=yellow</value>
- <json>{"white":"yellow","grey":"yellow","black":"yellow"}</json>
- </var>
- <alias name="mbtmdisp" id="379">
- <value><![CDATA[#LOCAL bd, gd, wd
- ;;
- #IF (%trigger( @gmcpwin) != 1) {#EXIT}
- ;;
- #IF (@mdata.black > 0) {$bd = @cg2} {$bd = @cr2}
- #IF (@mdata.grey > 0) {$gd = @cg2} {$gd = @cr2}
- #IF (@mdata.white > 0) {$wd = @cg2} {$wd = @cr2}
- ;;
- $bd = ($bd + %format( "&2d", %abs( @mdata.black)) + @rc)
- $gd = ($gd + %format( "&2d", %abs( @mdata.grey)) + @rc)
- $wd = ($wd + %format( "&2d", %abs( @mdata.white)) + @rc)
- ;;
- $x1 = 9
- $x2 = 19
- $x3 = 30
- $x4 = 18
- $x5 = 27
- $y1 = 36
- $y2 = 38
- ;;
- $disp = @rc@cup( $y1, $x1)$wd@cup( $y1, $x2)$gd@cup( $y1, $x3)$bd
- ;;
- #IF (@ldata.tickno != -1) {$disp = ($disp + @cup( $y2, $x4)@cw%format( "&3d", @ldata.tickno)@rc@cup( $y2, $x5)@cw%format( "&1d", @ldata.ticklen)@rc)} {$disp = ($disp + @cup( $y2, $x4)@cw%format( "&3d", 0)@rc@cup( $y2, $x5)@cw%format( "&1d", 0)@rc)}
- ;;
- ;;
- #WINDOW @gmcpwin {$disp}]]></value>
- </alias>
- <alias name="mbtdinit" id="380">
- <value>#WINDOW @gmcpwin {@cup( 36, 2)@eol@cw"WHITE:"@rc@cup( 36, 13)@cd"GREY:"@rc@cup( 36, 23)@cb"BLACK:"@rc}
- #WINDOW @gmcpwin {@cup( 38, 2)@eol@oc"CONJUNCTION IN:"@rc@cup( 38, 22)@oc"FOR:"@rc}
- ;;
- #CALL @commbt.setGMCP(True)</value>
- </alias>
- <alias name="mbtdreset" id="381">
- <value>#SECTION gmcpTimer {
- #ADDITEM gmcpupdt {mbtdinit}
- #ADDITEM gmcpupdt {mbtmdisp}
- }
- ;;
- #T+ gmcptimer</value>
- </alias>
- <alias name="lunes" id="382">
- <value>#LOCAL $disp
- ;;
- #IF (@testconfig( moons) = 1) {
- ldata = %json( %comget( commbt, Lunes))
- #IF (@ldata.tickno != -1 AND @ldata.ticklen != -1)
- {$disp = @oc"MoonBot: "@cw"The three-moon event will start in "@cy@ldata.tickno@cw" ticks and will last for "@cy@ldata.ticklen@cw" ticks."}
- {$disp = @oc"MoonBot: "@cr2"Moon tracking is not complete"}
- }
- ;;
- winwrite $disp</value>
- </alias>
- <var name="mbtacolors" type="Record" id="383">
- <value>white=[1;33m|grey=[1;33m|black=[1;33m</value>
- <json>{"white":"[1;33m","grey":"[1;33m","black":"[1;33m"}</json>
- </var>
- <alias name="mbtmdispn" enabled="false" id="384">
- <value><![CDATA[ldata = %json( %comget( commbt, Lunes))
- mdata = %json( %comget( commbt, getMoons))
- ;;
- #IF (%trigger( @gmcpwin) != 1) {#EXIT}
- ;;
- $bd = (%switch( (@mdata.black > 0), @cg2, true, @cr2) + %format( "&2d", %abs( @mdata.black)))
- $gd = (%switch( (@mdata.grey > 0), @cg2, true, @cr2) + %format( "&2d", %abs( @mdata.grey)))
- $wd = (%switch( (@mdata.white > 0), @cg2, true, @cr2) + %format( "&2d", %abs( @mdata.white)))
- #ECHO bd = $bd gd = $gd wd = $wd
- ;;
- $x1 = 9
- $x2 = 19
- $x3 = 30
- $x4 = 18
- $x5 = 27
- $y1 = 36
- $y2 = 38
- ;;
- #WINDOW @gmcpwin {@cup( $y1, $x1)$wd@cup( $y1, $x2)$gd@cup( $y1, $x3)$bd@clw}
- ;;
- #IF (@ldata.tickno != -1) {#WINDOW @gmcpwin {@cup( $y2, $x4)@cw%format( "&3d", @ldata.tickno)@clw@cup( $y2, $x5)@cw%format( "&1d", @ldata.ticklen)@rc}}
- {#WINDOW @gmcpwin {@cup( $y2, $x4)@cw%format( "&3d", 0)@cup( $y2, $x5)@cw%format( "&1d", 0)@clw}}]]></value>
- </alias>
- <alias name="moonsn" id="385">
- <value>$disp = ""
- ;;
- #IF (@testconfig( moons) = 1)
- {
- $data = %json( %comget( commbt, displayMoons))
- $disp = @oc + "MoonBot: " + @cm + "White Moon -> " + $data.white + @cm + "Grey Moon -> " + $data.grey + @cm + "Black Moon -> " + $data.black +@rc
- }
- {$disp = @oc + "MoonBot: " + @cw + "Moon Tracker is " + @cy + "inactive" + @rc}
- ;;
- #IF (!%null( $disp)) {#WINDOW @hWind {%crlf$disp@rc%crlf}}</value>
- </alias>
- <alias name="mbtmreset" id="386">
- <value>mbtdinit
- ;;
- mbtmdisp</value>
- </alias>
- </module>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement