Hello,
I was just wondering how I'd make a Minecraft Script that will run the command "/tempban [My username] 1s Reason: AFK" if my Minecraft Character hasn't moved in 10 minutes.
Kind regards,
Connor.
Auto AFK Kick Script - Minecraft
-
- Posts: 2
- Joined: 20 Jun 2018, 05:50
Re: Auto AFK Kick Script - Minecraft
Added missing close paren
Code: Select all
#NoEnv
#SingleInstance Force
#Persistent
#InstallKeybdHook
#InstallMouseHook
SetBatchLines -1
SendMode Input
minecraft := "ahk_exe notepad.exe"
message := "/tempban [My username] 1s Reason: AFK"
MAX_MINUTES_AFK := 10
TIMER_PERIOD_MS := 2000
SetTimer, MonitorMinecraft, % TIMER_PERIOD_MS
Return
MonitorMinecraft:
timeIdle := (A_TimeIdlePhysical // 1000) / 60 ;in mins
if (timeIdle > MAX_MINUTES_AFK && (WinActive(minecraft) || WinExist(minecraft)))
{
WinActivate
WinWaitActive
Send {Enter}
Send % "{Text}" message
Send {Enter}
SetTimer, , Off
SetTimer, MonitorForActivity, % TIMER_PERIOD_MS / 10
}
Return
MonitorForActivity:
if (A_TimeIdlePhysical < 200)
{
SetTimer, , Off
SetTimer, MonitorMinecraft, % TIMER_PERIOD_MS
}
Return
-
- Posts: 2
- Joined: 20 Jun 2018, 05:50
Re: Auto AFK Kick Script - Minecraft
Hello, I was just wondering how I fix this issue.
http://i67.tinypic.com/6omuk6.png
Kind regards,
Connor.
http://i67.tinypic.com/6omuk6.png
Kind regards,
Connor.
-
- Posts: 1
- Joined: 27 Jan 2021, 08:34
Re: Auto AFK Kick Script - Minecraft
I don’t know what your problem is but when someone runs /afk to afk it should set a variable to true then:
Every 10 minutes:
If {%player%.afk} is true:
Execute console command “tempban %player% 1s AFK
Every 10 minutes:
If {%player%.afk} is true:
Execute console command “tempban %player% 1s AFK
Who is online
Users browsing this forum: Bing [Bot], hiahkforum, phalanxdarken and 116 guests