Maybe we should make some competition where we use just chatgpt to create some simple but cool scripts for like actions or movements to just show how easy it is nowadays?
I wouldn't say that, take a look at OTAcademy's NimbusIm still suprised not many people trying to use chatGPT for scripts
I wouldn't say that, take a look at OTAcademy's Nimbus
The entire problem is that this thing is nowhere near beeing accurate with whatever it spits out
I havn't seen many cases browsing through which where actually spot on and worked, this bot comes up with a lot of nonsense or stuff which doesn't even work at all
Don't get me wrong not hating on ChatGPT but at current stage this is more like an "advanced" google but nothing to entirely write scripts for you which is production ready, if people spend the same ammount of time learning on how to properly script, rather than spending hours over hours trying to get ChatGPT to fix what you want to work, they would have invested their time a lot better in my opinion
ChatGPT but at current stage this is more like an "advanced" google
Its how you explain it more words more complicated code it will spit out i start wjth version 0.01 and add features one by one this way i make sure they dont interfere or fix bugs at hand with it largest file so far 10kb its not pretty but works exactly like its intended toI've tried it a few times, but it spits out weird logic in pretty much every scenario, know matter how many details you give it. Another issue is that chatGPT doesn't really understand the efficiency of specific methods.
It's quicker for me to code from scratch, then to understand what it has written, and then to fix the problems it has made.
But for beginners, it can both be positive and negative, you can learn, and also learn poorly xD
Yes but i mean with healthy competition or thread we could have a great list of basic scripts even that seem to be lacking on a lot of serversChatGPT is so good; it saves a lot of time for many people. It's necessary to correct scripts quickly, faster than reading and researching, and then correcting, which would take even more time for it to function properly! There are two advantages and disadvantages. Imagine if GPT were to fail and people didn't learn the functions? How would they manage? I think it's ideal to study Lua and GPT at the same time. You can ask GPT to guide you on how to correct and implement things properly. This way, you're learning and developing with GPT. Then, if GPT fails or closes down, you already know how to correct things without needing GPT!
ok let me try.ChatGPT usually fails a lot, even if you give it a well-documented source of knowledge, but that doesn't mean it's not useful.
I have learned a lot and it has saved me a lot of time when researching things
Some time ago I discovered a web application that allows you to create bots based on some famous models and even with your own models, and I was curious to create a bot based on chatgpt but with a more updated source of knowledge and so I created this bot: MillhioreTFS - Poe (https://poe.com/MillhioreTFS)
For now I have not added enough knowledge and it still gives strange results in some cases, but it can be improved.
local waves = {
{monster1 = amount1, monster2 = amount2, ...},
{monster1 = amount1, monster2 = amount2, ...},
{monster1 = amount1, monster2 = amount2, ...},
{monster1 = amount1, monster2 = amount2, ...}
}
local waveIndex = 1
local waveTimer
function startWaveTimer()
waveTimer = addEvent(spawnWave, 60000) -- 1 minute timer
print("Wave timer started")
end
function spawnWave()
local wave = waves[waveIndex]
for monsterName, monsterAmount in pairs(wave) do
for _ = 1, monsterAmount do
local monster = Game.createMonster(monsterName, arenaCenterPosition)
if monster then
monster:registerEvent("onThink")
end
end
end
waveIndex = waveIndex + 1
if waveIndex <= #waves then
startWaveTimer()
else
print("All waves have been spawned")
-- Spawn a rabbit in the arena if it's wave 4
if waveIndex == 4 then
local rabbit = Game.createMonster("Rabbit", arenaCenterPosition)
if rabbit then
print("Rabbit spawned")
-- Teleport all players out of the arena as a failswitch
local players = Game.getPlayers()
for _, player in ipairs(players) do
player:teleportTo(player:getTown():getTemplePosition())
end
print("All players teleported out")
end
end
-- Check if the arena is empty
if #Game.getSpectators(arenaCenterPosition, false, true, 3, 3) == 0 then
print("Arena is empty")
else
print("Arena is currently occupied")
end
end
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
startWaveTimer()
return true
end
function onTeleport(player, prevPosition, newPosition)
print("Player " .. player:getName() .. " has been teleported from " .. prevPosition.x .. "," .. prevPosition.y .. "," .. prevPosition.z .. " to " .. newPosition.x .. "," .. newPosition.y .. "," .. newPosition.z)
end
function onLogin(player)
print("Player " .. player:getName() .. " has logged in")
return true
end
function onLogout(player)
print("Player " .. player:getName() .. " has logged out")
return true
end
function onAdvance(player, skill, oldLevel, newLevel)
print("Player " .. player:getName() .. " has advanced in skill " .. skill .. " from level " .. oldLevel .. " to " .. newLevel)
return true
end
-- Register events
registerEventListener(EVENT_ADVANCE, "onAdvance")
registerEventListener(EVENT_USE, "onUse")
registerEventListener(EVENT_TELEPORT, "onTeleport")
registerCreatureEvent("onLogin")
registerCreatureEvent("onLogout")
Perhaps, but this is the issue right here. You still learn things like scoping, comparisons etc.ok let me try.
LUA:local waves = { {monster1 = amount1, monster2 = amount2, ...}, {monster1 = amount1, monster2 = amount2, ...}, {monster1 = amount1, monster2 = amount2, ...}, {monster1 = amount1, monster2 = amount2, ...} } local waveIndex = 1 local waveTimer function startWaveTimer() waveTimer = addEvent(spawnWave, 60000) -- 1 minute timer print("Wave timer started") end function spawnWave() local wave = waves[waveIndex] for monsterName, monsterAmount in pairs(wave) do for _ = 1, monsterAmount do local monster = Game.createMonster(monsterName, arenaCenterPosition) if monster then monster:registerEvent("onThink") end end end waveIndex = waveIndex + 1 if waveIndex <= #waves then startWaveTimer() else print("All waves have been spawned") -- Spawn a rabbit in the arena if it's wave 4 if waveIndex == 4 then local rabbit = Game.createMonster("Rabbit", arenaCenterPosition) if rabbit then print("Rabbit spawned") -- Teleport all players out of the arena as a failswitch local players = Game.getPlayers() for _, player in ipairs(players) do player:teleportTo(player:getTown():getTemplePosition()) end print("All players teleported out") end end -- Check if the arena is empty if #Game.getSpectators(arenaCenterPosition, false, true, 3, 3) == 0 then print("Arena is empty") else print("Arena is currently occupied") end end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) startWaveTimer() return true end function onTeleport(player, prevPosition, newPosition) print("Player " .. player:getName() .. " has been teleported from " .. prevPosition.x .. "," .. prevPosition.y .. "," .. prevPosition.z .. " to " .. newPosition.x .. "," .. newPosition.y .. "," .. newPosition.z) end function onLogin(player) print("Player " .. player:getName() .. " has logged in") return true end function onLogout(player) print("Player " .. player:getName() .. " has logged out") return true end function onAdvance(player, skill, oldLevel, newLevel) print("Player " .. player:getName() .. " has advanced in skill " .. skill .. " from level " .. oldLevel .. " to " .. newLevel) return true end -- Register events registerEventListener(EVENT_ADVANCE, "onAdvance") registerEventListener(EVENT_USE, "onUse") registerEventListener(EVENT_TELEPORT, "onTeleport") registerCreatureEvent("onLogin") registerCreatureEvent("onLogout")
its not bad but need polishing here is script few prompts before gpt seems to get stuck sometimes so i usually copy old code say go back to this revision and rephrase my prompt this has been making my scripts more successfull
I included chat gpt version of my arena
while true I could write that code and thinker for few minutes comments have been insightful and fixing the 0.4 syntax by putting correct functions makes me just learn more inside of the engine and its capabilities so it is a great learning path to be fair.
no no i put this into his "gpt version" my script is actually in comment i use the bugs and put in the window etc I guide chat gpt u have to explain to it exactly what because the logic will work EXACTLY like u say. I had it change 1 function 10 times because I could not logically explain it.Perhaps, but this is the issue right here. You still learn things like scoping, comparisons etc.
However, the logic is not good, and you do not learn anything about efficiency, because ChatGPT doesn't know.
So a beginner will look at this, and think this is ok to use. But that script has no exhausts to limit the amount of addEvents being used, or for some reason it is registering onThink to a monster...
ChatGPT is only as good as the person using it, so they can give it good logic to learn from....
const fs = require('fs');
const path = require('path');
const xml2js = require('xml2js');
const folderPath = './folder'; // Change this to the path of your folder
// Function to capitalize first letter
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
// Function to process a single XML file
function processFile(filePath) {
fs.readFile(filePath, 'utf-8', (err, data) => {
if (err) {
console.error('Error reading file:', err);
return;
}
// Parse XML to JSON
xml2js.parseString(data, (err, result) => {
if (err) {
console.error('Error parsing XML:', err);
return;
}
// Modify monster names
if (result.monster) {
result.monster.$.name = capitalizeFirstLetter(result.monster.$.name);
// Convert JSON back to XML
const builder = new xml2js.Builder();
const modifiedXml = builder.buildObject(result);
// Write modified XML back to file
fs.writeFile(filePath, modifiedXml, err => {
if (err) {
console.error('Error writing file:', err);
return;
}
console.log(`Modified XML file saved as ${filePath}`);
});
}
});
});
}
// Function to process all XML files in a folder
function processFolder(folderPath) {
fs.readdir(folderPath, (err, files) => {
if (err) {
console.error('Error reading folder:', err);
return;
}
files.forEach(file => {
const filePath = path.join(folderPath, file);
if (fs.statSync(filePath).isFile() && path.extname(filePath) === '.xml') {
processFile(filePath);
}
});
});
}
// Start processing the folder
processFolder(folderPath);
As long as you send a carefully written promtp it will give good results, even chatGPT does not read people's minds XDok let me try.
LUA:local waves = { {monster1 = amount1, monster2 = amount2, ...}, {monster1 = amount1, monster2 = amount2, ...}, {monster1 = amount1, monster2 = amount2, ...}, {monster1 = amount1, monster2 = amount2, ...} } local waveIndex = 1 local waveTimer function startWaveTimer() waveTimer = addEvent(spawnWave, 60000) -- 1 minute timer print("Wave timer started") end function spawnWave() local wave = waves[waveIndex] for monsterName, monsterAmount in pairs(wave) do for _ = 1, monsterAmount do local monster = Game.createMonster(monsterName, arenaCenterPosition) if monster then monster:registerEvent("onThink") end end end waveIndex = waveIndex + 1 if waveIndex <= #waves then startWaveTimer() else print("All waves have been spawned") -- Spawn a rabbit in the arena if it's wave 4 if waveIndex == 4 then local rabbit = Game.createMonster("Rabbit", arenaCenterPosition) if rabbit then print("Rabbit spawned") -- Teleport all players out of the arena as a failswitch local players = Game.getPlayers() for _, player in ipairs(players) do player:teleportTo(player:getTown():getTemplePosition()) end print("All players teleported out") end end -- Check if the arena is empty if #Game.getSpectators(arenaCenterPosition, false, true, 3, 3) == 0 then print("Arena is empty") else print("Arena is currently occupied") end end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) startWaveTimer() return true end function onTeleport(player, prevPosition, newPosition) print("Player " .. player:getName() .. " has been teleported from " .. prevPosition.x .. "," .. prevPosition.y .. "," .. prevPosition.z .. " to " .. newPosition.x .. "," .. newPosition.y .. "," .. newPosition.z) end function onLogin(player) print("Player " .. player:getName() .. " has logged in") return true end function onLogout(player) print("Player " .. player:getName() .. " has logged out") return true end function onAdvance(player, skill, oldLevel, newLevel) print("Player " .. player:getName() .. " has advanced in skill " .. skill .. " from level " .. oldLevel .. " to " .. newLevel) return true end -- Register events registerEventListener(EVENT_ADVANCE, "onAdvance") registerEventListener(EVENT_USE, "onUse") registerEventListener(EVENT_TELEPORT, "onTeleport") registerCreatureEvent("onLogin") registerCreatureEvent("onLogout")
its not bad but need polishing here is script few prompts before gpt seems to get stuck sometimes so i usually copy old code say go back to this revision and rephrase my prompt this has been making my scripts more successfull
I included chat gpt version of my arena
while true I could write that code and thinker for few minutes comments have been insightful and fixing the 0.4 syntax by putting correct functions makes me just learn more inside of the engine and its capabilities so it is a great learning path to be fair.
Post automatically merged:
here is also i attach node js converter for example for lua script npc where doAddBuyable blablabla all this long nonsense is taken
and put into xml format "item,id,price;item,id,price; for tradewindow it helped me convert some 1.2 npcs for example i guess this can be expanded on the capability of node js for example or even python with chat gpt for automation is incredible I love macroGPT
function onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
if not creature:isPlayer() then
return true
end
local playerLevel = creature:getLevel()
local expToAdd = 0
if playerLevel >= 0 and playerLevel <= 10 then
expToAdd = 4000
elseif playerLevel >= 11 and playerLevel <= 20 then
expToAdd = 4000
elseif playerLevel >= 21 and playerLevel <= 40 then
expToAdd = 8000
elseif playerLevel >= 41 and playerLevel <= 50 then
expToAdd = 45000
elseif playerLevel >= 51 and playerLevel <= 60 then
expToAdd = 75000
elseif playerLevel >= 61 and playerLevel <= 70 then
expToAdd = 130000
elseif playerLevel >= 71 and playerLevel <= 80 then
expToAdd = 220000
elseif playerLevel >= 81 and playerLevel <= 90 then
expToAdd = 290000
elseif playerLevel >= 91 and playerLevel <= 100 then
expToAdd = 390000
elseif playerLevel >= 101 and playerLevel <= 110 then
expToAdd = 490000
elseif playerLevel >= 111 and playerLevel <= 120 then
expToAdd = 590000
elseif playerLevel >= 121 and playerLevel <= 130 then
expToAdd = 690000
elseif playerLevel >= 131 and playerLevel <= 140 then
expToAdd = 790000
elseif playerLevel >= 141 and playerLevel <= 150 then
expToAdd = 890000
elseif playerLevel >= 151 and playerLevel <= 160 then
expToAdd = 990000
elseif playerLevel >= 161 and playerLevel <= 170 then
expToAdd = 1000000
elseif playerLevel >= 171 and playerLevel <= 180 then
expToAdd = 1050000
elseif playerLevel >= 181 and playerLevel <= 190 then
expToAdd = 1100000
elseif playerLevel >= 191 and playerLevel <= 200 then
expToAdd = 1200000
elseif playerLevel >= 201 and playerLevel <= 210 then
expToAdd = 1300000
elseif playerLevel >= 211 and playerLevel <= 220 then
expToAdd = 13500000
elseif playerLevel >= 221 and playerLevel <= 230 then
expToAdd = 1400000
elseif playerLevel >= 231 and playerLevel <= 240 then
expToAdd = 1450000
elseif playerLevel >= 241 and playerLevel <= 250 then
expToAdd = 1500000
else
expToAdd = 1500000
end
creature:addExperience(expToAdd)
creature:say("Zwrot bogloslawienstwa swiatyni wynosi " .. expToAdd .. " punktow doswiadczenia!", TALKTYPE_MONSTER_SAY)
return true
end