Jump to content

Can someone please help me optimize my script?


Azu
 Share

Recommended Posts

Make smaller/faster(/stronger)? Please? :lmao:

CODE
#include <GUIConstants.au3>

#include <string.au3>

$inipath="C:/AutoLogin.ini"

$readini = IniReadSectionNames($inipath)

Func NewIniFile()

$DA = FileOpenDialog("Browse to DA", "", "Dark Ages (*.exe)", 1 + 4 )

$DA = StringReplace($DA, "|", @CRLF)

IniWrite($inipath, "DA", "Path", $DA)

$DAName = InputBox("Input DA name", "Please type your DA name", "", "",)

IniWrite($inipath, "DA", "Name", $DAName)

$DAPassword = InputBox("Input DA password", "Please type your DA password", "", "",)

IniWrite($inipath, "DA", "Password", $DAPassword)

$RO = FileOpenDialog("Browse to RO", "", "Ragnarok Online (*.exe)", 1 + 4 )

$RO = StringReplace($RO, "|", @CRLF)

IniWrite($inipath, "RO", "Path", $RO)

$ROName = InputBox("Input RO name", "Please type your RO name", "", "",)

IniWrite($inipath, "RO", "Name", $ROName)

$ROPassword = InputBox("Input RO password", "Please type your RO password", "", "",)

IniWrite($inipath, "RO", "Password", $ROPassword)

$WoW = FileOpenDialog("Browse to WoW", "", "World of Warcraft (*.exe)", 1 + 4 )

$WoW = StringReplace($WoW, "|", @CRLF)

IniWrite($inipath, "WoW", "Path", $WoW)

$WoWName = InputBox("Input WoW name", "Please type your WoW name", "", "",)

IniWrite($inipath, "WoW", "Name", $WoWName)

$WoWPassword = InputBox("Input WoW password", "Please type your WoW password", "", "",)

IniWrite($inipath, "WoW", "Password", $WoWPassword)

EndFunc

I can rebuild it. Make it better, faster, stronger. That'll be six million dollars... ;)

I'm a newbie here myself, I just wanted to point out that the "Code" button on the editor doesn't work well for long listings. Someone else told me to edit the "Code" tag to a "Codebox" tag and you get a scroll bar. I used that in quoting your code in this reply. Good luck with your script.

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

...Someone else told me to edit the "Code" tag to a "Codebox" tag and you get a scroll bar...

Yeah, but now try copying the code back out of a post that used a codebox. If you use IE, you get one solid line of text, no line breaks. If you use Firefox to get code from a codebox, you should get the line returns - but you will loose some other formatting (like indentions). [Not that the original post/code had any indentions :-(] Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

maybe you could change this

Send("{CTRLDOWN}")
Send("v")
Send("{CTRLUP}")

to this

Send("^v")

and maybe change this

Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )
Sleep ( 100 )
Send ( "{ENTER}" )

to this

for $x = 1 to 15
     Sleep ( 100 )
     Send ( "{ENTER}" )
Next

8)

NEWHeader1.png

Link to comment
Share on other sites

Yeah, but now try copying the code back out of a post that used a codebox. If you use IE, you get one solid line of text, no line breaks. If you use Firefox to get code from a codebox, you should get the line returns - but you will loose some other formatting (like indentions). [Not that the original post/code had any indentions :-(]

Haven't seen it hurt anything I've cut/pasted in Firefox. But I'm generally pasting it straight into SciTE and the first thing I do is hit ^T, which gives me standardized indentations and saves it to a file.

Is the "Codebox" tag under the controll of the board owners, or are they stuck with the behavior of their blog software?

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Codebox doesn't work with internet explorer from what I've read on this forum o.o

So it's a good thing that nobody in their right mind uses MS IE anymore!

:lmao:

Interesting though... the www.autoitscript.com home page won't even open in an IE Tab on Firefox, yet everything works fine under a regular firefox tab... ?

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...