Jump to content

I hate guis


Cloud
 Share

Recommended Posts

I need someone to help me to just read the input boxes and make it to the variable. I dont know what im doing wrong. Also I want it to go on and save the variables when someone hits the done button. Im like really newb to this. Any and all help is welcomed.

I tried to do it but all i get is output of 7 8 ... Also could you explain how you did it. Thanks.

Func Menu()

$Menu = GUICreate("AutoSpammer", 244, 108, 309, 222)

GUISetCursor (2)

GUISetFont(10, 400, 0, "Arial")

GUISetBkColor(0xA6CAF0)

$Labe1 = GUICtrlCreateLabel("Delay", 0, 48, 37, 20)

$Labe2 = GUICtrlCreateLabel("Spams", 0, 0, 45, 20)

$Labe3 = GUICtrlCreateLabel("Effects", 0, 72, 44, 20)

$Labe4 = GUICtrlCreateLabel("Times", 0, 24, 39, 20)

Global $Count = GUICtrlCreateInput("2", 48, 0, 89, 24, -1, $WS_EX_CLIENTEDGE)

Global $Times = GUICtrlCreateInput("10", 48, 24, 89, 24, -1, $WS_EX_CLIENTEDGE)

Global $Delay = GUICtrlCreateInput("1000", 48, 48, 89, 24, -1, $WS_EX_CLIENTEDGE)

Global $Effects = GUICtrlCreateCombo("", 48, 74, 179, 24)

GUICtrlSetData(-1, "Random effects and colors|Random colors only|Random effects only|No Random colors or effects")

$ButtonCalc = GUICtrlCreateButton("Calcuator", 136, 0, 89, 25)

$Buttonpause = GUICtrlCreateButton("Pause", 136, 24, 89, 25)

$ButtonDone = GUICtrlCreateButton("Continue", 136, 48, 89, 25)

GUISetState(@SW_SHOW)

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

Exit

Case $msg = $ButtonCalc

Call ("Calc")

Case $msg = $Buttonpause

Call ("Pause")

Case $msg = $ButtonDone

;;;;; What do i do here to continue with the variables?

ExitLoop

EndSelect

WEnd

MsgBox(0,"Check Me", $count &" "& $Times) ;; I used this to test if they work and NOPE!

if $count > 0 And $delay > 0 And $times >0 Then

else

MsgBox(0,"Error", "Those are not valid numbers please run the script again.")

exit

endif

EndFunc

Link to comment
Share on other sites

  • Developers

There is nothing wrong with Call() but you should only use the Call() function when you need to run a "variable" Function name. Normally you just do : FunctionName(Parameters)

So in your case:

Calc()

Pause()

Etc.

For some reason scripters seem to think that using Call() is the regular way to run a Func ... B) Why would that be ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Alright its like java then. I just thought that was the standered.

Alright Im getting the same error....

Can someone show me an example of one?

Global $count =1

Global $spam[$count]

Local $label[$count]

$SpamMenu = GUICreate("Input Spams", 410, (25*$count+10), 310, 250)

For $w = 0 To $count-1 Step 1

$label[$w] = GUICtrlCreateLabel("Spam "& $w+1, 0, 8+24*$w, 40, 17)

$spam[$w] = GUICtrlCreateInput("Spam Here", 40, 8+24*$w, 370, 24, -1, $WS_EX_CLIENTEDGE)

Next

GUISetState(@SW_SHOW)

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

Exit

EndSelect

For $f = 0 To $count-1 Step 1

GuiCtrlRead($spam[$f])

MsgBox (0, "test", " Test - "+ $spam[$f])

Next

WEnd

Exit

Link to comment
Share on other sites

learn to make USE of the error message that autoit gives you

>"E:\AutoIt3.1.1\autoit3.exe" /ErrorStdOut "E:\AutoIt3.1.1\Examples\goog.au3"

E:\AutoIt3.1.1\Examples\goog.au3 (7) : ==> Variable used without being declared.:

$spam[$w] = GUICtrlCreateInput("Spam Here", 40, 8+24*$w, 370, 24, -1, $WS_EX_CLIENTEDGE)

$spam[$w] = GUICtrlCreateInput("Spam Here", 40, 8+24*$w, 370, 24, -1, ^ ERROR

>Exit code: 0 Time: 0.653

aka you need to #include <GuiConstants.au3>

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Link to comment
Share on other sites

learn to make USE of the error message that autoit gives you

aka you need to #include <GuiConstants.au3>

This is my sorce. It already had the include just 10 lines up. Still same problem. Im not dumb just lost B) I am dumb then.

But would declaring the variables first help it? I never had to in autoit.

#include <GUIConstants.au3>

Global $count =1

Global $spam[$count]

Local $label[$count]

$SpamMenu = GUICreate("Input Spams", 410, (25*$count+10), 310, 250)

For $w = 0 To $count-1 Step 1

$label[$w] = GUICtrlCreateLabel("Spam "& $w, 0, 8+24*$w, 40, 17)

$spam[$w] = GUICtrlCreateInput("Spam Here", 40, 8+24*$w, 370, 24, -1, $WS_EX_CLIENTEDGE)

Next

GUISetState(@SW_SHOW)

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

Exit

EndSelect

; For $f = 0 To $count-1 Step 1

; GuiCtrlRead($spam[$f])

; MsgBox (0, "test", " Test - "+ $spam[$f])

; Next

WEnd

Exit

Edited by Cloud
Link to comment
Share on other sites

make sure you have the latest version of includes.

OR

use 512 instead of $WS_EX_CLIENTEDGE

if this does not help POST THE ERROR MESSAGE !

Edited by w0uter

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Link to comment
Share on other sites

make sure you have the latest version of includes.

OR

use 512 instead of $WS_EX_CLIENTEDGE

if this does not help POST THE ERROR MESSAGE !

Ill try. There is no error it just dont want to assign a variable to an input. I run it and it says 2 4 6 8 10 12

I just want it to output the inputs.. Having alot of trouble. And I am using 3.1.

I just want it to ask for x inputs and then msg box the x inputs. This will solve like 101% of my problems.

Link to comment
Share on other sites

#include <GuiConstants.au3>

Global $count = 1
Global $spam[$count]
Local $label[$count]
$SpamMenu = GUICreate("Input Spams", 410, (25 * $count + 10), 310, 250)
For $w = 0 To $count - 1 Step 1
    $label[$w] = GUICtrlCreateLabel("Spam " & $w + 1, 0, 8 + 24 * $w, 40, 17)
    $spam[$w] = GUICtrlCreateInput("Spam Here", 40, 8 + 24 * $w, 370, 24, -1, $WS_EX_CLIENTEDGE)
Next
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
    
    For $f = 0 To $count - 1 Step 1
        MsgBox(0, "test", " Test - " & GUICtrlRead($spam[$f]))
    Next
WEnd
Exit

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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