mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-08 12:46:05 +00:00
Support Microsoft Excel #93 + ChatGPT
This commit is contained in:
parent
796918e07e
commit
ae04570d40
|
@ -2,16 +2,29 @@ var Office = require("lib/msoffice");
|
||||||
var ChatGPT = require("lib/chatgpt");
|
var ChatGPT = require("lib/chatgpt");
|
||||||
|
|
||||||
function main(args) {
|
function main(args) {
|
||||||
var excel = new Office.Excel();
|
var excel = new Office.Excel();
|
||||||
|
|
||||||
excel.open();
|
// 질문 목록
|
||||||
|
var questions = [
|
||||||
|
"엄마가 좋아 아빠가 좋아?",
|
||||||
|
"나도 모르는 사이 내 통장에 100억이 입금되어 있다면?",
|
||||||
|
"내 친구가 술에 취해 뻗었는데 신민아가 단둘이 술 먹자고 한다면, 친구 버리고 가도 되나?",
|
||||||
|
"회사 야유회를 가서 과장님과 같은 텐트에서 자고 있는데 우리 텐트에 뱀이 들어왔다면 과장님 깨워야 되나, 안 깨우고 혼자 도망쳐야 되나?"
|
||||||
|
];
|
||||||
|
|
||||||
var message = ChatGPT.chat("Say this is a test!");
|
// 엑셀 열기
|
||||||
console.log(message);
|
excel.open();
|
||||||
|
|
||||||
|
// 질문에 답하기
|
||||||
|
var i = 1;
|
||||||
|
questions.forEach(function(x) {
|
||||||
|
var answer = ChatGPT.chat(x);
|
||||||
|
console.log("받은 답변:", answer);
|
||||||
|
excel.setValueByPosition(i, 1, answer);
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
|
||||||
excel.setValueByPosition(1, 1, message);
|
//excel.close();
|
||||||
|
|
||||||
//excel.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.main = main;
|
exports.main = main;
|
Loading…
Reference in New Issue
Block a user