
Since version 1.49 Pree supports its own little scrip-language.
Sure there is not much implanted, but its enough for my needs and well I may implant some 
more if u guys need it.

I tried to clone the script-engine that staff-ftp uses, but in some parts its abit different.




  SELECT <sitename> | site[<intex>] | LOCAL <dir> | ALL | NONE | TODAY | YESTERDAY | MASK <mask>

    - select either a ftp or the files (all, none, today-dated, yesterday-dated)

  DESELECT TODAY | YESTERDAY | MASK <mask>

    - deselect items with the mask

  LIMITSELECTION TODAY | YESTERDAY | MASK <mask>
 
    - limit the selection just done to only today-dated and/or yesterday-dated fieles/dirs.

  REFRESH

    - refreshes directory

  CHDIR <new directory>

    - change dir

  COMPARE SIMPLE | EXT <site to compare currently choosen ftp>

    - compares windows either without size (simple) or with size /ext)

  IF <option> <comparator> <value>
    ...
  END

    - this is a basic if-implementation for option you can use any variable you defined
      or <sitename>.CONNECTED, <sitename>.OK (OK means last command was successfull), 
      <sitename>.PWD, <sitename>.state (the current state of ftp)

        state_rls_present=2, state_rls_not_present=1, state_unknown=0, state_fxp=3, 
        state_ready_to_pre=4, state_offline=8, state_pre_ok=9, state_pre_not_ok=10,
        state_fxp2=11, state_fxp12=12

 
    - comperator can be !=, <> or =

  GOTO <label>

    - jump to a new entry point. an entrypoint must start with ":" like ":CommeHere"
    - the keyword START means the 1st line of the script and END the end ohhhha ;)

  VAR <varname>=<contens>

    - define variables...looks better if u do configs with vars so the user doesnt need to go
      into the code to change something

    - contens could also be...

       SELECTION = an array with the current selection of items (ftp/fxp/local)

         e.g.:
         select ftp
         select mask *-blahaha
         var items=SELECTION

       GETPART "<variable>" "<part>" "<seperator>" = cuts parts of an other variable out

         e.g.:
         var item=this is a test
         var subitem=GETPART "$item" "4" " "
         #subitem would be "test" then

       MIRC LASTLINE <channel> = takes last line from that channel in mirc
        IRC LASTLINE <channel> = takes last line from that channel in mirc

         e.g.:
         var ll=MIRC LASTLINE #my_channel

       EXECUTE <program with parameters>

         you can then use the returncode and work with that

       FTPCMD <ftp-command>

         e.g.:
         var res=ftpcmd site dupe blahaahha-blh

       FTPSEARCH <rls>

         e.g.:
         var res=ftpsearch blahaahha-blh

       SITELIST
         holdes a list of all sites

       ACTIVESITELIST
         holdes a list of all *active* sites


       some calucation like "10+5" with "-,*,/"...also "$othervar + 10" is possible


  CONNECT [<sitename>]

    - opens a connection to an ftp-server

  DISCONNECT [<sitename>]

    - disconnects from selected site

  SAVEDIR <filename>

    - saves dir-list to file

  EXEC <filename>

    - executes a program

  SEND <string>

    - sends a site-sommand (u still must include "site" if needed)

  NUKE <rls> <ratio> <messag>

    - will nuke a release on selected site

  GETRLS <rls> [<site>/<dir>]

    - will get a release transfered

  TRADE <rls>

    - will trade a release

  DEL

    - will delete all selected files/dirs

  MOVE <new dir>

    - will move all selected files/dirs to a new dir

  SLEEP <seconds>

    - script sleeps for x seconds before doing next task

  MOVE <new name>

    - will rename all selected files/dirs to newname (maske only sence if only one is selected)


  MIRC <command>
   IRC <command>

    - send strings to mirc-client
      e.g. "MIRC /cmd whois %IRCNICK%" will display whois-message of your login
      (%IRCNICK% is an internal variable)

  WAITIRC <channel-mask> <message-mask>

    - script waits until some of that messages have been found in a channel (needs mirc32
      running)

      e.g.: waitirc #my_channel1;#my_channel2 *update*;*new*

      Can also have something like...
      waitirc #bluuabab hello %nick%!
      this will wait + create a variable with the name nick with that contents of the irc-line.
      U can imagine for what it might be usefull.

  SHOWRAW

    - opens dirlisting in notepad

  FILTER_WITH_SITERULE <sitename> <section>

    - selects only those files/folders who match a rule-section from that site


  WRITELN <text>

    - will write something to the log-screen/or irc-channel (good for debuging/statustext)

  FOR <item-variable> in <array>
    ...
  END

    - an array can be created with "var x=SELECTION" or by making your own with 
      ";" as seperator for your items...e.g.: "blahaha;blahaha2;labahah3"
    - the for-loop will run as long as there are items in an aray and as long as they 
      are not empty.
    - item-variable will then become the current array-index
    - attention: the window in the program will not jump into for-loops, also it will 
      be performed within the program itselfe.

      e.g.:
      select mask *-blhaa
      var s=SELECTION
      for item in $s                       #<-- the prg-indicator will stop here, but all 
        writeln $item                           will be perfomed, dont worry
      end

-----------------------------------

  There are some internal veriables like

  %TODAY%                        - dayted dir from today like 0913 for the 13th of sep.
  %YEASTERDAY%                   - dayted dir from yesterday
  %MONTH%                        - current month
  %DAY%                          - same for day
  %YEAR%                         - current year
  %MINUTE%                       - current minute
  %HOUR%                         - current hour
  %ircnick%			 - nick of the bot on irc
  