Skip to content

Instantly share code, notes, and snippets.

@bigdogmat
bigdogmat / wwwwee.lua
Created June 4, 2019 01:51
image shit testttttt
hook.Add("HUDPaint", "TESTOAJDWIOPAWDI", function()
hook.Remove("HUDPaint", "TESTOAJDWIOPAWDI")
local panel = vgui.Create "DHTML"
panel:SetVisible(true)
panel:SetSize(1024, 1024)
panel:SetHTML [[
<style type="text/css">
html {
overflow:hidden;
@bigdogmat
bigdogmat / wew.lua
Last active April 9, 2018 15:03
Weighted choice
local t = {
{name = 't', chance = 50},
{name = 'a', chance = 5},
{name = 's', chance = 515},
{name = 'y', chance = 80},
}
local totalChance = 0
for i = 1, #t do totalChance = totalChance + t[i].chance end
@bigdogmat
bigdogmat / functiontimers.lua
Created April 5, 2018 14:04
Function timers fixed, probably needs a rewrite
local string_match = string.match
local string_gsub = string.gsub
local string_find = string.find
local table_concat = table.concat
local string_sub = string.sub
local function checkArgs( str_args, func_args )
if func_args == "..." then -- Argument types don't matter
return true, true
elseif string_find( func_args, "...", 1, true ) then
@bigdogmat
bigdogmat / after.lua
Created September 9, 2017 06:58
E2 steamidconv file converted
local e2_steamIDTo64_s,e2_steamIDFrom64_s local tempcosts={}local util = util
local util_SteamIDFrom64 = util.SteamIDFrom64
local util_SteamIDTo64 = util.SteamIDTo64
__e2setcost(5) -- approximated
--- Given a 64bit SteamID will return a STEAM_0 style Steam ID.
tempcosts["e2_steamIDFrom64_s"]=__e2getcost() function e2_steamIDFrom64_s(self, args) local community_id = args[2] community_id = community_id[1](self, community_id)
return util_SteamIDFrom64(community_id)
end