www.ClassicTW.com
http://www.classictw.com/

scripting with ChatGPT
http://www.classictw.com/viewtopic.php?f=15&t=35966
Page 1 of 1

Author:  Crosby [ Wed May 28, 2025 8:43 am ]
Post subject:  scripting with ChatGPT

Is anybody working on teaching an AI to do some TWX scripting?

I've gone from thinking I'd never need AI to wondering if a couple
years from now we'll be totally dependent on its use.

Author:  Astrochimp [ Wed Jun 04, 2025 8:41 pm ]
Post subject:  Re: scripting with ChatGPT

We won't be dependent on it - it's just a productivity tool.

And anyway, it looks like ChatGPT already knows some stuff. Here's what it gave me for the prompt "can you write a twxproxy script that moves colonists from sector 1 to planet number 23 in the current sector and assigns them to fuel ore?"

I haven't tested it.

(edit:) looks like it's not gonna get to sector 1 unless it's right next door, maybe. But if you tell that to ChatGPT it'll probably fix it properly. Then you'll find another problem, and you can get ChatGPT to help you fix that, too. And on and on, just like with any other language. It's pretty tedious but it still beats doing all of it yourself. Sometimes.

# SCRIPT: move_colonists_to_planet23.ts
# PURPOSE: Move colonists from sector 1 to a planet in another sector, then assign to Fuel Ore

proc main
# Move to sector 1
setTextLineTrigger 1 moveDone "Command [TL="
send "1*"
pause
:moveDone

# Check if we have colonists in our hold
setTextLineTrigger 2 checkColonists "Citadel command (?=Help)"
send "c"
pause
:checkColonists

# Launch from citadel
send "q"

# Assuming we're carrying colonists now
# Move to the destination sector (example: 5)
# If you want to stay in current sector and planet is here, skip this
# Uncomment below and change sector if needed
# setTextLineTrigger 3 warpDone "Command [TL="
# send "5*"
# pause
:warpDone

# Land on planet #23
setTextLineTrigger 4 planetMenu "Planet #23 command (?=Help)"
send "l23"
pause
:planetMenu

# Transfer all colonists from ship to planet
setTextLineTrigger 5 planetMenu2 "Planet #23 command (?=Help)"
send "tc"
pause
:planetMenu2

# Assign colonists to Fuel Ore production
setTextLineTrigger 6 prodMenu "Production command (?=Help)"
send "p"
pause
:prodMenu

# Assign all available colonists to Fuel Ore
setTextLineTrigger 7 done "Production command (?=Help)"
send "f"
pause
:done

# Done!
send "q"
halt
end

Author:  Star Killer [ Wed Jun 25, 2025 3:33 pm ]
Post subject:  Re: scripting with ChatGPT

Micro is working on that since he can't see well anymore he's using it as a programing tool. not for twx though.


sk

Author:  ElderProphet [ Fri Oct 10, 2025 11:07 am ]
Post subject:  Re: scripting with ChatGPT

Astrochimp wrote:
We won't be dependent on it - it's just a productivity tool.

And anyway, it looks like ChatGPT already knows some stuff. Here's what it gave me for the prompt "can you write a twxproxy script that moves colonists from sector 1 to planet number 23 in the current sector and assigns them to fuel ore?"

I haven't tested it.

(edit:) looks like it's not gonna get to sector 1 unless it's right next door, maybe. But if you tell that to ChatGPT it'll probably fix it properly. Then you'll find another problem, and you can get ChatGPT to help you fix that, too. And on and on, just like with any other language. It's pretty tedious but it still beats doing all of it yourself. Sometimes.

# SCRIPT: move_colonists_to_planet23.ts

You're fired, ChatGPT. That script was terrible. :)

Author:  Grey Gamer [ Sun Nov 23, 2025 7:01 pm ]
Post subject:  SWATH Hostile Sector Cleaner

I recently read that LLMs are adequate at basic coding, but can't do complex programming, and if humans don't master the basic work, they will never be able to handle it when it becomes advanced.

"LLMs allow programmers to write code without understanding it and to increase productivity without increasing skill."
https://tomlee.wtf/2024/08/13/llms-and-programming

