Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
39 changes: 23 additions & 16 deletions gradlew
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to revert this file.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 14 additions & 12 deletions gradlew.bat
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And also revert this one.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions src/main/java/dev/shared/cudoriver/task/R01SevkiyatTask.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package dev.shared.cudoriver.task;

import eu.darkbot.api.API;
import eu.darkbot.api.extensions.Feature;
import eu.darkbot.api.extensions.Task;
import eu.darkbot.api.managers.BackpageAPI;
import eu.darkbot.api.utils.Inject;

@Feature(name = "R01 Dispatch Module", description = "Automatically collects and starts R01 dispatch tasks")
public class R01SevkiyatTask implements Task {

private final BackpageAPI backpage;
private long lastActionTime = 0;
private int currentSlot = 1;
private boolean collecting = true;

// 4 slot ve 3 saat bekleme
private static final int FIRST_SLOT_ID = 1;
private static final int LAST_SLOT_ID = 4;
private static final long ACTION_DELAY = 10800000L;
private static final int R01_RETRIEVER_ID = 1;

@Inject
public R01SevkiyatTask(BackpageAPI backpage) {
this.backpage = backpage;
}

@Override
public void onTickTask() {
if (System.currentTimeMillis() - lastActionTime < ACTION_DELAY) return;
if (backpage == null) return;

try {
if (collecting) {
backpage.getConnection("indexInternal.es?action=internalDispatch&subaction=collect&slotId=" + currentSlot);
Copy link
Copy Markdown
Contributor

@do-gamer do-gamer Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} else {
backpage.getConnection("indexInternal.es?action=internalDispatch&subaction=init&retrieverId=" + R01_RETRIEVER_ID + "&slotId=" + currentSlot);
}
updateState();
} catch (Exception e) {
// Hataları sessizce yut
}
}

private void updateState() {
lastActionTime = System.currentTimeMillis();
currentSlot++;

if (currentSlot > LAST_SLOT_ID) {
currentSlot = FIRST_SLOT_ID;
collecting = !collecting;
}
}
}
3 changes: 2 additions & 1 deletion src/main/resources/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"dev.shared.do_gamer.module.spaceball.Spaceball",
"dev.shared.do_gamer.behaviour.FixPetStuck",
"dev.shared.do_gamer.behaviour.RepairPet",
"dev.shared.do_gamer.task.CloseAdOffer"
"dev.shared.do_gamer.task.CloseAdOffer",
"dev.shared.cudoriver.task.R01SevkiyatTask"
],
"update": "https://raw.githubusercontent.com/Darkbot-Plugins/SharedPlugin/main/src/main/resources/plugin.json",
"download": "https://github.com/Darkbot-Plugins/SharedPlugin/releases/latest/download/SharedPlugin.jar"
Expand Down
Loading