[Solved]How can I overwrite the string?

Started by Zefk, November 11, 2016, 01:08:54 PM

Previous topic - Next topic
November 11, 2016, 01:08:54 PM Last Edit: November 12, 2016, 05:13:08 AM by Zefk
Here is my map script. At least for now it is a map script because that is where I have been coding and testing it. It controls and displays text on the screen with a string. You can activate it with key 'p', turn it off with 't', and turn it on with 'r'. Any ideas on how I can overwrite the string with a new one? I tried a few tactics, but they failed to work.

Code ( lua) Select
local text = "ZefK is gRaNd |zefk is grand |ZEFK IS GRAND!"

Code ( lua) Select
local sentence_word_length ={}
local alphabet_split = {}
local text_img = {}
local y_axis = {}
local x_axis = {}
local text_on = {}
--==========================================================================================================================================
----------------------
--CHANGE SETTINGS AREA
----------------------
--The text you want to show.
local text = "ZefK is gRaNd |zefk is grand |ZEFK IS GRAND!"

--Use font packages
local font_package = true

--Use image files
local image_files = false

--This will reverse the string if you want to talk elf or something.
local reverse = false

--Change the font package
--Leave it blank if you want the default font.
local font --= "minecraftia"

--Change font size
local font_size = 11

--Change color. Currently set to snow white (Not white 255,255,255, but snow white 255,250,250. Yeah, they are different.)
--Check in of script for some RGB color values.
local color_type = {255,255,255}

--This is how long your string is. "ZefK is gRaNd  zefk is grand  ZEFK IS GRAND!" = 44
--In Gedit I highlight and go to Tools> Document Satistics (You can use another software like notepad++ or you can count.....)
local max_text_len = 44

--The space between your font.
local spacing = 11

--Spacing for diagonal line.
local diagonal_line_space = 1

--Moves it down the x-axis
local diagonal_down = 0

--The length of the first sentence or word. This includes spaces. "ZefK is gRaNd " = 14
sentence_word_length[1] = 14
sentence_word_length[2] = 29
sentence_word_length[3] = 45

--Minus a value from the y_axis and minus a value from the x_axis. That causes a loop around or wrapping it around for a new line.
--You must minus from your start point. 70,70 in this case.
--Of course....this depends on your sentence_word_length and spacing.
y_axis[1] = 70
x_axis[1] = 70
y_axis[2] = 40 -- minus 30
x_axis[2] = -95 --minus 165
y_axis[3] = 10
x_axis[3] = -260

-----------------------------
--END OF CHANGE SETTINGS AREA
-----------------------------
--==========================================================================================================================================

--Tell the script it is a map and to use game functions
local map = ...
local game = map:get_game()

