madpoet 0 Posted January 30, 2011 Report Share Posted January 30, 2011 First time trying to write a bot that reads from files. I can manage just fine when set to a static location but I'd like the bot to read from whatever folder it is in to actually locate the file. Seems like if should be simple But I admit its escaping me and I haven't found an example yet in the tutorials that shows that scenario. Any pointers? Quote Link to post Share on other sites
Enigma 78 Posted January 30, 2011 Report Share Posted January 30, 2011 First time trying to write a bot that reads from files. I can manage just fine when set to a static location but I'd like the bot to read from whatever folder it is in to actually locate the file. Seems like if should be simple But I admit its escaping me and I haven't found an example yet in the tutorials that shows that scenario. Any pointers? Use the UI Open File and add to a list. Quote Link to post Share on other sites
nuc63 27 Posted January 30, 2011 Report Share Posted January 30, 2011 application directory will load file in your bot directory. Quote Link to post Share on other sites
Enigma 78 Posted January 30, 2011 Report Share Posted January 30, 2011 application directory will load file in your bot directory. I thought he just asked that he could add any file from any folder? I can manage just fine when set to a static location but I'd like the bot to read from whatever folder it is in to actually locate the file Or did i misunderstood? Quote Link to post Share on other sites
madpoet 0 Posted January 30, 2011 Author Report Share Posted January 30, 2011 Thanks, looks like $application folder is what I needed! Quote Link to post Share on other sites
nuc63 27 Posted January 30, 2011 Report Share Posted January 30, 2011 I thought he just asked that he could add any file from any folder? Or did i misunderstood? You answered perfectly I just gave a example of how to load a file in the same directory as your ubot bot. Quote Link to post Share on other sites
Gogetta 263 Posted January 30, 2011 Report Share Posted January 30, 2011 Just like nuc63 said, the $application folder is what you are looking to use for this. But keep in mind that this constant will use the path of your Ubot folder located in your documents until the bot is compiled. Quote Link to post Share on other sites
Enigma 78 Posted January 30, 2011 Report Share Posted January 30, 2011 Thanks, looks like $application folder is what I needed! You answered perfectly I just gave a example of how to load a file in the same directory as your ubot bot. So it seems he asked the wrong question, as my answer was actually good.Now he said he will use $applicationfolder Anyway, who cares?! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.