Page 1 of 1

Wanted: Cheater Widget!

Posted: 23 Jul 2009, 21:32
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...

Re: Wanted: Cheater Widget!

Posted: 23 Jul 2009, 21:54
by CarRepairer
For devving purposes, I find the fastest possible method is just having hotkeys in uikeys set up.

Re: Wanted: Cheater Widget!

Posted: 25 Jul 2009, 14:16
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

Re: Wanted: Cheater Widget!

Posted: 25 Jul 2009, 20:31
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"?

Re: Wanted: Cheater Widget!

Posted: 26 Jul 2009, 00:44
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.