Page 1 of 1

change file being called if usb is in different port

Posted: August 31st, 2017, 8:49 pm
by hashtaghashtag9967
I'm using a little "ai" "assistant" that does basic tasks on my computer i have it making sounds and producing images however i use rainmeter on a flash drive so i can use it at school (it wont work on the C: drive because of my schools admin protected laptops) i also use it at home and thus i transfer the flash drive back and forth, unfortunately the different names for the usb ports makes calling the files difficult ( ex. F:\Skins vs E:\Skins) i found a way to test witch it is however the problem comes when i need to change what file is called from my lua script i am trying to stitch the home string with the file directory but it doesn't appear to be working :???:


the home variable contains the E: or F: string

lua code:

Code: Select all


function file_check(file_name)
  local file_found=io.open(file_name, "r")  


  home = "F:"

  if file_found==nil then
    file_found=file_name .. " ... Error - File Not Found"
	home = "E:"
  else
    file_found=file_name .. " ... File Found"
	home = "F:"
  end
  return file_found
end

print(file_check("F:\\rainmeter sounds\\i_was_sleeping.wav"))
--if this file is found i know im on my home laptop ^^^









function DealWithInput(inArg)




	
   inputText = string.lower(inArg)
   
   

    print(home)
		
		
		
	if inputText == 'hi' then outputText = 'ugh i was sleeping -_-'SKIN:Bang('Play "home .. \\rainmeter sounds\\i_was_sleeping.wav"')

thanks in advance :D