SCRIPT BACKUPS

By Cold_Fussion on Nov 16, 2009

if u have 2 mirc's and u want the same scripts loaded to both use this...
u need to copy this code to ur mirc's exe folder into a file called ScriptLoader.mrc please...
its just an idea havent seen one yet, tested and all is ok...
ill add in the ALIAS backups when i finish sleeping... just wanted to be the 1st one to have this script uploaded :D

also if u want... i can make it copy the backed up scripts to the new mirc directory also...
lemme know

FIXED ONE TINY BAD BUG - SORRY

*EXAMPLE***
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\scripts\script1.mud"
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\Scripts\script14.mrc"
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\Scripts\script15.mrc"
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\script1.mrc"
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\Scripts\overrides.mrc"
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\Scripts\ONLINES.mrc"
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\dll\mirchooks.mrc"
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\mudclient.mrc"
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\Scripts\THEBANSCRIPTS.mrc"
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\Scripts\HECTIC-SAJOINER.mrc"
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\Scripts\IP CHECKER.mrc"
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\SocketScriptCreator.mrc"
5SKIPPING ALREADY LOADED SCRIPT - "C:\mirc6.20\Scripts\lets-see.mrc"
4NO NEW SCRIPTS NEEDED LOADING

on *:LOAD: {
  echo $active 7SCRIPT LOADER v1 BY HYPERION aka Cold_Fussion (aow.thegodsofwar.com 6667)
}
alias backupthescripts {
  unset %loaded.*
  set %loaded.dir $remove($mircexe,$gettok($mircexe,$gettok($mircexe,0,92),92))
  set %loaded.file  " $+ %loaded.dir $+ \Scripts.txt $+ "
  if $script(0) == 1 { echo $active U NEED MORE THAN 1 SCRIPT | halt }
  if $script(0) > 1 { set %loaded.scripts $script(0) }
  set %loaded.x 1
  while %loaded.x <= %loaded.scripts {
    set %loaded.check " $+ $script(%loaded.x) $+ "
    if ScriptLoader.mrc == $gettok($script(%loaded.x),$gettok($script(%loaded.x),0,92),92) { goto next1 }
    if %loaded.check !iswm $read(%loaded.file, w, %loaded.check) { write %loaded.file %loaded.check }
    :next1
    inc %loaded.x 1
  }
  echo $active 7Loaded Scripts Saved For Backup: $script(0)
  echo $active 7Remember to Copy ScriptLoader.mrc and Scripts.txt to the new mirc's exe folder and load the ScriptLoader.mrc to the new mirc... right click anywhere and select Load Backups
  unset %loaded.*
}
alias checkthescripts {
  if $script(0) <= 1 { echo $active SORRY UNABLE TO COMPLY | halt }
  set %checkthescripts.dir $remove($mircexe,$gettok($mircexe,$gettok($mircexe,0,92),92))
  set %checkthescripts.file " $+ %checkthescripts.dir $+ \checkingscripts.txt $+ "
  if $exists(%checkthescripts.file) == $true { remove %checkthescripts.file }
  set %checkthescripts.all $script(0)
  set %checkthescripts.x 1
  while %checkthescripts.x <= %checkthescripts.all {
    if ScriptLoader.mrc == $gettok($script(%checkthescripts.x),$gettok($script(%checkthescripts.x),0,92),92) { goto next2 }
    write %checkthescripts.file " $+ $script(%checkthescripts.x) $+ "
    :next2
    inc %checkthescripts.x 1
  }
  echo $active 10CHECK COMPLETE - LOADING SCRIPTS
  unset %checkthescripts.*
  loadthescripts
}
alias loadthescripts {
  set %backup.dir $remove($mircexe,$gettok($mircexe,$gettok($mircexe,0,92),92))
  set %backup.file1 " $+ %backup.dir $+ \checkingscripts.txt $+ "
  set %backup.file " $+ %backup.dir $+ \Scripts.txt $+ "
  if $exists(%backup.file) == $false { echo $active 4Scripts.txt is needed in %backup.dir | halt }
  set %backup.scripts $lines(%backup.file)
  set %backup.done 0
  set %backup.x 1
  while %backup.x <= %backup.scripts {
    set %backup.name $read(%backup.file,%backup.x)
    if %backup.name !iswm $read(%backup.file1, w, %backup.name) { load -rs $read(%backup.file,%backup.x) | inc %backup.done 1 | goto next3 }
    echo $active 5SKIPPING ALREADY LOADED SCRIPT - $read(%backup.file,%backup.x)
    :next3
    inc %backup.x
  }
  echo $active $iif(%backup.done > 1,10LOADED %backup.done SCRIPTS SUCCESSFULLY :D,4NO NEW SCRIPTS NEEDED LOADING)
  unset %backup.*
}
menu * {
  SCRIPT LOADER
  .Make Backup:/backupthescripts
  .Load Backups:/checkthescripts
}

Comments

Sign in to comment.
Cold_Fussion   -  Nov 19, 2009

i know... but i prefer to know what i set and so on... old habbits die hard :)

 Respond  
Ghost-writer   -  Nov 19, 2009

why set so many variables even if you unset them later, just use the var command.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.