for rep = 0,85 do
--Loading 85 characters for the font text "text = alphabet_split[rep]"
local alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-=+/:;,.?"'.."'"..'><0123456789'
local index = alphabet:find('')
      index = (index % #alphabet) + rep -- move to next letter, wrapping at end
local abc = alphabet:sub(index, index)
      table.insert(alphabet_split, abc)

--Image loading
if image_files == true then
text_img[rep] = sol.surface.create("alphabet/"..rep..".png")
end

--Font loading
if font_package == true then
text_img[rep] = sol.text_surface.create({ -- name a local variable something and assign it to the sol.text_surface
   font = font, -- font name
   text = alphabet_split[rep], -- text you want to show
   font_size = font_size, -- font size obviously
   color = color_type, -- color must be in a table RGB (http://www.rapidtables.com/web/color/RGB_Color.htm)
})

end
end

--A table because I like tables and it prevents upvalue errors
local dl = { --dl stands for dialog ('d'ia - 'l'og)

      split_string = {},
      place_x = {},
      place_y = {},
}

--Turn on the text at start
for on = 0, max_text_len do
  text_on[on] = true
end

--Solarus draw function for showing image
function sol.main:on_draw(screen)

--Reversed or not reversed calculations
if reverse == true then
   for msg = 0, max_text_len do
     local index = text:len()-msg
     local letter = text:sub(index, index)
     table.insert(dl.split_string, letter)
   end
else
   for msg = 0, max_text_len do
     local index = string.reverse(text):len()-msg
     local letter = string.reverse(text):sub(index, index)
     table.insert(dl.split_string, letter)
   end
end

--Calculating wat text to display.
for char = 0, max_text_len do
--Lowercase calculations
if text_on[char] == true then
  if dl.split_string[char] == "a" then
    text_img[1]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "b" then
    text_img[2]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "c" then
    text_img[3]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "d" then
    text_img[4]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "e" then
    text_img[5]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "f" then
    text_img[6]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "g" then
    text_img[7]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "h" then
    text_img[8]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "i" then
    text_img[9]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "j" then
    text_img[10]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "k" then
    text_img[11]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "l" then
    text_img[12]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "m" then
    text_img[13]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "n" then
    text_img[14]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "o" then
    text_img[15]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "p" then
    text_img[16]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "q" then
    text_img[17]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "r" then
    text_img[18]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "s" then
    text_img[19]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "t" then
    text_img[20]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "u" then
    text_img[21]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "v" then
    text_img[22]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "w" then
    text_img[23]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "x" then
    text_img[24]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "y" then
    text_img[25]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "z" then
    text_img[26]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
--Uppercase Calculations
  if dl.split_string[char] == "A" then
    text_img[27]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "B" then
    text_img[28]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "C" then
    text_img[29]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "D" then
    text_img[30]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "E" then
    text_img[31]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "F" then
    text_img[32]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "G" then
    text_img[33]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "H" then
    text_img[34]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "I" then
    text_img[35]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "J" then
    text_img[36]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "K" then
    text_img[37]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "L" then
    text_img[38]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "M" then
    text_img[39]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "N" then
    text_img[40]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "O" then
    text_img[41]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "P" then
    text_img[42]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "Q" then
    text_img[43]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "R" then
    text_img[44]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "S" then
    text_img[45]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "T" then
    text_img[46]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "U" then
    text_img[47]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "V" then
    text_img[48]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "W" then
    text_img[49]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "X" then
    text_img[50]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "Y" then
    text_img[51]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "Z" then
    text_img[52]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
--Special characters
  if dl.split_string[char] == "!" then
    text_img[53]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "@" then
    text_img[54]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "#" then
    text_img[55]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "$" then
    text_img[56]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "%" then
    text_img[57]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "^" then
    text_img[58]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "&" then
    text_img[59]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "*" then
    text_img[60]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "(" then
    text_img[61]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == ")" then
    text_img[62]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "-" then
    text_img[63]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "=" then
    text_img[64]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "+" then
    text_img[65]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "/" then
    text_img[66]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == ":" then
    text_img[67]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == ";" then
    text_img[68]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "," then
    text_img[69]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "." then
    text_img[70]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "?" then
    text_img[71]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == '"' then
    text_img[72]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "'" then
    text_img[73]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == ">" then
    text_img[74]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "<" then
    text_img[75]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "0" then
    text_img[76]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "1" then
    text_img[77]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "2" then
    text_img[78]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "3" then
    text_img[79]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "4" then
    text_img[80]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "5" then
    text_img[81]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "6" then
    text_img[82]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "7" then
    text_img[83]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "8" then
    text_img[84]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "9" then
    text_img[85]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
end
end

end --end of draw function

--Function for allowing key pressing
function sol.main:on_key_pressed(key)

--Turn on the text
if key == "r" then
  for char = 0,max_text_len do
   text_on[char] = true
  end
end

--Turn off the text
if key =="t" then
  for char = 0,max_text_len do
   text_on[char] = false
  end
end

--30 Lines max. Add on for more lines of text.
for i = 1, max_text_len do
  if i < sentence_word_length[1] then
   dl.place_y[i] = x_axis[1]
   dl.place_y[i] = y_axis[1]
   dl.place_x[i] = i * spacing + x_axis[1]
  elseif i < sentence_word_length[2] then
   dl.place_y[i] = x_axis[2]
   dl.place_y[i] = y_axis[2]
   dl.place_x[i] = i * spacing + x_axis[2]
  elseif i < sentence_word_length[3] then
   dl.place_y[i] = x_axis[3]
   dl.place_y[i] = y_axis[3]
   dl.place_x[i] = i * spacing + x_axis[3]
  elseif i < sentence_word_length[4] then
   dl.place_y[i] = x_axis[4]
   dl.place_y[i] = y_axis[4]
   dl.place_x[i] = i * spacing + x_axis[4]
  elseif i < sentence_word_length[5] then
   dl.place_y[i] = x_axis[5]
   dl.place_y[i] = y_axis[5]
   dl.place_x[i] = i * spacing + x_axis[5]
  elseif i < sentence_word_length[6] then
   dl.place_y[i] = x_axis[6]
   dl.place_y[i] = y_axis[6]
   dl.place_x[i] = i * spacing + x_axis[6]
  elseif i < sentence_word_length[7] then
   dl.place_y[i] = x_axis[7]
   dl.place_y[i] = y_axis[7]
   dl.place_x[i] = i * spacing + x_axis[7]
  elseif i < sentence_word_length[8] then
   dl.place_y[i] = x_axis[8]
   dl.place_y[i] = y_axis[8]
   dl.place_x[i] = i * spacing + x_axis[8]
  elseif i < sentence_word_length[9] then
   dl.place_y[i] = x_axis[9]
   dl.place_y[i] = y_axis[9]
   dl.place_x[i] = i * spacing + x_axis[9]
  elseif i < sentence_word_length[10] then
   dl.place_y[i] = x_axis[10]
   dl.place_y[i] = y_axis[10]
   dl.place_x[i] = i * spacing + x_axis[10]
  elseif i < sentence_word_length[11] then
   dl.place_y[i] = x_axis[11]
   dl.place_y[i] = y_axis[11]
   dl.place_x[i] = i * spacing + x_axis[11]
  elseif i < sentence_word_length[12] then
   dl.place_y[i] = x_axis[12]
   dl.place_y[i] = y_axis[12]
   dl.place_x[i] = i * spacing + x_axis[12]
  elseif i < sentence_word_length[13] then
   dl.place_y[i] = x_axis[13]
   dl.place_y[i] = y_axis[13]
   dl.place_x[i] = i * spacing + x_axis[13]
  elseif i < sentence_word_length[14] then
   dl.place_y[i] = x_axis[14]
   dl.place_y[i] = y_axis[14]
   dl.place_x[i] = i * spacing + x_axis[14]
  elseif i < sentence_word_length[15] then
   dl.place_y[i] = x_axis[15]
   dl.place_y[i] = y_axis[15]
   dl.place_x[i] = i * spacing + x_axis[15]
  elseif i < sentence_word_length[16] then
   dl.place_y[i] = x_axis[16]
   dl.place_y[i] = y_axis[16]
   dl.place_x[i] = i * spacing + x_axis[16]
  elseif i < sentence_word_length[17] then
   dl.place_y[i] = x_axis[17]
   dl.place_y[i] = y_axis[17]
   dl.place_x[i] = i * spacing + x_axis[17]
  elseif i < sentence_word_length[18] then
   dl.place_y[i] = x_axis[18]
   dl.place_y[i] = y_axis[18]
   dl.place_x[i] = i * spacing + x_axis[18]
  elseif i < sentence_word_length[19] then
   dl.place_y[i] = x_axis[19]
   dl.place_y[i] = y_axis[19]
   dl.place_x[i] = i * spacing + x_axis[19]
  elseif i < sentence_word_length[20] then
   dl.place_y[i] = x_axis[20]
   dl.place_y[i] = y_axis[20]
   dl.place_x[i] = i * spacing + x_axis[20]
  elseif i < sentence_word_length[21] then
   dl.place_y[i] = x_axis[21]
   dl.place_y[i] = y_axis[21]
   dl.place_x[i] = i * spacing + x_axis[21]
  elseif i < sentence_word_length[22] then
   dl.place_y[i] = x_axis[22]
   dl.place_y[i] = y_axis[22]
   dl.place_x[i] = i * spacing + x_axis[22]
  elseif i < sentence_word_length[23] then
   dl.place_y[i] = x_axis[23]
   dl.place_y[i] = y_axis[23]
   dl.place_x[i] = i * spacing + x_axis[23]
  elseif i < sentence_word_length[24] then
   dl.place_y[i] = x_axis[24]
   dl.place_y[i] = y_axis[24]
   dl.place_x[i] = i * spacing + x_axis[24]
  elseif i < sentence_word_length[25] then
   dl.place_y[i] = x_axis[25]
   dl.place_y[i] = y_axis[25]
   dl.place_x[i] = i * spacing + x_axis[25]
  elseif i < sentence_word_length[26] then
   dl.place_y[i] = x_axis[26]
   dl.place_y[i] = y_axis[26]
   dl.place_x[i] = i * spacing + x_axis[26]
  elseif i < sentence_word_length[27] then
   dl.place_y[i] = x_axis[27]
   dl.place_y[i] = y_axis[27]
   dl.place_x[i] = i * spacing + x_axis[27]
  elseif i < sentence_word_length[28] then
   dl.place_y[i] = x_axis[28]
   dl.place_y[i] = y_axis[28]
   dl.place_x[i] = i * spacing + x_axis[28]
  elseif i < sentence_word_length[29] then
   dl.place_y[i] = x_axis[29]
   dl.place_y[i] = y_axis[29]
   dl.place_x[i] = i * spacing + x_axis[29]
  elseif i < sentence_word_length[30] then
   dl.place_y[i] = x_axis[30]
   dl.place_y[i] = y_axis[30]
   dl.place_x[i] = i * spacing + x_axis[30]
  end

end

--Text effects. Diagonal line.
if key == "o" then
for char = 1,max_text_len do
  dl.place_y[char] = char * diagonal_line_space + diagonal_down
end
for char = 1,max_text_len do
  --dl.place_x[char] = char * 9 + x_axis[1]
   dl.place_x[char] = char * 9 + x_axis[char + 3]
end
end

--This move it down. Just an example.
if key == "i" then
for char = 1,max_text_len do
  dl.place_y[char] = char * diagonal_line_space + 20
end
for char = 1,max_text_len do
  --dl.place_x[char] = char * 9 + x_axis[1]
   dl.place_x[char] = char * 9 + x_axis[char + 3]
end
end

end

November 11, 2016, 01:49:37 PM #1 Last Edit: November 11, 2016, 03:24:38 PM by Zefk
I found out how to get parts of the string to vanish, but I'd still like to overwrite the string.

This will remove the first line.
Code ( lua) Select
if y_axis[4] == 90 then
  for i = 1,15 do
    dl.split_string[i] = ""
  end
end


Edit:
I found a work around for the text display, but being able to overwrite the string would be good for a dialog box.

Your code is a bit convoluted and difficult to follow, but I think your problem is that every draw cycle you are inserting characters into dl.split_string, but you never clear dl.split_string again. If I correctly understand what you are trying to do, you should add the following at line 111:
Code (lua) Select
dl.split_string = {}

A few additional comments...

1) Your endless if statements on lines to 131 to 387 could be optimized and simplified to a single line of code:
Code (lua) Select
text_img[ dl.split_string[char]:byte(1,1) ]:draw(screen, dl.place_x[char], dl.place_y[char])

You'd also have to change line 77 to:
Code (lua) Select
alphabet_split[abc:byte(1,1)] = abc

This would also mean that you'd have to rename your .png files where "a" is 97 and "A" is 65, etc.

Note that my example is not compatible with multi-byte utf-8 text, but it wouldn't be very hard to adapt it to be compatible (your script is not utf-8 compatible anyway).

2) hard-coding the sentence_word_length doesn't make sense. If you want to split the text into multiple lines, a better approach would be to use the new line character "\n" to designate the line breaks and then figure out where to split the lines dynamically at run time. For example:
Code (lua) Select
local text = "ZefK is gRaNd \nzefk is grand \nZEFK IS GRAND!"
for line in text:gmatch("[^\n]+") do print(line) end


3) You're doing a significant amount of processing every draw cycle, and I'm guessing you don't really need to recalculate the positions of every character 100 times per second. A better approach would be to create a surface that fills the screen, and then draw to that surface instead of all the times that you draw to your variable named screen. Then you could simply clear and redraw that surface any time the content of your text changes, and your on_draw() function would simply be:
Code (lua) Select
function sol.main:on_draw(screen) surface:draw(screen) end

Quote from: llamazing on November 12, 2016, 12:40:30 AM
Your code is a bit convoluted and difficult to follow, but I think your problem is that every draw cycle you are inserting characters into dl.split_string, but you never clear dl.split_string again. If I correctly understand what you are trying to do, you should add the following at line 111:
Code (lua) Select
dl.split_string = {}

That fixed it. This can now be used as a simple Dialog box. I always clear on my Lua scripts on my android, but I completely overlooked it. I will credit you in the script. Thank you for taking your time to assist.  :D