Paste #14837: cuboid paste

Date: 2015/03/30 19:49:14 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


stool: 
    type: world 
    events:
        on tpos1 command:
        - flag player tpos1:<player.location.simple>
#        - define pos1 '<player.flag[tpos1]||null>'
        - flag player tpos1_set
        - narrate " position 1 set on <player.location.simple> "
        - if <player.has_flag[tpos1_set]> && <player.has_flag[tpos2_set]> {
          - narrate " Cuboid selected "
          - define selectedCuboid cu@<player.flag[tpos1]>|<player.flag[tpos2]>
          - announce "<def[selectedCuboid]>"
            - define length <player.flag[tpos1].as_location.x.sub[<player.flag[tpos2].as_location.x>].abs.as_int>
            - define width <player.flag[tpos1].as_location.z.sub[<player.flag[tpos2].as_location.z>].abs.as_int>
            - define height <player.flag[tpos1].as_location.y.sub[<player.flag[tpos2].as_location.y>].abs.as_int>
            - announce "X-lange %length% Z-Breite %width% y-hohe %height% "
            - define length2 <def[length].add[1]>
            - define width2 <def[width].add[1]>
            - define heigth2 <def[height].add[1]>
            - announce "X-lange2  %length2% %width2% %heigth2%"
          - flag player tpos1_set:!
          - flag player tpos2_set:!
          }

        on tpos2 command:
        - flag player tpos2:<player.location.simple>
#        - define pos2 '<player.flag[tpos2]||null>'
        - flag player tpos2_set
        - narrate " position 2 set on <player.location.simple> "
        - if <player.has_flag[tpos1_set]> && <player.has_flag[tpos2_set]> {
          - narrate " Cuboid selected "
          - define selectedCuboid cu@<player.flag[tpos1]>|<player.flag[tpos2]>
          - announce "<def[selectedCuboid]>"
            - define length <player.flag[tpos1].as_location.x.sub[<player.flag[tpos2].as_location.x>].abs.as_int>
            - define width <player.flag[tpos1].as_location.z.sub[<player.flag[tpos2].as_location.z>].abs.as_int>
            - define height <player.flag[tpos1].as_location.y.sub[<player.flag[tpos2].as_location.y>].abs.as_int>
            - announce "X-lange %length% Z-Breite %width% y-hohe %height% "
            - define length2 <def[length].add[1]>
            - define width2 <def[width].add[1]>
            - define heigth2 <def[height].add[1]>
            - announce "X-lange2  %length2% %width2% %heigth2%"
          - flag player tpos1_set:!
          - flag player tpos2_set:!
          }

        on player clicks block:
        - if <context.item.scriptname||null> != wtool queue clear
        - if <context.click_type.is[==].to[LEFT_CLICK_BLOCK]> {
          - flag player tpos1:<context.location>
          - flag player tpos1_set
          - narrate " position 1 set on <context.location> "
          - if <player.has_flag[tpos1_set]> && <player.has_flag[tpos2_set]> {
            - narrate " Cuboid selected "
            - define selectedCuboid cu@<player.flag[tpos1]>|<player.flag[tpos2]>
            - announce "<def[selectedCuboid]>"
            - define length <player.flag[tpos1].as_location.x.sub[<player.flag[tpos2].as_location.x>].abs.as_int>
            - define width <player.flag[tpos1].as_location.z.sub[<player.flag[tpos2].as_location.z>].abs.as_int>
            - define height <player.flag[tpos1].as_location.y.sub[<player.flag[tpos2].as_location.y>].abs.as_int>
            - announce "X-lange %length% Z-Breite %width% y-hohe %height% "
            - define length2 <def[length].add[1]>
            - define width2 <def[width].add[1]>
            - define heigth2 <def[height].add[1]>
            - announce "X-lange2  %length2% %width2% %heigth2%"
            - flag player tpos1_set:!
            - flag player tpos2_set:!
          }
        }
         else if <context.click_type.is[==].to[RIGHT_CLICK_BLOCK]> {
         - flag player tpos2:<context.location>
         - flag player tpos2_set
         - narrate " position 2 set on <context.location> "
         - if <player.has_flag[tpos1_set]> && <player.has_flag[tpos2_set]> {
            - narrate " Cuboid selected "
            - define selectedCuboid cu@<player.flag[tpos1]>|<player.flag[tpos2]>
            - announce "<def[selectedCuboid]>"
            - define length <player.flag[tpos1].as_location.x.sub[<player.flag[tpos2].as_location.x>].abs.as_int>
            - define width <player.flag[tpos1].as_location.z.sub[<player.flag[tpos2].as_location.z>].abs.as_int>
            - define height <player.flag[tpos1].as_location.y.sub[<player.flag[tpos2].as_location.y>].abs.as_int>
            - announce "X-lange %length% Z-Breite %width% y-hohe %height% "
            - define length2 <def[length].add[1]>
            - define width2 <def[width].add[1]>
            - define height2 <def[height].add[1]>
            - announce "X-lange2  %length2% %width2% %height2%"
            - flag player tpos1_set:!
            - flag player tpos2_set:!
         }
         }
         else queue clear

        on cpaste command:
        - schematic load name:s_stone
        - narrate "X-Length:<schematic[s_stone].length> Z-Width:<schematic[s_stone].width> Y-Height:<schematic[s_stone].height>"
        - if <schematic[s_stone].length> != <def[length2]> {
          - narrate " Your X-Length is not the same like one from the schematic! "
          - queue clear
        }
        - if <schematic[s_stone].width> != <def[width2]> {
          - narrate " Your Z-Width is not the same like one from the schematic! "
          - queue clear
        }
        - if <schematic[s_stone].height> != <def[height2]> {
          - narrate " Your X-Height is not the same like one from the schematic! "
          - queue clear
        }
        # Paste the Schematic into the cuboid ... but how !?
#
#
#
#
#
#
#        on player clicks block: 
#        - if !<context.item_in_hand.scriptname||null> == wtool queue clear 
#        - if <context.click_type.is[==].to[LEFT_CLICK_BLOCK]> {
#          }
#          else <context.click_type.is[==].to[RIGHT_CLICK_BLOCK]> define pos 2 
# 
#    - define pos1 '<player.flag[dWEWand].as_list.get[1]||null>' 
#    - define pos2 '<player.flag[dWEWand].as_list.get[2]||null>' 
#    - define type '<player.flag[dWEWand_Type]||cuboid> 

wtool: 
    type: item 
    material: paper 
    display name: Selection Tool 
    lore: 
    - some text