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

ASAP VERY IMPORTNAT #5

Open
wants to merge 59 commits into
base: Buttons
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
3ba3466
Update README.md
Gold512 Feb 21, 2022
9859a94
added support for using trade command to gift
Gold512 Mar 2, 2022
f83c8cd
Update README.md
Gold512 Mar 2, 2022
a21c68f
Update README.md
Gold512 Mar 2, 2022
0982f6b
Merge branch 'Buttons' of https://github.com/Gold512/dankgrinder into…
Gold512 Mar 2, 2022
df738b2
made instance wait for master trade confirmation
Gold512 Mar 2, 2022
56b72f7
Added MaxItemsPerTrade
Gold512 Mar 3, 2022
9872a9e
add basic multi item trade system
Gold512 Mar 3, 2022
f20a5b3
Update README.md
Gold512 Mar 3, 2022
e3b4ed4
bug fixes
Gold512 Mar 3, 2022
45da1f4
Merge pull request #1 from Gold512/multi-item-trade
Gold512 Mar 3, 2022
853c414
Revert "Multi item trade"
Gold512 Mar 4, 2022
5e9a244
Merge pull request #2 from Gold512/revert-1-multi-item-trade
Gold512 Mar 4, 2022
0939849
slight refactoring
Gold512 Mar 4, 2022
e37e315
minor refactoring
Gold512 Mar 4, 2022
d182b95
fixed crash when master attempts to accept trade when dormant
Gold512 Mar 6, 2022
9c814a5
Merge branch 'Buttons' into multi-item-trade
Gold512 Mar 6, 2022
0336539
Merge pull request #3 from Gold512/multi-item-trade
Gold512 Mar 6, 2022
b429d02
Revert "Multi item trade"
Gold512 Mar 6, 2022
ce570aa
Merge pull request #4 from Gold512/revert-3-multi-item-trade
Gold512 Mar 6, 2022
046b8a0
fixed all the bugs i found, should not crash anymore
Gold512 Mar 6, 2022
f1c4056
re-compiled dankgrinder.exe
Gold512 Mar 6, 2022
52ff4d4
added more comments
Gold512 Mar 6, 2022
b9f9835
fixed auto highlow clicking the high button when supposed to click ja…
Gold512 Mar 6, 2022
77efe76
small bug fixes
Gold512 Mar 7, 2022
3b3171a
re-built dankgrinder exe
Gold512 Mar 10, 2022
783984a
now uses pls trade instead of share
Gold512 Mar 10, 2022
2a7f03c
added instances field to default config as well
Gold512 Mar 21, 2022
124de99
Fixed typo in readme
Gold512 Mar 21, 2022
3c94687
if not enough coins due to tax now retries with the original amount -…
Gold512 Mar 21, 2022
8afdbd1
bug fixes, now checks if master is valid
Gold512 Mar 21, 2022
7732e6a
Remove unnecessary check
Mar 22, 2022
68b6f4a
Unnecessary Fields
Mar 22, 2022
940d571
Remove unnecessary fields from here as well!
Mar 22, 2022
4a68467
Merge pull request #6 from DscNLg/Trading-Main
Gold512 Mar 22, 2022
0b52648
Revert "Remove Unnecessary config fields"
Gold512 Mar 23, 2022
e28bf29
Merge pull request #7 from Gold512/revert-6-Trading-Main
Gold512 Mar 23, 2022
cb76b33
Update README.md
Gold512 Mar 24, 2022
5864344
rebuilt executable
Gold512 Mar 25, 2022
2337288
Merge branch 'Trading-Main' of https://github.com/Gold512/dankgrinder…
Gold512 Mar 25, 2022
803bfb0
Fixed endless failing share loop
Gold512 Mar 26, 2022
15936df
updated default config
Gold512 Mar 26, 2022
d9cb566
fixed bug
Gold512 Mar 26, 2022
2b26561
recompiled exe
Gold512 Mar 26, 2022
c5f3fef
updated readme
Gold512 Mar 26, 2022
ada6c35
bux fixes
Gold512 Mar 28, 2022
1a3ba50
bug fix
Gold512 Mar 28, 2022
2727b32
rebuild
Gold512 Mar 28, 2022
4bf39d9
improved error messages to make debugging easier
Gold512 Mar 29, 2022
887c8d5
changed default config
Gold512 Mar 29, 2022
6b8dbe9
Update README.md
Gold512 Mar 30, 2022
89b3aa2
Update README.md
Gold512 Mar 31, 2022
e51f55a
Update README.md
Gold512 Apr 20, 2022
8e891b6
Merge branch 'V4NSH4J:Buttons' into Trading-Main
Gold512 Apr 27, 2022
48de038
rebuilt executable
Gold512 Apr 27, 2022
a23403a
Make dankmemer's ID a string to stop integer overflow
QuartzWarrior Jun 20, 2022
2f2f27e
Merge pull request #9 from QuartzWarrior/patch-1
Gold512 Jul 15, 2022
6716c96
Merge branch 'V4NSH4J:Buttons' into Trading-Main
Gold512 Jul 15, 2022
bdc105a
Update README.md
Gold512 Aug 5, 2022
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
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
# This fork (V4NSH4J/dankgrinder) is no longer being maintained. It has more up-to-date functions than the parent repository however with Dank Memer updates, certain features are bound to be dysfunctional. However, this repository provides are very nice base which isn't detected by Discord and is compatible with the latest Discord interactions introduced in api v9. Feel free to fork and add your own features and fix existing ones!
## Credits
forked from [V4NSH4J/dankgrinder](https://github.com/V4NSH4J/dankgrinder)

[original project repository](https://github.com/dankgrinder/dankgrinder)

I just added some small changes as it was not being updated

## Changes from upstream
- Added support for using trade to transfer items and coins
- can trade multiple items at once see [`trade object`](#trade-object) in [`features object`](#features-object)
- detects if the instance does not have enough money due to tax and attempts to account for tax

## Bugfixes
- Now logs an error when coins sent it more then amount of coins (could cause a loop if it tries to account for tax and retrade)


# Dank Grinder [![](https://goreportcard.com/badge/github.com/dankgrinder/dankgrinder)](https://goreportcard.com/report/github.com/dankgrinder/dankgrinder) [![](https://img.shields.io/github/workflow/status/dankgrinder/dankgrinder/Go)](https://github.com/dankgrinder/dankgrinder/actions) ![](https://img.shields.io/github/license/dankgrinder/dankgrinder) [![](https://img.shields.io/github/v/release/dankgrinder/dankgrinder)](https://github.com/dankgrinder/dankgrinder/releases/latest) ![](https://img.shields.io/github/downloads/dankgrinder/dankgrinder/total)
The most feature-rich, advanced Dank Memer automation tool (Now compatible with buttons!).
Made by github.com/dankgrinder & Buttons, work, trivia, crime, search, dig, guess the number, scratch and fish added by github.com/v4nsh4j
trade and bugfixes by github.com/gold512

Want to join the community or need support? [Join our Discord](https://discord.gg/Fjzpq8YPSn) (Be sure to join with an unconnected fresh alt to prevent bot blacklist on main). Have a question? [Create a question issue](https://github.com/dankgrinder/dankgrinder/issues/new?assignees=&labels=question&template=question.md&title=). Want to suggest a feature? [Create a suggestion issue](https://github.com/dankgrinder/dankgrinder/issues/new?assignees=&labels=suggestion&template=suggestion.md&title=). Encountered a bug? [Report a bug](https://github.com/dankgrinder/dankgrinder/issues/new?assignees=&labels=bug&template=bug-report.md&title=). Want to contribute? [Read our contribution guidelines](https://github.com/dankgrinder/dankgrinder/blob/master/CONTRIBUTING.md).

Expand All @@ -21,6 +36,15 @@ Want to join the community or need support? [Join our Discord](https://discord.g
* Automatically uses tidepods and buys lifesavers when dying from them
* Automatically buys a fishing pole, hunting rifle or laptop if they have broken
* Can Automate most of dank memer's commands!

## Tips
### Using too much CPU/Network
Try using discord permissions to only allow the instances to see channels they need to use

### Trade not accepting
Try using smaller clusters, the master has a button ratelimit quota and can only click so many buttons
Then just add the masters of those clusters as instances in another config to collect from them (in a tree pattern)

## Getting started

### Installation
Expand Down Expand Up @@ -128,6 +152,7 @@ Name | Type | Description
`log_to_file` | boolean | Whether or not to log errors and information to a file
`debug` | boolean | Enable logging debug level information. Currently has no effect
`scratch` | [scratch object](#scratch-object) | Options for automatically using the scratch command.
`trade` | [trade object](#trade-object) | Options for trading

### Commands object
Name | Type | Description
Expand Down Expand Up @@ -174,6 +199,12 @@ Name | Type | Description
`interval` | integer | The interval at which items will be gifted during an active shift. If set to 0, items will only be gifted once at the beginning of every active shift
`items` | array of strings | The Dank Memer item ids of the items to gift

### trade object
Name | Type | Description
---- | ---- | ----
`max_items` | integer | Maximum amount of items per trade
`delay` | integer | Minimum amount of time between accepting trades for masters in milliseconds (to reduce ratelimits)

### Gifting & Sharing confirmations update
Run a custom command "pls settings confirmations false" on your alts for gifting and sharing to function properly!

Expand Down Expand Up @@ -250,7 +281,7 @@ Name | Type | Description
`gift` | integer | The cooldown of the gift command in seconds, set a few seconds higher to account for network delay
`share` | integer | The cooldown of the share command in seconds, set a few seconds higher to account for network delay
`dig` | integer | The cooldown of the dig command in seconds, set a few seconds higher to account for network delay
'work' | integer | The cooldown of the work command in seconds, set a few seconds higher to account for network delay
`work` | integer | The cooldown of the work command in seconds, set a few seconds higher to account for network delay
`trivia` | integer | The cooldown of the trivia command in seconds, set a few seconds higher to account for network delay
`crime` | integer | The cooldown of the crime command in seconds, set a few seconds higher to account for network delay
`scratch` | integer | The cooldown of the scratch command in seconds, set a few seconds higher to account for network delay
Expand All @@ -261,6 +292,7 @@ Name | Type | Description
---- | ---- | ----
`typing` | [typing object](#typing-object) | Options for the use of typing when sending messages
`message_delay` | [message delay object](#message-delay-object) | Delay between receiving a message and starting to type and send a response
`button_press` | [button press delay object](#button-press-delay-object)

### Typing object
Name | Type | Description
Expand All @@ -275,6 +307,13 @@ Name | Type | Description
`base` | integer | The base delay in milliseconds. [Read more about base and variation](#base-and-variation)
`variation` | integer | The random variation of the delay in milliseconds. [Read more about base and variation](#base-and-variation)

### Button press delay object
Name | Type | Description
---- | ---- | ----
`base` | integer | The base delay in milliseconds. [Read more about base and variation](#base-and-variation)
`variation` | integer | The random variation of the delay in milliseconds. [Read more about base and variation](#base-and-variation)


### Base and variation
A base is a value that forms the base for a final result; it is the value that the program starts with.

Expand Down
81 changes: 69 additions & 12 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@
# asking for support on GitHub or Discord.

clusters:
default:
cluster_1:
master:
token: ""
channel_id: ""


instances:
- token: ""
channel_id: ""
- token: ""
channel_id: ""

shifts:
- state: "dormant"
duration:
base: 1
variation: 10
- state: "active"
duration:
base: 7200
Expand Down Expand Up @@ -47,13 +57,17 @@ features:
crime : true
guess: false

trade:
max_items: 2
delay: 1000

scratch:
enable: false
amount: 50
priority: false

custom_commands:
- value: "pls work mod"
# custom_commands:
# - value: "pls work mod"
auto_buy:
fishing_pole: true
hunting_rifle: true
Expand All @@ -74,12 +88,55 @@ features:
items:
- "bank"
- "pizza"
- "diaper"
- "pepe"
- "potato"
- "pepestatue"
- "boar"
- "freshbread"
- "cookie"
- "deer"
- "ant"
- "dragon"
- "duck"
- "exoticfish"
- "commonfish"
- "garbage"
- "jellyfish"
- "junk"
- "legendaryfish"
- "rabbit"
- "rarefish"
- "seaweed"
- "skunk"
- "stickbug"
- "trash"
- "worm"
- "aetheryxflower"
- "armpithair"
- "badoszcard"
- "bean"
- "bunnysapron"
- "bean"
- "bluephallicobject"
- "bluesplane"
- "sand"
- "bunnysapron"
- "candy"
- "corncob"
- "corndog"
- "ducttape"
- "fossil"
- "bread"
- "goldenphallic"
- "meme"
- "normie"
auto_share:
enable: false
maximum_balance: 8000000
minimum_balance: 5000000
auto_blackjack:
enable: true
maximum_balance: 5000000
minimum_balance: 500000
auto_blackjack:
enable: false
amount: 50
pause_below_balance: 100
pause_above_balance: 50000000
Expand Down Expand Up @@ -359,9 +416,9 @@ features:
buy_lifesaver_on_death: true
balance_check:
enable: true
interval: 180
log_to_file: true
verbose_log_to_stdout: false
interval: 1800
log_to_file: false
verbose_log_to_stdout: true
debug: false

compatibility:
Expand Down Expand Up @@ -1143,7 +1200,7 @@ compatibility:
hunt: 63
blackjack: 13
sell: 6
gift: 26
gift: 8
share: 13
dig: 42
work: 3600
Expand Down
6 changes: 6 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ type Features struct {
VerboseLogToStdout bool `yaml:"verbose_log_to_stdout"`
Debug bool `yaml:"debug"`
Scratch Scratch `yaml:"scratch"`
Trade Trade `yaml:"trade"`
}
type Scratch struct {
Enable bool `yaml:"enable"`
Expand Down Expand Up @@ -145,6 +146,11 @@ type AutoGift struct {
Items []string `yaml:"items"`
}

type Trade struct {
MaxItems int `yaml:"max_items"`
Delay int `yaml:"delay"`
}

type CustomCommand struct {
Value string `yaml:"value"`
Interval int `yaml:"interval"`
Expand Down
8 changes: 8 additions & 0 deletions config/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ func validateFeatures(features Features) error {
if features.AutoShare.MinimumBalance > features.AutoShare.MaximumBalance {
return fmt.Errorf("auto-share minumum must be smaller than or equal to maximum")
}

if features.Trade.MaxItems <= 0 {
return fmt.Errorf("max items per trade must be greater than 0, encountered %v", features.Trade.MaxItems)
}

if features.Trade.Delay <= 0 {
return fmt.Errorf("trade delay must be greater than 0, encountered %v", features.Trade.Delay)
}
}
if features.AutoTidepod.Enable && features.AutoTidepod.Interval < 0 {
return fmt.Errorf("auto-tidepod interval must be greater than or equal to 0")
Expand Down
Binary file added dankgrinder.exe
Binary file not shown.
3 changes: 2 additions & 1 deletion instance/balancecheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ func (in *Instance) updateBalance(balance int) {
in != in.Master {
in.sdlr.PrioritySchedule(&scheduler.Command{
Value: fmt.Sprintf(
"pls share %v <@%v>",
"pls trade %v <@%v>",
balance-in.Features.AutoShare.MinimumBalance,
in.Master.Client.User.ID,
),
Log: "sharing all balance above minimum with master instance",
AwaitResume: true,
})
}
in.balance = balance
Expand Down
14 changes: 9 additions & 5 deletions instance/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ const (
blackjackBaseCmdValue = "pls bj"
sellBaseCmdValue = "pls sell"
shopBaseCmdValue = "pls shop"
giftBaseCmdValue = "pls gift"
shareBaseCmdValue = "pls share"
tradeBaseCmdValue = "pls trade"
digCmdValue = "pls dig"
workCmdValue = "pls work"
triviaCmdValue = "pls trivia"
Expand All @@ -56,12 +55,17 @@ func shopCmdValue(item string) string {
return fmt.Sprintf("%v %v", shopBaseCmdValue, item)
}

func giftCmdValue(amount, item, id string) string {
return fmt.Sprintf("%v %v %v <@%v>", giftBaseCmdValue, amount, item, id)
func tradeCmdValue(itemlist, id string) string {
// itemlist will always have a trailing space so it is not necessary here
return fmt.Sprintf("%v %v<@%v>", tradeBaseCmdValue, itemlist, id)
}

func tradeItemListValue(amount, item string) string {
return fmt.Sprintf("%v %v ", amount, item)
}

func shareCmdValue(amount, id string) string {
return fmt.Sprintf("%v %v <@%v>", shareBaseCmdValue, amount, id)
return fmt.Sprintf("%v %v <@%v>", tradeBaseCmdValue, amount, id)
}

// commands returns a command pointer slice with all commands that should be
Expand Down
Loading