Site Search Script

Post your FTP Rush styles or scripts and discuss about them.

Site Search Script

Postby azour2k10 » Mon Mar 15, 2010 6:45 pm

Some time back i created a "site search" script but it really needs some optimization.
I created it with the help of some other scripts and it's doing the thing i wan't.
I'm posting it here hoping someone can make it better ;) and for everyone to use.

Script is made out of 2 files
sitesearch.mrc
Code: Select all
;-––––––––––––––––––––––––––––––––––––––––-
; Site Search
; Version 1.2
;-––––––––––––––––––––––––––––––––––––––––-
menu * {
  SiTE SEARCH
  .Site Search :/ss_rlssearch
  .Close @Search Window :/window -c @Search
  .Close Open Tabs :/ss_close_tabs
  Settings
  ..Open settings.ini :run $scriptdir $+ settings.ini
}

menu @Search {
  Download this release : { ss_downloadrls $strip($1-) }
  Fxp this release : { ss_fxprls $strip($1-) }
}

; Search input
alias ss_rlssearch {
  var %ss_search_item $?="Please enter string to search for on sites?"
  if ( %ss_search_item == $null ) { halt }
  /ss_search %ss_search_item
}

; Search engine
alias ss_search {
  inc %ss_colour
  %ss_colour = $iif(%ss_colour > 4,1,%ss_colour)
  ;if ( $window(@Search) != $null ) { window -c @Search }
  window -kzl @Search
  var %ss_search_sites $readini($scriptdir $+ settings.ini,search,sites)
  var %ss_loop 1
  var %ss_end $numtok(%ss_search_sites,44)
  while ( %ss_loop <= %ss_end ) {
    var %ss_site $gettok([ %ss_search_sites ], [ %ss_loop ],44)
    {
      .timer $+ $r(1,999) 1 %ss_loop dll rushmirc.dll SetMircCmd /ss_echo_search | dll rushmirc.dll RushScript RushApp.FTP.RAW(' $+ %ss_site $+ ','Site search $1-',RS_LOGIN or RS_LOGOUT);
    }
    inc %ss_loop
  }
}

; Search results
alias ss_echo_search {
  window -kzl @Search
  var %ss_rlsline $2-
  var %ss_site $remove($1,$chr(40),$chr(41))
  if ( $chr(47) isin $1- ) {
    ;if ( Values displayed isin $1- ) { halt }
    ;if ((*/*/* iswm $3-) || (*/*/*/* iswm $3-)) && (*Values*displayed*after*dir*name* !iswm $1-) && (*/Sample*(*)* !iswm $1-) && (*/Cover*(*)* !iswm $1-) && (*/Subs*(*)* !iswm $1-) && (*=Empty=* !iswm $1-) && (*/Vobsubs* !iswm $1-) && (*.r* !iswm $1-) && (*.jpg !iswm $1-) && (*.sfv !iswm $1-) && (*.m3u !iswm $1-) && (*.mp3 !iswm $1-) && (*.nfo !iswm $1-) && (*.mkv* !iswm $1-) {
    if (*Values*displayed*after*dir*name* !iswm $1-) && (*/Sample*(*)* !iswm $1-) && (*/Cover*(*)* !iswm $1-) && (*/CD*(*)* !iswm $1-) && (*/DISC*(*)* !iswm $1-) && (*/Subs*(*)* !iswm $1-) && (*=Empty=* !iswm $1-) && (*/Vobsubs* !iswm $1-) && (*.r* !iswm $1-) && (*.jpg* !iswm $1-) && (*.sfv* !iswm $1-) && (*.m3u* !iswm $1-) && (*.mp3* !iswm $1-) && (*.nfo* !iswm $1-) && (*.mkv* !iswm $1-) {
      if ( 200* iswm %ss_rlsline ) { aline -h @Search $+($chr(3),$gettok(4 8 9 12,%ss_colour,32)) $+ $remove($1-,200- ) }
    }
  }
  ss_close_tabs | unset %ss_site %ss_rlsline
}

;Download from results
alias ss_downloadrls {
  var %ss_site $1
  var %ss_rls $2
  var %ss_site $remove($1,$chr(41),$chr(40))
  if ( %ss_sdir == $null ) { set %ss_sdir c:\ }
  set %ss_sdir $sdir([ %ss_sdir ],Where shall I download too?)
  var %ss_rlsname $gettok([ %ss_rls ],-1,47)
  var %ss_path $remove([ %ss_rls ],[ %ss_rlsname ])
  /dll rushmirc.dll RushScript RushApp.FTP.Transfer(0,' $+ %ss_site $+ ',' $+ %ss_path $+ ',' $+ %ss_rlsname $+ ','',' $+ %ss_sdir $+ ',' $+ %ss_rlsname $+ ',RS_DOWN or RS_DIRDES or RS_DIRSRC or RS_LOGIN or RS_LOGOUT, '', '', '', '', '', 0, 0, 0, 0, 0, 0, 0);
}

alias ss_fxprls {
  echo -a FXP $1-
  var %ss_site $1
  var %ss_rls $2
  var %ss_site $remove($1,$chr(41),$chr(40))
  var %ss_rlsname $gettok([ %ss_rls ],-1,47)
  var %ss_path $remove([ %ss_rls ],[ %ss_rlsname ])
  var %ss_tsite $?="What site shall I fxp too?"
  var %ss_tpath $?="Where shall I send too (PATH)?"
  var %ss_yn $?!="Sure you want to send %ss_rlsname to %ss_tsite in %ss_tpath "
  echo -a info %ss_yn
  if ( %ss_yn != $true ) { halt }
  /dll rushmirc.dll RushScript RushApp.FTP.Transfer(0,' $+ %ss_site $+ ',' $+ %ss_path $+ ',' $+ %ss_rlsname $+ ',' $+ %ss_tsite $+ ',' $+ %ss_tpath $+ ',' $+ %ss_rlsname $+ ',RS_LOGIN or RS_CHECKLOGIN or RS_DIRSRC or RS_DIRDES or RS_LOGOUT, 'CD1;CD2;SAMPLE;COVERS', '', '', '', '(\w*100%\w*)|(\w*FINISHED\w*)|(\w*-\sCOMPLETE(\s(\)|-)|D\))\w*)', 1, 1, 1, 'RS_SORTDES or RS_SORTDATE', 'RS_SORTDES or RS_SORTDATE', 2, 0);
}

;Close tabs when search is completed
alias ss_close_tabs {
  /dll rushmirc.dll RushScript RushApp.DeleteEmptyTabs(0,0);
}
;-––––––––––––––––––––––––––––––––––––––––-
; End of file
;-––––––––––––––––––––––––––––––––––––––––-


settings.ini (i created a separate file for it so it could be used in other scripts as well)
Code: Select all
[search]
sites=Site1,Site2,Site3,Site4,Site5,etc,etc
azour2k10
 
4
 
Wed Mar 10, 2010 10:35 am

Return to Styles & Scripts

Who is online

Users browsing this forum: No registered users and 2 guests

cron