[HELP] How can i put timer on this ?
Prerequisites
- [X] I have read and understood the user manual
- [X] I made sure I am running the latest development build
- [X] I tried to look for similar feature requests before opening a new one
Console Client Version
1.18.1
Describe your problem
//MCCScript 1.0 MCC.LoadBot(new UseItem());
//MCCScript Extensions public class UseItem : ChatBot { private bool enabled = false; public override void Initialize() { RegisterChatBotCommand("auto", "UseItem repeatly", "start, stop", CommandHandler); LogToConsole("Loaded"); }
public string CommandHandler(string cmd, string[] args)
{
if (args.Length >= 1)
{
switch (args[0])
{
case "start": enabled = true; break;
case "stop": enabled = false; break;
}
return "Switched to " + args[0];
}
else
{
return "Current: " + (enabled ? "running" : "stopped") + ". Use /auto start|stop to switch";
}
}
public override void Update()
{
if (enabled)
UseItemInHand();
}
}
Suggest a possible solution
No response
Attach screenshot here (If applicable)
No response
Minecraft Version
No response
Device
No response
Operating System
Windows
Given what your script does, you can just setup ScriptScheduler and create a task with action=useitem with the desired time interval, instead of writing a C# bot.
Given what your script does, you can just setup ScriptScheduler and create a task with
action=useitemwith the desired time interval, instead of writing a C# bot.
timeInterval=0 its means 0 sec but doesnt go fast its like 1 click per sec can i get faster than this ?
ScriptScheduler interval is expressed in seconds so the minimum value is indeed 1 second.
You can do useitem several times each second by using an external script (so it will do it several times then wait 1 second):
useitem.txt
useitem
useitem
useitem
tasks.ini
[Task]
triggerOnInterval=true
timeInterval=1
action=script useitem.txt