-
Notifications
You must be signed in to change notification settings - Fork 335
/
Copy pathautocheat.lua
44 lines (38 loc) · 1.01 KB
/
autocheat.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
if not Spring.Utilities.IsDevMode() then
return
end
function widget:GetInfo()
return {
name = "Auto cheat",
desc = "Enables cheats for $VERSION game versions",
author = "ivand",
date = "2017",
license = "GNU LGPL, v2.1 or later",
layer = 0,
enabled = false
}
end
local gf = Spring.GetGameFrame()
function widget:Initialize()
local enable = (not Spring.IsCheatingEnabled())
if enable then
widgetHandler:UpdateCallIn('GameFrame');
else
widgetHandler:RemoveCallIn('GameFrame');
end
end
function widget:GameFrame(f)
if f > gf then
if not Spring.IsCheatingEnabled() and not Spring.IsReplay() then
Spring.SendCommands("say !cheats")
Spring.SendCommands("say !hostsay /globallos")
Spring.SendCommands("say !hostsay /godmode")
--Spring.SendCommands("say !hostsay /nocost")
Spring.SendCommands("cheat")
Spring.SendCommands("globallos")
Spring.SendCommands("godmode")
--Spring.SendCommands("nocost")
end
widgetHandler:RemoveCallIn('GameFrame');
end
end