AutoIT IMVU CHKN Renamer

DataMine
by DataMine · 20 posts
8 years ago in Autoit
Posted 8 years ago · Author
After spending the night with my head in WPF dependency properties and styles, I decided to take a break an work on something that was a little easier.

This script will rename all chkns in a folder with random names. The script itself isn't really that useful, writing it was a way for me to get back into AutoIT and to see what all was possible. I had also wanted to give this section of the forums more content and had hoped this would spark some creativity.

You can find the full source code below with comments so it should be easier to edit.

Code
#include <Array.au3>
#include <File.au3>

;The directory to search in
Global $workingDirectory = "C:\Users\User\Desktop\New folder"

;Create an array of all the CHKNs found in the working directory
$array = _FileListToArray($workingDirectory, "*.chkn")

;If no CHKNs were found
If @error = 4 Then
   MsgBox($MB_SYSTEMMODAL, "", "No CHKNs were found.")
   Exit
EndIf

;Iterate through the CHKNs
For $i = 1 to $array[0]
   Local $newName = genRandomName()

   FileMove($workingDirectory & "\" & $array[$i], $workingDirectory & "\" & $newName & ".chkn")

   ConsoleWrite($array[$i] & " was renamed to " & $newName & ".chkn" & @LF);
Next



;This function returns a random string
Func genRandomName()
   ;Create an array of ASCII codes to generate the string from.
   ;We do this rather than using Chr(Random(num,num,1)) because
   ;this is less work
   Local $characters = StringToASCIIArray("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")

   ;create a variable to store the random string in
   Local $name = ""

   ;the size of the random string to generate
   Local $size = 10

   For $i = 1 To $size
     ;Create local variable to store the previously chosen character
     Local $previousC = ""

     ;Create a variable to store the chosen character and give it a value
     ;by selecting a random ASCII code from the $characters array And
     ;converting it to a character
     Local $c = Chr($characters[Random(1, UBound($characters))])

     ;prevent duplicate characters side-by-side by repeatedly generating a new character
     ;using the same technique as above until a unique one is found
     Do
       $c = Chr($characters[Random(1, UBound($characters))])
       ;ConsoleWrite($c & @LF)
     Until Not ($c = $previousC)

     ;Set the newly selected character as the previous one
     $previousC = $c

     ;append the character to the string
     $name &= $c
   Next

   Return $name
EndFunc


@Don Von Alpha Dom
Posted 8 years ago
Thanks @ D.M and one more thing i think a pro assets renamer would be more usefull preferably one that keeps your assets in the product after renaming them so you dont have to load them in the editor again :D

just an ideea :D
Posted 8 years ago · Author
Adryan wrote:
Thanks @ D.M and one more thing i think a pro assets renamer would be more usefull preferably one that keeps your assets in the product after renaming them so you dont have to load them in the editor again just an ideea


I created a program that does just that for Don, I ended up spending so much more time on it than I needed to for him just in case other people wanted it too.

If there's a market for it, I'll put it up for sale.

@Adryan
Posted 8 years ago
D.M wrote:
Adryan wrote:Thanks @ D.M and one more thing i think a pro assets renamer would be more usefull preferably one that keeps your assets in the product after renaming them so you dont have to load them in the editor again just an ideeaI created a program that does just that for Don, I ended up spending so much more time on it than I needed to for him just in case other people wanted it too.If there's a market for it, I'll put it up for sale.@Adryan


Im interested @ D.M let me know the price :)
Posted 8 years ago · Author
Adryan wrote:
Im interested @ D.M let me know the price


I'm thinking about $10. I am adding a logging feature before I release it and I plan on updating the UI here soon but other than that,whenever you'd like to purchase it, let me know.


@Adryan
@Don Von Alpha Dom
Posted 8 years ago
D.M wrote:
I'm thinking about $10. I am adding a logging feature before I release it and I plan on updating the UI here soon but other than that,whenever you'd like to purchase it, let me know.@Adryan @Don Von Alpha Dom


@D.M
sent you a pm thanks
Posted 8 years ago
Is there anything like a script to automatically delete friends who haven't logged in for a given period of time? -if you get what i mean-

(Would be helpful if you have a massive friendlist, deleting people is a lot of work)
Posted 8 years ago
Formulax wrote:
Is there anything like a script to automatically delete friends who haven't logged in for a given period of time? -if you get what i mean-(Would be helpful if you have a massive friendlist, deleting people is a lot of work)


i didnt see anything like this but you have to talk to
@D.M
he knows best :wave:
Posted 8 years ago
Adryan wrote:
Formulax wrote:Is there anything like a script to automatically delete friends who haven't logged in for a given period of time? -if you get what i mean-(Would be helpful if you have a massive friendlist, deleting people is a lot of work)i didnt see anything like this but you have to talk to @D.M he knows best


Yeah, i thought he would probably read it here :D
Posted 8 years ago · Author
Formulax wrote:
Is there anything like a script to automatically delete friends who haven't logged in for a given period of time? -if you get what i mean-(Would be helpful if you have a massive friendlist, deleting people is a lot of work)


We don't have anything like that yet. It might be possible to do but I'd have to sit down and think about it for a while.

I know with autoIT you can click things on the client but I would need to first figure out how to target individual buttons in the friends mode and then figure out how to determine if the friend has no logged in a certain time period.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT