Untitled conversation
- User
[ML] (error) Z.lua: opcode '01BB' call caused an unhandled exception stack traceback: [C]: in function 'getObjectCoordinates' ...rams\Arizona Games Launcher\bin\arizona\moonloader\Z.lua:68: in function 'isPlayerNearObject' ...rams\Arizona Games Launcher\bin\arizona\moonloader\Z.lua:179: in function <...rams\Arizona Games Launcher\bin\arizona\moonloader\Z.lua:168> [ML] (error) Z.lua: Script died due to an error. (0E3382D4)
function isPlayerNearObject(object, radius) local _, objectX, objectY, objectZ = getObjectCoordinates(object) local playerX, playerY, playerZ = getCharCoordinates(PLAYER_PED) for _, player in ipairs(getAllChars()) do if doesCharExist(player) and not isCharDead(player) and player ~= PLAYER_PED then local playerDistance = getDistanceBetweenCoords3d(objectX, objectY, objectZ, playerX, playerY, playerZ) if playerDistance <= radius then return true end end end return false end
sampRegisterChatCommand("mainbot", function() lua_thread.create(function() local found, _, oreX, oreY, oreZ = findNearestOre() if not found then sampAddChatMessage("Руда не найдена в радиусе.", -1) return end
while true do wait(0) local playerX, playerY, playerZ = getCharCoordinates(PLAYER_PED) local playerDistance = getDistanceBetweenCoords3d(playerX, playerY, playerZ, oreX, oreY, oreZ) if isPlayerNearObject(obj, 4) then sampAddChatMessage("Игроки рядом с рудой. Игнорируем.", -1) break end if playerDistance > 2.5 then sampAddChatMessage("Нашел руду, рядом игроков нет, бежим туда.", -1) BeginToPoint(oreX, oreY, oreZ, 1, -255, false) else sampAddChatMessage("Достиг руды, начинаю копать!", -1) sendkey(1024) break end end end)function findNearestOre() local found, _, x, y, z repeat wait(0) found, dist, x, y, z = GetNearestObject(50, {854, 3930}) printStringNow("Ore Search...", 5) until found return found, x, y, z end
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.