ADVERTISEMENTREMOVE ADS
Game icon

AutoFarm script

🚜 Build a Tractor
3 months ago
Script preview thumbnail
Script Preview

Description

This script is a AutoFarm for Build a Tractor.
It includes:

  • AutoFarm Toggle – automatically fires and listens to specific RemoteEvents in a loop.

  • Anti-AFK system – prevents you from being kicked due to inactivity (note: may not always work on mobile devices).

  • Statistics Tab – shows live loop counter and timer to track AutoFarm performance.

ADVERTISEMENTREMOVE ADS
80 Lines • 2.64 KiB
Raw
local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
local Window = Rayfield:CreateWindow({
Name = "AutoFarm",
LoadingTitle = "AutoFarm",
LoadingSubtitle = "for that goofy ahh game",
ConfigurationSaving = {
Enabled = false
}
})
local MainTab = Window:CreateTab("Main", 4483362458)
local StatsTab = Window:CreateTab("Statistics", 4483362458)
local AutoFarmToggle = false
local AntiAFKStarted = false
local LoopCounter = 0
local StartTime = 0
local LoopCounterLabel = StatsTab:CreateLabel("AutoFarm Loop Counter: 0")
local TimerLabel = StatsTab:CreateLabel("AutoFarm Timer: 0s")
MainTab:CreateToggle({
Name = "AutoFarm",
CurrentValue = false,
Flag = "AutoFarmToggle",
Callback = function(Value)
AutoFarmToggle = Value
if AutoFarmToggle then
print("Starting AutoFarm")
LoopCounter = 0
StartTime = tick()
if not AntiAFKStarted then
AntiAFKStarted = true
print("Starting Anti AFK")
local vu = game:GetService("VirtualUser")
game:GetService("Players").LocalPlayer.Idled:Connect(function()
vu:CaptureController()
vu:ClickButton2(Vector2.new())
end)
end
task.spawn(function()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")
local Main = RemoteEvents:WaitForChild("Main")
local Drive = Main:WaitForChild("Drive")
local GetCurrentShop = Main:WaitForChild("GetCurrentShop")
while AutoFarmToggle do
local argsReady = { "Ready" }
Drive:FireServer(unpack(argsReady))
local argsShop = { "Main" }
local success, result = pcall(function()
return GetCurrentShop:InvokeServer(unpack(argsShop))
end)
if success then
local argsAgain = { "Ready" }
Drive:FireServer(unpack(argsAgain))
end
LoopCounter += 1
LoopCounterLabel:Set("AutoFarm Loop Counter: " .. tostring(LoopCounter))
TimerLabel:Set("AutoFarm Timer: " .. math.floor(tick() - StartTime) .. "s")
task.wait(0.5)
end
end)
else
print("AutoFarm stopped")
end
end,
})
ADVERTISEMENTREMOVE ADS

Comments

0 comments
to add a comment
Loading comments
ADVERTISEMENTREMOVE ADS