Attempting to import ChatGPT Into CC:Tweaked #2103
Replies: 4 comments 2 replies
-
CC:T has no Most likely issue: You are editing the Can you clarify what you mean by the command computer with internet modem though? Are you meaning an external hardware modem, or some mod addon? CC:T should have network access by default, without anything extra (unless, again, disabled in the serverconfig). |
Beta Was this translation helpful? Give feedback.
-
I meant with the ingame modem, i was under the belief that I needed to connect that to a computer to access "internet". I changed the script to how you said it should be, yet I still get "ChatGPT: Error: Failed to connect to the OpenAI API." I assume this error is out of CC:T's control? |
Beta Was this translation helpful? Give feedback.
-
No, that error is part of your program, and is misleading. When you make an http request using In other words, you should be doing something like this: local handle, err_msg, err_handle = http.post(...)
if not handle then
if err_handle then -- server gave us 4xx or 5xx
printError(err_handle.readAll()) -- you may wish to serialize this or write it to a file or something. Sometimes API errors can be quite long.
err_handle.close()
end
error(err_msg)
end
-- Making it to this point means successful connection
local data = handle.readAll()
-- ... Your current handling of this assumes that every failed http request means a failed connection, but the server is likely responding that you've done something incorrectly. And yeah, the ingame modems are only for in-game communications. Communications between CC computers and peripherals (monitors, printers, other CC computers, etc.). If you have http enabled, all computers can access it regardless of if they have a modem attached. |
Beta Was this translation helpful? Give feedback.
-
This whole program and "issue"/discussion feels AI generated, i dont know a singular person who actually talks like this. Is it really that hard to atleast ask questions yourself when using AI generated code? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Minecraft Version
1.20.1
Version
1.113.1
Details
Subject: HTTP Module Not Available in CC:Tweaked (Minecraft 1.20.1) Despite Successful Internet Test
Hi CC:Tweaked Team,
I'm running into a persistent issue with the
http
module in CC:Tweaked (1.20.1). I’ve tried everything I could think of, but nothing seems to resolve the problem. Here’s a breakdown of what’s happening:Issue:
Whenever I run a script that uses the
http
module, I get the error:Setup:
What I’ve Tried:
https://www.google.com
and returned HTML content. This suggests that the modem and internet access are working.cc-tweaked.cfg
and ensured:http.request()
andhttp.get()
. The script is formatted correctly and worked for others on the same CC:Tweaked version.Odd Behavior:
http
module still returns the "not available" error, as if the module is entirely missing or disabled.require("http")
in a Lua test also fails with "module not found", which is unexpected sincehttp
should be built into CC:Tweaked.I’ve spent a lot of time troubleshooting this and would really appreciate your insight. Thanks in advance.
Full "Pama_GPT.lua" File here: https://pastebin.com/HNJRRipp
(attempting to recreate something like the big A.I from MC:SM.)
Beta Was this translation helpful? Give feedback.
All reactions