E
Edwin
Guest
I need to use string_insert() function with specific variable that keeps the position of where I need to insert my string with string_insert(). The string what I'm gonna insert is an alpha tag. Other script will delete this tag and make the text transparent from position keeping variable to end. In this simple way, I will make the typewriter effect.
The problem is that I've failedly tried to create the script that gonna skip my other tags and insert an alpha tag using string_insert() function.
So my script looks like this:
Tags that script should skip are [c=...] and [/c]. Please answer if you know how to implement this. I tried to make it by my own but did not work.
Thank you for your care.
The problem is that I've failedly tried to create the script that gonna skip my other tags and insert an alpha tag using string_insert() function.
So my script looks like this:
Code:
/// string_insert_tag(substr,str,index)
// Declare variables
var substr, str, index, cst, cet, cct, l, cstl, i;
// Set variables
substr = argument[0];
str = argument[1];
index = round(argument[2]);
cst = '[c=';
cet = ']';
cct = '[/c]';
l = string_length(str);
cstl = string_length(cst);
// To get the string inside the tags
for (var p = 1; p < l; p ++) {
if (string_char_at(str, p) == "[" && string_char_at(str, p+1) == "c" && string_char_at(str, p+2) == "=") {
i = string_copy(str, p + cstl, string_pos(cct, string_delete(str, 1, p + cstl)));
}
}
// Return the string with substring
return string_insert(substr, str, index);
Thank you for your care.