Wanted: Cheater Widget!

Wanted: Cheater Widget!

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Wanted: Cheater Widget!

Post by very_bad_soldier »

No, not what you think 8)

Does anyone still has the "Cheater Widget" which displays two or three GUI buttons to activate cheat/nocost? I think it got lost when unknown files got lost...
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Wanted: Cheater Widget!

Post by CarRepairer »

For devving purposes, I find the fastest possible method is just having hotkeys in uikeys set up.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Wanted: Cheater Widget!

Post by Google_Frog »

Or you could just use this:

Code: Select all

function widget:GetInfo()
  return {
    name      = "Cheat",
    desc      = "Cheats",
    author    = "Google Frog",
    date      = "Dec 30, 2008",
    license   = "GNU GPL, v2 or later",
    layer     = 0,
    enabled   = true --  loaded by default?
  }
end

function widget:GameOver()  
  local frame = Spring.GetGameFrame() 
  local plist = Spring.GetPlayerList() 
  if (#plist == 1) and (frame < 100) then  
    Spring.SendCommands{"cheat"}
    Spring.SendCommands{"spectator"}
    Spring.SendCommands{"godmode"}	
  end  
  widgetHandler:RemoveWidget()  
end
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Wanted: Cheater Widget!

Post by very_bad_soldier »

Thanks to you, both sounds reasonable. I still have a slight emotional binding to the original cheater widget since it has such a nice GUI and I learned lots from it while making my own GUI buttons ;)

@google:
Shouldnt the "GameOver" callin be replaced by something like "GameStart"?
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Wanted: Cheater Widget!

Post by Google_Frog »

very_bad_soldier wrote:@google:
Shouldnt the "GameOver" callin be replaced by something like "GameStart"?
The reason for game over is so that it doesn't autocheat when playing missions as bots don't count as players.
Post Reply

Return to “Lua Scripts”