-- SETTINGS TABLE local Settings = { Prefix = "-"; Owner = "profesyonel31ci"; Location = { C_Lamp = {1,0}; C_DonationBox = {3,-1}; }; Power = { --> | 1: vip | 2: vip+ | 3: mod | 4: admin | 5: co | ["TEST123"] = 5; }; } Settings.LocalPath = debug.getinfo(1).source:match("@?(.*/)"):match("(.+)scripts") -- LOCK SYSTEM local Lock = loadfile(Settings.LocalPath .. "LockSys.lua")() -- FILE LOAD&SAVE local PowerFile = { FileName = "power.dat"; } function PowerFile.load() local File = io.open(Settings.LocalPath .. PowerFile.FileName, "r") if not File then File = io.open(Settings.LocalPath .. PowerFile.FileName, 'w'); File:close(); File = io.open(Settings.LocalPath .. PowerFile.FileName, "r") end local Data = File:read("*a") File:close() for Name, Power in Data:gmatch("|(%S+)|(%d+)|") do Settings.Power[Name] = tonumber(Power) end LogToConsole("Power File Loaded!") end function PowerFile.save() local File = io.open(Settings.LocalPath .. PowerFile.FileName, "w") local Data = "" for Name, Power in pairs(Settings.Power) do Data = Data .. "|" .. Name .. "|" .. Power .. "|\n" end File:write(Data) File:close() LogToConsole("Power File Saved!") end PowerFile.load() -- GLOBALS & LOCALS local function GetPlayerByNetID(netid) for _, p in pairs(GetPlayerList()) do if p.netid == netid then return p end end return nil end local MakeBGL = Lock.make_Blue_Gem_Lock local MakeDL = Lock.make_Diamond_Lock local BreakDL = Lock.break_Diamond_Lock local BreakBGL = Lock.break_Blue_Gem_Lock local PreLocks = Lock.makeAll local CalcD = Lock.find_Deal local CalcW = Lock.calculate_forAll local CalcT = Lock.calculate_Broken local Location = GetLocal().pos -- MESSAGES local Messages = { ROOM_REGISTERED = "`wOda `6&TAG `wkayit edildi!"; ["$ROOM_REGISTERED"] = false; POWER_SET = "`6&PLAYER`w'in yetki gucu `9&POWER `wolarak degistirildi!"; ["$POWER_SET"] = true; POWER_REMOVED = "`6&PLAYER`w'in yetki gucu `4silindi!"; ["$POWER_REMOVED"] = true; ENABLED_SET = "`wBot ozellikleri `6&FLAG"; ["$ENABLED_SET"] = true; BAD_POWER = "`wSenin gucun bana sokmez aslanim ::DD"; ["$BAD_POWER"] = true; CANT_FIND_C_PART = "`wParca bulunamadi!"; ["$CANT_FIND_C_PART"] = true; C_PART_SET = "`wParca `6&PART `wyeni konumuyla duzenlendi!"; ["$C_PART_SET"] = true; MAXBET_SET = "`wMaximum Bet `6&BET World Lock `wolarak degistirildi!"; ["$MAXBET_SET"] = true; MINBET_SET = "`wMinimum Bet `6&BET World Lock `wolarak degistirildi!"; ["$MINBET_SET"] = true; ROOM_CLEARED = "`wOda `6&TAG `wtemizlendi!"; ["$ROOM_CLEARED"] = true; ROOM_REGISTERED_P = "`wKonumda oda bulundu ve kayit edildi!"; ["$ROOM_REGISTERED_P"] = true; ROOM_CLEARED_ALL = "`wTum odalara temizlendi!"; ["$ROOM_CLEARED_ALL"] = true; ROOM_UNREGISTERED = "`wOda `6&TAG`w'nin kaydi silindi!"; ["$ROOM_UNREGISTERED"] = true; GAME_RESETED = "`wMevcut oyun sona erdi!"; ["$GAME_RESETED"] = true; ROOM_UNREGISTERED_ALL = "`wTum odalarin kaydi silindi!"; ["$ROOM_UNREGISTERED_ALL"] = true; FORMAT_ENV = "`6BGL: `9&B `6DL: `9&D `6WL: `9&W"; FORMAT_MAXBET = "`wMax Bet: `6&BET World Lock"; FORMAT_MINBET = "`wMin Bet: `6&BET World Lock"; POOL_CLEARED = "`wBekleme havuzu temizlendi!"; ["$POOL_CLEARED"] = true; CANT_FIND_MESSAGE = "`wMesaj kalibi bulunamadi!"; ["$CANT_FIND_MESSAGE"] = true; SMESSAGE = "`wKalip `6&SMSG `wdurumu `9&FLAG"; ["$SMESSAGE"] = true; MAX_BET = "`wMax `6&BET World Lock `woynayabilirsin!"; ["$MAX_BET"] = true; MIN_BET = "`wMin `6&BET World Lock `woynayabilirsin!"; GAS_POWER_SET = "`wOyuna katilmak icin gereken guc `6&POWER `wolarak belirlendi!"; ["$GAS_POWER_SET"] = true; ["$MIN_BET"] = true; NO_EMPTY_ROOM = "`wMevcut bos oda bulunamadi!"; ["$NO_EMPTY_ROOM"] = true; } -- IDs local ID = { ROULETTE = 758; LAMP = 10154; --696 DONATIONBOX = 1452; } -- GAME TABLE local Game = { Pool = {}; MaxBet = 1000; --> 10 DLS MinBet = 500; --> 5 DLS GasPower = 0; Instance = nil; Enabled = false; } -- UTILS local Utils = { Vector = {}; tagKey = '&'; } function Utils.FixTag(str, tag_t) for key, value in pairs(tag_t) do if str:find(Utils.tagKey .. key) then str = str:gsub(Utils.tagKey .. key, value) end end return str end local function GetItem(id) if id == 242 then return {id = 242; amount = Lock.Wallet.World_Lock} elseif id == 1796 then return {id = 1796; amount = Lock.Wallet.Diamond_Lock} elseif id == 7188 then return {id = 7188; amount = Lock.Wallet.Blue_Gem_Lock} end for _, item in pairs(GetInventory()) do if item.id == id then return item end end return {id = 0; amount = 0} end function Utils.ClearColors(text) return text:gsub("`%S", "") end function Utils.Vector.GetDistance(x1,y1,x2,y2) --> TILE FORMAT return ((x2-x1)^2 + (y2-y1)^2)^0.5 end function Utils.Vector.PTT(vector) --> PATH TO TILE return math.floor(vector.x/32), math.floor(vector.y/32) end function Utils.Vector.PTT_t(vector) --> PATH TO TILE TABLE return {x = math.floor(vector.x/32); y = math.floor(vector.y/32)} end function Utils.Vector.TTP(vector) --> TILE TO PATH return math.floor(vector.x*32), math.floor(vector.y*32) end function Utils.Vector.TTP_T(vector) --> TILE TO PATH TABLE return {x = math.floor(vector.x*32); y = math.floor(vector.y*32)} end function Utils.Vector.inArea(pos1, pos2, pos3) local x1,x2,y1,y2 = pos1.x, pos2.x, pos1.y, pos2.y if x1 > x2 then x1 = pos2.x; x2 = pos1.x; end if y1 > y2 then y1 = pos2.y; y2 = pos1.y; end local x,y = pos3.x, pos3.y --LogToConsole(x1 .. "," .. y1 .. ";" .. x2 .. "," .. y2 .. ";" .. x .. "," .. y) return x >= x1 and x2 >= x and y >= y1 and y2 >= y end function Utils.FindTiles(id) local t = {} for _, tile in pairs(GetTiles()) do if tile.fg == id or tile.bg == id then table.insert(t, tile) end end if #t < 1 then tile = nil end return t end -- ACTIONS local Action = {} function Action.Chat(ChatMessage) local packet = [[action|input |text|]] .. ChatMessage SendPacket(2, packet) end function Action.DonationBoxTake(x,y) Action.Interact(x,y,32) local packet = [[action|dialog_return dialog_name|donation_box_edit buttonClicked|takeall 1|0 ]] SendPacket(2, packet) end function Action.WorldBan(UserNetID) local packet1 = string.format([[action|wrench |netid|%s ]], UserNetID) SendPacket(2, packet1) Sleep(50) local packet = string.format([[action|dialog_return dialog_name|popup netID|%s| netID|%s| buttonClicked|worldban ]], GetLocal().netid, UserNetID) SendPacket(2, packet) end function Action.Kick(UserNetID) local packet1 = string.format([[action|wrench |netid|%s ]], UserNetID) SendPacket(2, packet1) Sleep(50) local packet = string.format([[action|dialog_return dialog_name|popup netID|%s| netID|%s| buttonClicked|kick ]], GetLocal().netid, UserNetID) SendPacket(2, packet) end function Action.Pull(UserNetID) local packet1 = string.format([[action|wrench |netid|%s ]], UserNetID) SendPacket(2, packet1) Sleep(50) local packet = string.format([[action|dialog_return dialog_name|popup netID|%s| netID|%s| buttonClicked|pull ]], GetLocal().netid, UserNetID) SendPacket(2, packet) end function Action.Drop(ItemID,ItemAmount) local packet = string.format([[action|dialog_return dialog_name|drop_item itemID|%d| count|%d ]], ItemID, ItemAmount) SendPacket(2, packet) end function Action.Teleport(x,y) local packet = {} packet.x = x packet.y = y packet.px = -1 packet.py = -1 packet.characterstate = 32 Location.x = x; Location.y = y; SendPacketRaw(false, packet) end function Action.TeleportB(x,y) local xB, yB = Location.x, Location.y Action.Teleport(x,y) return function() Action.Teleport(xB,yB) end end function Action.Interact(x,y,i) local packet = { type = 3; value = i; px = x; py = y; x = x*32; y = y*32;} SendPacketRaw(false, packet) end -- ROOM MANAGER local RoomManager = { Rooms = {}; } function RoomManager.registerRoom(tag,donationbox_t, lamp_t, roulette_t, area_t) RoomManager.Rooms[tag] = {tag = tag; donationbox_t = donationbox_t; lamp_t = lamp_t; roulette_t = roulette_t; area_t = area_t;} if Messages["$ROOM_REGISTERED"] then --local message = FixTag(Messages.ROOM_REGISTERED, {TAG = tag;}) --Action.Chat(message) end end function RoomManager.isPlaying(netid) for _, room in pairs(RoomManager.Rooms) do if room.PlayerNetID == netid then return true end end return false end function RoomManager.getReadyRoom() for tag, room in pairs(RoomManager.Rooms) do if room.PlayerNetID == nil then return tag,room end end return nil end function RoomManager.clearRoom(tag) if not RoomManager.Rooms[tag] then return end if RoomManager.Rooms[tag].PlayerNetID ~= nil then local area = RoomManager.Rooms[tag].area_t local player = GetPlayerByNetID(RoomManager.Rooms[tag].PlayerNetID) --local pos = Utils.Vector.PTT_t(player.pos) --if player and Utils.Vector.inArea(area[1], area[2], pos) then -- Action.Kick(RoomManager.Rooms[tag].PlayerNetID) --end end RoomManager.Rooms[tag].PlayerNetID = nil end function RoomManager.unregisterRoom(tag) if RoomManager.Rooms[tag].PlayerNetID ~= nil then local area = RoomManager.Rooms[tag].area_t local player = GetPlayerByNetID(RoomManager.Rooms[tag].PlayerNetID) local pos = Utils.Vector.PTT_t(player.pos) --if player and Utils.Vector.inArea(area[1], area[2], pos) then -- Action.Kick(RoomManager.Rooms[tag].PlayerNetID) --end end RoomManager.Rooms[tag] = nil end function RoomManager.getPlayerRoom(netid) for tag, room in pairs(RoomManager.Rooms) do if room.PlayerNetID == netid then return tag,room end end return nil end function RoomManager.registerPlayer(tag, netid) RoomManager.Rooms[tag].PlayerNetID = netid RoomManager.Rooms[tag].i = 0 end function RoomManager.unregisterPlayer(tag) RoomManager.Rooms[tag].PlayerNetID = nil end function RoomManager.sizeOfRooms() local i = 0 for _,__ in pairs(RoomManager.Rooms) do i = i + 1 end return i end function RoomManager.registerFromP(pos) local x,y = Utils.Vector.PTT(pos) local Roulette = GetTile(x,y) if Roulette.fg == ID.ROULETTE then local C = Settings.Location --LogToConsole(tostring(C.C_Lamp[1]) .. " , " .. tostring(C.C_Lamp[2]) .. " : " .. tostring(C.C_DonationBox[1]) .. " , " .. tostring(C.C_DonationBox[2])) local Lamp = GetTile(Roulette.x + C.C_Lamp[1], Roulette.y + C.C_Lamp[2]) local DonationBox = GetTile(Roulette.x + C.C_DonationBox[1], Roulette.y + C.C_DonationBox[2]) if Lamp.fg == ID.LAMP and DonationBox.fg == ID.DONATIONBOX then RoomManager.registerRoom(RoomManager.sizeOfRooms()+1, DonationBox, Lamp, Roulette, {x = 0, y = 0}) return true end end return false end function RoomManager.autoRegister(limit) local Roulettes = Utils.FindTiles(ID.ROULETTE) if not Roulettes then return false end local i = 0 RoomManager.Rooms = {} for _, Roulette in pairs(Roulettes) do if i > limit then break end local C = Settings.Location local Lamp = GetTile(Roulette.x + C.C_Lamp[1], Roulette.y + C.C_Lamp[2]) local DonationBox = GetTile(Roulette.x + C.C_DonationBox[1], Roulette.y + C.C_DonationBox[2]) if Lamp.fg == ID.LAMP and DonationBox.fg == ID.DONATIONBOX then i = i + 1 RoomManager.registerRoom(i, DonationBox, Lamp, Roulette, {x = 0, y = 0}) Sleep(200) end end return true end -- MACRO local Macro = {} function Macro.isOwner(PlayerName) return Settings.Owner == PlayerName end function Macro.getPower(PlayerName) if Macro.isOwner(PlayerName) then return 99 end return Settings.Power[PlayerName] or 0 end function Macro.getRawPlayerName(Player_t) if not Player_t then return 0 end return Utils.ClearColors(Player_t.name):gsub("%s", "") end function Macro.getPlayerPower(Player_t) local name = Macro.getRawPlayerName(Player_t) return Macro.getPower(name) end function Macro.executePower(fnc, power, tpower) if tpower > power-1 then fnc() else if Messages["$BAD_POWER"] then Action.Chat(Messages.BAD_POWER) end end end function Macro.dropLocks(bgl,dl,wl) if bgl > 0 then Action.Drop(7188, bgl) end if dl > 0 then Action.Drop(1796, dl) end if wl > 0 then Action.Drop(242, wl) end Lock.remove(wl,dl,bgl) end -- HOOKING & LISTENERS||EVENT ADAPTERS local function OnPowerSet(PlayerName, Power, WhoUsed) local rawname = Macro.getRawPlayerName(WhoUsed) if rawname == PlayerName then return end LogToConsole(tostring(Macro.isOwner(rawname)) .. " , " .. tostring(Power) .. " , " .. tostring(Macro.getPower(rawname))) if not Macro.isOwner(rawname) and (Power or 0) > Macro.getPower(rawname) - 1 then return end Settings.Power[PlayerName] = Power if not Power and Messages["$POWER_REMOVED"] then Action.Chat(Utils.FixTag(Messages.POWER_REMOVED, {PLAYER = PlayerName})) elseif Power and Messages["$POWER_SET"] then Action.Chat(Utils.FixTag(Messages.POWER_SET, {PLAYER = PlayerName; POWER = Power})) end PowerFile.save() end local function OnEnabledSet(Flag) Game.Enabled = Flag if Messages["$ENABLED_SET"] then local F if Flag then F = "AKTIF" else F = "DE-AKTIF" end Action.Chat(Utils.FixTag(Messages.ENABLED_SET, {FLAG = F})) end end --> TASK & HELPER local task = nil local tpBack = nil function Game.PoolNext() Sleep(4000) local kk = nil if tpBack ~= nil then tpBack() end Game.Instance = nil for key, t in pairs(Game.Pool) do if GetPlayerByNetID(t.PlayerNetID) then Sleep(3000) Game.Instance = t local tag, room = RoomManager.getPlayerRoom(t.PlayerNetID) --Interact(room.lamp_t.x, room.lamp_t.y, 18) local xR, yR = Utils.Vector.TTP({x = room.roulette_t.x-1; y = room.roulette_t.y}) tpBack = Action.TeleportB(xR, yR) kk = key break end end if kk then Game.Pool[kk] = nil end end local function OnDonationBoxDonate(DonatedItemID, DonatedItemAmount, WhoDonated) if not Game.Enabled then return end local Count = DonatedItemAmount local NetID = WhoDonated.netid if DonatedItemID ~= 7188 and DonatedItemID ~= 1796 and DonatedItemID ~= 242 then return end if DonatedItemID == 7188 then Count = Count*10000 end if DonatedItemID == 1796 then Count = Count*100 end PreLocks() local tag, room = RoomManager.getPlayerRoom(NetID) if not room then return end Action.DonationBoxTake(room.donationbox_t.x, room.donationbox_t.y) local wl,dl,bgl = CalcW(Count) Lock.add(wl,dl,bgl) local function LOCAL_MACRO1() local xR, yR = Utils.Vector.TTP({x = room.roulette_t.x-1; y = room.roulette_t.y}) tpBack = Action.TeleportB(xR, yR) Sleep(100) local wl,dl,bgl = CalcW(Count) if CalcD(Count) then task = function() Macro.dropLocks(bgl,dl,wl) tpBack() if Messages["$MAX_BET"] then Action.Chat(Utils.FixTag(Messages.MAX_BET, {BET = Game.MaxBet})) end end else Macro.dropLocks(bgl,dl,wl) tpBack() end end if Count > Game.MaxBet then LOCAL_MACRO1() if Messages["$MAX_BET"] then Action.Chat(Utils.FixTag(Messages.MAX_BET, {BET = Game.MaxBet})) end return elseif Count < Game.MinBet then LOCAL_MACRO1() if Messages["$MIN_BET"] then Action.Chat(Utils.FixTag(Messages.MIN_BET, {BET = Game.MinBet})) end return end PreLocks() if Game.Instance then table.insert(Game.Pool, {PlayerNetID = NetID; Count = Count}) return end Game.Instance = {PlayerNetID = NetID; Count = Count} Sleep(110) --Interact(room.lamp_t.x, room.lamp_t.y, 18) local xR, yR = Utils.Vector.TTP({x = room.roulette_t.x-1; y = room.roulette_t.y}) tpBack = Action.TeleportB(xR, yR) --Action.Chat("Donate: " .. GetPlayerByNetID(NetID).name .. "(" .. Item.id .. ") -> " .. Count .. "x " .. ItemName) end local function OnRouletteSpin(SpinNumber, WhoSpined) if not Game.Enabled then return end local NetID = WhoSpined.netid local Point = SpinNumber if NetID == GetLocal().netid and Game.Instance and Game.Instance.Point then if Game.Instance.Point == 28 or Game.Instance.Point == 19 or Game.Instance.Point == 0 then Game.Instance.Point = 10 elseif Game.Instance.Point > 9 then Game.Instance.Point = math.floor(Game.Instance.Point/10) + Game.Instance.Point%10 if Game.Instance.Point > 9 then Game.Instance.Point = Game.Instance.Point%10 end end if Point == 28 or Point == 19 or Point == 0 then Point = 10 elseif Point > 9 then Point = math.floor(Point/10) + Point%10 if Point > 9 then Point = Point%10 end end local tag, room = RoomManager.getPlayerRoom(Game.Instance.PlayerNetID) Sleep(110) if not room then Game.Instance = nil; return end local xL, yL = room.lamp_t.x, room.lamp_t.y --Interact(xL,yL,18) if Point >= Game.Instance.Point then --> HOSTER BOT WINS --RoomManager.clearRoom(tag) tpBack() tpBack = nil local kk = nil Game.Instance = nil for key, t in pairs(Game.Pool) do if GetPlayerByNetID(t.PlayerNetID) then Game.Instance = t local tag, room = RoomManager.getPlayerRoom(t.PlayerNetID) Sleep(100) --Interact(room.lamp_t.x, room.lamp_t.y, 18) local xR, yR = Utils.Vector.TTP({x = room.roulette_t.x-1; y = room.roulette_t.y}) tpBack = Action.TeleportB(xR, yR) kk = key break end end if kk then Game.Pool[kk] = nil end else --> PLAYER WIN if Game.Instance.Point == 10 then Game.Instance.Count = Game.Instance.Count*3; else Game.Instance.Count = Game.Instance.Count*2; end Sleep(100) local wl,dl,bgl = CalcW(Game.Instance.Count) if CalcD(Game.Instance.Count) then task = function() Macro.dropLocks(bgl,dl,wl) Sleep(900) Game.PoolNext() end else Macro.dropLocks(bgl,dl,wl) Sleep(900) Game.PoolNext() end end return end if not Game.Instance or Game.Instance.PlayerNetID ~= NetID or Game.Instance.Point then return end Game.Instance.Point = Point Sleep(1000) local roulette = Utils.FindTiles(ID.ROULETTE) Action.Interact(roulette[1].x, roulette[1].y, 18) end local function OnChatSendMessage(ChatMessage, WhoSent) if not ChatMessage or not WhoSent then return end local prefix = Settings.Prefix local UserPower = Macro.getPlayerPower(WhoSent) local UserNetID = WhoSent.netid local PlayerName = Utils.ClearColors(WhoSent.name):gsub("%s", "") if ChatMessage:find(prefix .. "setpower") and Macro.getPlayerPower(WhoSent) > 4 then local TargetName = ChatMessage:match("setpower (%S+)") local Power = tonumber(ChatMessage:match(TargetName .. " (%S+)")) OnPowerSet(TargetName, Power, WhoSent) elseif ChatMessage == prefix .. "enabled" then Macro.executePower(function() OnEnabledSet((not Game.Enabled)) end, 4, UserPower) elseif ChatMessage == prefix .. "gas" then Macro.executePower(function() if not Game.Enabled then return end local tag,room = RoomManager.getReadyRoom() if not room then if Messages["$NO_EMPTY_ROOM"] then Action.Chat(Messages.NO_EMPTY_ROOM) end return end if RoomManager.isPlaying(UserNetID) then --Action.Chat("`4Zaten Oyundasin!") return end local posR = {x = room.lamp_t.x+1; y = room.lamp_t.y} local x,y = Utils.Vector.TTP(posR) local tpBack = Action.TeleportB(x,y) Action.Pull(UserNetID) tpBack() RoomManager.registerPlayer(tag, UserNetID) end, Game.GasPower, UserPower) elseif ChatMessage:find(prefix .. "registera") then Macro.executePower(function() local Limit = tonumber(ChatMessage:match("registera (%d+)")) if not Limit then Limit = 99 end RoomManager.autoRegister(Limit) end, 3, UserPower) elseif ChatMessage:find(prefix .. "setlocation") then Macro.executePower(function() local part = ChatMessage:match("setlocation (%S+)") local x = tonumber(ChatMessage:match("(%S+):")) local y = tonumber(ChatMessage:match(":(%S+)")) if not Settings.Location[part] then if Messages["$CANT_FIND_C_PART"] then Action.Chat(Messages.CANT_FIND_C_PART) end return end Settings.Location[part][1] = x Settings.Location[part][2] = y if Messages["$C_PART_SET"] then Action.Chat(Utils.FixTag(Messages.C_PART_SET, {PART = part})) end end, 4, UserPower) elseif ChatMessage == prefix .. "pullme" then Macro.executePower(function() Action.Pull(UserNetID) end, 2, UserPower) elseif ChatMessage:find(prefix .. "setmaxbet") then Macro.executePower(function() local maxbet1 = tonumber(ChatMessage:match("setmaxbet (%d+)")) if not maxbet1 then return end Game.MaxBet = maxbet1 if Messages["$MAXBET_SET"] then Action.Chat(Utils.FixTag(Messages.MAXBET_SET, {BET = Game.MaxBet})) end end, 4, UserPower) elseif ChatMessage:find(prefix .. "setminbet") then Macro.executePower(function() local minbet1 = tonumber(ChatMessage:match("setminbet (%d+)")) if not minbet1 then return end Game.MinBet = minbet1 if Messages["$MINBET_SET"] then Action.Chat(Utils.FixTag(Messages.MINBET_SET, {BET = Game.MinBet})) end end, 4, UserPower) elseif ChatMessage == prefix .. "tpme" then Macro.executePower(function() Action.Teleport(WhoSent.pos.x, WhoSent.pos.y) end, 3, UserPower) elseif ChatMessage:find(prefix .. "clear") then Macro.executePower(function() local tag = tonumber(ChatMessage:match("clear (%S+)")) if not tag then return end RoomManager.clearRoom(tag) if Messages["$ROOM_CLEARED"] then Action.Chat(Utils.FixTag(Messages.ROOM_CLEARED, {TAG = tag})) end end, 3, UserPower) elseif ChatMessage == prefix .. "nextpool" then Macro.executePower(function() Game.PoolNext() end, 3, UserPower) elseif ChatMessage == prefix .. "register" then Macro.executePower(function() local f = RoomManager.registerFromP(WhoSent.pos) if f and Messages["$ROOM_REGISTERED_P"] then Action.Chat(Messages.ROOM_REGISTERED_P) end end, 3, UserPower) elseif ChatMessage:find(prefix .. "type") then Macro.executePower(function() local message = ChatMessage:match("type (.+)") if not message then return end Action.Chat(message) end, 3, UserPower) elseif ChatMessage == prefix .. "clearall" then Macro.executePower(function() for tag, room in pairs(RoomManager.Rooms) do if room.PlayerNetID then Action.Kick(PlayerNetID) end RoomManager.clearRoom(tag) end if Messages["$ROOM_CLEARED_ALL"] then Action.Chat(Messages.ROOM_CLEARED_ALL) end end, 3, UserPower) elseif ChatMessage:find(prefix .. "unregister") and not ChatMessage == prefix .. "unregisterall" then Macro.executePower(function() local tag = tonumber(ChatMessages:match("unregister (%S+)")) if not tag then return end RoomManager.unregisterRoom(tag) if Messages["$ROOM_UNREGISTERED"] then Action.Chat(Utils.FixTag(Messages.ROOM_UNREGISTERED, {TAG = tag})) end end, 3, UserPower) elseif ChatMessage == prefix .. "unregisterall" then Macro.executePower(function() for tag, _ in pairs(RoomManager.Rooms) do RoomManager.unregisterRoom(tag) end if Messages["$ROOM_UNREGISTERED_ALL"] then Action.Chat(Messages.ROOM_UNREGISTERED_ALL) end end, 3, UserPower) elseif ChatMessage:find(prefix .. "setgaspower") then local power = tonumber(ChatMessage:match("setgaspower (%d+)")) if not power then return end Game.GasPower = power if Messages["$GAS_POWER_SET"] then Action.Chat(Utils.FixTag(Messages.GAS_POWER_SET, {POWER = power})) end elseif ChatMessage == prefix .. "resetgame" then Macro.executePower(function() if Messages["$GAME_RESETED"] then Action.Chat(Messages.GAME_RESETED) end Game.Instance = nil end, 3, UserPower) elseif ChatMessage == prefix .. "env" then Macro.executePower(function() local wl,dl,bgl = GetItem(242).amount, GetItem(1796).amount, GetItem(7188).amount Action.Chat(Utils.FixTag(Messages.FORMAT_ENV, {B = bgl; D = dl; W = wl})) end, 1, UserPower) elseif ChatMessage == prefix .. "maxbet" then Macro.executePower(function() Action.Chat(Utils.FixTag(Messages.FORMAT_MAXBET, {BET = Game.MaxBet})) end, 1, UserPower) elseif ChatMessage == prefix .. "minbet" then Macro.executePower(function() Action.Chat(Utils.FixTag(Messages.FORMAT_MINBET, {BET = Game.MinBet})) end, 1, UserPower) elseif ChatMessage:find(prefix .. "break") then Macro.executePower(function() local t = ChatMessage:match("break (%S+)") if not t then return end if t == "wl" then MakeDL() elseif t == "dl" then BreakDL() elseif t == "bgl" then BreakBGL() elseif t == "bgl2" then MakeBGL() end end, 4, UserPower) elseif ChatMessage:find(prefix .. "move") then Macro.executePower(function() local x1,y1 = tonumber(ChatMessage:match("(%S+):")), tonumber(ChatMessage:match(":(%S+)")) if x1 == 0 and y1 == 0 then Action.Teleport(GetLocal().pos.x, GetLocal().pos.y) return end if not x1 or not y1 then return end local x2,y2 = Utils.Vector.PTT(Location) local pos = {x = (x2+x1), y = (y2+y1)} local x,y = Utils.Vector.TTP(pos) Action.Teleport(x,y) end, 3, UserPower) elseif ChatMessage:find(prefix .. "drop") then Macro.executePower(function() local count = ChatMessage:match("drop (%S+)") if not count then return end if count == "all" then local wl,dl,bgl = GetItem(242).amount, GetItem(1796).amount, GetItem(7188).amount Macro.dropLocks(bgl,dl,wl) else count = tonumber(count) local wl,dl,bgl = CalcW(count) if CalcD(count) then task = function() Macro.dropLocks(bgl,dl,wl) end else Macro.dropLocks(bgl,dl,wl) end end end, 5, UserPower) elseif ChatMessage == prefix .. "clearpool" then Macro.executePower(function() Game.Pool = {} if Messages["$POOL_CLEARED"] then Action.Chat(Messages.POOL_CLEARED) end end, 3, UserPower) elseif ChatMessage:find(prefix .. "smessage") then Macro.executePower(function() local targetmessage = ChatMessage:match("smessage (%S+)"):upper() if Messages["$" .. targetmessage] == nil then if Messages["$CANT_FIND_MESSAGE"] then Action.Chat(Messages.CANT_FIND_MESSAGE) end else Messages["$" .. targetmessage] = (not Messages["$" .. targetmessage]) if Messages["$SMESSAGE"] then local F if Messages["$" .. targetmessage] then F = "AKTIF" else F = "DE-AKTIF" end Action.Chat(Utils.FixTag(Messages.SMESSAGE, {SMSG = targetmessage; FLAG = F})) end end end, 4, UserPower) end end local function HOOK(variant_t) if Game.Enabled then for tag, room in pairs(RoomManager.Rooms) do local netid = room.PlayerNetID if netid then local Player = GetPlayerByNetID(netid) if not Player then RoomManager.Rooms[tag].PlayerNetID = nil if Game.Instance and Game.Instance.PlayerNetID == netid then Game.Instance = nil end else local pos1 = {x = room.lamp_t.x-3; y = room.lamp_t.y} local pos2 = {x = room.roulette_t.x+6; y = room.roulette_t.y+1} local pos3 = Utils.Vector.PTT_t(Player.pos) if not Utils.Vector.inArea(pos1,pos2,pos3) then if room.i > 6 then --Action.Chat(Player.name .. " `4Oda disina ciktigi icin atildi!") RoomManager.Rooms[tag].PlayerNetID = nil RoomManager.Rooms[tag].i = 0 if Game.Instance and Game.Instance.PlayerNetID == netid then Game.Instance = nil; tpBack(); tpBack = nil end Action.Kick(netid) else RoomManager.Rooms[tag].i = RoomManager.Rooms[tag].i + 1 end end end end end end if variant_t[0] == "OnConsoleMessage" then if variant_t[1]:find("CP") then return end variant_t[1] = Utils.ClearColors(variant_t[1]) if variant_t[1]:find("^Collected") then local count, name = variant_t[1]:match("Collected (%d+) (.+)%.") count = tonumber(count) local id = GetItemInfo(name).id if id == 242 then Lock.add(count, 0,0) elseif id == 1796 then Lock.add(0, count,0) elseif id == 7188 then Lock.add(0,0,count) end end end if variant_t[0] == "OnTalkBubble" then if not variant_t then return end local NetID = tonumber(variant_t[1]) local Player = GetPlayerByNetID(NetID) -- PLAYER CHAT if variant_t[2] == nil or variant_t == nil then return end if variant_t[2]:find("player_chat") then local NetID = tonumber(variant_t[1]) local Player = GetPlayerByNetID(NetID) local Message = Utils.ClearColors(variant_t[2]:match("chat=(.+)")) OnChatSendMessage(Message,Player) elseif variant_t[2]:find("You shattered") or variant_t[2]:find("You compressed") then if task then task(); task = nil end elseif variant_t[2]:find("Donation Box") then if not Game.Enabled then return end variant_t[2] = Utils.ClearColors(variant_t[2]) local Count = tonumber(variant_t[2]:match("places (%d+)")) local ItemName = variant_t[2]:match("places %d+ (.+) into") local Item = GetItemInfo(ItemName) OnDonationBoxDonate(Item.id, Count, Player) elseif variant_t[2]:find("Box emptied") then PreLocks() elseif variant_t[2]:find("spun the wheel") then variant_t[2] = Utils.ClearColors(variant_t[2]) local Point = tonumber(variant_t[2]:match("got (%d+)")) OnRouletteSpin(Point, Player) end end end; AddHook("onvariant", "hook1", HOOK)