Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from class-tools/dev
Browse files Browse the repository at this point in the history
VER 1.0.1
  • Loading branch information
jsh-jsh authored Mar 16, 2022
2 parents 1926f8d + fe7766e commit 317c825
Show file tree
Hide file tree
Showing 10 changed files with 159 additions and 44 deletions.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/BugReport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Bug Report
about: Bug report template Issues.
---

[comment]: <> (Please set the title to "BUG ${Your Title}".)

Description:

Screenshot (If any):

Terminal Output (If any):

Program Version:

Operating System Version:
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/NewRecommendations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: New Recommendations
about: New Recommendations for this program.
---

[comment]: <> (Please set the title to "REC ${Your Title}".)

Description:

Expected Effect Picture (If any):
18 changes: 18 additions & 0 deletions .github/workflows/checkiss.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---

name: No Free usage issue checker

on:
issues:
types: [opened, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check issue actor
uses: fluttercandies/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
forked: '--no-forked'
words: To support our project, please file the issue after you starred the repo. Thanks! 🙂
18 changes: 18 additions & 0 deletions .github/workflows/gitmsg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---

name: Check Commit Message

on: [push, pull_request]
jobs:
check:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Install exlg-git-commit-msg-std
run: |
npm config set registry http://registry.npmjs.org/
yarn config set registry https://registry.yarnpkg.com
yarn add exlg-git-commit-msg-std
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vscode/
*.exe
*.txt
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Class Tools Develop Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# Web-Class-Helper
# Web-Class-Helper

A practical command line gadget during online class.

**English** | [简体中文](./README.zh-Hans.md)

### Contributors

| <img src="https://avatars.githubusercontent.com/u/68993466?v=4" width="60px"></br> jsh-jsh (jinshuhang) | <img src="https://avatars.githubusercontent.com/u/53416099?v=4" width="60px"></br> ren-yc (Yuchen Ren) |
| :---: | :---: |
| ![](https://shields.io/badge/Coding-green?logo=visual-studio-code&style=for-the-badge)<br>![](https://shields.io/badge/BugTester-yellow?logo=open-bug-bounty&style=for-the-badge) | ![](https://shields.io/badge/Coding-green?logo=visual-studio-code&style=for-the-badge)<br>![](https://shields.io/badge/BugTester-yellow?logo=open-bug-bounty&style=for-the-badge) |
11 changes: 11 additions & 0 deletions README.zh-Hans.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Web-Class-Helper

一个在网课期间实用的命令行小工具。

[English](./README.md) | **简体中文**

### 贡献名单

| <img src="https://avatars.githubusercontent.com/u/68993466?v=4" width="60px"></br> jsh-jsh (jinshuhang) | <img src="https://avatars.githubusercontent.com/u/53416099?v=4" width="60px"></br> ren-yc (Yuchen Ren) |
| :---: | :---: |
| ![](https://shields.io/badge/Coding-green?logo=visual-studio-code&style=for-the-badge)<br>![](https://shields.io/badge/BugTester-yellow?logo=open-bug-bounty&style=for-the-badge) | ![](https://shields.io/badge/Coding-green?logo=visual-studio-code&style=for-the-badge)<br>![](https://shields.io/badge/BugTester-yellow?logo=open-bug-bounty&style=for-the-badge) |
90 changes: 49 additions & 41 deletions WCH.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
Web-Class-Helper v1.0.0
JSH
Web-Class-Helper v1.0.1
Under MIT License
Class Tools Develop Team (jsh-jsh ren-yc)
*/
//#include <winsock2.h>
#include <stdio.h>
#include <windows.h>
#include <conio.h>
Expand Down Expand Up @@ -40,11 +40,11 @@ string Weekdayname[7] = {
"Friday.txt",
"Saturday.txt"};
int n;
bool fgh=1;
bool fgh=true;
ifstream fin;
ofstream fout;
int main(){
system("mode con cols=50 lines=5");
system("mode con cols=100 lines=20");
SetConsoleTitle("Web-Class-Helper");
TalkDate q=GetTime();
if (q.Month == 1 || q.Month == 2)
Expand All @@ -62,12 +62,14 @@ int main(){
string tname="NULL";
fin>>h>>m>>tname;
mm.emplace(make_pair(h,make_pair(m,tname)));
//cout<<mm.count(h)<<endl;
}
printf("Please input your name:");
printf("Web-Class-Helper 1.0.1\n");
printf("Copyright (c) 2022 Class Tools Develop Team.\n");
printf("Type 'help' to get help.\n\n");
printf("Please input your username: ");
cin >> op;
printf("Welcome\n");
while(op!="bye"){
printf("\n");
while(op!="quit"){
int h=GetTime().Hour;
for (auto it = mm.equal_range(h).first; it != mm.equal_range(h).second; it++)
{
Expand All @@ -77,6 +79,14 @@ int main(){
MessageBox(NULL, ((it->second).second).c_str(), "Web-Class-Helper", MB_OK);
}
}
if(JudgeKey()){
HideWindow(1);
fgh=true;
}
if (fgh){
printf("$ ");
cin >> op;
}
if(op=="add"){
int h=0;
int m=0;
Expand All @@ -91,8 +101,17 @@ int main(){
mm.emplace(make_pair(h, make_pair(m, tname)));
PrintOK();
}
}
if(op=="delete"){
}else if(op=="help"){
printf("Commands:\n");
printf("1.quit (Quit this program)\n");
printf("2.add hour minute name (Add clock at hour:minute)\n");
printf("3.delete hour minute name (Delete clock at hour:minute)\n");
printf("4.change hour minute name (Change clock at hour:minute)\n");
printf("5.ow (Get a sentence) **From web**\n");
printf("6.hide (Hide the command line window)\n");
printf("7.game (Guessing game)\n");
printf("8.time (Get time at once)\n");
}else if(op=="delete"){
int h=0;
int m=0;
int flag=0;
Expand All @@ -112,8 +131,7 @@ int main(){
if(!flag){
PrintError();
}
}
if(op=="change"){
}else if(op=="change"){
int h = 0;
int m = 0;
int flag = 0;
Expand All @@ -133,27 +151,17 @@ int main(){
{
PrintError();
}
}
if(op=="ow"){
}else if(op=="ow"){
GetGet();
}
if(JudgeKey()){
HideWindow(1);
fgh=1;
}
if (fgh == 1)
{
cin >> op;
}
if(op=="hide"){
}else if(op=="hide"){
HideWindow(0);
fgh=0;
}
if(op=="game"){
fgh=false;
}else if(op=="game"){
Game();
}
if(op=="time"){
}else if(op=="time"){
PrintTime(GetTime());
}else{
printf("%s: The command %s is not recognized as a command.\n", op.c_str(), op.c_str());
}
}
fout.open(Weekdayname[Week].c_str());
Expand Down Expand Up @@ -182,18 +190,18 @@ TalkDate GetTime()
}
void Bye()
{
printf("Have a good time. Good bye");
printf("Have a good time. Good bye.\n");
}
void Lazy()
{
printf("This code is very lazy,So it didn't work\n");
printf("This code is very lazy, So it didn't work.\n");
}
void PrintTime(TalkDate a)
{
printf("%d %d %d %d %d %d\n", a.Year, a.Month, a.Day, a.Hour, a.Minute, a.Second);
printf("%d/%02d/%02d %02d %02d %02d\n", a.Year, a.Month, a.Day, a.Hour, a.Minute, a.Second);
}
void PrintError(){
printf("This input or code is wrong.Please see your code.\n");
printf("This input or code is wrong. Please see your code.\n");
}
inline void in_data(string fname)
{
Expand All @@ -205,7 +213,7 @@ inline void out_data(string fname)
}
void HideWindow(bool ju)
{
HWND hwnd = FindWindow("ConsoleWindowClass",NULL);
HWND hwnd = FindWindow("ConsoleWindowClass", NULL);
if (hwnd)
{
ShowWindow(hwnd, ju);
Expand All @@ -215,30 +223,30 @@ bool JudgeKey(){
int a=GetKeyState(VK_CONTROL);
int b=GetKeyState(VK_DOWN);
if(a<0&&b<0){
return 1;
return true;
}
else{
return 0;
return false;
}
}
void Game(){
srand(time(0));
int n=rand()%10000+1;
int z=0;
while(z!=n){
printf("Please input your number:");
printf("Please input your number: ");
cin>>z;
if(z>n){
printf("Please smaller\n");
printf("The answer is smaller.\n");
}
if(z<n){
printf("Please bigger\n");
printf("The answer is bigger.\n");
}
if(z==-100000){
return ;
}
}
printf("Yeah!!You WIN!!\n");
printf("The answer is %d. You WIN!!!\n", n);
return ;
}
void PrintOK(){
Expand Down
4 changes: 2 additions & 2 deletions WCH.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ char name[32];
int cnt[8];
void GetGet()
{
int uid, len, i = 0;
int len;
DWORD unused;
char url[128], user[16], *file, *ptr;
char url[128], *file;
HANDLE hFile;
hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
char ss[128] = "https://v1.hitokoto.cn/?encode=text";
Expand Down

0 comments on commit 317c825

Please sign in to comment.