I don't know how I could have gotten through grad school without LLMs because whenever I asked my classmates for help, they either ignored me or said "We'll get through this together."
Did that make them feel good? It didn't accomplish anything!
It was infuriating because if anyone else asked for help, one of us replied.
I helped my classmates vastly more than they helped me.
My professors almost always refused to help (or just ignored me), but then they made me sign a form claiming I never asked for help.
I did finally graduate, but I haven't found a job...

The most useful thing LLMs ever did was give me a response so bad I figured out how to do it myself, but I don't have any idea what I would have done when my advisor ordered me to completely rewrite my 50-page research paper the first 8 times if I couldn't feed it into an LLM and tell it what changes I needed.

I don't know if Grammarly could have done that, but I had a professor command me to pay for it, and I responded "Why? I write better than it does."

The problem was that I would tell the LLM "Please change x, y, and z throughout my paper while maintaining two spaces between sentences and the Oxford comma in accordance with my school requirements.

It would respond "I changed x, y, and z throughout your paper while maintaining two spaces between sentences and the Oxford comma in accordance with your school requirements."

However, it always reduced the spaces between sentences, and eliminated the Oxford comma.
Then I fed it into Grammarly and it demanded I put two spaces between sentences, although it has some weird inverse Oxford comma rule.
"I ate dinner, and my brother went to bed" was allegedly correct, but "Larry, Curly, and Moe" was incorrect.

It also pointed out hundreds of errors in my quotes.
Sure, they wrote poorly, but I can't change their words!
All of this was too complicated to search and replace.
I wrote "Dr." dozens of times in my 50-page research paper!

I used to pull up Gemini, ChatGPT, and CoPilot, ask the same questions, and 2-3 of them would give garbage answers, but I didn't have all night to try to figure out everything on my own, I had too many deadlines!
Since I finished my classes, I tend to use Gemini because I'll ask ChatGPT something and it asks me some silly follow-up question.
"Obviously. Why haven't you done that yet?!"
This repeats until it says “You’ve hit your usage limit. Please try again later.”

Obviously, useful responses aren't the product.
We're training it so it can sell services to corporations, but I have hit the usage limit so many times, it seems like its purpose is to waste our time unless we pay.

Gemini doesn't have a usage limit, but even though I tell it when to change # to //, it either uses # everywhere (which fails), or // everywhere, which is unnecessary and looks weird.

