subtledoctor Posted February 24, 2015 Share Posted February 24, 2015 Pretty much what it says on the tin. This question has such universal terms ("read" "text" "file") that it is defeating my Google-fu, so I come to you in supplication. Specifically: I would like to read from baldur.ini, check to see whether the string ~'Cleric Ranger Spells', '0'~ exists, and then take a certain action if it does and a different action if it doesn't. Like, can I TEXT_SPRINT %rcspells% ~'Cleric Ranger Spells', '0'~ COPY + ~%USER_DIRECTORY%/Baldur.ini~ ~override~ [umm, maybe SET a %boolean value% to check for the presence of %rcspells%...?] BUT_ONLY ACTION_IF [%boolean value%] = true THEN BEGIN [yadda yadda] END ACTION_IF [%boolean value% = false] THEN BEGIN [yadda yadda] END Possible? Link to comment
Mike1072 Posted February 24, 2015 Share Posted February 24, 2015 Yes, this is possible. COPY + is a very bad idea - maybe you were thinking of COPY - ? COPY - ~%USER_DIRECTORY%/Baldur.ini~ ~%USER_DIRECTORY%~ COUNT_REGEXP_INSTANCES ~'Cleric Ranger Spells',[ %TAB%]*'1'~ cr_bugfix_enabled ACTION_IF (cr_bugfix_enabled) BEGIN // no druid spells for cleric/rangers END ELSE BEGIN END Link to comment
subtledoctor Posted February 24, 2015 Author Share Posted February 24, 2015 Yes - the COPY + was a typo, leftover from some other advice in a different context. Good catch. And, thanks! (Once again!) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.