GithubHelp home page GithubHelp logo

Comments (6)

swolewizard avatar swolewizard commented on July 21, 2024

Something like adding Thread.Sleep(750) in the loop

int ms = 750;
int num = 0;
            for (int index = 0; index < LootItems.Count; ++index)
            {
                if (!LootItems[index].Rolled)
                {
                    RollItem(RollOption.Pass, index);
                    Thread.Sleep(ms);
                    ++num;
                }
            }

[Command("/pass")]
[HelpMessage("Pass on things you haven't rolled for yet.")]
public void PassCommand(string command, string args)
{
int num = 0;
for (int index = 0; index < LootItems.Count; ++index)
{
if (!LootItems[index].Rolled)
{
RollItem(RollOption.Pass, index);
++num;
}
}

from xivplugins.

swolewizard avatar swolewizard commented on July 21, 2024

Did a lil testing, you'd have to use something a little more elegant than Thread.Sleep as it freezes the entire game, until the Thread.Sleep is done.

from xivplugins.

swolewizard avatar swolewizard commented on July 21, 2024

I added this instead of Thread.Sleep

await Task.Delay(1000);

and now it works as intended

from xivplugins.

swolewizard avatar swolewizard commented on July 21, 2024

I didn't really know how to make dalamud plugins but after 4-5 hours, I've got the hang of it.
I managed to create this for myself in a fork, I added configuration to toggle enable Delay and set the min/max random delay, by default its 500ms-750ms
and each command has the option to be delayed.

If you'd like to use the code I added in the fork for this plugin, let me know and I'll send a merge request.

from xivplugins.

Aida-Enna avatar Aida-Enna commented on July 21, 2024

Heya, nice work! Sure, send over a PR and I'll add it in. 👍

from xivplugins.

Aida-Enna avatar Aida-Enna commented on July 21, 2024

Solved by #6. Thanks again!

from xivplugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.