• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Chat gpt competition?

highsanta

Advanced OT User
Joined
Dec 20, 2023
Messages
406
Solutions
3
Reaction score
176
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?
 
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?

Yes please, it is getting out of hand the amount of requests that can easily be fixed with ChatGBT :')
 
Im still suprised not many people trying to use chatGPT for scripts
 
Im 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
 
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

I agree for sure but if it comes to simple scripts they can use ChatGPT at some point if you ask me
 
GPT helped me to fix bugged lua, badly written and created scripts like a dungeon script or a task script.

Better than nothing
 
ChatGPT but at current stage this is more like an "advanced" google

That's what I use it for, even for non-scripting stuff.
Google is too bloated with useless shit now, it's near impossible to research anything if it's not the first/second link. lol
 
I'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
 
I'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
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 to
 
ChatGPT 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!
 
ChatGPT 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!
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 servers
 
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.
 
In my opinion, the GPT chat is very good for learning things, it all depends on the way it is used and how help requests are made. Firstly, you need to have an understanding of which parts of the server the files will be used on, whether it's TFS, and which versions will be used, such as 1.2, etc. How different types of paths work, whether it involves actions, talkactions, or globalevents which dirt paths do they stay in exactly and whether it involves .lua or xml? for example, whether something needs to be added to globa.lua? Do you need to add any files to libs? or if any function will be recognized in the sources... If the script fails, you need to add more and more information and eventually it will give you the desired script, but keep in mind that it won't work miracles... In recent days, I managed to create some roulette systems that didn't exist out there, I also managed to develop some player bot scripts similar to the ones Gesior posted but it's not perfect at all but it's already a great start.
 
Last edited:
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.
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.
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
 

Attachments

Last edited:
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.
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....
It will be interesting to see how advanced this type of AI can become in the future though.
 
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....
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.
Post automatically merged:

1711041834810.png
1711041917618.png
Sorry random languages but its like every one of those is script i have my friends pop on my account for this so I can fix prompt live etc xd
Post automatically merged:

JavaScript:
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);

here is another node js script that checks monster.xml files and capitalizes first letter if its lowercase
 
Last edited:
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.
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
As long as you send a carefully written promtp it will give good results, even chatGPT does not read people's minds XD
Can you show me the prompt you used?
 
certainly at least for me chatgpt rocks it made an script that makes certain monster as hunter hits double hits as in old tibia <3
i was looking for something like this long ago :D love it added a function to make spells combo like for demons/dragons and so on <3
 
I wrote a lot of scripts using chatgpt, I improved a lot, I learned a lot, how I can do something better. Lots of help that I didn't find on the forum. Or when someone wrote that they would do it for me for a fee. I don't like this type of stuff, if I wanted to pay I would put it in the work section. He fixed all these scripts, it took a few days but it works. However, there are many things that won't help either, he just doesn't know these functions, after suggesting some others, he converts them but still something is missing. Nevertheless, a very useful tool! I wanted players to not lose so much when they die, so I'll share this script:
Lua:
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
 
Back
Top