Author Topic: FileSwap (a small script, but useful)  (Read 1719 times)

0 Members and 2 Guests are viewing this topic.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
FileSwap (a small script, but useful)
« on: December 04, 2007, 10:32:12 pm »
Script Name: FileSwap
Script Description: this was a random idea I thought up when I saw how annoying it was to switch out taunt file names (I have a taunts.txt for server commands and rpg server commands and misc taunts, and I get tired of switching them out manually)
Original Author(s): Me
Core Version: 2.6.3
Code: too small to use a small part

please note that this only works with plain text files (unless you want a 'yournamehere.doc.txt' or a 'Soldat.ini.txt'
I might make it use a Extention const, but it would complicate things, besides, WriteFile does not work well with things other than .txt (right?)

(is attached, also comes with a command to switch your files on a local SoldatServer game)

NOTE: file names are CaSe SeNsItIvE but you dont need to put the .txt
btw, you can swap files in different folders
Example:
(using command)
/swap Scripts/DefaultOld/includes Scripts/Default/includes
(this would swap the includes.txt files of the two folders)

(using procedure)
...
FileSwap('Scripts/DefaultOld/includes.txt','Scripts/Default/includes');
...
(remember, you dont need to put the extention, but files have to be .txt)
« Last Edit: December 05, 2007, 02:58:17 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."