summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorjj2012-07-12 14:50:59 +0200
committerjj2012-07-12 14:50:59 +0200
commit9c0bc3144a9a7c6979b76c6edb012b80b14cbed7 (patch)
tree0265287b71290c9391d8f01d350d4d5c672c3de9 /scripts
parentc823f1273737a18bf0df9720c287c30bb9f5623c (diff)
downloaddfhack-9c0bc3144a9a7c6979b76c6edb012b80b14cbed7.tar.gz
dfhack-9c0bc3144a9a7c6979b76c6edb012b80b14cbed7.tar.bz2
dfhack-9c0bc3144a9a7c6979b76c6edb012b80b14cbed7.tar.xz
magmasource: add documentation
Diffstat (limited to 'scripts')
-rw-r--r--scripts/magmasource.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/magmasource.rb b/scripts/magmasource.rb
index 14f517fd..8525d51e 100644
--- a/scripts/magmasource.rb
+++ b/scripts/magmasource.rb
@@ -1,11 +1,11 @@
# create an infinite magma source at the cursor
$magma_sources ||= []
-$magma_onupdate ||= nil
case $script_args[0]
when 'here'
$magma_onupdate ||= df.onupdate_register(12) {
+ # called every 12 game ticks (100x a dwarf day)
if $magma_sources.empty?
df.onupdate_unregister($magma_onupdate)
$magma_onupdate = nil
@@ -52,14 +52,15 @@ when 'stop'
else
puts <<EOS
Creates a new infinite magma source at the cursor.
+
Arguments:
here - create a new source at the current cursor position
- call multiple times for higher flow
+ (call multiple times for higher flow)
delete-here - delete the source under the cursor
stop - delete all created magma sources
EOS
if $magma_sources.first
- puts "Current magma sources:", $magma_sources.map { |s| " #{s.inspect}" }
+ puts '', 'Current magma sources:', $magma_sources.map { |s| " #{s.inspect}" }
end
end