MCCTeam / Minecraft-Console-Client

Lightweight console for Minecraft chat and automated scripts
https://mccteam.github.io
Other
1.67k stars 402 forks source link

I want to script or code #2790

Closed xDarkLife55 closed 2 months ago

xDarkLife55 commented 2 months ago

I want to afk client when it's start firstly enter server, second send /login ... , third send /tekblok. How can I do that ?

milutinke commented 2 months ago

You can use the Script Scheduler bot to execute a text script. Go on the following link and read about it: https://mccteam.github.io/guide/chat-bots.html#script-scheduler

But here is a simple example of login and then executing additional commands.

  1. Create a new txt file named LoginScript.txt in the same folder the client executable is located in, in it put the following:

    send /login YourPasswordHere
    wait 1
    send /tekblok

    Obviously replace YourPasswordHere with your own password and save the file.

  2. If the client is running, close it, and open MinecraftClient.ini in some text editor (eg. Notepad), then find the ChatBot.ScriptScheduler section, set Enabled to true.

Then bellow, delete 2 existing example tasks, and create a new one:

[[ChatBot.ScriptScheduler.TaskList]]
    Task_Name = "Login Task"
    Trigger_On_First_Login = false
    Trigger_On_Login = true
    Trigger_On_Times = { Enable = false, Times = [ 14:00:00, ] }
    Trigger_On_Interval = { Enable = false, MinTime = 3.6, MaxTime = 4.8 }
    Action = "script LoginScript"

Save the file, and then run the client.

xDarkLife55 commented 2 months ago

thank u so much