This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 77c5d16
Showing
12 changed files
with
893 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.DS_Store | ||
*.[56789ao] | ||
*.a[56789o] | ||
*.so | ||
*.pyc | ||
._* | ||
.nfs.* | ||
[56789a].out | ||
*~ | ||
*.orig | ||
*.rej | ||
*.exe | ||
.*.swp | ||
core | ||
*.cgo*.go | ||
*.cgo*.c | ||
_cgo_* | ||
_obj | ||
_test | ||
_testmain.go | ||
|
||
/VERSION.cache | ||
/bin/ | ||
/build.out | ||
/doc/articles/wiki/*.bin | ||
/goinstall.log | ||
/last-change | ||
/misc/cgo/life/run.out | ||
/misc/cgo/stdio/run.out | ||
/misc/cgo/testso/main | ||
/pkg/ | ||
/src/*.*/ | ||
/src/cmd/cgo/zdefaultcc.go | ||
/src/cmd/dist/dist | ||
/src/cmd/go/internal/cfg/zdefaultcc.go | ||
/src/cmd/internal/objabi/zbootstrap.go | ||
/src/go/build/zcgo.go | ||
/src/go/doc/headscan | ||
/src/internal/buildcfg/zbootstrap.go | ||
/src/runtime/internal/sys/zversion.go | ||
/src/unicode/maketables | ||
/src/time/tzdata/zzipdata.go | ||
/test.out | ||
/test/garbage/*.out | ||
/test/pass.out | ||
/test/run.out | ||
/test/times.out | ||
/.idea | ||
/.idea/* | ||
|
||
/configs/tokens.conf | ||
/bin/* | ||
/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 DrunkLeen | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
BUILD_DIR = ./bin | ||
APP_NAME = "TimeFarmBot" | ||
|
||
build: build-windows-arm build-windows-amd64 build-linux-arm build-linux-amd64 | ||
@mkdir "$(BUILD_DIR)/configs" | ||
@touch "$(BUILD_DIR)/configs/query.conf" | ||
|
||
build-windows-arm: | ||
@GOOS=windows GOARCH=arm go build -o $(BUILD_DIR)/$(APP_NAME)-windows-arm.exe | ||
|
||
build-windows-amd64: | ||
@GOOS=windows GOARCH=amd64 go build -o $(BUILD_DIR)/$(APP_NAME)-windows-x86_64.exe | ||
|
||
build-linux-arm: | ||
@GOOS=linux GOARCH=arm go build -o $(BUILD_DIR)/$(APP_NAME)-linux-arm | ||
|
||
build-linux-amd64: | ||
@GOOS=linux GOARCH=amd64 go build -o $(BUILD_DIR)/$(APP_NAME)-linux-x86_64 | ||
|
||
clean: | ||
@rm -rf $(BUILD_DIR) | ||
# | ||
#run: build | ||
# @./bin/blumbot | ||
|
||
|
||
run: build | ||
@sh -c '\ | ||
OS=$$(uname -s | tr A-Z a-z); \ | ||
ARCH=$$(uname -m); \ | ||
case "$${OS}" in \ | ||
linux) \ | ||
case "$${ARCH}" in \ | ||
x86_64) \ | ||
echo "Running Linux AMD64 binary..."; \ | ||
$(BUILD_DIR)/$(APP_NAME)-linux-x86_64 ;; \ | ||
arm*|aarch64) \ | ||
echo "Running Linux ARM binary..."; \ | ||
$(BUILD_DIR)/$(APP_NAME)-linux-arm ;; \ | ||
esac ;; \ | ||
darwin) \ | ||
case "$${ARCH}" in \ | ||
x86_64) \ | ||
echo "Running macOS AMD64 binary..."; \ | ||
$(BUILD_DIR)/$(APP_NAME)-darwin-x86_64 ;; \ | ||
arm*|aarch64) \ | ||
echo "Running macOS ARM binary..."; \ | ||
$(BUILD_DIR)/$(APP_NAME)-darwin-arm ;; \ | ||
esac ;; \ | ||
msys*|cygwin*|mingw*) \ | ||
case "$${ARCH}" in \ | ||
x86_64) \ | ||
echo "Running Windows AMD64 binary..."; \ | ||
$(BUILD_DIR)/$(APP_NAME)-windows-x86_64.exe ;; \ | ||
arm*|aarch64) \ | ||
echo "Running Windows ARM binary..."; \ | ||
$(BUILD_DIR)/$(APP_NAME)-windows-arm.exe ;; \ | ||
esac ;; \ | ||
*) echo "Unsupported OS: $${OS}" ;; \ | ||
esac' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
## [TimeFarm](https://t.me/TimeFarmCryptoBot?start=t7VMMd2tHp04UGDg) Bot | ||
--- | ||
|
||
### Overview | ||
This bot is designed to automate various tasks in a Telegram mini-app [TimeFarm](https://t.me/TimeFarmCryptoBot?start=t7VMMd2tHp04UGDg). | ||
|
||
### Features | ||
- Automatically generates tokens | ||
- Automated Task Start/Claim Farming | ||
- Mission Management: Starts missions and claims the mission balance once completed | ||
|
||
### Getting Started | ||
#### Prerequisites | ||
Before you begin, ensure you have met the following | ||
requirements: | ||
- You have a Telegram account | ||
- You have to download the executable of build it from source | ||
|
||
How to get query? Follow this steps: | ||
1. open Telegram Desktop and login. | ||
2. go to `Settings` | ||
3. click on `Advanced` | ||
4. click on `Experimental settings` | ||
5. turn on `Enable webview inspecting` | ||
6. go your BlumBot page and click on `Launch Blum` | ||
7. right click on the blum page and select `Inspect Element` | ||
8. click on `Application` tab | ||
9. in the left bar use the dropdown next to `session storage` and click on `telegram.blum.codes` | ||
10. select `telegram_initparam` | ||
11. right click on `tgwebappdata` and select `copy value` | ||
12. create a new directory in the same directory as executable file and name it `configs` | ||
13. create a new blank file with the name `query_list.conf` | ||
14. paste your query IDs | ||
15. run the bot and enjoy! | ||
|
||
|
||
### Disclaimer | ||
|
||
This bot is intended for educational purposes only. Use it at your own risk. The author is not responsible for any misuse or damage caused by using this bot. | ||
|
||
### Contributing | ||
|
||
Contributions are welcome! Please follow these steps to contribute: | ||
|
||
1. Fork the repository. | ||
2. Create a new branch (git checkout -b feature/your-feature). | ||
3. Make your changes and commit them (git commit -m 'Add some feature'). | ||
4. Push to the branch (git push origin feature/your-feature). | ||
Create a pull request. | ||
|
||
### License | ||
|
||
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module github.com/drunkleen/TimeFarm-Bot | ||
|
||
go 1.21.12 | ||
|
||
require ( | ||
github.com/fatih/color v1.17.0 // indirect | ||
github.com/mattn/go-colorable v0.1.13 // indirect | ||
github.com/mattn/go-isatty v0.0.20 // indirect | ||
golang.org/x/sys v0.22.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= | ||
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= | ||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= | ||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= | ||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= | ||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= | ||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= | ||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= | ||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= | ||
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= | ||
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"github.com/drunkleen/TimeFarm-Bot/requests" | ||
"github.com/drunkleen/TimeFarm-Bot/utils" | ||
"log" | ||
"strconv" | ||
"strings" | ||
"time" | ||
) | ||
|
||
var ( | ||
tokenList []string | ||
generateTokenEnable bool | ||
//upgradeEnable bool | ||
taskAutoClaimEnable bool | ||
) | ||
|
||
func main() { | ||
utils.ClearScreen() | ||
utils.PrintLogo() | ||
parseArgs() | ||
|
||
if generateTokenEnable { | ||
queries, err := utils.ParseQueries() | ||
if err != nil { | ||
panic(err) | ||
} | ||
query: | ||
for _, queryID := range queries { | ||
err := requests.GetAndSaveToken(queryID) | ||
if err != nil { | ||
fmt.Printf(utils.Red("Error generating token for query:\n%s\n"), queryID) | ||
continue query | ||
} | ||
err = utils.DeleteQuery(queryID) | ||
if err != nil { | ||
fmt.Printf(utils.Red("Error deleting query from list:\n%s\n"), queryID) | ||
} | ||
} | ||
} | ||
var err error | ||
tokenList, err = utils.ParseTokens() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
runLoop() | ||
} | ||
|
||
func runLoop() { | ||
var startTime time.Time = time.Now() | ||
var printString string | ||
for { | ||
for tokenIndex, tokenVal := range tokenList { | ||
printString += fmt.Sprintf(utils.Green("--------------------- Account: %d ----------------------\n"), tokenIndex) | ||
status, err := requests.CheckFarmingStatus(tokenVal) | ||
if err != nil { | ||
log.Printf("Error checking farming status for token %d: %v\n", tokenIndex+1, err) | ||
continue | ||
} | ||
|
||
if taskAutoClaimEnable { | ||
tasksResp, err := requests.CheckTasks(tokenVal) | ||
if err != nil { | ||
printString += fmt.Sprintf(utils.Red("Error checking tasks %v\n"), err) | ||
} | ||
|
||
taskResponses: | ||
for _, t := range tasksResp { | ||
if t.Submission.Status == "CLAIMED" || t.Title == "Connect TON wallet" { | ||
continue taskResponses | ||
} | ||
if t.Submission.Status == "SUBMITTED" { | ||
_, err := requests.ClaimTasks(tokenVal, t.Id) | ||
if err != nil { | ||
printString += fmt.Sprintf(utils.Red("Error claiming task: %s\n"), t.Title) | ||
} | ||
continue taskResponses | ||
} | ||
_, err := requests.SubmitTasks(tokenVal, t.Id) | ||
if err != nil { | ||
printString += fmt.Sprintf(utils.Red("Error submitting task: %v\n"), t.Title) | ||
} | ||
} | ||
} | ||
|
||
_, _ = requests.UpgradeLevel(tokenVal) | ||
|
||
farmingResponse, err := requests.FinishFarming(tokenVal) | ||
if err != nil { | ||
printString += fmt.Sprintf(utils.Red("Error finishing farming %v\n"), err) | ||
continue | ||
} | ||
|
||
if errorValue, ok := farmingResponse["error"].(map[string]any); ok { | ||
if message, ok := errorValue["message"].(string); ok { | ||
if message == "Farming didn't start" { | ||
_, err := requests.StartFarming(tokenVal) | ||
if err != nil { | ||
printString += fmt.Sprintf("Error starting farming") | ||
} | ||
printString += fmt.Sprintf("Farming started successfully!\n") | ||
} | ||
} | ||
} | ||
|
||
startedAt, err := time.Parse(time.RFC3339, status.ActiveFarmingStartedAt) | ||
if err != nil { | ||
fmt.Printf("Error parsing time: %v\n", err) | ||
continue | ||
} | ||
|
||
duration := time.Duration(status.FarmingDurationInSec) * time.Second | ||
BalanceFloat, _ := strconv.ParseFloat(status.Balance, 64) | ||
|
||
printString += fmt.Sprintf( | ||
"Balance: %.0f | Start: %v | End: %v\n", | ||
BalanceFloat, | ||
startedAt.Format(time.Kitchen), | ||
utils.FormatLeftDuration(startedAt.Add(duration).Sub(time.Now())), | ||
) | ||
} | ||
|
||
utils.ClearScreen() | ||
utils.PrintLogo() | ||
fmt.Printf(utils.Cyan(" Current Time: %v\n"), time.Now().UTC().Format(time.Kitchen)) | ||
fmt.Println(printString) | ||
fmt.Println(utils.Green("-------------------------------------------------------")) | ||
|
||
fmt.Printf(utils.Cyan(" Up Time: %v\n"), utils.FormatLeftDuration(time.Since(startTime))) | ||
printString = "" | ||
time.Sleep(5 * time.Second) | ||
|
||
} | ||
} | ||
|
||
func parseArgs() { | ||
generateToken := flag.String("generate-query", "", "Do you want generate tokens from ./configs/query.conf? (y/N): ") | ||
//autoUpgradeClock := flag.String("upgrade", "", "Do you want auto upgrade clock? (y/N)") | ||
tasks := flag.String("task", "", "Do you want to auto claim tasks? (Y/n): ") | ||
flag.Parse() | ||
|
||
if *generateToken == "" { | ||
fmt.Print("Do you want generate tokens from ./configs/query.conf? (y/N): ") | ||
var generateTokenInput string | ||
fmt.Scanln(&generateTokenInput) | ||
generateTokenInput = strings.TrimSpace(strings.ToLower(generateTokenInput)) | ||
|
||
if generateTokenInput == "y" || generateTokenInput == "yes" { | ||
generateTokenEnable = true | ||
} | ||
} | ||
//if *autoUpgradeClock == "" { | ||
// fmt.Print("Do you want auto upgrade clock? (y/N): ") | ||
// var upgradeInput string | ||
// fmt.Scanln(&upgradeInput) | ||
// upgradeInput = strings.TrimSpace(strings.ToLower(upgradeInput)) | ||
// | ||
// if upgradeInput == "y" || upgradeInput == "yes" { | ||
// upgradeEnable = true | ||
// } | ||
//} | ||
if *tasks == "" { | ||
fmt.Print("Do you want to auto claim tasks? (Y/n): ") | ||
var taskInput string | ||
fmt.Scanln(&taskInput) | ||
taskInput = strings.TrimSpace(strings.ToLower(taskInput)) | ||
|
||
if taskInput == "" || taskInput == "y" || taskInput == "yes" { | ||
taskAutoClaimEnable = true | ||
} | ||
} | ||
} |
Oops, something went wrong.