Sign in to follow this  
Followers 0
Bam

ERROR: _IsPressed() already defined.

4 posts in this topic

C:\Program Files\AutoIt3\Include\IsPressed_UDF.au3(301,48) : ERROR: _IsPressed() already defined.

idk why this will work

#include <LimitInputEx.au3>

_LimitInputEx(1, "0D");Block ENTER


While 1
    Sleep(100)
WEnd

Func OnAutoItExit()
    _LimitInputEx()
EndFunc ;==>OnAutoITExit

but this dosnt

(its a public computer that im trying to make it where people cant navigate from the page and do some harm to the computer)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>;
#include <Misc.au3>
#include <EditConstants.au3>;
#include <LimitInputEx.au3>;

Local $MX, $Loop
$Loop = 0
$User = 0

HotKeySet("{ESC}", "Stop")
HotKeySet("{F9}", "LoginUser")
HotKeySet("{F8}", "LogOut")


Call("WaitToStart")
Call("Monitor")

Func Stop()
    Shutdown(5)
    Exit
EndFunc  ;==>Stop

Func WaitToStart()
    Sleep(600)
EndFunc  ;==>WaitToStart

Func Monitor()
    _LimitInputEx(1, "0D");Block ENTER
    If $User = 0 Then
        While 1
            _MouseTrap(5, 124, 1018, 727)
            If Not WinActive("YTB Travel Sweepstakes") Then
                WinActivate("YTB Travel Sweepstakes")
                Sleep(100)
            EndIf
        WEnd
    EndIf
EndFunc  ;==>Monitor

Func LoginUser()
    Local $GUIWidth = 220, $GUIHeight = 80
    Local $Edit_Login, $Login_Btn, $Cancel_Btn, $msg, $Read
    GUICreate("Login", $GUIWidth, $GUIHeight)
    GUICtrlCreateLabel("UserName", 10, 10)
    $Edit_Login = GUICtrlCreateInput("", 10, 25, 200, 20, $ES_PASSWORD)
    $Login_Btn = GUICtrlCreateButton("Login", 20, 50, 70, 25, $BS_DEFPUSHBUTTON)
    $Cancel_Btn = GUICtrlCreateButton("Cancel", 130, 50, 70, 25)
    GUISetState(@SW_SHOW)
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                GUIDelete()
            Case $msg = $Login_Btn
                $Read = GUICtrlRead($Edit_Login)
                If $Read = "Admin" Then
                    GUIDelete()
                    ToolTip('Admin', 0, 0)
                    $User = 1
                    _LimitInputEx()
                Else
                EndIf
            Case $msg = $Cancel_Btn
                GUIDelete()
                Call("LogOut")
        EndSelect
        If $User = 0 Then
            _MouseTrap(407, 345, 619, 418)
        EndIf
    WEnd
EndFunc  ;==>LoginUser

Func LogOut()
    $User = 0
    ToolTip('', 0, 0)
    Call("Monitor")
EndFunc  ;==>LogOut

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

C:\Program Files\AutoIt3\Include\IsPressed_UDF.au3(301,48) : ERROR: _IsPressed() already defined.

idk why this will work

#include <LimitInputEx.au3>

<snip>

but this dosnt

(its a public computer that im trying to make it where people cant navigate from the page and do some harm to the computer)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>;
#include <Misc.au3>
#include <EditConstants.au3>;
#include <LimitInputEx.au3>;

<snip>
The AutoIt standard version of _IsPressed() is declared inside Misc.au3. You must be declaring it again in one of your other #include file (or an #include file inside one of those).

:)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

any recomendations for easy fix? :)

Share this post


Link to post
Share on other sites

any recomendations for easy fix? :lmao:

Temporarily remove '#include <Misc.au3>' from your script, put the cursor on one of the calls to _IsPressed() (add one if it's not part of your script already), and hit CTRL-j in SciTE. It will search the include files and open the one containing that function.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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