Sign in to follow this  
Followers 0
Thatsgreat2345

Send a variable

8 posts in this topic

i was wondering if theres anyway to send a variable i tryed but it wasnt workign like you insert a certain key in a GUI and u have send("{$input_1}") or what?

#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>



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

$Input_1 = GuiCtrlCreateInput("", 50, 50, 70, 20)
$Input_2 = GuiCtrlCreateInput("", 50, 120, 70, 20)
$Input_3 = GuiCtrlCreateInput("", 50, 190, 70, 20)
$Label_4 = GuiCtrlCreateLabel("Skill Button", 30, 20, 120, 20)
$Label_5 = GuiCtrlCreateLabel("Pot Button", 30, 90, 110, 20)
$Label_6 = GuiCtrlCreateLabel("Number of Casts", 30, 160, 120, 20)
$Input_4 = GuiCtrlCreateInput("", 30, 280, 70, 20)
$Label_8 = GuiCtrlCreateLabel("Number Of Pots To Cast", 40, 260, 100, 20)
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{f1}", "ShowMessage") ;Shift-Alt-d

;;;; Body of program would go here;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
$skill = $Input_1

while 1
for $i = 1 to $Input_3
send("{$skill}")
sleep(1000)
Next
for $h = 1 to $Input_4
send("{Input_3}")
next
wend
Endfunc

Share this post


Link to post
Share on other sites



Below is what I think will help. Let me know after you test it. I am not positive because of how your question is worded.

Send($Input_3)

Let me know how it works,

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

neither of them seem to be working :-/

Share this post


Link to post
Share on other sites

neither of them seem to be working :-/

To read the value from the GUI you need to do GUIRead($Input_3)..


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

like this cuz it aint working and with the send i cant figure out how to encorporate it in with the send cuz on an old script i used it was like Send(GuiCtrlRead($Input_3) & "{Enter}"); but i cant figure out how to take off the enter and yeah

#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>


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

$Input_1 = GuiCtrlCreateInput("", 50, 50, 70, 20)
$Input_2 = GuiCtrlCreateInput("", 50, 120, 70, 20)
$Input_3 = GuiCtrlCreateInput("", 50, 190, 70, 20)
$Label_4 = GuiCtrlCreateLabel("Skill Button", 30, 20, 120, 20)
$Label_5 = GuiCtrlCreateLabel("Pot Button", 30, 90, 110, 20)
$Label_6 = GuiCtrlCreateLabel("Number of Casts", 30, 160, 120, 20)
$Input_4 = GuiCtrlCreateInput("", 30, 280, 70, 20)
$Label_8 = GuiCtrlCreateLabel("Number Of Pots To Cast", 40, 260, 100, 20)
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{f7}", "ShowMessage") ;Shift-Alt-d

;;;; Body of program would go here;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
while 1
for $i = 1 to GUICtrlRead($Input_3)
send("{" & $Input_1 & "}")
sleep(1000)
Next
for $h = 1 to GUICtrlRead($Input_4)
send("{" & $Input_2 & "}")
Next
WEnd
Endfunc

Share this post


Link to post
Share on other sites

Try this...

#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>


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

$Input_1 = GuiCtrlCreateInput("", 50, 50, 70, 20)
$Input_2 = GuiCtrlCreateInput("", 50, 120, 70, 20)
$Input_3 = GuiCtrlCreateInput("", 50, 190, 70, 20)
$Label_4 = GuiCtrlCreateLabel("Skill Button", 30, 20, 120, 20)
$Label_5 = GuiCtrlCreateLabel("Pot Button", 30, 90, 110, 20)
$Label_6 = GuiCtrlCreateLabel("Number of Casts", 30, 160, 120, 20)
$Input_4 = GuiCtrlCreateInput("", 30, 280, 70, 20)
$Label_8 = GuiCtrlCreateLabel("Number Of Pots To Cast", 40, 260, 100, 20)
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
   ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{f7}", "ShowMessage");Shift-Alt-d

;;;; Body of program would go here;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    While 1
        For $i = 1 to GUICtrlRead($Input_3)
            Send(GUICtrlRead($Input_1))
            Sleep(1000)
        Next
        For $h = 1 to GUICtrlRead($Input_4)
            Send(GUICtrlRead($Input_2)
        Next
    WEnd
Endfunc

You put the GUICtrlRead in most of the right places. B). Now if the input from $Input_1or2 is a key and not a string then you will need the "{" & "}" stuff. I took it out as it seems it would be unnecessary.

I hope this helps you more in the right direction.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

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