Every LLM I have tried always tries to use statements like:
If ($string CONTAINS "ack)
Unfortunately, each time I attempt to run a script containing a "CONTAINS" statement, it errors out.

However, I mentioned to Gemini hat I was pulling a list of known hostile sectors from SWATH, adjusting formatting in Word (which was probably unnecessary), stripping unnecessary columns in Excel, and then pasting the list of targets in Notepad, and it wrote this:

Code:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SWATH Data Sector Cleaner</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <style>
        body {
            font-family: 'Inter', sans-serif;
            background-color: #f7f7f7;
        }
        textarea {
            resize: none;
            font-family: monospace;
            min-height: 200px;
        }
    </style>
</head>
<body class="p-4 sm:p-8">

<div class="max-w-4xl mx-auto bg-white shadow-xl rounded-xl p-6 md:p-10">
    <h1 class="text-3xl font-bold text-gray-800 mb-2">SWATH Hostile Sector Cleaner</h1>
    <p class="text-gray-600 mb-6">Paste your raw, multi-column report data from SWATH below. This tool will automatically extract only the sector numbers (the first column) into a clean list for your TWX-Proxy script.</p>

    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
        <!-- Input Area -->
        <div>
            <label for="rawInput" class="block text-sm font-medium text-gray-700 mb-2">1. Paste Raw SWATH Data Here:</label>
            <textarea id="rawInput" class="w-full border-2 border-gray-300 rounded-lg p-3 focus:ring-blue-500 focus:border-blue-500 transition duration-150" placeholder="Example line: 368 --- 12 2025-11-23 -"></textarea>
            <button onclick="cleanData()" class="mt-4 w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded-lg shadow-md transition duration-200">
                Process Data (Click Here)
            </button>
        </div>

        <!-- Output Area -->
        <div>
            <label for="cleanOutput" class="block text-sm font-medium text-gray-700 mb-2">2. Clean Sector List (Ready for hostiles.txt):</label>
            <textarea id="cleanOutput" class="w-full border-2 border-green-300 bg-green-50 rounded-lg p-3 focus:ring-green-500 focus:border-green-500 transition duration-150" placeholder="1234&#10;5678&#10;9012" readonly></textarea>
            <p id="statusMessage" class="mt-2 text-sm text-gray-500"></p>
        </div>
    </div>
</div>

<script>
    function cleanData() {
        const rawText = document.getElementById('rawInput').value;
        const outputField = document.getElementById('cleanOutput');
        const statusMsg = document.getElementById('statusMessage');
        const lines = rawText.split('\n');
        const cleanSectors = [];
        let extractedCount = 0;

        // Clear previous output and status
        outputField.value = '';
        statusMsg.textContent = 'Processing...';
        statusMsg.classList.remove('text-red-500', 'text-green-600');
       
        // Regex to find the first sequence of digits at the start of a line,
        // ignoring leading whitespace/tabs and the optional column header line.
        const sectorRegex = /^\s*(\d+)/;

        lines.forEach((line) => {
            // Skip header lines or obvious non-data lines
            if (line.includes("Sector") || line.trim() === '') {
                return;
            }

            const match = line.match(sectorRegex);
           
            if (match && match[1]) {
                const sectorNumber = match[1];
                cleanSectors.push(sectorNumber);
                extractedCount++;
            }
        });

        if (extractedCount > 0) {
            outputField.value = cleanSectors.join('\n');
            statusMsg.textContent = `Successfully extracted ${extractedCount} sector numbers. Copy this list and save it as hostiles.txt.`;
            statusMsg.classList.add('text-green-600');
        } else {
            outputField.value = '';
            statusMsg.textContent = 'No valid sector numbers found. Ensure you are pasting the raw SWATH report text.';
            statusMsg.classList.add('text-red-500');
        }
    }
</script>

</body>
</html>


Does it know html better than it knows TWX-Proxy? :) That works great and looks nice! :)

I could easily do that in TWX-Proxy, but it wouldn't look as nice! :D

Author:  Grey Gamer [ Mon Dec 01, 2025 4:43 pm ]
Post subject:  Re: scripting with ChatGPT

I asked ChatGPT:
Quote:
What does CBY do in TW2002 and how to best implement using a TWX-Proxy script?

It responded with a word salad, but suddenly, it is a big fan.
I tried quoting it, but I don't know if it uses characters not supported by phpBB, but it was 1.5-2 pages of utter nonsense.

Clod told me it didn't know, which was refreshing, if useless, although of course, it used two paragraphs to say that.

Gemini had some weird story about being a "Corporate buy [fuel]" command.
It wrote a script which wouldn't do anything, but it only guesses how everything works and assumes commands, etc.

If you insist on working with LLMs, you're going to explain the same things over and over again.

Author:  Xanos [ Thu Dec 04, 2025 9:40 pm ]
Post subject:  Re: scripting with ChatGPT

Garbage in, garbage out.
A hammer is a useful tool also, but not everything is a nail.

Author:  Hammer_2 [ Mon Dec 08, 2025 7:14 am ]
Post subject:  Re: scripting with ChatGPT

Xanos wrote:
Garbage in, garbage out.
A hammer is a useful tool also, but not everything is a nail.


I resemble that comment!

That being said; if anyone has looked at some of my scripts they'd have made the same garbage comment.

Hope everyone is doing well!

Author:  Grey Gamer [ Wed Dec 10, 2025 4:19 pm ]
Post subject:  Re: scripting with ChatGPT

My scripts stopped working.
The planetary trader I wrote a couple of years back and used without a problem all of that time doesn't do anything.
The Ptrader someone gave me runs CIM and claims it is out of ports when there are hundreds at 100% in sectors with fighters.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/