Advertisement
Guest User

bbb

a guest
Apr 25th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 31.71 KB | None | 0 0
  1. DICE_SCRIPT_PROJECT = {
  2.     -- Payout.
  3.     -- Default: 80%
  4.     PAYOUT_PERCENTAGE = 80,
  5.    
  6.     -- Minimum amount of cash.
  7.     -- Default: 5k
  8.     MINIMUM_BET = 5000,
  9.    
  10.     -- Maximum amount of cash.
  11.     -- Default: 300k
  12.     MAXIMUM_BET = 300000,
  13.    
  14.     -- Main backpack.
  15.     -- Default: Any
  16.     MAIN_BACKPACK = "Purple Backpack",
  17.    
  18.     -- Backpack for crystal coins.
  19.     -- Default: Orange Backapack
  20.     CRYSTAL_COINS_BACKPACK = "Orange Backpack",
  21.    
  22.     -- Backpack for platinum coins.
  23.     -- Default: Red Backpack
  24.     PLATINUM_COINS_BACKPACK = "Red Backpack",
  25.    
  26.     -- Accept abbreviated values.
  27.     -- Possible choices: h or l
  28.     ACCEPT_ABBREVIATIONS = true,
  29.    
  30.     -- Accept numeric values.
  31.     -- Possible choices: 123 or 456
  32.     ACCEPT_NUMERIC = true,
  33.    
  34.     -- Ping compensation for slow connections.
  35.     -- Default: 100
  36.     PING_COMPENSATION = 100,
  37.    
  38.     -- Switch broadcast mode. Displays a broadcasted message.
  39.     -- >> "{operator}'s CASINO: HIGH/LOW - MIN {min}K / MAX {max}K - {payout}% PAYOUT"
  40.     BROADCAST_MESSAGES = true,
  41.    
  42.     -- Item name to use when player wins bet.
  43.     -- If you do not want any item to be used, type "none".
  44.     -- Default: Lyre
  45.     WON_BET_ITEM = "Lyre",
  46.  
  47.     -- Item name to use when player loses bet.
  48.     -- If you do not want any item to be used, type "none".
  49.     -- Default: Trough Kit
  50.     LOST_BET_ITEM = "Trough Kit",
  51.  
  52.     -- Switch use party hat in casino.
  53.     USE_PARTY_HAT = true,
  54.    
  55.     -- Item name to use as decoration under dice.
  56.     -- If you do not want any item to be decorative, type "none".
  57.     -- Default: "Ectoplasmic Sushi"
  58.     DECORATION_ITEM = "Ectoplasmic Sushi",
  59.  
  60.     -- Display HUD with statistics.
  61.     SHOW_STATS_HUD = true,
  62. }
  63.  
  64. -----------------------------------------------
  65. --[[ DO NOT EDIT ANYTHING BELOW THIS LINE ]] --
  66. -----------------------------------------------
  67. CONTAINERS = { COUNTER_BROWSE_FIELD = nil, LOCKER_BROWSE_FIELD = nil, MAIN_BACKPACK = nil, CRYSTAL_COINS_BACKPACK = nil, DEPOTLOCK = nil, PLATINUM_COINS_BACKPACK = nil }
  68. DICE_ID = { 5792, 5793, 5794, 5795, 5796, 5797 }
  69. CASH = { CRYSTAL_COIN = 3043, PLATINUM_COIN = 3035 }
  70. CASH_ID = { 3035, 3043 }
  71. COUNTER_ID = { 2318, 2320, 2321, 2343, 2345 }
  72. LOCKER = { X = 0, Y = 0, Z = 0 }
  73. LOCKER_ID = { 3497, 3498, 3499, 3500 }
  74. GLOWING_SWITCH_ID = { 10145 }
  75. COUNTER = { X = 0, Y = 0, Z = 0 }
  76. DUSTBIN = { X = 0, Y = 0, Z = 0 }
  77. DUSTBIN_ID = { 2526 }
  78. GAMBLE_OPTION = { HIGH = 1, LOW = 0, NONE = -1 }
  79. PLAYER = { LAST_SEEN = "", BALANCE = 0, OPTION = GAMBLE_OPTION.NONE, SPOT = { X = 0, Y = 0, Z = 0 } }
  80. LOADING_COMPLETE = false
  81. RESTACK_ITEMS = true
  82. DECORATION_ITEM_ID = Item.GetID(DICE_SCRIPT_PROJECT.DECORATION_ITEM)
  83. WON_BET_ITEM_ID = Item.GetID(DICE_SCRIPT_PROJECT.WON_BET_ITEM)
  84. LOST_BET_ITEM_ID = Item.GetID(DICE_SCRIPT_PROJECT.LOST_BET_ITEM)
  85. if (DICE_SCRIPT_PROJECT.SHOW_STATS_HUD) then
  86.     HEADS_UP_DISPLAY =
  87.     {
  88.         SCRIPT_NAME = "DICE SCRIPT PROJECT",
  89.         SCRIPT_VERSION = "Beta-0.1.0",
  90.         SCRIPT_HEADER = HUD.New(10, 20, "", 30, 144, 255),
  91.         STATS_HEADER = HUD.New(10, 40, "STATISTICS", 255, 165, 0),
  92.         AMOUNT_CASH =
  93.         {
  94.             DISPLAY_CRYSTAL =
  95.             {
  96.                 TEXT = HUD.New(10, 60, "Crystal Coins", 255, 255, 255),
  97.                 AMOUNT = HUD.New(140, 60, "0k", 255, 255, 255)
  98.             },
  99.             DISPLAY_PLATINUM =
  100.             {
  101.                 TEXT = HUD.New(10, 76, "Platinum Coins", 255, 255, 255),
  102.                 AMOUNT = HUD.New(140, 76, "0k", 255, 255, 255)
  103.             }
  104.         },
  105.         BETS =
  106.         {
  107.             WON =
  108.             {
  109.                 TEXT = HUD.New(10, 92, "Bets Won", 255, 255, 255),
  110.                 AMOUNT = HUD.New(140, 92, "0 (0k)", 255, 255, 255),
  111.                 AMOUNT_RAW = 0,
  112.                 AMOUNT_CASH = 0
  113.             },
  114.             LOST =
  115.             {
  116.                 TEXT = HUD.New(10, 108, "Bets Lost", 255, 255, 255),
  117.                 AMOUNT = HUD.New(140, 108, "0 (0k)", 255, 255, 255),
  118.                 AMOUNT_RAW = 0,
  119.                 AMOUNT_CASH = 0
  120.             },
  121.             OUTCOME =
  122.             {
  123.                 TEXT = HUD.New(10, 128, "OUTCOME", 255, 255, 255),
  124.                 AMOUNT = HUD.New(140, 128, "0 (0k)", 255, 255, 255),
  125.                 AMOUNT_RAW = 0,
  126.                 AMOUNT_CASH = 0
  127.             }
  128.         },
  129.         SETTINGS_HEADER = HUD.New(10, 148, "SETTINGS", 255, 165, 0),
  130.         PING_COMPENSATION =
  131.         {
  132.             TEXT = HUD.New(10, 168, "Ping Compensation: ", 255, 255, 255),
  133.             VALUE = HUD.New(140, 168, tostring(DICE_SCRIPT_PROJECT.PING_COMPENSATION), 255, 255, 255)
  134.         },
  135.         PAYOUT =
  136.         {
  137.             TEXT = HUD.New(10, 184, "Payout percentage: ", 255, 255, 255),
  138.             VALUE = HUD.New(140, 184, DICE_SCRIPT_PROJECT.PAYOUT_PERCENTAGE.."%", 255, 255, 255)
  139.         },
  140.         MIN_MAX_BET =
  141.         {
  142.             TEXT = HUD.New(10, 200, "Bet: ", 255, 255, 255),
  143.             VALUE = HUD.New(140, 200, math.floor(DICE_SCRIPT_PROJECT.MINIMUM_BET/1000).."k - "..math.floor(DICE_SCRIPT_PROJECT.MAXIMUM_BET/1000).."k", 255, 255, 255)
  144.         },
  145.         ABBREVIATIONS =
  146.         {
  147.             TEXT = HUD.New(10, 216, "Abbreviations: ", 255, 255, 255),
  148.             VALUE = HUD.New(140, 216, tostring(DICE_SCRIPT_PROJECT.ACCEPT_ABBREVIATIONS), 107, 142, 35)
  149.         },
  150.         NUMERIC_BETS =
  151.         {
  152.             TEXT = HUD.New(10, 232, "Numeric bets: ", 255, 255, 255),
  153.             VALUE = HUD.New(140, 232, tostring(DICE_SCRIPT_PROJECT.ACCEPT_NUMERIC), 107, 142, 35)
  154.         },
  155.         BROADCAST_MESSAGES =
  156.         {
  157.             TEXT = HUD.New(10, 248, "Broadcast messages: ", 255, 255, 255),
  158.             VALUE = HUD.New(140, 248, tostring(DICE_SCRIPT_PROJECT.BROADCAST_MESSAGES), 178, 34, 34)
  159.         },
  160.         COLORS =
  161.         {
  162.             BLACK = {R = 10, G = 10, B = 10},
  163.             ORANGE = {R = 255, G = 165, B = 0},
  164.             BLUE = {R = 30, G = 144, B = 255},
  165.             CORNSILK = {R = 205, G = 200, B = 177},
  166.             WHITE = {R = 255, G = 255, B = 255},
  167.             GREEN = {R = 107, G = 142, B = 35},
  168.             RED = {R = 178, G = 34, B = 34},
  169.         }
  170.     }
  171.     HEADS_UP_DISPLAY.SCRIPT_HEADER:SetText(HEADS_UP_DISPLAY.SCRIPT_NAME.." "..HEADS_UP_DISPLAY.SCRIPT_VERSION)
  172.     if (DICE_SCRIPT_PROJECT.ACCEPT_ABBREVIATIONS) then
  173.         HEADS_UP_DISPLAY.ABBREVIATIONS.VALUE:SetTextColor(107, 142, 35)
  174.     else
  175.         HEADS_UP_DISPLAY.ABBREVIATIONS.VALUE:SetTextColor(178, 34, 34)
  176.     end
  177.     if (DICE_SCRIPT_PROJECT.ACCEPT_NUMERIC) then
  178.         HEADS_UP_DISPLAY.NUMERIC_BETS.VALUE:SetTextColor(107, 142, 35)
  179.     else
  180.         HEADS_UP_DISPLAY.NUMERIC_BETS.VALUE:SetTextColor(178, 34, 34)
  181.     end
  182.     if (DICE_SCRIPT_PROJECT.BROADCAST_MESSAGES) then
  183.         HEADS_UP_DISPLAY.BROADCAST_MESSAGES.VALUE:SetTextColor(107, 142, 35)
  184.     else
  185.         HEADS_UP_DISPLAY.BROADCAST_MESSAGES.VALUE:SetTextColor(178, 34, 34)
  186.     end
  187. end
  188. function CountItemsOfIDs(container, IDs)
  189.     if (container == nil) then
  190.         return 0
  191.     end
  192.     local tempTotal = 0
  193.     for iterator, itemID in ipairs(IDs) do
  194.         tempTotal = tempTotal + container:CountItemsOfID(itemID)
  195.     end
  196.     return tempTotal
  197. end
  198.  
  199. function CountCash(container, cashID)
  200.     local tempTotalCash = 0
  201.     if (type(cashID) == "string") then
  202.         tempTotalCash = tempTotalCash + (container:CountItemsOfID(CASH.CRYSTAL_COIN) * 10000)
  203.         tempTotalCash = tempTotalCash + (container:CountItemsOfID(CASH.PLATINUM_COIN) * 100)
  204.     else
  205.         if (cashID == CASH.CRYSTAL_COIN) then
  206.             tempTotalCash = tempTotalCash + (container:CountItemsOfID(CASH.CRYSTAL_COIN) * 10000)
  207.         elseif (cashID == CASH.PLATINUM_COIN) then
  208.             tempTotalCash = tempTotalCash + (container:CountItemsOfID(CASH.PLATINUM_COIN) * 100)
  209.         end
  210.     end
  211.     return tempTotalCash
  212. end
  213.  
  214. function MoveCash(fromContainer, toContainer, cashID, amount, delay)
  215.     if (toContainer:Index() == 0 or toContainer:Index() == 1) then
  216.         local tempPositionX, tempPositionY, tempPositionZ = 0, 0, 0
  217.         if (toContainer:Index() == 0) then
  218.             tempPositionX = COUNTER.X
  219.             tempPositionY = COUNTER.Y
  220.             tempPositionZ = COUNTER.Z
  221.         elseif (toContainer:Index() == 1) then
  222.             tempPositionX = LOCKER.X
  223.             tempPositionY = LOCKER.Y
  224.             tempPositionZ = LOCKER.Z
  225.         end
  226.         for itemFromContainer = fromContainer:ItemCount() - 1, 0, -1 do
  227.             tempItemFromContainer = fromContainer:GetItemData(itemFromContainer)
  228.             if (tempItemFromContainer.id == cashID) then
  229.                 if (tempItemFromContainer.count >= amount) then
  230.                     fromContainer:MoveItemToGround(itemFromContainer, tempPositionX, tempPositionY, tempPositionZ, amount)
  231.                 else
  232.                     fromContainer:MoveItemToGround(itemFromContainer, tempPositionX, tempPositionY, tempPositionZ, tempItemFromContainer.count)
  233.                     amount = amount - tempItemFromContainer.count
  234.                 end
  235.             end
  236.         end
  237.     else
  238.         for itemFromContainer = fromContainer:ItemCount() - 1, 0, -1  do
  239.             tempItemFromContainer = fromContainer:GetItemData(itemFromContainer)
  240.             if (tempItemFromContainer.id == cashID) then
  241.                 if (tempItemFromContainer.count >= amount) then
  242.                     fromContainer:MoveItemToContainer(itemFromContainer, toContainer:Index(), toContainer:ItemCount() + 1, amount)
  243.                 else
  244.                     fromContainer:MoveItemToContainer(itemFromContainer, toContainer:Index(), toContainer:ItemCount() + 1, tempItemFromContainer.count)
  245.                     amount = amount - tempItemFromContainer.count
  246.                 end
  247.             end
  248.         end
  249.     end
  250.     wait(delay + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  251. end
  252.  
  253. function Win()
  254.     local jackpot = PLAYER.BALANCE + (DICE_SCRIPT_PROJECT.PAYOUT_PERCENTAGE * PLAYER.BALANCE / 100)
  255.     local payout = jackpot
  256.     if (payout > 0) then
  257.         if (WON_BET_ITEM_ID > 0) then
  258.             for itemMainBackpack = CONTAINERS.DEPOTLOCK:ItemCount()-1, 0, -1 do
  259.                 if (CONTAINERS.DEPOTLOCK:GetItemData(itemMainBackpack).id == WON_BET_ITEM_ID) then
  260.                     CONTAINERS.DEPOTLOCK:UseItem(itemMainBackpack, true)
  261.                     wait(500 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  262.                     break
  263.                 end
  264.             end
  265.         end
  266.         local cc_amount, plat_amount = 0, 0
  267.         while payout >= 10000 do
  268.             cc_amount = cc_amount + 1
  269.             payout = payout - 10000
  270.         end
  271.         while payout >= 100 do
  272.             plat_amount = plat_amount + 1
  273.             payout = payout - 100
  274.         end
  275.         if (DICE_SCRIPT_PROJECT.SHOW_STATS_HUD) then
  276.             HEADS_UP_DISPLAY.BETS.LOST.AMOUNT_RAW = HEADS_UP_DISPLAY.BETS.LOST.AMOUNT_RAW + 1
  277.             HEADS_UP_DISPLAY.BETS.LOST.AMOUNT_CASH = HEADS_UP_DISPLAY.BETS.LOST.AMOUNT_CASH + (cc_amount * 10000) + (plat_amount * 100)
  278.             HEADS_UP_DISPLAY.BETS.LOST.AMOUNT:SetText(tostring(HEADS_UP_DISPLAY.BETS.LOST.AMOUNT_RAW).." ("..tostring(HEADS_UP_DISPLAY.BETS.LOST.AMOUNT_CASH/1000).."k)")
  279.             HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_RAW = HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_RAW + 1
  280.             HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_CASH = HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_CASH - HEADS_UP_DISPLAY.BETS.LOST.AMOUNT_CASH
  281.             if (HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_CASH > 0) then
  282.                 HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT:SetTextColor(107, 142, 35)
  283.             elseif (HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_CASH == 0) then
  284.                 HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT:SetTextColor(255, 255, 255)
  285.             else
  286.                 HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT:SetTextColor(178, 34, 34)
  287.             end
  288.             HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT:SetText(tostring(HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_RAW).." ("..tostring(math.floor(HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_CASH/1000)).."k)")
  289.         end
  290.         for iterator, value in pairs(GAMBLE_OPTION) do
  291.             if (value == PLAYER.OPTION) then
  292.                 print(PLAYER.LAST_SEEN.." won "..(jackpot/1000).."k - High/Low: "..iterator.." - Payout: "..cc_amount.." cc + "..plat_amount.." plats.")
  293.                 break
  294.             end
  295.         end
  296.         if (plat_amount > 0) then
  297.             MoveCash(CONTAINERS.PLATINUM_COINS_BACKPACK, CONTAINERS.COUNTER_BROWSE_FIELD, CASH.PLATINUM_COIN, plat_amount, 300)
  298.         end
  299.         if (cc_amount > 0) then
  300.             MoveCash(CONTAINERS.CRYSTAL_COINS_BACKPACK, CONTAINERS.COUNTER_BROWSE_FIELD, CASH.CRYSTAL_COIN, cc_amount, 300)
  301.         end
  302.         if (DICE_SCRIPT_PROJECT.SHOW_STATS_HUD) then
  303.             HEADS_UP_DISPLAY.AMOUNT_CASH.DISPLAY_CRYSTAL.AMOUNT:SetText(tostring(CountCash(CONTAINERS.CRYSTAL_COINS_BACKPACK, CASH.CRYSTAL_COIN)/1000).."k")
  304.             HEADS_UP_DISPLAY.AMOUNT_CASH.DISPLAY_PLATINUM.AMOUNT:SetText(tostring(CountCash(CONTAINERS.PLATINUM_COINS_BACKPACK, CASH.PLATINUM_COIN)/1000).."k")
  305.         end
  306.     end
  307. end
  308.  
  309. function Lose()
  310.     if (DICE_SCRIPT_PROJECT.SHOW_STATS_HUD) then
  311.         HEADS_UP_DISPLAY.BETS.WON.AMOUNT_RAW = HEADS_UP_DISPLAY.BETS.WON.AMOUNT_RAW + 1
  312.         HEADS_UP_DISPLAY.BETS.WON.AMOUNT_CASH = HEADS_UP_DISPLAY.BETS.WON.AMOUNT_CASH + PLAYER.BALANCE
  313.         HEADS_UP_DISPLAY.BETS.WON.AMOUNT:SetText(tostring(HEADS_UP_DISPLAY.BETS.WON.AMOUNT_RAW).." ("..tostring(HEADS_UP_DISPLAY.BETS.WON.AMOUNT_CASH/1000).."k)")
  314.         HEADS_UP_DISPLAY.AMOUNT_CASH.DISPLAY_CRYSTAL.AMOUNT:SetText(tostring(CountCash(CONTAINERS.CRYSTAL_COINS_BACKPACK, CASH.CRYSTAL_COIN)/1000).."k")
  315.         HEADS_UP_DISPLAY.AMOUNT_CASH.DISPLAY_PLATINUM.AMOUNT:SetText(tostring(CountCash(CONTAINERS.PLATINUM_COINS_BACKPACK, CASH.PLATINUM_COIN)/1000).."k")
  316.         HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_RAW = HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_RAW + 1
  317.         HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_CASH = HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_CASH + HEADS_UP_DISPLAY.BETS.WON.AMOUNT_CASH
  318.         if (HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_CASH > 0) then
  319.             HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT:SetTextColor(107, 142, 35)
  320.         elseif (HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_CASH == 0) then
  321.             HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT:SetTextColor(255, 255, 255)
  322.         else
  323.             HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT:SetTextColor(178, 34, 34)
  324.         end
  325.         HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT:SetText(tostring(HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_RAW).." ("..tostring(math.floor(HEADS_UP_DISPLAY.BETS.OUTCOME.AMOUNT_CASH/1000)).."k)")
  326.     end
  327.     if (LOST_BET_ITEM_ID > 0) then
  328.         for itemMainBackpack = CONTAINERS.DEPOTLOCK:ItemCount()-1, 0, -1 do
  329.             if (CONTAINERS.DEPOTLOCK:GetItemData(itemMainBackpack).id == LOST_BET_ITEM_ID) then
  330.                 CONTAINERS.DEPOTLOCK:UseItem(itemMainBackpack, true)
  331.                 wait(200)
  332.                 CONTAINERS.DEPOTLOCK:UseItem(itemMainBackpack, true)
  333.                 break
  334.             end
  335.         end
  336.     end
  337.     for iterator, value in pairs(GAMBLE_OPTION) do
  338.         if (value == PLAYER.OPTION) then
  339.             print(PLAYER.LAST_SEEN.." lost "..(PLAYER.BALANCE/1000).."k - High/Low: "..iterator)
  340.             break
  341.         end
  342.     end
  343. end
  344.  
  345. function ReachGlowingSwitch()
  346.     local GlowingSwitches = {}
  347.     local AvailablePairsOfSwitches = {}
  348.     local posz = Self.Position().z
  349.     for iterator, switchID in ipairs(GLOWING_SWITCH_ID) do
  350.         for posx = 7, -7, -1 do
  351.             for posy = 5, -5, -1 do
  352.                 if (switchID == Map.GetTopUseItem(Self.Position().x + posx, Self.Position().y + posy, posz).id) then
  353.                     for posx_pair = -2, 2, 2 do
  354.                         for posy_pair = -2, 2, 2 do
  355.                             if not (Self.Position().x + posx == Self.Position().x + posx + posx_pair and Self.Position().y + posy == Self.Position().y + posy + posy_pair) then
  356.                                 if (switchID == Map.GetTopUseItem(Self.Position().x + posx + posx_pair, Self.Position().y + posy + posy_pair, posz).id) then
  357.                                     local insertSwitch = false
  358.                                     if(#GlowingSwitches <= 0) then
  359.                                         insertSwitch = true
  360.                                     else
  361.                                         local opx, opy = Self.Position().x + posx, Self.Position().y + posy
  362.                                         local px, py = Self.Position().x + posx + posx_pair, Self.Position().y + posy + posy_pair
  363.                                         for iterator, PairsOfSwitches in ipairs(GlowingSwitches) do
  364.                                             if (PairsOfSwitches.Operator.x == px and PairsOfSwitches.Operator.y == py) and
  365.                                                 (PairsOfSwitches.Player.x == opx and PairsOfSwitches.Player.y == opy) then
  366.                                                 insertSwitch = false
  367.                                                 break
  368.                                             else
  369.                                                 insertSwitch = true
  370.                                             end
  371.                                         end
  372.                                     end
  373.                                     if (insertSwitch) then
  374.                                         table.insert(GlowingSwitches, { Operator = { x = Self.Position().x + posx, y = Self.Position().y + posy },
  375.                                                                         Player = { x = Self.Position().x + posx + posx_pair, y = Self.Position().y + posy + posy_pair } } )
  376.                                     end
  377.                                 end
  378.                             end
  379.                         end
  380.                     end
  381.                 end
  382.             end
  383.         end
  384.     end
  385.     print("Found "..#GlowingSwitches.." pairs of switches.")
  386.     local GlowingSwitchReached = false
  387.     while not GlowingSwitchReached do
  388.         for iterator, PairsOfSwitches in ipairs(GlowingSwitches) do
  389.             Self.UseItemFromGround(PairsOfSwitches.Operator.x, PairsOfSwitches.Operator.y, posz)
  390.             local prevPosition = Self.Position()
  391.             wait(500 + DICE_SCRIPT_PROJECT.PING_COMPENSATION, 1000 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  392.             if Self.DistanceFromPosition(prevPosition.x, prevPosition.y, posz) >= 1 then
  393.                 while Self.DistanceFromPosition(PairsOfSwitches.Operator.x, PairsOfSwitches.Operator.y, posz) > 1 do
  394.                     Self.UseItemFromGround(PairsOfSwitches.Operator.x, PairsOfSwitches.Operator.y, posz)
  395.                     wait(100 + DICE_SCRIPT_PROJECT.PING_COMPENSATION, 200 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  396.                 end
  397.                 if(PairsOfSwitches.Operator.x < Self.Position().x) then
  398.                     Self.Step(WEST)
  399.                     GlowingSwitchReached = true
  400.                     break
  401.                 elseif(PairsOfSwitches.Operator.x > Self.Position().x) then
  402.                     Self.Step(EAST)
  403.                     GlowingSwitchReached = true
  404.                     break
  405.                 elseif(PairsOfSwitches.Operator.y < Self.Position().y) then
  406.                     Self.Step(NORTH)
  407.                     GlowingSwitchReached = true
  408.                     break
  409.                 elseif(PairsOfSwitches.Operator.y > Self.Position().y) then
  410.                     Self.Step(SOUTH)
  411.                     GlowingSwitchReached = true
  412.                     break
  413.                 else
  414.                     GlowingSwitchReached = true
  415.                     break
  416.                 end
  417.             end
  418.         end
  419.     end
  420.     print("Depot found!")
  421.     wait(100 + DICE_SCRIPT_PROJECT.PING_COMPENSATION, 400 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  422.     return true
  423. end
  424.  
  425. function UpdateSystemCoordinates()
  426.     local posx = Self.Position().x
  427.     local posy = Self.Position().y
  428.     local posz = Self.Position().z
  429.     LOCKER.Z = posz
  430.     for x = -1, 1 do
  431.         for y = -1, 1 do
  432.             if (table.contains(LOCKER_ID, Map.GetTopUseItem(posx + x, posy + y, Self.Position().z).id)) then
  433.                 LOCKER.X = posx + x
  434.                 LOCKER.Y =  posy + y
  435.             end
  436.         end
  437.     end
  438.     COUNTER.Z = posz
  439.     for x = -1, 1 do
  440.         for y = -1, 1 do
  441.             if (table.contains(COUNTER_ID, Map.GetTopUseItem(posx + x, posy + y, Self.Position().z).id)) then
  442.                 COUNTER.X = posx + x
  443.                 COUNTER.Y =  posy + y
  444.             end
  445.         end
  446.     end
  447.     DUSTBIN.Z = posz
  448.     for x = -7, 7 do
  449.         for y = -5, 5 do
  450.             if (table.contains(DUSTBIN_ID, Map.GetTopUseItem(posx + x, posy + y, Self.Position().z).id)) then
  451.                 DUSTBIN.X = posx + x
  452.                 DUSTBIN.Y =  posy + y
  453.             end
  454.         end
  455.     end
  456.     PLAYER.SPOT.Z = posz
  457.     if (COUNTER.X == posx - 1) then
  458.         if (COUNTER.Y == posy - 1) then
  459.             if (LOCKER.X == posx - 1 and LOCKER.Y == posy) then
  460.                 PLAYER.SPOT.X = posx
  461.                 PLAYER.SPOT.Y = posy - 2
  462.             elseif (LOCKER.X == posx and LOCKER.Y == posy - 1) then
  463.                 PLAYER.SPOT.X = posx - 2
  464.                 PLAYER.SPOT.Y = posy
  465.             end
  466.         elseif (COUNTER.Y == posy + 1) then
  467.             if (LOCKER.X == posx - 1 and LOCKER.Y == posy) then
  468.                 PLAYER.SPOT.X = posx
  469.                 PLAYER.SPOT.Y = posy + 2
  470.             elseif (LOCKER.X == posx and LOCKER.Y == posy + 1) then
  471.                 PLAYER.SPOT.X = posx - 2
  472.                 PLAYER.SPOT.Y = posy
  473.             end
  474.         end
  475.     elseif (COUNTER.X == posx + 1) then
  476.         if (COUNTER.Y == posy - 1) then
  477.             if (LOCKER.X == posx + 1 and LOCKER.Y == posy) then
  478.                 PLAYER.SPOT.X = posx
  479.                 PLAYER.SPOT.Y = posy - 2
  480.             elseif (LOCKER.X == posx and LOCKER.Y == posy - 1) then
  481.                 PLAYER.SPOT.X = posx + 2
  482.                 PLAYER.SPOT.Y = posy
  483.             end
  484.         elseif (COUNTER.Y == posy + 1) then
  485.             if (LOCKER.X == posx + 1 and LOCKER.Y == posy) then
  486.                 PLAYER.SPOT.X = posx
  487.                 PLAYER.SPOT.Y = posy + 2
  488.             elseif (LOCKER.X == posx and LOCKER.Y == posy + 1) then
  489.                 PLAYER.SPOT.X = posx + 2
  490.                 PLAYER.SPOT.Y = posy
  491.             end
  492.         end
  493.     end
  494. end
  495.  
  496. function CheckDiceAndDecoration()
  497.     if (DECORATION_ITEM_ID > 0) then
  498.         if (CONTAINERS.LOCKER_BROWSE_FIELD:CountItemsOfID(DECORATION_ITEM_ID) < 1) then
  499.             if (Container.New(2):CountItemsOfID(DECORATION_ITEM_ID) >= 1) then
  500.                 for itemMainBackpack = Container.New(2):ItemCount() - 1, 0, -1 do
  501.                     local tempItemMainBackpack = Container.New(2):GetItemData(itemMainBackpack)
  502.                     if (DECORATION_ITEM_ID == tempItemMainBackpack.id) then
  503.                         Container.New(2):MoveItemToGround(itemMainBackpack, LOCKER.X, LOCKER.Y, LOCKER.Z, 1)
  504.                         wait(300 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  505.                         break
  506.                     end
  507.                 end
  508.             end
  509.         end
  510.     end
  511.     local DiceInLocker = CountItemsOfIDs(CONTAINERS.LOCKER_BROWSE_FIELD, DICE_ID)
  512.     if (DiceInLocker < 1) then
  513.         local AmountOfDice = CountItemsOfIDs(Container.New(2), DICE_ID)
  514.         if (AmountOfDice >= 1) then
  515.             for itemMainBackpack = Container.New(2):ItemCount() - 1, 0, -1 do
  516.                 local tempItemMainBackpack = Container.New(2):GetItemData(itemMainBackpack)
  517.                 if table.contains(DICE_ID, tempItemMainBackpack.id) then
  518.                     Container.New(2):MoveItemToGround(itemMainBackpack, LOCKER.X, LOCKER.Y, LOCKER.Z, 1)
  519.                     wait(300 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  520.                     break
  521.                 end
  522.             end
  523.         end
  524.     end
  525. end
  526. function EffectMessage(proxy, message, x, y, z)
  527.     if (LOADING_COMPLETE) then
  528.         local ROLLED_NUMBER = string.match(message, Self.Name().." rolled a (.+).")
  529.         if(ROLLED_NUMBER) then
  530.             ROLLED_NUMBER = ROLLED_NUMBER + 0
  531.             local PlayerWon = false
  532.             if (PLAYER.OPTION == GAMBLE_OPTION.LOW) then
  533.                 if (ROLLED_NUMBER >= 1 and ROLLED_NUMBER <= 3) then
  534.                     PlayerWon = true
  535.                 end
  536.             elseif (PLAYER.OPTION == GAMBLE_OPTION.HIGH) then
  537.                 if (ROLLED_NUMBER >= 4 and ROLLED_NUMBER <= 6) then
  538.                     PlayerWon = true
  539.                 end
  540.             end
  541.             if (PlayerWon) then
  542.                 Win()
  543.             else
  544.                 Lose()
  545.             end
  546.         end
  547.     end
  548. end
  549.  
  550. function LocalSpeech(proxy, mtype, speaker, level, text)
  551.     if (LOADING_COMPLETE) then
  552.         if (Creature(speaker):Position().x == PLAYER.SPOT.X and
  553.             Creature(speaker):Position().y == PLAYER.SPOT.Y and
  554.             Creature(speaker):Position().z == PLAYER.SPOT.Z) then
  555.             text = text:trim():lower()
  556.             if (DICE_SCRIPT_PROJECT.ACCEPT_ABBREVIATIONS) then
  557.                 if (text == "h") or (text == "l") then
  558.                     if (text == "h") then
  559.                         PLAYER.OPTION = GAMBLE_OPTION.HIGH
  560.                     elseif (text == "l") then
  561.                         PLAYER.OPTION = GAMBLE_OPTION.LOW
  562.                     end
  563.                 else
  564.                     PLAYER.OPTION = GAMBLE_OPTION.NONE
  565.                 end
  566.             end
  567.             if (DICE_SCRIPT_PROJECT.ACCEPT_NUMERIC) then
  568.                 if (text == "456") or (text == "123") then
  569.                     if (text == "456") then
  570.                         PLAYER.OPTION = GAMBLE_OPTION.HIGH
  571.                     elseif (text == "123") then
  572.                         PLAYER.OPTION = GAMBLE_OPTION.LOW
  573.                     end
  574.                 else
  575.                     PLAYER.OPTION = GAMBLE_OPTION.NONE
  576.                 end
  577.             end
  578.             if (text == "high") or (text == "low") then
  579.                 if (text == "high") then
  580.                     PLAYER.OPTION = GAMBLE_OPTION.HIGH
  581.                 elseif (text == "low") then
  582.                     PLAYER.OPTION = GAMBLE_OPTION.LOW
  583.                 end
  584.             else
  585.                 PLAYER.OPTION = GAMBLE_OPTION.NONE
  586.             end
  587.             if (PLAYER.OPTION ~= GAMBLE_OPTION.NONE) then
  588.                 PLAYER.BALANCE = CountCash(CONTAINERS.COUNTER_BROWSE_FIELD, "all")
  589.                 if (PLAYER.BALANCE >= DICE_SCRIPT_PROJECT.MINIMUM_BET and PLAYER.BALANCE <= DICE_SCRIPT_PROJECT.MAXIMUM_BET) then
  590.                     print(speaker.."'s balance: "..PLAYER.BALANCE)
  591.                     MoveCash(CONTAINERS.COUNTER_BROWSE_FIELD, CONTAINERS.MAIN_BACKPACK, CASH.CRYSTAL_COIN, 100, 500)
  592.                     MoveCash(CONTAINERS.COUNTER_BROWSE_FIELD, CONTAINERS.MAIN_BACKPACK, CASH.PLATINUM_COIN, 100, 500)
  593.                     local authPlayerBalance = CountCash(CONTAINERS.MAIN_BACKPACK, "all")
  594.                     print(speaker.."'s balance authentication: "..authPlayerBalance)
  595.                     if (PLAYER.BALANCE == authPlayerBalance) then
  596.                         PLAYER.LAST_SEEN = speaker
  597.                         PLAYER.BALANCE = authPlayerBalance
  598.                         MoveCash(CONTAINERS.MAIN_BACKPACK, CONTAINERS.CRYSTAL_COINS_BACKPACK, CASH.CRYSTAL_COIN, 100, 500)
  599.                         MoveCash(CONTAINERS.MAIN_BACKPACK, CONTAINERS.PLATINUM_COINS_BACKPACK, CASH.PLATINUM_COIN, 100, 500)
  600.                         if (DECORATION_ITEM_ID > 0) then
  601.                             CONTAINERS.LOCKER_BROWSE_FIELD:UseItem(2, true)
  602.                         else
  603.                             CONTAINERS.LOCKER_BROWSE_FIELD:UseItem(1, true)
  604.                         end
  605.                     else
  606.                         MoveCash(CONTAINERS.MAIN_BACKPACK, CONTAINERS.COUNTER_BROWSE_FIELD, CASH.CRYSTAL_COIN, 100, 500)
  607.                         MoveCash(CONTAINERS.MAIN_BACKPACK, CONTAINERS.COUNTER_BROWSE_FIELD, CASH.PLATINUM_COIN, 100, 500)
  608.                         print("Warning: Player took cash back.")
  609.                     end
  610.                 end
  611.             end
  612.         end
  613.     end
  614. end
  615. if (DICE_SCRIPT_PROJECT.BROADCAST_MESSAGES) then
  616.     Module.New('DICE_SCRIPT_PROJECT: BROADCASTER', function(moduleObject)
  617.         if (LOADING_COMPLETE) then
  618.             local PlayersAround = false
  619.             for name, creature in Creature.iPlayers(2) do
  620.                 if (name ~= nil) then
  621.                     PlayersAround = true
  622.                     break
  623.                 end
  624.             end
  625.             if not PlayersAround then
  626.                 local broadcast = string.upper(Self.Name()).."'S CASINO: HIGH/LOW"
  627.                 if (DICE_SCRIPT_PROJECT.ACCEPT_ABBREVIATIONS) then
  628.                     broadcast = broadcast..", H/L"
  629.                 end
  630.                 if (DICE_SCRIPT_PROJECT.ACCEPT_NUMERIC) then
  631.                     broadcast = broadcast..", 123/456"
  632.                 end
  633.                 broadcast = broadcast.." - MIN "..(DICE_SCRIPT_PROJECT.MINIMUM_BET/1000).."K / MAX "..(DICE_SCRIPT_PROJECT.MAXIMUM_BET/1000).."K - "..DICE_SCRIPT_PROJECT.PAYOUT_PERCENTAGE.."% PAYOUT"
  634.                 Self.Say(broadcast)
  635.             end
  636.             moduleObject:Delay(math.random(30 * 1000, 60 * 1000))
  637.         end
  638.     end)
  639. end
  640.  
  641. if (DICE_SCRIPT_PROJECT.USE_PARTY_HAT) then
  642.     Module.New('DICE_SCRIPT_PROJECT: PARTY-HAT', function(moduleObject)
  643.         if (LOADING_COMPLETE) then
  644.             if (Self.Head().id == Item.GetID("party hat")) then
  645.                 Self.UseItemFromEquipment("head")
  646.                 moduleObject:Delay(1500)
  647.             end
  648.         end
  649.     end)
  650. end
  651.  
  652. Module.New('DICE_SCRIPT_PROJECT: ANTI-TRASHER', function(moduleObject)
  653.     if (LOADING_COMPLETE) then
  654.         for itemCounter = CONTAINERS.COUNTER_BROWSE_FIELD:ItemCount() - 1, 0, -1  do
  655.             local tempItemCounter = CONTAINERS.COUNTER_BROWSE_FIELD:GetItemData(itemCounter)
  656.             if not table.contains(CASH_ID, tempItemCounter.id) then
  657.                 print("Throw: "..tempItemCounter.count.." "..Item.GetName(tempItemCounter.id).." - Counter >> Dustbin")
  658.                 CONTAINERS.COUNTER_BROWSE_FIELD:MoveItemToGround(itemCounter, DUSTBIN.X, DUSTBIN.Y, DUSTBIN.Z, tempItemCounter.count) -- dustbin
  659.             else
  660.                 local CashToExchange = CONTAINERS.COUNTER_BROWSE_FIELD:CountItemsOfID(CASH.PLATINUM_COIN)
  661.                 if CashToExchange >= 100 then
  662.                     MoveCash(CONTAINERS.COUNTER_BROWSE_FIELD, CONTAINERS.MAIN_BACKPACK, CASH.PLATINUM_COIN, 100, 500)
  663.                     local authCashToExchange = CountCash(CONTAINERS.MAIN_BACKPACK, CASH.PLATINUM_COIN)
  664.                     if authCashToExchange == 10000 then
  665.                         print("Exchange: 100 Platinum coins >> 1 Crystal coin")
  666.                         MoveCash(CONTAINERS.MAIN_BACKPACK, CONTAINERS.PLATINUM_COINS_BACKPACK, CASH.PLATINUM_COIN,  100, 200)
  667.                         MoveCash(CONTAINERS.CRYSTAL_COINS_BACKPACK, CONTAINERS.COUNTER_BROWSE_FIELD, CASH.CRYSTAL_COIN, 1, 200)
  668.                     else
  669.                         print("Warning: Player changed cash amount.")
  670.                         MoveCash(CONTAINERS.MAIN_BACKPACK, CONTAINERS.COUNTER_BROWSE_FIELD, CASH.PLATINUM_COIN,  100, 200)
  671.                         return false
  672.                     end
  673.                 else
  674.                     return false
  675.                 end
  676.             end
  677.         end
  678.     end
  679.     if (CONTAINERS.LOCKER_BROWSE_FIELD ~= nil) then
  680.         for itemLocker = 0, CONTAINERS.LOCKER_BROWSE_FIELD:ItemCount() - 1 do
  681.             local tempItemLocker = CONTAINERS.LOCKER_BROWSE_FIELD:GetItemData(itemLocker)
  682.             if not table.contains(LOCKER_ID, tempItemLocker.id) then
  683.                 if not table.contains(DICE_ID, tempItemLocker.id) then
  684.                     if not table.contains(CASH_ID, tempItemLocker.id) then
  685.                         if (DECORATION_ITEM_ID > 0) then
  686.                             if not (DECORATION_ITEM_ID == tempItemLocker.id) then
  687.                                 print("Throw: "..tempItemLocker.count.." "..Item.GetName(tempItemLocker.id).." - Locker >> Dustbin")
  688.                                 CONTAINERS.LOCKER_BROWSE_FIELD:MoveItemToGround(itemLocker, DUSTBIN.X, DUSTBIN.Y, DUSTBIN.Z, tempItemLocker.count) -- dustbin
  689.                             end
  690.                         end
  691.                     else
  692.                         MoveCash(CONTAINERS.LOCKER_BROWSE_FIELD, CONTAINERS.CRYSTAL_COINS_BACKPACK, CASH.CRYSTAL_COIN, 100, 500)
  693.                         MoveCash(CONTAINERS.LOCKER_BROWSE_FIELD, CONTAINERS.PLATINUM_COINS_BACKPACK, CASH.PLATINUM_COIN, 100, 500)
  694.                     end
  695.                 end
  696.             end
  697.         end
  698.     end
  699. end)
  700.  
  701. if (RESTACK_ITEMS) then
  702.     Module.New('DICE_SCRIPT_PROJECT: RE-STACK_ITEMS', function(moduleObject)
  703.         if (LOADING_COMPLETE) then
  704.             if(CONTAINERS.PLATINUM_COINS_BACKPACK:ItemCount() >= 2) then
  705.                 for itemPlatinumCoin = CONTAINERS.PLATINUM_COINS_BACKPACK:ItemCount() - 1, 0, -1 do
  706.                     if not (itemPlatinumCoin == 0) then
  707.                         local item_temp = CONTAINERS.PLATINUM_COINS_BACKPACK:GetItemData(itemPlatinumCoin)
  708.                         local item_prev_temp = CONTAINERS.PLATINUM_COINS_BACKPACK:GetItemData(itemPlatinumCoin-1)
  709.                         if(item_temp.count < item_prev_temp.count) then
  710.                             CONTAINERS.PLATINUM_COINS_BACKPACK:MoveItemToContainer(itemPlatinumCoin, CONTAINERS.PLATINUM_COINS_BACKPACK:Index(), 0)
  711.                             print("Restack Items: Moving "..item_temp.count.." platinum coins to beginning of the stack.")
  712.                         end
  713.                     end
  714.                 end
  715.             end
  716.             if(CONTAINERS.CRYSTAL_COINS_BACKPACK:ItemCount() >= 2) then
  717.                 for itemCrystalCoin = CONTAINERS.CRYSTAL_COINS_BACKPACK:ItemCount() - 1, 0, -1 do
  718.                     if not (itemCrystalCoin == 0) then
  719.                         local item_temp = CONTAINERS.CRYSTAL_COINS_BACKPACK:GetItemData(itemCrystalCoin)
  720.                         local item_prev_temp = CONTAINERS.CRYSTAL_COINS_BACKPACK:GetItemData(itemCrystalCoin-1)
  721.                         if(item_temp.count < item_prev_temp.count) then
  722.                             CONTAINERS.CRYSTAL_COINS_BACKPACK:MoveItemToContainer(itemCrystalCoin, CONTAINERS.CRYSTAL_COINS_BACKPACK:Index(), 0)
  723.                             print("Restack Items: Moving "..item_temp.count.." crystal coins to beginning of the stack.")
  724.                         end
  725.                     end
  726.                 end
  727.             end
  728.             moduleObject:Delay(200 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  729.         end
  730.     end)
  731. end
  732.  
  733. Module.New('DICE_SCRIPT_PROJECT: TURN-PLAYER', function(moduleObject)
  734.     if (LOADING_COMPLETE) then
  735.         local Potential_Gambler_Detected = false
  736.         local posx = Self.Position().x
  737.         local posy = Self.Position().y
  738.         local lookDirection = Self.LookDirection()
  739.         for name, creature in Creature.iPlayers(2) do
  740.             if (creature:Position().x == PLAYER.SPOT.X and
  741.                 creature:Position().y == PLAYER.SPOT.Y and
  742.                 creature:Position().z == PLAYER.SPOT.Z) then
  743.                 Potential_Gambler_Detected = true
  744.                 break
  745.             end
  746.         end
  747.         if (Potential_Gambler_Detected) then
  748.             if (PLAYER.SPOT.X < posx) then
  749.                 if (lookDirection ~= WEST) then
  750.                     Self.Turn(WEST)
  751.                 end
  752.             elseif (PLAYER.SPOT.X > posx) then
  753.                 if (lookDirection ~= EAST) then
  754.                     Self.Turn(EAST)
  755.                 end
  756.             else
  757.                 if (PLAYER.SPOT.Y < posy) then
  758.                     if (lookDirection ~= NORTH) then
  759.                         Self.Turn(NORTH)
  760.                     end
  761.                 elseif (PLAYER.SPOT.Y > posy) then
  762.                     if (lookDirection ~= SOUTH) then
  763.                         Self.Turn(SOUTH)
  764.                     end
  765.                 else
  766.                     print("Error: Self character is the potential gambler.")
  767.                 end
  768.             end
  769.         else
  770.             if (LOCKER.X < posx) then
  771.                 if (lookDirection ~= EAST) then
  772.                     Self.Turn(EAST)
  773.                 end
  774.             elseif (LOCKER.X > posx) then
  775.                 if (lookDirection ~= WEST) then
  776.                     Self.Turn(WEST)
  777.                 end
  778.             else
  779.                 if (LOCKER.Y < posy) then
  780.                     if (lookDirection ~= SOUTH) then
  781.                         Self.Turn(SOUTH)
  782.                     end
  783.                 elseif (LOCKER.Y > posy) then
  784.                     if (lookDirection ~= NORTH) then
  785.                         Self.Turn(NORTH)
  786.                     end
  787.                 else
  788.                     print("Error: Self character is above locker.")
  789.                 end
  790.             end
  791.         end
  792.         moduleObject:Delay(1000)
  793.     end
  794. end)
  795.  
  796. Module.New('DICE_SCRIPT_PROJECT: MAIN_MODULE', function(moduleObject)
  797.     local DP_IDS = {3497, 3498, 3499, 3500}
  798.     local DP_POSITIONS = {}
  799.    
  800.     Client.HideEquipment()
  801.     while #Container.GetAll() ~= 6 do
  802.         LOADING_COMPLETE = false
  803.         if (ReachGlowingSwitch()) then
  804.             wait(100 + DICE_SCRIPT_PROJECT.PING_COMPENSATION, 300 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  805.             UpdateSystemCoordinates()
  806.             for i = 0, 15 do
  807.                 closeContainer(i)
  808.             end
  809.             if Self.BrowseField(COUNTER.X, COUNTER.Y, COUNTER.Z) == 1 then
  810.                 wait(100 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  811.                 CONTAINERS.COUNTER_BROWSE_FIELD = Container.New(0)
  812.             end
  813.             if Self.BrowseField(LOCKER.X, LOCKER.Y, LOCKER.Z) == 1 then
  814.                 wait(100 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  815.                 CONTAINERS.LOCKER_BROWSE_FIELD = Container.New(1)
  816.             end
  817.            
  818.  
  819.            
  820.             --Self.OpenMainBackpack(false)
  821.             Self.OpenDepot()
  822.             wait(100 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  823.             Container.New(2):OpenChildren("Purple Backpack")
  824.             wait(100 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  825.             CONTAINERS.MAIN_BACKPACK = Container.New(3)
  826.             Container.New(3):OpenChildren({DICE_SCRIPT_PROJECT.CRYSTAL_COINS_BACKPACK, false})
  827.             wait(100 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  828.             CONTAINERS.CRYSTAL_COINS_BACKPACK = Container.New(4)
  829.             Container.New(3):OpenChildren({DICE_SCRIPT_PROJECT.PLATINUM_COINS_BACKPACK, false})
  830.             wait(100 + DICE_SCRIPT_PROJECT.PING_COMPENSATION)
  831.             CONTAINERS.PLATINUM_COINS_BACKPACK = Container.New(5)
  832.             CheckDiceAndDecoration()
  833.            
  834.         end
  835.     end
  836.     CONTAINERS.COUNTER_BROWSE_FIELD = Container.New(0)
  837.     CONTAINERS.LOCKER_BROWSE_FIELD = Container.New(1)
  838.     CONTAINERS.DEPOTLOCK = Container.New(2)
  839.     CONTAINERS.MAIN_BACKPACK = Container.New(3)
  840.     CONTAINERS.CRYSTAL_COINS_BACKPACK = Container.New(4)
  841.     CONTAINERS.PLATINUM_COINS_BACKPACK = Container.New(5)
  842.     CheckDiceAndDecoration()
  843.     LOADING_COMPLETE = true
  844. end)
  845. LocalSpeechProxy.OnReceive("LocalSpeech", LocalSpeech)
  846. EffectMessageProxy.OnReceive("EffectMessage", EffectMessage)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement