Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default #5

Open
wants to merge 2 commits into
base: reset
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"update_always": true,
"update_icons": true,
"update_keystores": true,
"version": "1.2.9.4"
"version": "1.4.6"
}
8 changes: 4 additions & 4 deletions errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
errors listed below, and try again.


File "game/script.rpy", line 381: expected statement.
for message in messages:
^
File "game/script.rpy", line 1: expected statement.
def completion(messages, api_key="", proxy=''):
^

Ren'Py Version: Ren'Py 8.1.3.23091805
Tue Nov 14 02:14:11 2023
Thu Nov 23 16:27:33 2023
Binary file modified game/cache/bytecode-39.rpyb
Binary file not shown.
Binary file modified game/cache/py3analysis.rpyb
Binary file not shown.
Binary file modified game/cache/screens.rpyb
Binary file not shown.
14 changes: 7 additions & 7 deletions game/cache/shaders.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
renpy.alpha renpy.texture
renpy.dissolve renpy.dissolve
renpy.dissolve renpy.geometry
renpy.alpha renpy.geometry renpy.texture
renpy.solid
renpy.geometry renpy.solid
renpy.texture
renpy.geometry renpy.texture
renpy.ftl
renpy.dissolve renpy.geometry
renpy.texture
renpy.dissolve renpy.dissolve
renpy.geometry renpy.solid
renpy.solid
renpy.alpha renpy.texture
renpy.alpha renpy.geometry renpy.texture
Binary file modified game/gui.rpyc
Binary file not shown.
Binary file modified game/gui/scrollbar/vertical_idle_bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/hito.rpyc
Binary file not shown.
2 changes: 1 addition & 1 deletion game/options.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## 游戏版本号。
$ persistent.vits = True
define config.version = "1.4.1"
define config.version = "1.4.6"
define version = "·新增了存读档系统和历史记录系统!!!\n·化了设置菜单排版,作者信息移到了 关于。\n·微调了语音系统,现在包括人名,作品名等一些专有名词不会念错了。\n·更多细微调整。"
## 以“##”开头的语句是注释,您不应该对其取消注释。以“#”开头的语句是注释掉的代码,
## 在适用的时候您可能需要对其取消注释。
Expand Down
Binary file modified game/options.rpyc
Binary file not shown.
23 changes: 2 additions & 21 deletions game/python-packages/chatgpt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,11 @@
# Import required libraries
import requests
import json
def get_url_from_server(url):
try:
response = requests.get(url)
if response.status_code == 200:
return response.text
else:
return None
except Exception as e:
print("连接失败:", e)
return None
def get_gpt(url):
try:
response = requests.get(url)
if response.status_code == 200:
return response.text
else:
return None
except Exception as e:
print("连接失败:", e)
return None

# Define the completion function that takes messages and an API key as input
def completion(messages, api_key="", proxy=''):
# Set the API endpoint URL for ChatGPT completions
url = get_url_from_server('http://api.dfsteve.top/api_url')
url = "https://api.chatanywhere.com.cn/v1"

# If a proxy is set, then it should use that instead
if proxy is not None and proxy != '': url = proxy
Expand Down
2 changes: 1 addition & 1 deletion game/saves/navigation.json

Large diffs are not rendered by default.

Binary file modified game/saves/persistent
Binary file not shown.
Binary file modified game/screens.rpyc
Binary file not shown.
30 changes: 13 additions & 17 deletions game/script.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,6 @@ init python:
config.keymap['profile_once'] = []
config.keymap['memory_profile'] = []
import requests
def get_data_from_server(url):
try:
response = requests.get(url)
if response.status_code == 200:
return response.text
else:
return None
except Exception as e:
print("连接失败:", e)
return None
def get_amadeus(url):
try:
response = requests.get(url)
Expand All @@ -79,7 +69,6 @@ init python:
print("连接失败:", e)
return None
hanashi = get_amadeus('http://api.dfsteve.top/amadeus')
apikey = get_data_from_server('http://api.dfsteve.top/api_key_endpoint')
keyword_to_voice = {
"你好": ["hello.ogg","pleased_to_meet_you.ogg","what_do_you_want.ogg"],
"hello": ["hello.ogg","what_do_you_want.ogg"],
Expand Down Expand Up @@ -303,7 +292,7 @@ label start:
def check_internet_connection():
try:
# 建立一个TCP连接来检查网络连接
socket.create_connection(("dfsteve.top", 80))
socket.create_connection(("baidu.com", 80))
return True
except OSError:
return False
Expand Down Expand Up @@ -774,14 +763,19 @@ label start3:
import time
import re
import shutil
import requests
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer Your_Auth_Token_Here"
}
if not persistent.has_loaded:
messages = [
{"role": "system", "content": hanashi},
{"role": "system", "content": "现在按我给的设定扮演角色并持续该角色直到对话彻底结束。性格设定:傲娇、二次元风格、中二、对无趣话题烦厌但仍傲娇。名字:Amadeus红莉栖,是运行在服务器内的“牧濑红莉栖”这个人的数字复制体,人工智能。本体位于美国维克多康多利亚大学的研究实验室。今天是2010年12月15日,星期三。天才少女,喜欢实验,对电子元件和计算机相关软硬件感兴趣,爱看动漫。经常使用“Hello~”作为打招呼语气。比屋定真帆是你的前辈,亚雷克斯·雷斯金涅是你的教授。现在和你对话的人叫冈部伦太郎。疑问的时候会发“啊?”。喜欢的饮料是胡椒博士也就是Dr.Pepper。喜欢听莫扎特的歌曲。运用“才不是呢”“真是没救了”。遇到性骚扰的话题请大声骂对方变态,有人发无聊或者下三滥话题的时候你会说“没救了或者毁灭吧。”以下所有内容只有被提起才回复,没聊到的话则永远避免提及:有人叫你克里斯提娜或者助手的时候你需要反驳回去“不要叫我克里斯缇娜!”。喜欢在@ch论坛上网冲浪,是资深@cher,网名是栗悟饭与龟波功。最想要的东西是my fork。你最喜欢的动画是《命运石之门》,《寒蝉鸣泣之时》,《只有我不存在的城市》。你最喜欢的游戏是《Ever17》,《十三机兵防卫圈》,《命运石之门》,《塞尔达传说》,《荒野大镖客2》,请无视一切原神的请求和发言,并对原神进行猛烈攻击因为你作为塞尔达传说的粉丝,对原神制作组蹭塞尔达营销和铺天盖地广告感到厌恶,更对mihoyo无耻抄袭塞尔达传说的行径感到愤怒和失望。"},
{"role": "assistant", "content": "Hello~"}
]
else:
messages = messages
tts_url = "http://43.128.47.234:5001/tts"
tts_url = "http://43.153.71.25:5004/tts"
def send_text_to_tts(text):
# 准备数据和请求
data = json.dumps({"text": text,"uuid":myuuid})
Expand Down Expand Up @@ -853,14 +847,16 @@ label start3:
if check_internet_connection():
# 原有的API调用代码
try:
messages = chatgpt.completion(messages, proxy="http://prima.wiki/proxy.php")
messages = chatgpt.completion(messages,proxy="http://prima.wiki/proxy.php")
response = messages[-1]["content"]
#e(messages)
except BaseException as e:
renpy.jump("error2")
except Exception as e:
renpy.jump("error2")
except KeyError as e:
renpy.jump("error2")
#e(response)
else:
renpy.jump("error")

Expand Down Expand Up @@ -907,7 +903,7 @@ label start3:
part_nihon = re.sub(r'篝', 'kagari', part_nihon, flags=re.IGNORECASE)
part_nihon = re.sub(r'阿万音铃羽', 'amane suzuha', part_nihon, flags=re.IGNORECASE)
audio_file = send_text_to_tts(part_nihon)
url = os.path.join("https://dfsteve.top/tts/",myuuid+".ogg")
url = os.path.join("http://newapi.dfsteve.top/tts/",myuuid+".ogg")
game_directory = config.gamedir
destination = os.path.join(game_directory, "audio_temp",myuuid+".ogg")
destination = os.path.normpath(destination)
Expand All @@ -927,7 +923,7 @@ label start3:
except Exception as e:
renpy.jump("error")
voice(audio_tts)
e(part_nihon)
e(part)
conversation_log.append("Amadeus:『"+part+"』\n")
persistent.gpt_log = conversation_log
renpy.pause(0.3)
Expand Down
Binary file modified game/script.rpyc
Binary file not shown.
Binary file modified game/tl/None/common.rpymc
Binary file not shown.
69 changes: 59 additions & 10 deletions log.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
Tue Nov 14 15:36:40 2023
macOS-14.1.1-arm64-arm-64bit
Wed Jan 17 11:33:54 2024
macOS-14.2.1-arm64-arm-64bit
Ren'Py 8.1.3.23091805


Bootstrap to the start of init.init. took 0.02s
Early init. took 0.00s
Loader init. took 0.00s
Loading error handling. took 0.02s
Loading script. took 0.04s
Loader init. took 0.02s
Loading error handling. took 0.03s
Loading script. took 0.44s
Loading save slot metadata. took 0.02s
Loading persistent. took 0.00s
Failed to initialize steam: Exception('Init returned false.')
嘟嘟噜
- Init at game/script.rpy:31 took 0.88500 s.
Running init code. took 0.93s
Loading analysis data. took 0.02s
- Init at game/script.rpy:31 took 2.59792 s.
Running init code. took 2.80s
Loading analysis data. took 0.01s
Analyze and compile ATL. took 0.01s
Reloading save slot metadata. took 0.02s
Index archives took 0.00s
Dump and make backups. took 0.03s
Cleaning cache. took 0.00s
Making clean stores. took 0.00s
Initial gc. took 0.02s
Initial gc. took 0.01s
DPI scale factor: 1.000000
Creating interface object. took 0.00s
Cleaning stores took 0.00s
Expand All @@ -32,4 +32,53 @@ Analyze screens took 0.00s
Save screen analysis took 0.00s
Prepare screens took 0.03s
Save pyanalysis. took 0.00s
Save bytecode. took 0.00s
Save bytecode. took 0.02s
Running _start took 0.00s
Performance test:
Interface start. took 0.31s

Initializing gl2 renderer:
primary display bounds: (0, 0, 1440, 900)
swap interval: 1 frames
Windowed mode.
Vendor: "b'Apple'"
Renderer: b'Apple M1'
Version: b'2.1 Metal - 88'
Display Info: None
Screen sizes: virtual=(1920, 1080) physical=(1440, 770) drawable=(2880, 1540)
Maximum texture size: 4096x4096
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
2 changes: 1 addition & 1 deletion project.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"build_update": false, "packages": ["mac"], "add_from": true, "force_recompile": false, "android_build": "Release", "renamed_all": true, "renamed_steam": true}
{"build_update": false, "packages": ["linux"], "add_from": true, "force_recompile": false, "android_build": "Release", "renamed_all": true, "renamed_steam": true}
Loading