Jump to content

Recommended Posts

Posted

i am working on new script and i am new at autoscript...

i am putting 1 input and 1 button @koda..

and i wanna my functions Sleep($input1)

like somethin this and iam using this commands

$time = GuiCtrlRead($input1)

..bla.bla..bla..

Sleep($time)

func

bla bla

endfunc

But it is not waitin anything.. whats the problem?

Posted

It's your code. This works fine with AutoIt version 3.2.12.1

$gui = GUICreate ("Test", 300, 200)
$input = GUICtrlCreateInput ("", 10, 10, 280, 20)
$button = GUICtrlCreateButton ("Sleep", 240, 35, 50, 25)
GUISetState (@SW_SHOW)

While 1
    $nMSG = GUIGetMsg ()
    Switch $nMSG
        Case -3
            Exit
        Case $button
            $time = GUICtrlRead ($input)
            $timer = TimerInit ()
            ConsoleWrite ("!!!!!!!! STARTING SLEEP FOR " & $time & "ms" & @CRLF)
            Sleep ($time)
            ConsoleWrite ("DONE (" & TimerDiff ($timer) & "ms)" & @CRLF)
    EndSwitch
WEnd

:P

Posted

thank you BrettFF timer is working but i have another problem now :P

i wanna login a site... so my way is this

Global $user = guictrlread(input1)

bla..bla..bla..

MouseClick(x,y,left)

Send($user)

so its not workng.. what do you think?

Posted

More information is needed- think what and those general questions... as Admiral has said, his crystal ball is cloudy, but sadly there was a defect with all of crystal balls when they got handed out, and mine is always cloudy..... :P

Posted

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Linksys Modem Reset Program - Kontinyu", 335, 295, 291, 136)

GUISetBkColor(0x000000)

GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")

GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")

GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")

GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")

$Label1 = GUICtrlCreateLabel("Linksys Modem Reset Program", 24, 8, 296, 30)

GUICtrlSetFont(-1, 17, 400, 0, "MS Sans Serif")

GUICtrlSetColor(-1, 0xA6CAF0)

GUICtrlSetOnEvent(-1, "Label1Click")

$Button1 = GUICtrlCreateButton("Reset", 40, 160, 265, 65, 0)

GUICtrlSetOnEvent(-1, "Button1Click")

$ModemIp = GUICtrlCreateInput("ModemIp", 24, 48, 289, 21)

GUICtrlSetOnEvent(-1, "ModemIpChange")

$Group1 = GUICtrlCreateGroup("Login", 32, 80, 289, 73)

GUICtrlSetColor(-1, 0x648BCB)

$UserName = GUICtrlCreateInput("UserName", 40, 96, 121, 21)

GUICtrlSetOnEvent(-1, "UserNameChange")

$Pass = GUICtrlCreateInput("Pass", 40, 128, 121, 21)

GUICtrlSetOnEvent(-1, "PassChange")

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

Global $start = 0

$ModemIp1 = GUICtrlRead($ModemIp)

$UserName1 = GUICtrlRead($UserName)

$Pass1 = GUICtrlRead($Pass)

While 1

Sleep(100)

if $start = 1 Then

_Reset ()

EndIf

WEnd

Func _reset ()

#region --- ScriptWriter generated code Start ---

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

Run('C:\Program Files\Mozilla Firefox\firefox.exe')

WinWait("Mozilla Firefox","")

If Not WinActive("Mozilla Firefox","") Then WinActivate("Mozilla Firefox","")

WinWaitActive("Mozilla Firefox","")

MouseMove(290,68)

MouseDown("left")

MouseUp("left")

Send($ModemIp1)

WinWait("Kimlik doÄŸrulama gerekli","")

If Not WinActive("Kimlik doÄŸrulama gerekli","") Then WinActivate("Kimlik doÄŸrulama gerekli","")

WinWaitActive("Kimlik doÄŸrulama gerekli","")

MouseMove(152,86)

MouseDown("left")

MouseMove(152,85)

MouseUp("left")

MouseDown("left")

MouseMove(0,75)

MouseUp("left")

Send($UserName1)

MouseMove(161,99)

MouseDown("left")

MouseMove(162,99)

MouseUp("left")

MouseMove(192,110)

MouseDown("left")

MouseMove(37,106)

MouseUp("left")

Send($Pass1)

MouseMove(244,145)

MouseDown("left")

MouseUp("left")

WinWait("Basic Setup - Mozilla Firefox","")

If Not WinActive("Basic Setup - Mozilla Firefox","") Then WinActivate("Basic Setup - Mozilla Firefox","")

WinWaitActive("Basic Setup - Mozilla Firefox","")

MouseMove(1126,283)

MouseDown("left")

MouseUp("left")

WinWait("Gateway Status - Mozilla Firefox","")

If Not WinActive("Gateway Status - Mozilla Firefox","") Then WinActivate("Gateway Status - Mozilla Firefox","")

WinWaitActive("Gateway Status - Mozilla Firefox","")

MouseMove(483,691)

MouseDown("left")

MouseUp("left")

MouseMove(582,690)

MouseDown("left")

MouseUp("left")

#endregion --- ScriptWriter generated code End ---

EndFunc

Func Button1Click()

$start = 1

EndFunc

Func Form1Close()

Exit

EndFunc

Func Form1Maximize()

EndFunc

Func Form1Minimize()

EndFunc

Func Form1Restore()

EndFunc

Func Label1Click()

EndFunc

Func ModemIpChange()

EndFunc

Func PassChange()

EndFunc

Func UserNameChange()

EndFunc

Script is this... i am trying to work with this..

and wanna do this without ie functions..

There is no Cloud no more i hop :P

Posted

I just wanted to say that I agree with BrettF and so does most people on this forum. (about all except Elishac :P)

Using IE is considered the best when automating browsing the internet and such stuff. :P

Note that there is a FF.au3 but it's actually far harder to use and can never get as good as the IE functions.

Posted

OK. you are right. but when i am using ie functions.. i am still have sam problem.. its cant read modems ip from Guictrlcreatebox..

Posted

Hi.

Could you just start from the beginning- what do you want to achieve? What program/website? Those sort of questions. Then we can best help you :P

Cheers,

Brett

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
×
×
  • Create New...