Jump to content

possible with auto it?


Recommended Posts

ok here's what i need to do.....

I need something to pop up that enables me to change the script, BUT i need the script to STAY as a .exe, and i need this to be configurable (meaning it pops up EVERY time you double click the .exe)

i need it to be able to edit the sleep time in a certain part of the script, and in seconds (like 1, 2, 3, .1, .5, ect.) and for those to convert into of course, the miliseconds that are used in auto it (1 = 100 or 1000 or w/e it is)

if that converting thing isnt possible thats ok, but i still need it to edit the sleep time of a certain part of the script.

another thing that is NOT IMPORTANT, i need it to be able to change the button it sends

Example:

Send("w")

turns into

Send("q")

when you type it in the box.....

i want it to look SOMETHING like this, but it doesnt have to be exact

Posted Image

is there any possible way to do this using ONLY auto it? and if i'd need another program or something, does anyone know what program i'd need and how hard/easy it'd be?

Edit: in the pic, the 2 empty boxes are where you type the numbers/letters for the sleep and key send thingy

Edited by TK_Incorperate
Link to comment
Share on other sites

ok here's what i need to do.....

I need something to pop up that enables me to change the script, BUT i need the script to STAY as a .exe, and i need this to be configurable (meaning it pops up EVERY time you double click the .exe)

i need it to be able to edit the sleep time in a certain part of the script, and in seconds (like 1, 2, 3, .1, .5, ect.) and for those to convert into of course, the miliseconds that are used in auto it (1 = 100 or 1000 or w/e it is)

if that converting thing isnt possible thats ok, but i still need it to edit the sleep time of a certain part of the script.

another thing that is NOT IMPORTANT, i need it to be able to change the button it sends

Example:

Send("w")

turns into

Send("q")

when you type it in the box.....

i want it to look SOMETHING like this, but it doesnt have to be exact

Posted Image

is there any possible way to do this using ONLY auto it? and if i'd need another program or something, does anyone know what program i'd need and how hard/easy it'd be?

Edit: in the pic, the 2 empty boxes are where you type the numbers/letters for the sleep and key send thingy

I dont think it is possible to change the script once it has been compiled. What you could do is use an ini file to store the values and you can change that as often as you want.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

I dont think it is possible to change the script once it has been compiled. What you could do is use an ini file to store the values and you can change that as often as you want.

would you happen to know how to do that?? its not extremely important, but it is a great contribution to what im making, and would make alot of things ALOT easier hehe :"> anyone who could give me some info on how to do this, i would be greatly appreceated ;)

Edit: sorry for all the newbie questions lol... im new to autoit, and the help file isnt really "newbie friendly" lol

Edited by TK_Incorperate
Link to comment
Share on other sites

would you happen to know how to do that?? its not extremely important, but it is a great contribution to what im making, and would make alot of things ALOT easier hehe :"> anyone who could give me some info on how to do this, i would be greatly appreceated ;)

Edit: sorry for all the newbie questions lol... im new to autoit, and the help file isnt really "newbie friendly" lol

Can you set the sleep time as a variable, then get the new sleep time from the input box, if a not valid time is entered then do not update the Sleep variable

Link to comment
Share on other sites

Can you set the sleep time as a variable, then get the new sleep time from the input box, if a not valid time is entered then do not update the Sleep variable

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 151,(@DesktopWidth-392)/2, (@DesktopHeight-151)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Button_1 = GuiCtrlCreateButton("SleepTime", 50, 30, 150, 30)
$Button_2 = GuiCtrlCreateButton("Letter", 50, 90, 150, 30)
$Input_3 = GuiCtrlCreateInput("", 250, 30, 60, 30)
$Input_4 = GuiCtrlCreateInput("", 250, 90, 60, 30)
$SleepTime = 5000
$Letter = "P"

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $Msg = $Button_1
        $NewSleepTime = GUICtrlRead ( $input_3  ) * 1000
    $SleepTime = $NewSleepTime
    MsgBox (0,"", $SleepTime)
Case $Msg = $Button_2
    $NewLetter = GUICtrlRead ( $input_4  )
    $Letter = $NewLetter
    MsgBox (0,"", $Letter)
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit

something like that, but you'll want some error checking in it incase the wrong information is entered

Link to comment
Share on other sites

ok nvm thats confusing...

It would be simpler if you posted your code and let us change it a bit...

...but see if this code makes sense to you.

If not, ask questions about it.

AutoItSetOption("SendKeyDelay", 1) ;(milliseconds)
AutoItSetOption("WinWaitDelay", 1) ;(milliseconds)

$Key2Send = ""
$Time2Sleep = 0

$Key2Send = InputBox("AutoIt", "Tell me what key you would like to send.")
If @error Then Exit

$Time2Sleep = InputBox("AutoIt", "Enter delay in milliseconds between sending the keys.")
If @error Then Exit

$ans = MsgBox(1, "AutoIt", "I'm going to open Notepad now.")
If $ans = 2 Then Exit

Run("notepad")
WinWait("Untitled - Notepad")

For $i = 1 To 10
    WinActivate("Untitled - Notepad")
    WinWaitActive("Untitled - Notepad")
    Send($Key2Send)
    Sleep($Time2Sleep)
Next

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

Link to comment
Share on other sites

lol i dont think it'd be ok to post my code here.... what im writing is a bot for a game, well.... not a bot, but an auto-clicker wit certain configable stuff, lol.....

what i wonder tho, is there any way like.... instead of doing this...

Send("Z")

is there any way i can make it pull somethin from a .ini.... like say for example (i know this isnt it, just using an example to say something LIKE this would be really good to use)

Send("ml1.ini\LTBut")

and inside the .ini have the line for that like...

LTBut = Z, so it could be changable... ect.

lol i realise what i pisted about it picking up the letter from the .ini is stupid, but im just using it as an example to ask if i could do something LIKE that

Link to comment
Share on other sites

ok.... so that didnt quite work....

i have this inside of a script

While 1
    TrayTip("Currently", "Replacing", 10)
        Send("{ALT}{RIGHT}{DOWN}f")
$Keybind = IniRead("NPTR.ini", "NPTR", "Delchar")
  Send($Keybind)
        Send("{ENTER}{ESC}")
$Keybind = IniRead("NPTR.ini", "NPTR", "Repchar")
  Send($Keybind)
            Sleep(3000);I perfer keeping this at 3 seconds, but you can change to your likings
WEnd

then insode of the same folder, i have a .ini named "NPTR.ini"

and inside of that .ini these are the EXACT contents

[NPTR]
  Delchar=car
  Repchar=truck

and i get this error......

"Line 21 (File "C:\Program Files\AITest\NPTR.au3"):

$Keybind = IniRead("NPTR.ini", "NPTR", "Delchar")

$Keybind = ^ERROR

Error: Incorrect number of parameters in function call"

Link to comment
Share on other sites

Error: Incorrect number of parameters in function call"

Sorry, wrote that code blind...

You have to specify a default string.

$Keybind = IniRead("NPTR.ini", "NPTR", "Delchar", "Fill In The Blank")
This will set the value in case the INI doesn't exist or the Delchar line is missing. What you fill it with depends on how your script should handle this issue.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

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