Announcement

Collapse
No announcement yet.

Search and Replace

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Search and Replace

    Just a simple search and replace. Was developed for button changing...found a better way to do that...so I modified the code to do a universal search and replace within a file. This script is a byproduct of a different script. Someone may find it useful:

    The original idea is that you can change anything in an INC file, without messing with the rest of the file. A skin could have one INC file, something like settings.txt, with all the settings in it, and make changes to a single item. Works like this:
    Start the script run;path to sr.exe
    Setvar's SROLD SRNEW SRFILETOEDIT SRTEXTORLINE
    Script will then edit the file
    SRTEXTORLINE:
    TEXT will search for specific text and replace just that text.
    search for /DEFINE fontsizemk1 "18" , replace with /DEFINE fontsizemk1 "22"

    LINE will search for specific text and replace the whole line.
    search for fontsizemk1, replace with /DEFINE fontsizemk1 "22"--better because you may not know the old font size or whatever value you are replacing.

    This will also work on .skin files... you could replace an INC line to include a different file to change the look of a skin.
    Located here: SR
    CarPC in my 82 Camaro. Dual core atom, M4-ATX, 7 lilliput, bu353 GPS, Reborn skin, punch 40/100ix
    MediaLaunch for RR
    Online Check for RR
    Locker for RR

  • #2
    It seems just what I was looking for!!!
    ..is it possible to use it to change some line in skin.ini without changing the others too?
    ...or does it work just with INC .txt file?

    Edited--------
    I jumped the line:
    This will also work on .skin files... you could replace an INC line to include a different file to change the look of a skin.


    how can I do if I want to search and replace a string like this:
    B20[HL],[/HL]120[HL],[/HL]100[HL],[/HL]315[HL],[/HL]70[HL],[/HL]"SKIN"[HL],[/HL]"skin browser"
    ??
    Live today like it is your last day, and behave as though you will live forever...

    my WEBSITE

    MapMonkey Dalai skin-preview-download ITA-email me for ENG
    Road Runner CrystalBlue skin-preview-beta release

    Comment


    • #3
      I found an old post from guino on the comma issue..... define comma in skin.ini:
      cm=,
      Then use $cm$ in place of the comma.
      Example from MKIII exectbl.ini (not in that skin, just the version I have)
      "MENURED","RUN;$skinpath$\sr.exe||setvar;srold;men u_OFF||setvar;srnew;menu_OFFred.png$CM$menu_OFFred .png$CM$menu_On.png$CM$menu_OFFred.png||setvar;srf iletoedit;menu.skin||setvar;srtextorline;line||wai t;2||reloadskin"

      It changes the images the skin uses
      skin.ini contains cm=,

      If B20 is unique to that line, you should be able to search for B20 and replace with your line.
      CarPC in my 82 Camaro. Dual core atom, M4-ATX, 7 lilliput, bu353 GPS, Reborn skin, punch 40/100ix
      MediaLaunch for RR
      Online Check for RR
      Locker for RR

      Comment


      • #4
        looking for a little help please.

        i have this working via useing OSK to define the changes. but i can not get it to write
        || it will only write whats before it, not the || and whats after it.

        i open OSK type SILABS||Silabs, ENTER , Script runs, Result = SILABS

        any ideas guys, i did try $CM$=|| in the skin.ini but that did'nt work,may have that bit wrong in the code below,

        1st code without $CM$

        "NEWBUTTONIS"," ||OSKTOCMD;NEWBUTTON;ADDBUTTON"
        "ADDBUTTON","RUN;$skinpath$\sr.exe||setvar;srold;$ REPLACE$||setvar;srnew;$NEWBUTTON$||setvar;srfilet oedit;buttonlist.txt||setvar;srtextorline;line||AD DTOFILE;$SKINPATH$buttonlist.txt;=$REPLACE$"

        2nd code with $CM$

        "NEWBUTTONIS"," ||OSKTOCMD;NEWBUTTON;ADDBUTTON"
        "ADDBUTTON","RUN;$skinpath$\sr.exe||setvar;srold;$ REPLACE$||setvar;srnew;$NEWBUTTON$$CM$$NEWBUTTON$| |setvar;srfiletoedit;buttonlist.txt||setvar;srtext orline;line||ADDTOFILE;$SKINPATH$buttonlist.txt;=$ REPLACE$"


        Thanks

        ENJOY
        Riderunner / Genesis
        Plugin Breaker in test BassRR Plugin Player, Wifiman_NET
        New Home for Genesis & BassRR :adding to site ,, Hellfyre night
        Bassrr Beta Release :Version 1.3.7
        Movie_info Release :Version 3.1.0
        Wifiman_NET:Version 1.0.0

        Every Future, Needs A Beginning

        Comment

        Working...
        X