Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------
- -- Configuration --
- ---------------------------
- -- Containers --
- local Containers = {
- Cash = 'Blue Backpack', -- money backpack
- Items = 'Broacde Backpack' -- need implement
- }
- -- Misc Options--
- local PartyhatTime = 1000 -- in ms
- local Ping = 100 -- set lagging in sent packet to server
- local TimetoKick = 25 -- time to kick from house
- local WarringTimes = 5 -- agresive action agnist you
- local inviterfile_path = 'C:\\Users\\Midaz\\Documents\\XenoBot\\AutoInviter\\main'
- -- Ban list --
- local Banned = { -- list banned players
- {name = 'Charlover', reason = 'no reason', time = os.time() + 99999},
- }
- -- Cast Settings --
- local AutoCast = true
- local CastCommand = "!cast"
- local StopCastCommand = "!cast off"
- -- Bet Config --
- local Bet = {
- Min = 5,
- Max = 50,
- Payout = 90 --%
- }
- --- Positions ---
- local GamblerSQM = {
- {32281, 31120, 7},
- {32282, 31120, 7},
- {32283, 31120, 7},
- {32281, 31121, 7},
- {32282, 31121, 7},
- {32283, 31121, 7},
- {32282, 31122, 7}
- }
- local InviterSQM = { -- valid pos inviting player to house
- {32281, 31123, 7},
- {32282, 31123, 7},
- {32283, 31123, 7}
- }
- local Location = {
- Dice = {32283, 31118, 7}, -- dice sqm position
- Counter = {32282, 31119, 7, id = 2326}, -- accept cash/items
- Yourself = {32282, 31118, 7}, -- my position
- PayoutCounter = {32283, 31119, 7, id = 2323} -- payout cash here
- }
- local HouseUntrashSQM = {
- inRange = {
- {0, 0, 0, ids = {0}},
- },
- toFar = {
- {0, 0, 6, ids = {408}}
- }
- }
- -------------------------------------
- -- DO NOT TOUCH NOTHING BELOW --
- -------------------------------------
- local PacketIDs = {834, 2796, 2785, 2793, 6114, 2789, 2806, 17972, 6372, 2776, 831, 2804, 2797, 2805, 2802, 2811, 2808, 2801, 6371, 2803, 2791, 2783, 2800, 2778, 833, 2807, 2779, 832, 6115, 2794, 2792, 2799, 2798, 2784, 268}
- local Casino = {}
- local Invited = {}
- local Gambler = {}
- local Balance = {}
- local Interested = {}
- local time = os.clock()
- local Profit = 0
- local Warring = 0
- -- HUDS --
- -- Character Info --
- local HeadHUD = HUD.CreateTextDisplay(5, 55, "Rif's House Casino" , 41, 230, 239)
- local CharinfoHUD = HUD.CreateTextDisplay(5, 75, "Character Info" , 234, 244, 23)
- local HeadingHUD = HUD.CreateTextDisplay(5, 95, "Croupier:", 255, 255, 255)
- local HeadingNameHUD = HUD.CreateTextDisplay(70, 95, Self.Name() , 140, 255, 230)
- local latencyHUD = HUD.CreateTextDisplay(5, 115, "Latency:", 255, 255, 255)
- local latencyvalueHUD = HUD.CreateTextDisplay(69, 115, Self.Ping() .."", 0, 124, 249)
- -- Bet Info --
- local CasinoInfoHUD = HUD.CreateTextDisplay(5, 165, "Bet Info" , 234, 244, 23)
- local PayHUD = HUD.CreateTextDisplay(5, 185, "Payout:", 255, 255, 255)
- local PayoutHUD = HUD.CreateTextDisplay(85, 185, Bet.Payout .."%" , 140, 255, 230)
- local MaxBetHUD = HUD.CreateTextDisplay(5, 205, "Max:", 255, 255, 255)
- local BetMaxHUD = HUD.CreateTextDisplay(86, 205, Bet.Max .."" , 140, 255, 230)
- local MinBetHUD = HUD.CreateTextDisplay(5, 225, "Min:", 255, 255, 255)
- local BetMinHUD = HUD.CreateTextDisplay(87, 225, Bet.Min .."" , 140, 255, 230)
- local BetPingHUD = HUD.CreateTextDisplay(5, 245, "Ping:", 255, 255, 255)
- local BetPingHUD = HUD.CreateTextDisplay(85, 245, Ping .."" ,140, 255, 230)
- -- General Info --
- local GeneralInfoHUD = HUD.CreateTextDisplay(5, 295, "General Info" , 234, 244, 23)
- local StatusHUD = HUD.CreateTextDisplay(5, 315, "Status:", 255, 255, 255)
- local StatusFalseHUD = HUD.CreateTextDisplay(65, 315, "", 255, 20, 10)
- local StatusTrueHUD = HUD.CreateTextDisplay(65, 315, "", 300, 255, 10)
- local BalanceHUD = HUD.CreateTextDisplay(5, 335, "Balance:", 255, 255, 255)
- local BalanceCashHUD = HUD.CreateTextDisplay(66, 335, "0", 140, 255, 230)
- local CustomerHUD = HUD.CreateTextDisplay(5, 355, "Players: 0", 255, 255, 255)
- print([[--/
- House Casino By Rif
- Version 1.2
- Currently Owner:
- Mihelox
- /--]])
- -- FUNCTIONS --
- function Self.GetIDFromPos(x, y, z)
- return (Map.GetTopUseItem(x, y, z).id or Map.GetTopMoveItem(x, y, z).id)
- end
- local Configurations = {
- id = {
- Dice = Self.GetIDFromPos(Location.Dice[1], Location.Dice[2], Location.Dice[3]),
- Counter = Self.GetIDFromPos(Location.Counter[1], Location.Counter[2], Location.Counter[3]),
- Yourself = Self.GetIDFromPos(Location.Yourself[1], Location.Yourself[2], Location.Yourself[3]),
- PayoutCounter = Self.GetIDFromPos(Location.PayoutCounter[1], Location.PayoutCounter[2], Location.PayoutCounter[3]),
- }
- }
- function Self.BanPlayer(name, time, reason)
- if name ~= nil and time ~= nil and reason ~= nil then
- if not table.exist(name, Banned) then
- if type(name) == 'string' then
- if tonumber(time) > 0 then
- table.insert(Banned, {name = name:lower(), reason = reason, time = (os.time() + (time*60))})
- Gambler.Remove()
- Self.Say('Banned ' .. name ..' for '.. reason ..'. Ban time ' ..(math.floor(((os.time() + (time*60)) - os.time())/60)+1) ..' min.')
- Warring = 0
- else
- print('Time need be a number.')
- end
- else
- print('Character name cannot be number!')
- end
- else
- print('This player was banned some time ago.')
- end
- else
- print("Miss some argument in function 'Self.BanPlayer()'")
- end
- end
- function Self.UnbanPlayer(name)
- if table.exist(name, Banned) then
- table.remove(Banned, playerindex)
- Self.Say(name ..' is valid to enter my house!')
- else
- print('This player doesnt exist!')
- end
- end
- function Self.InstalCasino()
- if AutoCast then
- print("Open Cast")
- Self.Say(CastCommand)
- else
- print('Loading...')
- end
- local cashBP = Container.New(Containers.Cash)
- local itemsBP = Container.New(Containers.Items)
- local bro = Container.New('Browse Field')
- while not bro:isOpen() do
- if Self.DistanceFromPosition(Location.Dice[1], Location.Dice[2], Location.Dice[3]) <= 1 then
- Self.BrowseField(Location.Dice[1], Location.Dice[2], Location.Dice[3])
- wait(500+Ping)
- bro = Container.New('Browse Field')
- else
- print('Error in Location.Dice, to far.')
- end
- if bro:isOpen() then
- break
- end
- end
- while not cashBP:isOpen() do
- local cashBpID = Item.GetID(Containers.Cash)
- for spot, item in bro:iItems() do
- if bro:CountItemsOfID(cashBpID) > 0 then
- if cashBpID == item.id then
- bro:UseItem(spot, true)
- wait(500+Ping)
- cashBP = Container.New(Containers.Cash)
- end
- else
- print('Cannot find ' ..Containers.Cash)
- end
- end
- if cashBP:isOpen() then
- break
- end
- end
- while cashBP:isOpen() do
- local cont = Container.GetFirst()
- if cont:CountItemsOfID(3043) <= 0 then
- print('No cash to start the game.')
- else
- if cont:isFull() then
- for spot, item in cont:iItems() do
- if Item.isContainer(item.id) then
- cont:UseItem(spot, true)
- wait(500+Ping)
- end
- end
- else
- print('Casino loaded successfully.')
- break
- end
- end
- end
- Self.SmartSay('Casino House | Min '.. Bet.Min ..' CC | Max '.. Bet.Max ..' CC | Payout '.. Bet.Payout ..'% | Bot&Cast ON! | AUTO INVITER ON |', 2, 5)
- end
- function Self.AcceptCash()
- if Gambler.isExist() then
- local cont = Container.GetFirst()
- local vBasic = cont:CountItemsOfID(3043)
- local playerBalance = Gambler.Cash()
- if Map.GetTopUseItem(Location.Counter[1], Location.Counter[2], Location.Counter[3]).id == 3043 then
- inform = true
- if not cont:isFull() then
- Map.PickupItem(Location.Counter[1], Location.Counter[2], Location.Counter[3], Container.GetFirst():Index(), 19, 100)
- wait(300+Ping)
- player_cash = Gambler.Cash() + cont:CountItemsOfID(3043) - vBasic
- Gambler.InsertCash(player_cash)
- else
- for spot, newbp in Container.GetFirst():iItems() do
- if Item.isContainer(newbp.id) then
- Container.GetFirst():UseItem(spot, true)
- wait(300+Ping)
- end
- end
- end
- end
- if Map.GetTopUseItem(Location.Counter[1], Location.Counter[2], Location.Counter[3]).id ~= 3043 then
- if inform then
- inform = nil
- if playerBalance ~= Gambler.Cash() then
- Self.SmartSay('Balance '..Gambler.Cash(), 0, 10)
- end
- end
- end
- end
- end
- function Self.PayoutCash(toPay)
- local toPayout = toPay
- local vBasic0 = toPay
- while toPay >= 1 do
- local cont = Container.GetFirst()
- if cont:CountItemsOfID(3043) >= 1 then
- for spot, item in cont:iItems() do
- local spot = 0
- if item.id == 3043 then
- local vBasic = cont:CountItemsOfID(3043)
- if toPay < 1 then
- break
- end
- cont:MoveItemToGround(spot, Location.PayoutCounter[1], Location.PayoutCounter[2], Location.PayoutCounter[3], toPay)
- wait(500+Ping)
- toPay = vBasic0 -(vBasic-cont:CountItemsOfID(3043))
- vBasic0 = vBasic0 - (vBasic-cont:CountItemsOfID(3043))
- Gambler.InsertCash(toPay)
- end
- end
- else
- cont:GoBack()
- wait(300+Ping)
- end
- end
- if (toPay < 1) then
- Self.SmartSay('Payoff '..toPayout, 0, 1.2)
- time = os.clock()
- end
- end
- function Self.BetCheck()
- if process_low or process_high then
- if player_bet < Bet.Min then
- process_high, process_low, player_bet = nil, nil, 0
- Self.SmartSay('Minimium '.. Bet.Min, 0, 2)
- elseif player_bet > Bet.Max then
- if Gambler.Cash() >= Bet.Max then
- player_bet = Bet.Max
- Roll = true
- else
- if Gambler.Cash() >= Bet.Min then
- player_bet = Gambler.Cash()
- Roll = true
- else
- process_high, process_low, player_bet = nil, nil, 0
- Self.SmartSay('Minimium '.. Bet.Min, 0, 2)
- end
- end
- elseif player_bet >= Bet.Min and player_bet <= Bet.Max then
- if Gambler.Cash() >= player_bet then
- Roll = true
- else
- if Gambler.Cash() >= Bet.Min and Gambler.Cash() <= Bet.Max then
- player_bet = Gambler.Cash()
- Roll = true
- else
- process_high, process_low, player_bet = nil, nil, 0
- Self.SmartSay('Minimium '.. Bet.Min, 0, 2)
- end
- end
- end
- end
- end
- function Self.UntrashLocations()
- local mapDice = Map.GetTopUseItem(Location.Dice[1], Location.Dice[2], Location.Dice[3]).id
- local mapPayoutCounter = Map.GetTopUseItem(Location.PayoutCounter[1], Location.PayoutCounter[2], Location.PayoutCounter[3]).id
- local mapCounter = Map.GetTopUseItem(Location.Counter[1], Location.Counter[2], Location.Counter[3]).id
- local mapYourself = Map.GetTopUseItem(Location.Yourself[1], Location.Yourself[2], Location.Yourself[3]).id
- function Self.UntrashDice()
- if not table.find({5792, 5793, 5794, 5795, 5796, 5797}, mapDice) then
- Warring = Warring + 1
- if table.find({3043}, mapDice) then
- if Gambler.isExist() then
- Map.MoveItem(Location.Dice[1], Location.Dice[2], Location.PayoutCounter[1], Location.PayoutCounter[2])
- wait(300+Ping)
- else
- Map.PickupItem(Location.Dice[1], Location.Dice[2], Location.Dice[3], Container.GetFirst():Index(), 19, 100)
- wait(300+Ping)
- end
- else
- if Gambler.isExist() then
- toMove = {Location.PayoutCounter[1], Location.PayoutCounter[2]}
- else
- toMove = {Location.Yourself[1], Location.Yourself[2]}
- end
- Map.MoveItem(Location.Dice[1], Location.Dice[2], toMove[1], toMove[2])
- wait(300+Ping)
- end
- return true
- end
- return false
- end
- function Self.UntrashCounter()
- if not table.find({3043, Location.Counter.id}, mapCounter) then
- if Gambler.isExist() then
- toMove = {Gambler.Position[1], Gambler.Position[2]}
- else
- toMove = {Location.Yourself[1], Location.Yourself[2]}
- end
- Map.MoveItem(Location.Counter[1], Location.Counter[2], toMove[1], toMove[2])
- wait(300+Ping)
- return trued
- end
- if not Gambler.isExist() and mapCounter == 3043 then
- Map.PickupItem(Location.Counter[1], Location.Counter[2], Location.Counter[3], Container.GetFirst():Index(), 19, 100)
- wait(300+Ping)
- return true
- end
- return false
- end
- function Self.UntrashYourself()
- if mapYourself == 3043 then
- if Gambler.isExist() then
- Map.MoveItem(Location.Yourself[1], Location.Yourself[2], Location.PayoutCounter[1], Location.PayoutCounter[2])
- wait(300+Ping)
- else
- Map.PickupItem(Location.Yourself[1], Location.Yourself[2], Location.Yourself[3], Container.GetFirst():Index(), 19, 100)
- wait(300+Ping)
- end
- return true
- end
- return false
- end
- function Self.UntrashPayoutCounter()
- if not Gambler.isExist() then
- if mapPayoutCounter ~= Location.PayoutCounter.id then
- if mapPayoutCounter == 3043 then
- Map.PickupItem(Location.PayoutCounter[1], Location.PayoutCounter[2], Location.PayoutCounter[3], Container.GetFirst():Index(), 19, 100)
- wait(300+Ping)
- else
- Map.MoveItem(Location.PayoutCounter[1], Location.PayoutCounter[2], Location.Yourself[1], Location.Yourself[2])
- wait(300+Ping)
- end
- return true
- end
- end
- return false
- end
- function Self.UntrashHouseSquare()
- for index, tbl in ipairs(HouseUntrashSQM.inRange) do
- if not table.find(tbl.ids, Map.GetTopUseItem(tbl[1], tbl[2], tbl[3]).id) then
- if not table.find(PacketIDs, Map.GetTopUseItem(tbl[1], tbl[2], tbl[3]).id) then
- Warring = Warring + 1
- if Gambler.isExist() then
- toMove = {Gambler.Position[1], Gambler.Position[2]}
- else
- toMove = {Location.Yourself[1], Location.Yourself[2]}
- end
- Map.MoveItem(tbl[1], tbl[2], toMove[1], toMove[2])
- wait(300+Ping)
- else
- Map.MoveItem(tbl[1], tbl[2], Location.Yourself[1], Location.Yourself[2])
- Self.BanPlayer(Invited[1], 24*60, 'trying debug script')
- end
- return true
- end
- end
- return false
- end
- Self.UntrashHouseSquare()
- if (Self.UntrashDice() or Self.UntrashCounter() or Self.UntrashYourself() or Self.UntrashPayoutCounter()) then
- return true
- end
- return false
- end
- function Self.RollNumber()
- if MSG == nil and Roll then
- Self.UseDice()
- end
- end
- function Self.UseDice()
- Spam = os.difftime(os.clock(), Timer)
- if Spam > (0.9 + (Ping/1000)) and Roll then
- Self.UseItemFromGround(Location.Dice[1], Location.Dice[2], Location.Dice[3])
- Timer = os.clock()
- end
- end
- function Self.SmartSay(msg, type, delay)
- Diff = os.difftime(os.time(), T)
- if Diff >= delay then
- Self.Speak(msg, type)
- T = os.time()
- end
- end
- function Self.FirstSay(msg, delay)
- Diff1 = os.difftime(os.time(), T1)
- if not first_say then
- Self.Say(msg)
- first_say = true
- T1 = os.time()
- else
- if Diff1 >= delay then
- Self.Speak(msg, 0)
- T1 = os.time()
- end
- end
- end
- function Self.SayBanInfo()
- if potencialPlayer ~= nil then
- if table.exist(potencialPlayer:lower(), Banned) then
- local warring = '' ..playername.. ' was banned for ' ..playerreason.. ', remain ~' .. ((math.floor((playertime - os.time())/60)) + 1).. ' min.'
- Self.FirstSay(warring, 5)
- end
- end
- end
- function Self.PayRate()
- return {total = (Bet.Payout/100)+1, part = Bet.Payout/100}
- end
- function Interested.PositionMatch(x, y, z)
- for j = 1, #InviterSQM do
- if (InviterSQM[j][1] == x and InviterSQM[j][2] == y and InviterSQM[j][3] == z) then
- return true
- end
- end
- return false
- end
- function Interested.isExist()
- for _, c in Creature.iPlayers(7) do
- if table.count(Invited) == 0 then
- if Interested.PositionMatch(c:Position().x, c:Position().y, c:Position().z) then
- if c:Name() == potencialPlayer then
- if not table.exist(potencialPlayer:lower(), Banned) then
- Interested.Position = {c:Position().x, c:Position().y, c:Position().z}
- Interested.Name = c:Name():lower()
- return true
- else
- Self.SayBanInfo()
- end
- end
- end
- end
- end
- return false
- end
- function Gambler.ControlBanList()
- for v, t in ipairs(Banned) do
- if t.time ~= nil then
- if t.time - os.time() <= 0 then
- table.remove(Banned, v)
- print(t.name ..' was removed from ban list couse of time.')
- end
- end
- end
- end
- function Gambler.Cash()
- local cash = 0
- for i = 1, #Balance do
- if Balance[i].name == Invited[1] then
- cash = Balance[i].cash
- end
- end
- return cash
- end
- function Gambler.InsertCash(toInsert)
- for i = 1, #Balance do
- if Balance[i].name == Invited[1] then
- lastName = Balance[i].name
- table.remove(Balance, i)
- table.insert(Balance, {name = lastName, cash = toInsert})
- end
- end
- end
- function Gambler.PositionMatch(x, y, z)
- for j = 1, #GamblerSQM do
- if (GamblerSQM[j][1] == x and GamblerSQM[j][2] == y and GamblerSQM[j][3] == z) then
- return true
- end
- end
- return false
- end
- function Gambler.isExist()
- for _, c in Creature.iPlayers(7) do
- if table.count(Invited) > 0 then
- if c:Name() == Invited[1] then
- if Gambler.PositionMatch(c:Position().x, c:Position().y, c:Position().z) then
- Gambler.Position = {c:Position().x, c:Position().y, c:Position().z}
- return true
- end
- end
- end
- end
- return false
- end
- function Gambler.Remove()
- if table.count(Invited) > 0 then
- print("Removing "..potencialPlayer.."!")
- wait(300+Ping)
- Write("nothing")
- wait(1000+Ping)
- table.remove(Invited, 1)
- end
- end
- function table.count(table_name)
- local count = 0
- for i = 1, #table_name do
- if i ~= nil then
- count = count + 1
- end
- end
- return count
- end
- function table.exist(name, tbl)
- for index, i in ipairs(tbl) do
- if i.name:lower() == name:lower() then
- playerindex = index
- playercash = i.cash
- playername = i.name
- playerreason = i.reason
- playertime = i.time
- return true
- end
- end
- return false
- end
- function Write(text)
- file = io.open(inviterfile_path, "w+")
- file:write(text)
- file:close()
- end
- function AntiDebug()
- for index, tbl in ipairs(HouseUntrashSQM.toFar) do
- if (table.find(PacketIDs, Map.GetTopUseItem(Location.Counter[1], Location.Counter[2], Location.Counter[3]).id) or table.find(PacketIDs, Map.GetTopUseItem(Location.PayoutCounter[1], Location.PayoutCounter[2], Location.PayoutCounter[3]).id)) then
- if Invited[1] ~= nil then
- Self.BanPlayer(Invited[1], 24*60, 'trying debug script')
- end
- return true
- end
- end
- return false
- end
- function Casino.isInstalled()
- AntiDebug()
- Self.UntrashLocations()
- if Container.New(Containers.Cash):isOpen() and Self.DistanceFromPosition(Location.Yourself[1], Location.Yourself[2], Location.Yourself[3]) == 0 then
- return true
- end
- return false
- end
- -- Misc Lua Func --
- luaSelfUsePartyHat = function ()
- Self.UseItemFromEquipment("head")
- wait(Ping)
- end
- luaSelfPlayNuts = function ()
- Self.UseItemFromEquipment("weapon")
- wait(300+Ping)
- end
- -- MODULES --
- Module.New('Casino functions', function()
- if Casino.isInstalled() then
- Self.AcceptCash()
- Self.BetCheck()
- Self.RollNumber()
- end
- end)
- Module.New("Party hat", function(ox)
- if Casino.isInstalled() then
- if not Gambler.isExist() then
- luaSelfUsePartyHat()
- end
- end
- ox:Delay(PartyhatTime+200+Ping, PartyhatTime+500+Ping)
- end)
- Module.New('HUD status', function()
- if not Casino.isInstalled() then
- StatusTrueHUD:SetText("")
- StatusFalseHUD:SetText("OFF")
- else
- StatusFalseHUD:SetText("")
- StatusTrueHUD:SetText("ON")
- end
- end)
- Module.New('Remove gambler', function()
- local unbanProcess = Gambler.ControlBanList()
- if Warring == -2 then
- Self.BanPlayer(Invited[1], 60, 'trashing house')
- Warring = 0
- end
- if not Gambler.isExist() then
- if os.clock() - time >= 3 then
- Gambler.Remove()
- end
- else
- if os.clock() - time >= TimetoKick then
- Gambler.Remove()
- end
- if math.floor(os.clock() - time) == 10 then
- Self.FirstSay('Kick in 10 seconds.', 2)
- end
- if math.floor(os.clock() - time) == 18 then
- Self.FirstSay('Kick in 5 seconds.', 2)
- end
- end
- end)
- Module.New('Advertising', function(mod)
- if not Gambler.isExist() and Casino.isInstalled() then
- Self.SmartSay('Casino House | Min '.. Bet.Min ..' CC | Max '.. Bet.Max ..' CC | Payout '.. Bet.Payout ..'% | Bot&Cast ON! | AUTO INVITER ON |', 2, 5)
- end
- mod:Delay(17000, 20000)
- end, true)
- -- PROXIES --
- LocalSpeechProxy.OnReceive("Speech._Key", function(proxy, mtype, speaker, level, text)
- local text = text:lower()
- if table.find({"inv", "invite", "play"}, text) and table.count(Invited) == 0 and Casino.isInstalled() and not Self.UntrashLocations() then
- potencialPlayer = speaker
- if Interested.isExist() then
- print("Inviting "..potencialPlayer.."!")
- wait(150+Ping)
- Write(""..potencialPlayer.."")
- table.insert(Invited, potencialPlayer)
- Self.Say("Welcome, "..speaker.."!")
- wait(1300+Ping)
- time = os.clock()
- first_say = nil
- Warring = 0
- if not table.exist(speaker, Balance) then
- table.insert(Balance, {name = potencialPlayer, cash = 0})
- CustomerHUD:SetText("Players: " ..table.count(Balance) .. "")
- else
- player_cash = playercash
- end
- end
- end
- for i = 1, #Invited do
- if table.find({"bye", "bb", "cya", "good bye"}, text) and speaker == Invited[i] then
- Self.Say("Good Bye, "..speaker.."!")
- Gambler.Remove()
- wait(300+Ping)
- break
- end
- end
- if not process_low and not process_high and speaker == Invited[1] and not Self.UntrashLocations() and Casino.isInstalled() then
- if Gambler.Cash() >= 1 then
- local number = text:match('%d+')
- local proxy_msg = text:match('%a+')
- if table.find({'123', 'l', 'low'}, text) then
- process_low = true
- player_bet = Gambler.Cash()
- elseif table.find({'456', 'h', 'high'}, text) then
- process_high = true
- player_bet = Gambler.Cash()
- elseif table.find({'pay', 'payout', '>', '<', 'withdraw', 'out', 'payo', 'v', '^'}, text) then
- Self.PayoutCash(Gambler.Cash())
- end
- if tonumber(number) ~= nil then
- number = number + 0
- if number >= 1 then
- if table.find({'123', 'l', 'low'}, proxy_msg) then
- process_low = true
- player_bet = number
- elseif table.find({'456', 'h', 'high'}, proxy_msg) then
- process_high = true
- player_bet = number
- end
- end
- end
- end
- if table.find({'bet', 'min', 'max', 'rate'}, text) then
- Self.FirstSay('Minimum '.. Bet.Min ..' - Maximum '.. Bet.Max ..'', 2)
- elseif table.find({'info', 'inform', 'information', '%'}, text) then
- Self.FirstSay('Min '.. Bet.Min ..' | Max '.. Bet.Max ..' | Payout '.. Bet.Payout ..'%', 2)
- elseif table.find({'balance', 'account', 'total'}, text) then
- Self.FirstSay('Balance ' ..Gambler.Cash(), 0, 2)
- end
- if table.find({"credits", "author", "credit", "owner"}, text) and Casino.isInstalled() then
- Self.Say("Script By Rif")
- wait(Ping)
- Self.Say("Current Owner: Mihelox")
- end
- end
- end)
- EffectMessageProxy.OnReceive("DiceSignal", function(proxy, message)
- if process_high or process_low and Roll then
- MSG = string.match(message, ""..Self.Name().."".." rolled a (.+).")
- if tonumber(MSG) ~= nil then
- MSG = tonumber(MSG)
- if MSG >= 1 and MSG <= 6 then
- Roll = nil
- end
- if process_low then
- if MSG >= 1 and MSG < 4 then
- local win = math.floor(player_bet*Self.PayRate().part)
- local balance = math.floor((Gambler.Cash()-player_bet)+player_bet*Self.PayRate().total)
- Profit = Profit - win
- Gambler.InsertCash(balance)
- process_low, MSG, player_bet = nil, nil, 0
- luaSelfPlayNuts()
- Self.SmartSay('Won '.. win ..' | Balance '..Gambler.Cash(), 0, 1.2)
- time = os.clock()
- BalanceCashHUD:SetText(Profit)
- elseif MSG >= 4 and MSG < 7 then
- local lose = player_bet
- local balance = Gambler.Cash()-player_bet
- Profit = Profit + lose
- Gambler.InsertCash(balance)
- process_low, MSG, player_bet = nil, nil, 0
- Self.SmartSay('Lost '.. lose ..' | Balance '..Gambler.Cash(), 0, 1.2)
- time = os.clock()
- BalanceCashHUD:SetText(Profit)
- end
- elseif process_high then
- if MSG >= 1 and MSG < 4 then
- local lose = player_bet
- local balance = Gambler.Cash()-player_bet
- Profit = Profit + lose
- Gambler.InsertCash(balance)
- process_high, MSG, player_bet = nil, nil, 0
- Self.SmartSay('Lost '.. lose ..' | Balance '..Gambler.Cash(), 0, 1.2)
- time = os.clock()
- BalanceCashHUD:SetText(Profit)
- elseif MSG >= 4 and MSG < 7 then
- local win = math.floor(player_bet*Self.PayRate().part)
- local balance = math.floor((Gambler.Cash()-player_bet)+player_bet*Self.PayRate().total)
- Profit = Profit - win
- Gambler.InsertCash(balance)
- process_high, MSG, player_bet = nil, nil, 0
- luaSelfPlayNuts()
- Self.SmartSay('Won '.. win ..' | Balance '..Gambler.Cash(), 0, 1.2)
- time = os.clock()
- BalanceCashHUD:SetText(Profit)
- end
- end
- end
- end
- end)
- function onSpeak(chat, msg)
- chat:SendYellowMessage(Self.Name(), msg)
- local msg1 = msg
- local msg = msg:lower()
- local value = msg:match('%d+')
- local chat_msg = msg:match('%a+')
- local valid_settings = (not ban_v1 and not ban_v2 and not ban_v3 and not ban_v4)
- if table.find({'/ban', 'ban'}, msg) then
- chat:SendOrangeMessage('XenoBot', 'Insert ban name:')
- ban_v1 = true
- elseif ban_v1 then
- banName = msg1
- if not table.exist(banName:lower(), Banned) then
- ban_v2 = true
- ban_v1 = nil
- chat:SendOrangeMessage('XenoBot', 'Insert time(1 = 1min):')
- end
- elseif ban_v2 and banName ~= nil and type(banName) == 'string' then
- if tonumber(msg) ~= nil then
- msg = msg + 0
- if msg > 0 then
- banTime = msg
- chat:SendOrangeMessage('XenoBot', 'Insert reason:')
- ban_v3 = true
- ban_v2 = nil
- end
- else
- chat:SendOrangeMessage('XenoBot', 'String message cannot be accepted. Insert number.')
- end
- elseif ban_v3 then
- if tostring(msg) ~= '' then
- ban_v3 = nil
- banReason = msg
- Self.BanPlayer(banName, banTime, banReason)
- chat:SendOrangeMessage('XenoBot', banName.. ' was banned.')
- end
- elseif table.find({'/unban', 'unban'}, msg) then
- ban_v4 = true
- chat:SendOrangeMessage('XenoBot', 'Insert unban name:')
- elseif ban_v4 then
- unbanName = msg
- Self.UnbanPlayer(unbanName)
- ban_v4 = false
- chat:SendOrangeMessage('XenoBot', unbanName.. 'was unbaned.')
- end
- if table.find({'/start', 'start'}, msg) and valid_settings then
- if not Casino.isInstalled() then
- chat:SendOrangeMessage('XenoBot', 'Starting Script.')
- Self.InstalCasino()
- end
- end
- if table.find({'/cast', 'cast'}, msg) and valid_settings then
- if Casino.isInstalled() then
- chat:SendOrangeMessage('XenoBot', 'Opening Broadcast.')
- Self.Say(CastCommand)
- end
- end
- if table.find({'/stopcast', 'stopcast'}, msg) and valid_settings then
- if Casino.isInstalled() then
- chat:SendOrangeMessage('XenoBot', 'Closing Broadcast.')
- Self.Say(StopCastCommand)
- end
- end
- if table.find({'/stop', 'stop'}, msg) and valid_settings then
- if Casino.isInstalled() then
- if Gambler.isExist() then
- chat:SendOrangeMessage('XenoBot', 'Kicking Gambler and Stopping Game.')
- print("Stopping Script...")
- Self.Say("Game Stopped")
- Self.CloseContainers()
- Gambler.Remove()
- else
- chat:SendOrangeMessage('XenoBot', 'Pausing Game.')
- print("Stopping Script...")
- Self.CloseContainers()
- end
- end
- end
- if table.find({'/kick', 'kick'}, msg) and valid_settings and Casino.isInstalled() and not Self.UntrashLocations() and Gambler.isExist() then
- chat:SendOrangeMessage('XenoBot', 'Kicking Actual Gambler.')
- print("Removing "..potencialPlayer.."!")
- Gambler.Remove()
- Self.Say(''..potencialPlayer..', Was Kicked By Console!')
- wait(500+Ping)
- end
- end
- if tonumber(value) ~= nil then
- value = value + 0
- if value >= 0 and valid_settings then
- if table.find({'/ping', 'ping'}, chat_msg) then
- Ping = value
- chat:SendOrangeMessage('XenoBot', 'Ping setup to '.. value ..'ms')
- end
- if value >= 1 then
- if table.find({'/min', '/minbet', 'min', 'minbet'}, chat_msg) then
- Bet = {Max = Bet.Max, Min = value, Payout = Bet.Payout}
- if Gambler.isExist() then
- Self.Say('Minimum is '.. value ..' now.')
- end
- chat:SendOrangeMessage('XenoBot', 'Minimum is '.. value ..' now.')
- elseif table.find({'/max', '/maxbet', 'max', 'maxbet'}, chat_msg) then
- Bet = {Max = value, Min = Bet.Min, Payout = Bet.Payout}
- if Gambler.isExist() then
- Self.Say('Maximum is '.. value ..' now.')
- end
- chat:SendOrangeMessage('XenoBot', 'Maximum is '.. value ..' now.')
- elseif table.find({'/payout', '/%', 'payout', '%'}, chat_msg) then
- Bet = {Max = Bet.Max, Min = Bet.Min, Payout = value}
- if Gambler.isExist() then
- Self.Say('Payout is '.. value ..'% now.')
- end
- chat:SendOrangeMessage('XenoBot', 'Payout is '.. value ..'% now.')
- end
- end
- end
- end
- function onClose() end
- local chat = Channel("</Config/>", onSpeak, onClose)
- chat:SendOrangeMessage('XenoBot', 'Commands:\n[#1] /start or /stop - start or stop script\n[#2] /ping - actions delay, eg. ping 200\n[#3] /min or /max or /payout - bet config eg. max 25, payout 80\n[#4] /ban or /unban - add or remove players to ban list\n[#5] /kick - kick the actual player\n[#6] /cast or /stopcast - Open Broadcasting or Close Broadcast')
- Module.New("dir", function(module)
- if Self.LookDirection() ~= 0 then
- Self.Turn('SOUTH')
- end
- end)
- Module.New("autoreset", function(module)
- if #Container.GetAll() == 0 or not Casino.isInstalled() then -- Self.LookDirection()
- Self.InstalCasino()
- end
- module:Delay(10)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement