Jump to content
Sign in to follow this  
Guest Ken_Salter

A simple .SCF load-boundary fixer-upper

Recommended Posts

Guest

I wrote this snippit of elisp while messing about with the .SCF files. It is brutally simple and won't cope with anything 'cept for N lat and W lon, although you could trivially modify it to taste. You could also easily change how much it changes the loading boundaries by.To use it on a whole lot of files at once, fire up dired and make a keystroke macro to load each one in turn and call modscf. I did 35 in about 3 seconds that way.Hope it's useful to somebody.Oh, and don't laugh too hard, my elisp was unused for some 15+ years :) but like falling off a bicycle, you don't manage to ever quite forget.John/madmaxPS - looks like the board software is gonna remove the indentation, but what the heck, it should still work, and I'm too lazy at the moment to package it up for an upload!(defun modscf-replace (fn) (re-search-forward "[0-9]+") (let ((val (string-to-int (buffer-substring (match-beginning 0) (match-end 0))))) (replace-match (int-to-string (funcall fn val)))))(defun modscf () (interactive) (undo-boundary) (save-excursion (goto-char (point-min)) (re-search-forward "load lower left") (modscf-replace '1-) (re-search-forward "n") (modscf-replace '1+) (re-search-forward "load upper right") (modscf-replace '1+) (re-search-forward "n") (modscf-replace '1-)))

Share this post


Link to post
Share on other sites
Guest

Hehe - I'd have to say that it wouldn't completely surprise me if somebody, somewhere, had implemented an entire flight simulator in elisp :)'Tis a pity - they don't even seem to teach most of the young'uns lisp any more!John/madmax/over-the-hill lisp hacker

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...