User:Joshinils: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (that's lua :P) |
||
Line 38: | Line 38: | ||
Remaining research command: | Remaining research command: | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="lua" line='line'> | ||
/c global.research = function(amount) | /c global.research = function(amount) | ||
if amount == nil then | if amount == nil then |
Revision as of 07:09, 5 September 2017
Subpages
copy-pasta
== Siehe auch == * [[Research/de|Forschung]] * [[Technologies/de|Technologien]]
! Technologie !! Kosten !! Auswirkung !! Aufaddierte <br/>Auswirkung
Block that puts foo and bar next to each another if there is space, else it wraps and puts them underneath:
<div><ul> <li style="display:inline-block;"> foo </li> <li style="display:inline-block;"> bar </li> </ul></div>
Lua stuff
Screenshot command:
/c game.take_screenshot{resolution = {x = 1000, y = 1000}, zoom = 2, show_entity_info = true}
Remaining research command:
/c global.research = function(amount)
if amount == nil then
game.print(game.player.force.research_progress * 100 .. "% done")
else
game.print(amount -game.player.force.research_progress * amount .. " packs needed")
end
end
Reveal circular area around input (default {x=0,y=0}
, can be exchanged with game.player.position
)
/c global.reveal=function(input)
--[[set radius the first time this gets run]]
global=global or {}
global.radius=global.radius or 128
radius_squared=global.radius*global.radius
origin=input or {x=0, y=0}
for x=-global.radius, global.radius, 32 do
for y=-global.radius, global.radius, 32 do
if x*x+y*y<radius_squared then
game.player.force.chart(game.player.surface, {{origin.x+x, origin.y+y }, {origin.x+x, origin.y+y }})
end
end
end
game.print("r="..global.radius)
--[[increase radius every successive time it is run, may be set outside of this function]]
global.radius=global.radius+32
end
Delete everything except the player character (when input == nil
, when all
is present, then everything including the player character gets deleted)
/c global.delete = function(input, all)
for surface in pairs(game.surfaces) do
for _, ent in pairs(surface.find_entities_filtered{type=input} do
if all or (ent.type ~= "player" and input ~= "player") then entity.destroy() end
end
end
end