Sign in to follow this  
Followers 0
chorao157

[How] Sender

11 posts in this topic

#1 ·  Posted (edited)

How i can make one sender?

for example :

Posted Image

I need to set the variables for each 1000 ms? and for each number?

how I'll make sure that the button which he selected?

Edited by chorao157

Share this post


Link to post
Share on other sites



Are you asking how to click a button and then get an input box to pop up and assign that input into a variable? Or are you trying to make sure that the you have to click an enter a value into the first button, then enable the second button, input a value for that, then enable the last button to input a value into that?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

For example, where such a select Number and a menu (or checkbox), the person selects a number to send around in the second menu is again one more but with the delay that she wants this key is sent, and finally a button, that button i have him get the information menu and perform the action that the person chosen ..

EX: I chose a button, with a delay of 1000 ms, and clicked start, then he is going to send one every 1 sec

understand?

sorry for bad english, i'm from brazil, i learn less english playing

Edited by chorao157

Share this post


Link to post
Share on other sites

Do you have any code at all? This would help answer some basic questions like:

  • How many characters in the number are you trying to send? Is there a minimum/maximum number of characters?
  • Are only digits allowed? Are letters also allowed? Or are other alphanumeric characters allowed?
  • To what/where will it be sending this number? To a separate GUI, another program window?
Having some code with which to start will give the forum some explanation of what you are trying to do. No one here (within the forum) is for hire, so you'll need to give us something that shows us that you are trying and just need help.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Global $1 = 1000
Global $2 = 2000
Global $3 = 3000
Global $4 = 5000
Global $6 = 6000
Global $7 = 7000
Global $8 = 8000
Global $9 = 9000
Global $10 = 10000
Global $01 
Global $02 
Global $03 
Global $04 
Global $06 
Global $07 
Global $08 
Global $09
global $0


if $menu = $01
send(1)
endif
if $menu2 = $1
sleep(1000)
endif

I do not know how to begin, I just did that, then I did not get done, not yours if I use IF, I still have not made the GUI code just doing

Edited by chorao157

Share this post


Link to post
Share on other sites

Here's an example, although it may not even be close to what you want

Opt('ExpandEnvStrings', 1)
Opt('TrayAutoPause', 0)
Opt('TrayIconDebug', 1)
Opt('TrayOnEventMode', 1)
Opt('WinTitleMatchMode', 4)
Opt('WinWaitDelay', 100)
Opt('MouseCoordMode', 0)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <Timers.au3>
#include <Misc.au3>
_Singleton(@ScriptName, 0)

Global $MainGUI, $hGUI
Local $Msg, $Button[3] = ['Choose Number to Send', 'Delay in Milliseconds', 'Send']
Local $Color = 0x00F4F4F0, $TextColor = 0x000000, $sColor = 0x0000A0, $sTextColor = 0xFFFFFF
$MainGUI = GUICreate('Number Sender', 10 + (180 * UBound($Button)), 100)
For $i = 0 To UBound($Button) - 1
    $X_Coord = 10 + ($i * 180)
    $Button[$i] = GUICtrlCreateButton($Button[$i], $X_Coord, 30, 150, 30)
    GUICtrlSetFont($Button[$i], -1, -1, -1)
    If $i > 0 Then GUICtrlSetState($Button[$i], $GUI_DISABLE)
Next
GUISetState()
While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button[0]
            Local $Number = InputBox('Enter a number', 'No more than 4 digits', '', ' M4')
            If @error = 1 Then ContinueLoop
            If StringRegExp($Number, '[^\d]') Then ContinueLoop
            GUICtrlSetBkColor($Button[0], $sColor)
            GUICtrlSetColor($Button[0], $sTextColor)
            GUICtrlSetFont($Button[0], -1, -1, 2 + 4)
            GUICtrlSetState($Button[1], $GUI_ENABLE)
        Case $Button[1]
            Local $Delay = InputBox('Enter the Delay Time', 'Delay in Milliseconds', '', ' M')
            If @error = 1 Then ContinueLoop
            If StringRegExp($Delay, '[^\d]') Then ContinueLoop
            GUICtrlSetBkColor($Button[1], $sColor)
            GUICtrlSetColor($Button[1], $sTextColor)
            GUICtrlSetFont($Button[1], -1, -1, 2 + 4)
            GUICtrlSetBkColor($Button[2], 0xFF0000)
            GUICtrlSetColor($Button[2], $sTextColor)
            GUICtrlSetState($Button[2], $GUI_ENABLE)
        Case $Button[2]
            GUISetState(@SW_HIDE, $MainGUI)
            For $i = 0 To UBound($Button) - 1
                GUICtrlSetBkColor($Button[$i], $Color)
                GUICtrlSetColor($Button[$i], $TextColor)
                GUICtrlSetFont($Button[$i], -1, -1, -1)
                If $i > 0 Then GUICtrlSetState($Button[$i], $GUI_DISABLE)
            Next
            ShowGUI($Number, $Delay)
            GUISetState(@SW_SHOW, $MainGUI)
            WinActivate($MainGUI)
    EndSwitch
WEnd


Func ShowGUI($Number, $Delay)
    Local $Button, $hMsg, $Begin, $Grey = 0x00F4F4F0, $Black = 0x000000
    $hGUI = GUICreate('', 300, 300)
    $Button = GUICtrlCreateButton('', 0, 0, 300, 300)
    GUICtrlSetFont($Button, 50, -1, -1)
    GUICtrlSetBkColor($Button, $Grey)
    GUISetState(@SW_DISABLE, $MainGUI)
    GUISetState(@SW_SHOW, $hGUI)
    GUISwitch($hGUI)
    $Begin = TimerInit()
    While 1
        If GUICtrlRead($Button) <> $Number Then GUICtrlSetData($Button, $Number)
        $hMsg = GUIGetMsg()
        If $hMsg = $GUI_EVENT_CLOSE Then ExitLoop
        If TimerDiff($Begin) >= $Delay - 50 Then
            GUICtrlSetData($Button, '')
            GUICtrlSetBkColor($Button, $Black)
            Sleep(50)
            GUICtrlSetBkColor($Button, $Grey)
            $Begin = TimerInit()
        EndIf
    WEnd
    GUISetState(@SW_ENABLE, $MainGUI)
    GUIDelete($hGUI)
    GUISwitch($MainGUI)
EndFunc   ;==>ShowGUI

Share this post


Link to post
Share on other sites

yes and almost what I want, so that more and how he would even send an example (this script and its pretty challenging, thought it was simpler)

while1

case $buttonstart

send ("1")

Sleep (1000)

wend

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

sorry for double post, ;(

Edited by chorao157

Share this post


Link to post
Share on other sites

Are you send the output to a particular window, or whatever window that has focus? How do you plan on stopping the Loop that sends the output? These are the kinds of questions that I need answered before I can guide you. I appreciate your efforts in using English, but your requirement is too vague for me to give you more precise help.

Share this post


Link to post
Share on other sites

Problem: Read the selected delay, read the number you select, and apply this reading button

Test table:

begin

var number, delay;

Read (number);

Reading (delay);

send button on;

end.

can be in any window, and a send, so that more people will determine the delay and the number to be sent

Share this post


Link to post
Share on other sites

any can help?

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