Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tbcounter = 1
- local function onKeyPress(dik)
- if dik == DIK_keys.DIK_M then
- printf("M pressed, populating stashes!")
- --local tbcounter = 1
- while (tbcounter < 65535) do
- local t_obj = alife():object(tbcounter)
- if t_obj then
- local t_name = t_obj:name()
- local t_secname = t_obj:section_name()
- local lvl = alife():level_name(game_graph():vertex(t_obj.m_game_vertex_id):level_id())
- --if t_secname == "inventory_box" and lvl == "l08_yantar" then
- if t_secname == "inventory_box" then
- treasure_manager.set_random_stash(nil, nil, nil, tbcounter, nil)
- --PRINT THE FOLLOWING INFO TO CONSOLE
- printf("set_random_stash number %s (%s) lvl:%s",tbcounter,t_name,lvl)
- --UNCOMMENT THIS TO DO ONE AT A TIME EACH PRESS OF M
- --tbcounter = tbcounter + 1
- --return
- end
- end
- tbcounter = tbcounter + 1
- end
- end
- end
- function on_game_start()
- RegisterScriptCallback("on_key_press", onKeyPress)
- end
Advertisement
Add Comment
Please, Sign In to add comment