Sign in to follow this  
Followers 0
Azu

Can someone please help me optimize my script?

8 posts in this topic

#1 ·  Posted (edited)

Hello I just made my first script and am wandering if anyone knows of any ways to improve it? :lmao:

Please tell me if you do! Thanks!

Edited by Azu

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

...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]

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Oh and thanks Valuater :lmao:

Edited by Azu

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I don't know o.o

IE is awful.

But a lot of people use it, and I don't want them to be unable to read my posts.

=p

Share this post


Link to post
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
Sign in to follow this  
Followers 0