Jump to content
UBot Underground

Relative Paths?


Recommended Posts

Hi Everyone!

 

I have some files that need to be included in my Bot, but when compiled but I'm not sure how to code them in the program.

 

They are just text files that are used to write to and then scrape form while the bot is running, as well as store information for later.  Could one of you vets please let me know how to do this?

 

Many Thanks!

 

Peace,

LJ

Link to post
Share on other sites

Hello,

 

You can use $read file

not sure what is in the file soooo.... I would tell you more.

 

 

you can use that in an "add list to list" like this

navigate("http://www.ubotstudio.com/tutorials","Wait")
set(#read file,$read file("C:\\your file path"),"Global")
add list to list(%a,$list from text($read file("C:\\your file path"),$new line),"Delete","Global")
add list to list(%b,$list from file("{$special folder("Application")}\\your file.tat"),"Delete","Global")

 

just a few examples

press Ctrl + e and type file u will see loads :)

play with special folder

"Application" means the same folder as your bot.exe or bot.ubot flle

 

see file commands and file functions

http://wiki.ubotstudio.com/wiki/Main_Page

 

 

HTHelps,

 

CD

Link to post
Share on other sites

As CD already showed in his code, the answer (I think) you are looking for is a function called $special folder. This will allow you to choose a folder that will work on anyone's computer. If you try application for example it will store the text file in the same folder as the folder the program is located.

 

The following is an example of how to use it, it will save a file on anyone's desktop without the full path needed. In most cases though you will probably be using something like application folder then  maybe have a folder in there called data so it would be application\data\whatever.txt

set(#save_file,"{$special folder("Desktop")}\\ubot.txt","Global")
save to file(#save_file,"test")
  • Like 1
Link to post
Share on other sites

 

As CD already showed in his code, the answer (I think) you are looking for is a function called $special folder. This will allow you to choose a folder that will work on anyone's computer. If you try application for example it will store the text file in the same folder as the folder the program is located.

 

The following is an example of how to use it, it will save a file on anyone's desktop without the full path needed. In most cases though you will probably be using something like application folder then  maybe have a folder in there called data so it would be application\data\whatever.txt

set(#save_file,"{$special folder("Desktop")}\\ubot.txt","Global")
save to file(#save_file,"test")

Thank you CD and Nick!

 

You got it exactly Nick!  I need to include the files in the complied package that I send to users and this will get me there :-)

 

Thank you both very much!

 

Peace,

LJ

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...