#### Simple Drag Lights Add-on #### ========================= #### #### by Sinanju #### #### Original Drag add-On for LFSLapper 12 March 2012 #### This amended and simplified start lights add-on August 2025 #### #### Install this file into ..\bin\default\includes #### then open the addonsused.lpr file and paste the following line; #### include( "./drag2.lpr"); #### ############################################################################################# # # NOTE: To start lights, type !drag # To close lights, type !dragoff # ############################################################################################# # # Video for this simulation: https://youtu.be/pFmTPuCUVVY # ############################################################################################# # Colour Codes: # ^0 - black # ^1 - red # ^2 - green # ^3 - yellow # ^4 - blue # ^5 - violet # ^6 - cyan # ^7 - white # ^8 - no color (grey) (or leave text colour blank) ############################################################################################# CatchEvent OnLapperStart() ### Set initial sie and placements for Drag Lights GlobalVar $DragL; $DragL = 50; # Increase / Decrease to move lights left or right GlobalVar $DragT; $DragT = 20; # Increase / Decrease to move lights up or down GlobalVar $DragW; $DragW = 7; # Do NOT change (this sets width of the background and the lights) GlobalVar $DragH; $DragH = 27; # Do NOT change (this sets height of the background and the lights) GlobalVar $DragS; $DragS = 8; # Do NOT change (this sets spacing of the background and the lights) GlobalVar $DragT; $DragT = -1; # Do NOT change (this sets timing of the lights) GlobalVar $DragT2; $DragT2 = 8; # Increase / Decrease for length of time light cluster with green stays on screen (set to -1 if you want it permanent) ### Set initial values for events GlobalVar $DragMode; $DragMode = "off"; #Drag option turned OFF, unless switched on GlobalVar $RTime; $RTime = round( RandomNum( 4,9 ),0); # Random time to when first of 3 vertical yellow lights start GlobalVar $RandTime; $RandTime = round( RandomNum( 1,2 ),0); # Random time between vertical yellow and green lights going on EndCatchEvent ############################################################################################# # Section to open/close lights ############################################################################################# CatchEvent OnMSO( $userName, $text ) $idxOfFirtsSpace = indexOf( $text, " "); IF ( $idxOfFirtsSpace == -1 ) THEN $command = $text; $argv = ""; ELSE $command = subStr( $text,0,$idxOfFirtsSpace ); $argv = trim( subStr( $text,$idxOfFirtsSpace ) ); ENDIF SWITCH ( $command) CASE "!drag": CASE "!Drag": CASE "!DRAG": IF ( UserIsAdmin( $userName ) == 1 ) # Use this part (IF-THEN-ELSE-ENDIF statement) if you only want Admin to switch Drag system on THEN $DragMode = "Drag"; SE_DragStart($KeyFlags); # Starts Drag system ELSE openPrivButton( "hud_message",74,1,51,5,4,8,0,langEngine( "%{drag_notadmin}%" ) ); ENDIF BREAK; CASE "!dragoff": CASE "!Dragoff": CASE "!DragOff": CASE "!DRAGOFF": IF ( UserIsAdmin( $userName ) == 1 ) # Use this part (IF - ENDIF statement) if you only want Admin to switch Drag system off THEN SE_DragOff($KeyFlags); # Closes Drag system ELSE openPrivButton( "hud_message",74,1,51,5,4,8,0,langEngine( "%{drag_notadmin}%" ) ); ENDIF BREAK; ENDSWITCH EndCatchEvent ############################################################################################# # Light Clusters ############################################################################################# Sub SE_DragStart($KeyFlags) # A Sinanju Event (opens light clusters) ### Lights # Left openGlobalButton( "drag_backL1",$DragL+15,$DragT+58,$DragW,$DragH+15,$DragS,$DragT,32,""); # Background openGlobalButton( "drag_backL2",$DragL+15,$DragT+58,$DragW,$DragH+15,$DragS,$DragT,32,""); # Another background to make it darker openGlobalButton( "drag_cdytl",$DragL,$DragT+50,$DragW+30,$DragH,$DragS,$DragT,0,"^0•"); # Top Light - blank/black openGlobalButton( "drag_cdyml",$DragL,$DragT+60,$DragW+30,$DragH,$DragS,$DragT,0,"^0•"); # Second Light - blank openGlobalButton( "drag_cdybl",$DragL,$DragT+70,$DragW+30,$DragH,$DragS,$DragT,0,"^0•"); # Third Light - blank openGlobalButton( "drag_stl",$DragL,$DragT+80,$DragW+30,$DragH,$DragS,$DragT,0,"^1•"); # Start Light - red # Right openGlobalButton( "drag_backR1",$DragL+78,$DragT+58,$DragW,$DragH+15,$DragS,$DragT,32,""); # Background openGlobalButton( "drag_backR2",$DragL+78,$DragT+58,$DragW,$DragH+15,$DragS,$DragT,32,""); # Another background to make it darker openGlobalButton( "drag_cdytr",$DragL+63,$DragT+50,$DragW+30,$DragH,$DragS,$DragT,0,"^0•"); # Top Light - blank/black openGlobalButton( "drag_cdymr",$DragL+63,$DragT+60,$DragW+30,$DragH,$DragS,$DragT,0,"^0•"); # Second Light - blank openGlobalButton( "drag_cdybr",$DragL+63,$DragT+70,$DragW+30,$DragH,$DragS,$DragT,0,"^0•"); # Third Light - blank openGlobalButton( "drag_str",$DragL+63,$DragT+80,$DragW+30,$DragH,$DragS,$DragT,0,"^1•"); # Start Light - red DelayedCommand( $RandTime, SE_CountDownTop ); EndSub Sub SE_DragOff ($KeyFlags) # A Sinanju Event (turns drag system off and removes xmas lights from screen) closeButtonRegex (GetCurrentPlayerVar("UserName"), "drag_*"); $DragMode = "off"; EndSub Sub SE_CountDownTop() closeGlobalButton ("drag_cdytl&drag_cdytr"); openGlobalButton( "drag_cdytl",$DragL,$DragT+50,$DragW+30,$DragH,$DragS,$DragT,0,"^3•"); # Changes top single light to yellow openGlobalButton( "drag_cdytr",$DragL+62,$DragT+50,$DragW+30,$DragH,$DragS,$DragT,0,"^3 •"); openGlobalButton( "drag_stl",$DragL,$DragT+80,$DragW+30,$DragH,$DragS,$DragT,0,"^0•"); # Start Light - blank openGlobalButton( "drag_str",$DragL+63,$DragT+80,$DragW+30,$DragH,$DragS,$DragT,0,"^0•"); # Start Light - blank DelayedCommand( $RandTime, SE_CountDownMiddle ); EndSub Sub SE_CountDownMiddle() closeGlobalButton ("drag_cdym&drag_right_cdym"); openGlobalButton( "drag_cdyml",$DragL,$DragT+60,$DragW+30,$DragH,$DragS,$DragT,0,"^3•"); # Count Down Yellow middle openGlobalButton( "drag_cdymr",$DragL+62,$DragT+60,$DragW+30,$DragH,$DragS,$DragT,0,"^3 •"); DelayedCommand( $RandTime, SE_CountDownBottom ); EndSub Sub SE_CountDownBottom () closeGlobalButton ("drag_cdyb&drag_right_cdyb"); openGlobalButton( "drag_cdybl",$DragL,$DragT+70,$DragW+30,$DragH,$DragS,$DragT,0,"^3•"); # Count Down Yellow bottom openGlobalButton( "drag_cdybr",$DragL+62,$DragT+70,$DragW+30,$DragH,$DragS,$DragT,0,"^3 •"); DelayedCommand( $RandTime, SE_Start ); EndSub Sub SE_Start () openGlobalButton( "drag_backL1",$DragL+15,$DragT+58,$DragW,$DragH+15,$DragS,$DragT2,32,""); # Background openGlobalButton( "drag_backL2",$DragL+15,$DragT+58,$DragW,$DragH+15,$DragS,$DragT2,32,""); # Background openGlobalButton( "drag_backR1",$DragL+78,$DragT+58,$DragW,$DragH+15,$DragS,$DragT2,32,""); # Background openGlobalButton( "drag_backR2",$DragL+78,$DragT+58,$DragW,$DragH+15,$DragS,$DragT2,32,""); # Background openGlobalButton( "drag_cdytl",$DragL,$DragT+50,$DragW+30,$DragH,$DragS,$DragT2,0,"^0•"); # Top Light - blank/black openGlobalButton( "drag_cdyml",$DragL,$DragT+60,$DragW+30,$DragH,$DragS,$DragT2,0,"^0•"); # Second Light - blank openGlobalButton( "drag_cdybl",$DragL,$DragT+70,$DragW+30,$DragH,$DragS,$DragT2,0,"^0•"); # Third Light - blank openGlobalButton( "drag_cdytr",$DragL+63,$DragT+50,$DragW+30,$DragH,$DragS,$DragT2,0,"^0•"); # Top Light - blank/black openGlobalButton( "drag_cdymr",$DragL+63,$DragT+60,$DragW+30,$DragH,$DragS,$DragT2,0,"^0•"); # Second Light - blank openGlobalButton( "drag_cdybr",$DragL+63,$DragT+70,$DragW+30,$DragH,$DragS,$DragT2,0,"^0•"); # Third Light - blank openGlobalButton( "drag_stl",$DragL,$DragT+80,$DragW+30,$DragH,$DragS,$DragT2,0,"^2•"); # Start Light - green openGlobalButton( "drag_str",$DragL+63,$DragT+80,$DragW+30,$DragH,$DragS,$DragT2,0,"^2•"); # Start Light - green EndSub ############################################################################################# # Language Section ############################################################################################# Lang "EN" drag_notadmin = "You are not an Admin!"; EndLang Lang "FR" drag_notadmin = "Vous n'êtes pas un administrateur !"; EndLang