Jump to content
UBot Underground

Comparison - Using $Get File Info - Help?


Recommended Posts

Hi,

 

I think I have my logic correct here:

 

I am looking at a list of images and performing a lookup of each file in size and then doing a comparison for files sizes and if over a set size to alert "Big" or "OK"

 

Am i missing something?

 

I am using File/Folder plugin by botguru.net

ui button("Choose Image Directory") {
    add list to list(%imageslist,$get files($plugin function("File Management.dll", "$folder browser dialog"),"Yes"),"Don\'t Delete","Global")
}
with each(%imageslist,#file) {
    set(#result,$plugin function("FileFolderCommands.dll", "$get file info", #file, "Total Size"),"Global")
    if($comparison(#result,">= Greater than or equal to",5000000)) {
        then {
            alert("big")
        }
        else {
            alert("OK")
        }
    }
}
Link to post
Share on other sites

OK,

 

I have it working now: - Just save and re-opened in Ubot Studio - how odd!

ui button("Choose Image Directory") {
    add list to list(%imageslist,$get files($plugin function("File Management.dll", "$folder browser dialog"),"Yes"),"Don\'t Delete","Global")
}
with each(%imageslist,#file) {
    set(#result,$plugin function("FileFolderCommands.dll", "$get file info", #file, "Total Size"),"Global")
    if($comparison(#result,">= Greater than or equal to",5000000)) {
        then {
            alert("File is bigger than 5mb allowed by twitter")
        }
        else {
            alert("OK")
        }
    }
}
Edited by welby
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...