- 12
- 3
- Версия MoonLoader
- Другое
ели как написал данного бота, работает он роде хорошо, но проблема в том. то что после регистрации он летит на чекпоинт, коробку берет, но не летит что бы её сдать. А если зайти с аккаунта который ранее был зареган, бот будет работать ну роде бесконечно ниже прикреплю код
бот на почту родина
бот на почту родина
Lua:
local sampev = require("samp.events")
local requests = require("requests")
require("addon")
local nick = getBotNick()
pass = 874090123140
ref = Sam_Mason
local servers = {
["185.169.134.163:7777"] = "RODINA 01",
["185.169.134.60:8904"] = "RODINA 02",
["185.169.134.62:8904"] = "RODINA 03",
["185.169.134.108:7777"] = "RODINA 04",
["80.66.71.85:7777"] = "RODINA 05",
["80.66.82.58:7777"] = "RODINA 06",
["80.66.82.55:7777"] = "RODINA 07"
}
function onLoad()
propingovka()
getrodinaname()
end
function getrodinaname(ip)
if not servers[ip] then
return
end
rodina_server = servers[ip]
end
function propingovka()
local function mysplit(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t = {};
i = 1
for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do
t[i] = str
i = i + 1
end
return t
end
local response = requests.get("http://" .. mysplit(getServerAddress(), ":")[1] .. ":80")
if response.status_code == 200 then
print("Try to ping server...")
end
end
function sampev.onShowDialog(id, style, title, btn1, btn2, text)
if title:find("место") then
sendDialogResponse(id, 1, 0, "")
end
if id == 629 then
sendDialogResponse(id, 1, 0, "")
coordStart(812.70355224609, 1370.1687011719, 12.220350265503, 35, 2, false)
end
end
function sendRegister(nick, pass, ref)
newTask(function()
local string1 = string.format("registration|%s|%s|null|friends|%s", nick, pass, ref)
local bs = bitStream.new()
bs:writeInt8(220)
bs:writeInt8(18)
bs:writeInt32(string.len(string1))
bs:writeString(string1)
bs:writeInt32(1)
bs:sendPacketEx(2, 9, 6)
bs:reset()
wait(500)
local string2 = "createCharacter|man|0"
bs = bitStream.new()
bs:writeInt8(220)
bs:writeInt8(18)
bs:writeInt32(string.len(string2))
bs:writeString(string2)
bs:writeInt32(1)
bs:sendPacketEx(2, 9, 6)
bs:reset()
end)
end
function sendAuthorization(nick, pass)
local string = string.format("authorization|%s|%s|0", nick, pass)
local bs = bitStream.new()
bs:writeInt8(220)
bs:writeInt8(18)
bs:writeInt32(string.len(string))
bs:writeString(string)
bs:writeInt32(1)
bs:sendPacketEx(2, 9, 6)
bs:reset()
end
function onReceivePacket(id, bs)
newTask(function()
if id == 220 then
bs:ignoreBits(8)
if bs:readInt8() == 17 then
bs:ignoreBits(32)
local str = bs:readString(bs:readInt32(32))
if str:find("event%.setActiveView") then
if str:find("Auth") then
sendRegister(nick, pass, ref)
wait(1000)
sendAuthorization(nick, pass)
end
end
if str:find("'hud.interactionButton.initializeTitle'") then
if str:find("Взять коробку") then
coordStart(820.42095947266, 1394.9270019531, 11.998925209045, 35, 2, false)
end
end
end
end
end)
end
function sampev.onSendSpawn()
floodEnterOn()
coordStart(821.96490478516, 1304.4523925781, 12.229024887085, 35, 2, false)
end
function sendCefKey(arg)
local bs = bitStream.new()
bs:writeInt8(220)
bs:writeInt8(0)
bs:writeInt8(arg)
bs:writeInt8(64)
bs:sendPacket()
bs:reset()
end
function floodEnterOn()
newTask(function()
while isCoordActive() do wait(0) end
updateSync()
wait(500)
flood_enter = true
while flood_enter do
sendCefKey(13)
updateSync()
wait(100)
end
end)
end
function floodEnterOff()
flood_enter = false
end
function sampev.onServerMessage(color, text)
if text:find("Вы заработали") then
coordStart(812.70355224609, 1370.1687011719, 12.220350265503, 35, 2, false)
end
end)
end
function findpickup(mode)
local x, y, z = getBotPosition()
if mode == 0 then
for k, v in pairs(getAllPickups()) do
if getDistanceBetweenCoords2d(x, y, v.position.x, v.position.y) <= 3 then
newTask(function()
sendPickedUpPickup(k)
end)
end
end
end
end
function getDistanceBetweenCoords2d(x1, y1, x2, y2)
return math.sqrt(((x2 - x1)^2) + ((y2 - y1)^2))
end
function onCoordStop()
findpickup(0)
end