Jump to content

Need Help Script dont work


au3scr
 Share

Recommended Posts

Am i only one who cant run this script?

can some one help here?

[autoit]#include <GUIConstants.au3>

#include <GUIEdit.au3>

#include<misc.au3>

#include <GUIConstants.au3>

#include <GUIEdit.au3>

HotKeySet ("{enter}", "read_func")

HotKeySet ("^{NUMPADADD}", "IncreaseFont")

HotKeySet ("^{NUMPADSUB}", "DecreaseFont")

HotKeySet ("{f11}", "fullscreen")

;~ HotKeySet ("^{mousewheelup}", "IncreaseFont")

;~ HotKeySet ("^{Mousewheeldown}", "DecreaseFont")

$line = 1

$FontSize = 12

$Form1 = GUICreate ("Terminal", 499, 294, 201, 116, BitOr($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX))

$fsize = 10

GUISetCursor (7)

$undobutton = GuiCtrlCreateButton("Undo", 0, 0, 24, 24,$BS_BITMAP)

GUICtrlSetImage (-1, "C:\undo.bmp",0)

$CommandInput = GUICtrlCreateEdit ("", 0, 20, 497, 273, BitOR ($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX))

GUICtrlSetData (-1, "shell:")

GUICtrlSetFont (-1, $fsize, 500, 0, "Terminal")

GUICtrlSetColor (-1, 0xFFFFFF)

GUICtrlSetBkColor (-1, 0x000000)

GUISetState()

While 1

$msg = GUIGetMsg ()

Switch $msg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

Select

Case $msg = $undobutton

_GUICtrlEdit_Undo ($CommandInput)

EndSelect

WEnd

Func read_func()

$line = _GUICtrlEdit_GetLineCount ($CommandInput) - 1

$Input = _GUICtrlEdit_GetLine ($CommandInput, $line)

$command = StringTrimLeft ($Input, 6)

$Say = StringInStr ($command, "say")

$Exit = StringInStr ($command, "exit")

$sysinfo = StringInStr ($command, "sys")

$ipconfig = StringInStr ($command, "ipconfig")

$ping = StringInStr ($command, "ping")

$run = StringInStr ($command, "run")

$play = StringInStr ($command, "play")

$kill = StringInStr ($command, "kill")

$delfile = StringInStr ($command, "delfile")

$soundvol = StringInStr ($command, "soundvol")

$diskfree = StringInStr ($command, "diskfree")

$tcmd = StringInStr ($command, "tcmd")

$transparent = StringInStr ($command, "transparent")

$untrans = StringInStr ($command, "untrans")

$aptgetupdate = StringInStr ($command, "aptgetupdate")

$FileCopy= StringInStr ($command, "filecopy")

$dirCopy= StringInStr ($command, "dircopy")

$filemove= StringInStr ($command, "filemove")

$commands= StringInStr ($command, "commands")

$textedit= StringInStr ($command, "textedit")

$attribget= StringInStr ($command, "attribget")

$attribset= StringInStr ($command, "attribset")

$winminimizeall= StringInStr ($command, "winminimizeall")

If $Say Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & $string & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

If $Exit Then

Exit

Else

If $sysinfo Then

sys()

;HERE'S THE FIX========

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 30

HotKeySet ("{enter}", "read_func")

;==========================

Else

If $textedit Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 15)

GuiCtrlSetData($CommandInput,"")

;~ $Handle=FileOpen($string,2)

$Text=FileRead($string)

ClipPut($Text)

Send("^v")

Do

Sleep(1)

Until _IsPressed("71");71 for F2

$nano = GUICtrlRead($commandinput)

FileWrite($string,$nano)

;~ FileWrite($Handle,"the new texti didnt understand u")

;HERE'S THE FIX========

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 30

HotKeySet ("{enter}", "read_func")

;==========================

Else

If $commands Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 15)

GuiCtrlSetData($CommandInput,"")

$Text=FileRead(@ScriptDir & "\help.txt")

ClipPut($Text)

Send("^v")

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 30

HotKeySet ("{enter}", "read_func")

;==========================

Else

If $winminimizeall Then

WinMinimizeAll()

WinWaitActive("Terminal")

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 21)

Send (@CRLF & "all windows minimized" & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

If $attribget Then

$string = StringTrimLeft ($Input, 16)

$fileattrib = FileGetAttrib ($string)

HotKeySet ("{enter}")

ClipPut (@CRLF & "File has following attributes:" & $fileattrib & @CRLF)

Send ("^v{enter}")

HotKeySet ("{enter}", "read_func")

;HERE'S THE FIX========

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 30

HotKeySet ("{enter}", "read_func")

;==========================

Else

If $diskfree Then

df()

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 6

HotKeySet ("{enter}", "read_func")

EndIf

If $kill Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 11)

Send (@CRLF & "Killing " & $string & "...")

$PID = ProcessExists ($string & ".exe")

If $PID Then

ProcessClose ($PID & ".exe")

Send (@CRLF & "Shell:")

$line = $line + 4

Else

Send (@CRLF & "FATAL ERROR: could not find progress" & "..." & @CRLF & "Shell:")

$line = $line + 6

EndIf

HotKeySet ("{enter}", "read_func")

Else

If $tcmd Then

HotKeySet ("{enter}")

WinSetTrans ("Terminal", "", 128)

Send (@CRLF & "Shell:")

$line = $line + 4

HotKeySet ("{enter}", "read_func")

Else

If $transparent Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 18)

Send (@CRLF & "transparent " & $string & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

WinSetTrans ($string, "", 128)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not find external window title" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $untrans Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 14)

Send (@CRLF & "untransparent " & $string & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

WinSetTrans ($string, "", 255)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not find external window title" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $run Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "running " & $string & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Run ($string)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not find external program" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $aptgetupdate Then

Run(@ScriptDir&"\update.exe")

Exit

Else

If $play Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 11)

Send (@CRLF & "running " & $string & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

SoundPlay ($string)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not find external program" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $delfile Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 11)

Send (@CRLF & "Deleting" & $string & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

FileDelete ($string)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not delete file" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $soundvol Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 15)

SoundSetWaveVolume ($string)

Send (@CRLF & "Volume has been set to : " & $string & "%" & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

If $ipconfig Then

HotKeySet ("{enter}")

Send (@CRLF & "Your IP address is :" & @IPAddress1 & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

;~ COPY

If $filecopy Then

$Comm=StringSplit($Input,"+")

MsgBox(0,"",$Comm[0])

If $Comm[0]=3 Then

HotKeySet ("{enter}")

Send (@CRLF & "Copying :" & $Comm[2]&" to: "&$Comm[3] & @CRLF & "shell:")

FileCopy($Comm[2],$Comm[3])

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

HotKeySet ("{enter}")

Send (@CRLF & "Incorrect number of parameters in function call"& @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

;~ COPY#2

Else

If $attribset Then

$Comm=StringSplit($Input,"+")

MsgBox(0,"",$Comm[0])

If $Comm[0]=3 Then

HotKeySet ("{enter}")

Send (@CRLF & "Copying :" & $Comm[2]&" to: "&$Comm[3] & @CRLF & "shell:")

FileSetAttrib($Comm[2],$Comm[3])

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

HotKeySet ("{enter}")

Send (@CRLF & "Incorrect number of parameters in function call"& @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $dircopy Then

$Comm=StringSplit($Input,"+")

MsgBox(0,"",$Comm[0])

If $Comm[0]=3 Then

HotKeySet ("{enter}")

Send (@CRLF & "Copying :" & $Comm[2]&" to: "&$Comm[3] & @CRLF & "shell:")

DirCopy($Comm[2],$Comm[3])

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

HotKeySet ("{enter}")

Send (@CRLF & "Incorrect number of parameters in function call"& @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $filemove Then

$Comm=StringSplit($Input,"+")

MsgBox(0,"",$Comm[0])

If $Comm[0]=3 Then

HotKeySet ("{enter}")

Send (@CRLF & "Copying :" & $Comm[2]&" to: "&$Comm[3] & @CRLF & "shell:")

FileMove($Comm[2],$Comm[3])

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

HotKeySet ("{enter}")

Send (@CRLF & "Incorrect number of parameters in function call"& @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

;~ END COPY

Else

HotKeySet ("{enter}")

Send (@CRLF & "'" & $command & "'" & "is not a valid command" & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndFunc ;==>read_func

Func sys()

HotKeySet ("{enter}")

;~ run("notepad")

$VOL = DriveGetLabel ("C:\")

$SERIAL = DriveGetSerial ("C:\")

$TOTAL = DriveSpaceTotal ("C:\")

$FREE = DriveSpaceFree ("C:\")

$FS = DriveGetFileSystem ("C:\")

;~ WinWaitActive("Untitled - Notepad")

;~ WinSetTitle("Untitled - Notepad","","system")

ClipPut (@CRLF & "monitor:")

Send ("^v{enter}")

ClipPut ("Ekraanilaius: " & @DesktopWidth)

Send ("^v{enter}")

ClipPut ("Ekraanik

Link to comment
Share on other sites

Urgh, any particular reason for this mixed use of switch and select?

While 1
    $msg = GUIGetMsg ()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
    Select
        Case $msg = $undobutton
     _GUICtrlEdit_Undo ($CommandInput)
    EndSelect
WEndoÝ÷ Øb²j+yçßÈÛhºÇ¨ê¶¦'­¨(±é^rܱö¬µêí©ìÂ+»­¶«z¬mç§jZ-¡üµêâØ^ëhÚâ½êìw¶§"ë³­r¬!ø§v+^jÈ®Ú+y§ZºÚ"µÍÚ[HB  ÌÍÛÙÈHÕRQÙ]ÙÈ

BÝÚ]Ú    ÌÍÛÙÂØÙH ÌÍÑÕRWÑUSÐÓÔÑB^]ØÙH  ÌÍÝ[Ø]ÛÑÕRPÝY]Õ[È
    ÌÍÐÛÛ[X[[]
B[ÝÚ]ÚÑ[
Link to comment
Share on other sites

Maybee if you cared to tell us whats wrong with it?:P

No, I have not tried it. Why should I boother when you don't bother to try to explain what you expects it to do. And what it does instead?..;)

EDIT: A small hint provided by the tools that comes with scite4autoit3

ERROR: _GUICtrlEdit_Undo(): undefined function.

+>22:52:52 Starting AutoIt3Wrapper v.1.9.1
>Running AU3Check (1.54.7.0)  from:D:\portableapps\devtools\scite\..\autoit-v3.2.3.0
D:\code\au3\foo.au3(33,36) : ERROR: _GUICtrlEdit_Undo(): undefined function.
            _GUICtrlEdit_Undo ($CommandInput)
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\code\au3\foo.au3(37,50) : ERROR: _GUICtrlEdit_GetLineCount(): undefined function.
    $line = _GUICtrlEdit_GetLineCount ($CommandInput)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\code\au3\foo.au3(38,53) : ERROR: _GUICtrlEdit_GetLine(): undefined function.
    $Input = _GUICtrlEdit_GetLine ($CommandInput, $line)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\code\au3\foo.au3 - 3 error(s), 0 warning(s)
!>22:52:54 AU3Check ended.rc:2
+>22:53:00 AutoIt3Wrapper Finished
Edited by Uten
Link to comment
Share on other sites

I have still problem..

Some days ago i didnt had it but then i reinstalled autoit..now i dont know whats the problem...Bad script or wrong version of autoit

autoit beta 3.2.9.3

Any ideas?

C:\Documents and Settings\rain\Desktop\NUEVOS~3.AU3(36,50) : ERROR: _GUICtrlEdit_GetLineCount(): undefined function.
    $line = _GUICtrlEdit_GetLineCount ($CommandInput)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\rain\Desktop\NUEVOS~3.AU3(37,53) : ERROR: _GUICtrlEdit_GetLine(): undefined function.
    $Input = _GUICtrlEdit_GetLine ($CommandInput, $line)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\rain\Desktop\NUEVOS~3.AU3 - 2 error(s), 0 warning(s)
[autoit]#include <GUIConstants.au3>

#include <GUIEdit.au3>

#include <misc.au3>

#include <GUIConstants.au3>

#include <GUIEdit.au3>

#include <string.au3>

HotKeySet ("{enter}", "read_func")

HotKeySet ("^{NUMPADADD}", "IncreaseFont")

HotKeySet ("^{NUMPADSUB}", "DecreaseFont")

HotKeySet ("{f11}", "fullscreen")

;~ HotKeySet ("^{mousewheelup}", "IncreaseFont")

;~ HotKeySet ("^{Mousewheeldown}", "DecreaseFont")

$line = 1

$FontSize = 12

$Form1 = GUICreate ("Terminal", 499, 294, 201, 116, BitOr($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX))

$fsize = 10

GUISetCursor (7)

$CommandInput = GUICtrlCreateEdit ("", 0, 20, 497, 273, BitOR ($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX))

GUICtrlSetData (-1, "shell:")

GUICtrlSetFont (-1, $fsize, 500, 0, "Terminal")

GUICtrlSetColor (-1, 0xFFFFFF)

GUICtrlSetBkColor (-1, 0x000000)

GUISetState()

While 1

$msg = GUIGetMsg ()

Switch $msg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Func read_func ()

$line = _GUICtrlEdit_GetLineCount ($CommandInput) - 1

$Input = _GUICtrlEdit_GetLine ($CommandInput, $line)

$command = StringTrimLeft ($Input, 6)

$Say = StringInStr ($command, "say")

$Exit = StringInStr ($command, "exit")

$sysinfo = StringInStr ($command, "sys")

$ipconfig = StringInStr ($command, "ipconfig")

$ping = StringInStr ($command, "ping")

$run = StringInStr ($command, "run")

$play = StringInStr ($command, "play")

$kill = StringInStr ($command, "kill")

$delfile = StringInStr ($command, "delfile")

$soundvol = StringInStr ($command, "soundvol")

$diskfree = StringInStr ($command, "diskfree")

$tcmd = StringInStr ($command, "tcmd")

$transparent = StringInStr ($command, "transparent")

$untrans = StringInStr ($command, "untrans")

$aptgetupdate = StringInStr ($command, "aptgetupdate")

$FileCopy= StringInStr ($command, "filecopy")

$dirCopy= StringInStr ($command, "dircopy")

$filemove= StringInStr ($command, "filemove")

$commands= StringInStr ($command, "commands")

$textedit= StringInStr ($command, "textedit")

$attribget= StringInStr ($command, "attribget")

$attribset= StringInStr ($command, "attribset")

$winminimizeall= StringInStr ($command, "winminimizeall")

If $Say Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & $string & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

If $Exit Then

Exit

Else

If $sysinfo Then

sys()

;HERE'S THE FIX========

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 30

HotKeySet ("{enter}", "read_func")

;==========================

Else

If $textedit Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 15)

GuiCtrlSetData($CommandInput,"")

;~ $Handle=FileOpen($string,2)

$Text=FileRead($string)

ClipPut($Text)

Send("^v")

Do

Sleep(1)

Until _IsPressed("71");71 for F2

$nano = GUICtrlRead($commandinput)

FileWrite($string,$nano)

;~ FileWrite($Handle,"the new texti didnt understand u")

;HERE'S THE FIX========

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 30

HotKeySet ("{enter}", "read_func")

;==========================

Else

If $commands Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 15)

GuiCtrlSetData($CommandInput,"")

$Text=FileRead(@ScriptDir & "\help.txt")

ClipPut($Text)

Send("^v")

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 30

HotKeySet ("{enter}", "read_func")

;==========================

Else

If $winminimizeall Then

WinMinimizeAll()

WinWaitActive("Terminal")

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 21)

Send (@CRLF & "all windows minimized" & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

If $attribget Then

$string = StringTrimLeft ($Input, 16)

$fileattrib = FileGetAttrib ($string)

HotKeySet ("{enter}")

ClipPut (@CRLF & "File has following attributes:" & $fileattrib & @CRLF)

Send ("^v{enter}")

HotKeySet ("{enter}", "read_func")

;HERE'S THE FIX========

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 30

HotKeySet ("{enter}", "read_func")

;==========================

Else

If $diskfree Then

df()

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 6

HotKeySet ("{enter}", "read_func")

EndIf

If $kill Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 11)

Send (@CRLF & "Killing " & $string & "...")

$PID = ProcessExists ($string & ".exe")

If $PID Then

ProcessClose ($PID & ".exe")

Send (@CRLF & "Shell:")

$line = $line + 4

Else

Send (@CRLF & "FATAL ERROR: could not find progress" & "..." & @CRLF & "Shell:")

$line = $line + 6

EndIf

HotKeySet ("{enter}", "read_func")

Else

If $tcmd Then

HotKeySet ("{enter}")

WinSetTrans ("Terminal", "", 128)

Send (@CRLF & "Shell:")

$line = $line + 4

HotKeySet ("{enter}", "read_func")

Else

If $transparent Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 18)

Send (@CRLF & "transparent " & $string & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

WinSetTrans ($string, "", 128)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not find external window title" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $untrans Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 14)

Send (@CRLF & "untransparent " & $string & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

WinSetTrans ($string, "", 255)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not find external window title" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $run Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "running " & $string & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Run ($string)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not find external program" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $aptgetupdate Then

Run(@ScriptDir&"\update.exe")

Exit

Else

If $play Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 11)

Send (@CRLF & "running " & $string & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

SoundPlay ($string)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not find external program" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $delfile Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 11)

Send (@CRLF & "Deleting" & $string & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

FileDelete ($string)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not delete file" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $soundvol Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 15)

SoundSetWaveVolume ($string)

Send (@CRLF & "Volume has been set to : " & $string & "%" & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

If $ipconfig Then

HotKeySet ("{enter}")

Send (@CRLF & "Your IP address is :" & @IPAddress1 & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

;~ COPY

If $filecopy Then

$Comm=StringSplit($Input,"+")

MsgBox(0,"",$Comm[0])

If $Comm[0]=3 Then

HotKeySet ("{enter}")

Send (@CRLF & "Copying :" & $Comm[2]&" to: "&$Comm[3] & @CRLF & "shell:")

FileCopy($Comm[2],$Comm[3])

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

HotKeySet ("{enter}")

Send (@CRLF & "Incorrect number of parameters in function call"& @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

;~ COPY#2

Else

If $attribset Then

$Comm=StringSplit($Input,"+")

MsgBox(0,"",$Comm[0])

If $Comm[0]=3 Then

HotKeySet ("{enter}")

Send (@CRLF & "Copying :" & $Comm[2]&" to: "&$Comm[3] & @CRLF & "shell:")

FileSetAttrib($Comm[2],$Comm[3])

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

HotKeySet ("{enter}")

Send (@CRLF & "Incorrect number of parameters in function call"& @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $dircopy Then

$Comm=StringSplit($Input,"+")

MsgBox(0,"",$Comm[0])

If $Comm[0]=3 Then

HotKeySet ("{enter}")

Send (@CRLF & "Copying :" & $Comm[2]&" to: "&$Comm[3] & @CRLF & "shell:")

DirCopy($Comm[2],$Comm[3])

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

HotKeySet ("{enter}")

Send (@CRLF & "Incorrect number of parameters in function call"& @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $filemove Then

$Comm=StringSplit($Input,"+")

MsgBox(0,"",$Comm[0])

If $Comm[0]=3 Then

HotKeySet ("{enter}")

Send (@CRLF & "Copying :" & $Comm[2]&" to: "&$Comm[3] & @CRLF & "shell:")

FileMove($Comm[2],$Comm[3])

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

HotKeySet ("{enter}")

Send (@CRLF & "Incorrect number of parameters in function call"& @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

;~ END COPY

Else

HotKeySet ("{enter}")

Send (@CRLF & "'" & $command & "'" & "is not a valid command" & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndFunc ;==>read_func

Func sys ()

HotKeySet ("{enter}")

;~ run("notepad")

$VOL = DriveGetLabel ("C:\")

$SERIAL = DriveGetSerial ("C:\")

$TOTAL = DriveSpaceTotal ("C:\")

$FREE = DriveSpaceFree ("C:\")

$FS = DriveGetFileSystem ("C:\")

;~ WinWaitActive("Untitled - Notepad")

;~ WinSetTitle("Untitled - Notepad","","system")

ClipPut (@CRLF & "monitor:")

Send ("^v{enter}")

ClipPut ("Ekraanilaius: " & @DesktopWidth)

Send ("^v{enter}")

ClipPut ("Ekraanik

Link to comment
Share on other sites

me here again.. I have problem with this script.. it dont start , start with errors.

Some days ago i didnt had it but then i reinstalled autoit..now i dont know whats the problem...Bad script or wrong version of autoit

autoit beta 3.2.9.3

Any ideas?

Can some one fix the script or say what beta version i should use (link will help also)

C:\Documents and Settings\rain\Desktop\NUEVOS~3.AU3(36,50) : ERROR: _GUICtrlEdit_GetLineCount(): undefined function.
    $line = _GUICtrlEdit_GetLineCount ($CommandInput)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\rain\Desktop\NUEVOS~3.AU3(37,53) : ERROR: _GUICtrlEdit_GetLine(): undefined function.
    $Input = _GUICtrlEdit_GetLine ($CommandInput, $line)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\rain\Desktop\NUEVOS~3.AU3 - 2 error(s), 0 warning(s)

[autoit]#include <GUIConstants.au3>

#include <GUIEdit.au3>

#include <misc.au3>

#include <GUIConstants.au3>

#include <GUIEdit.au3>

#include <string.au3>

HotKeySet ("{enter}", "read_func")

HotKeySet ("^{NUMPADADD}", "IncreaseFont")

HotKeySet ("^{NUMPADSUB}", "DecreaseFont")

HotKeySet ("{f11}", "fullscreen")

;~ HotKeySet ("^{mousewheelup}", "IncreaseFont")

;~ HotKeySet ("^{Mousewheeldown}", "DecreaseFont")

$line = 1

$FontSize = 12

$Form1 = GUICreate ("Terminal", 499, 294, 201, 116, BitOr($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX))

$fsize = 10

GUISetCursor (7)

$CommandInput = GUICtrlCreateEdit ("", 0, 20, 497, 273, BitOR ($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX))

GUICtrlSetData (-1, "shell:")

GUICtrlSetFont (-1, $fsize, 500, 0, "Terminal")

GUICtrlSetColor (-1, 0xFFFFFF)

GUICtrlSetBkColor (-1, 0x000000)

GUISetState()

While 1

$msg = GUIGetMsg ()

Switch $msg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Func read_func ()

$line = _GUICtrlEdit_GetLineCount ($CommandInput) - 1

$Input = _GUICtrlEdit_GetLine ($CommandInput, $line)

$command = StringTrimLeft ($Input, 6)

$Say = StringInStr ($command, "say")

$Exit = StringInStr ($command, "exit")

$sysinfo = StringInStr ($command, "sys")

$ipconfig = StringInStr ($command, "ipconfig")

$ping = StringInStr ($command, "ping")

$run = StringInStr ($command, "run")

$play = StringInStr ($command, "play")

$kill = StringInStr ($command, "kill")

$delfile = StringInStr ($command, "delfile")

$soundvol = StringInStr ($command, "soundvol")

$diskfree = StringInStr ($command, "diskfree")

$tcmd = StringInStr ($command, "tcmd")

$transparent = StringInStr ($command, "transparent")

$untrans = StringInStr ($command, "untrans")

$aptgetupdate = StringInStr ($command, "aptgetupdate")

$FileCopy= StringInStr ($command, "filecopy")

$dirCopy= StringInStr ($command, "dircopy")

$filemove= StringInStr ($command, "filemove")

$commands= StringInStr ($command, "commands")

$textedit= StringInStr ($command, "textedit")

$attribget= StringInStr ($command, "attribget")

$attribset= StringInStr ($command, "attribset")

$winminimizeall= StringInStr ($command, "winminimizeall")

If $Say Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & $string & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

If $Exit Then

Exit

Else

If $sysinfo Then

sys()

;HERE'S THE FIX========

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 30

HotKeySet ("{enter}", "read_func")

;==========================

Else

If $textedit Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 15)

GuiCtrlSetData($CommandInput,"")

;~ $Handle=FileOpen($string,2)

$Text=FileRead($string)

ClipPut($Text)

Send("^v")

Do

Sleep(1)

Until _IsPressed("71");71 for F2

$nano = GUICtrlRead($commandinput)

FileWrite($string,$nano)

;~ FileWrite($Handle,"the new texti didnt understand u")

;HERE'S THE FIX========

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 30

HotKeySet ("{enter}", "read_func")

;==========================

Else

If $commands Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 15)

GuiCtrlSetData($CommandInput,"")

$Text=FileRead(@ScriptDir & "\help.txt")

ClipPut($Text)

Send("^v")

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 30

HotKeySet ("{enter}", "read_func")

;==========================

Else

If $winminimizeall Then

WinMinimizeAll()

WinWaitActive("Terminal")

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 21)

Send (@CRLF & "all windows minimized" & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

If $attribget Then

$string = StringTrimLeft ($Input, 16)

$fileattrib = FileGetAttrib ($string)

HotKeySet ("{enter}")

ClipPut (@CRLF & "File has following attributes:" & $fileattrib & @CRLF)

Send ("^v{enter}")

HotKeySet ("{enter}", "read_func")

;HERE'S THE FIX========

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 30

HotKeySet ("{enter}", "read_func")

;==========================

Else

If $diskfree Then

df()

HotKeySet ("{enter}")

Send (@CRLF & "shell:")

$line = $line + 6

HotKeySet ("{enter}", "read_func")

EndIf

If $kill Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 11)

Send (@CRLF & "Killing " & $string & "...")

$PID = ProcessExists ($string & ".exe")

If $PID Then

ProcessClose ($PID & ".exe")

Send (@CRLF & "Shell:")

$line = $line + 4

Else

Send (@CRLF & "FATAL ERROR: could not find progress" & "..." & @CRLF & "Shell:")

$line = $line + 6

EndIf

HotKeySet ("{enter}", "read_func")

Else

If $tcmd Then

HotKeySet ("{enter}")

WinSetTrans ("Terminal", "", 128)

Send (@CRLF & "Shell:")

$line = $line + 4

HotKeySet ("{enter}", "read_func")

Else

If $transparent Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 18)

Send (@CRLF & "transparent " & $string & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

WinSetTrans ($string, "", 128)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not find external window title" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $untrans Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 14)

Send (@CRLF & "untransparent " & $string & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

WinSetTrans ($string, "", 255)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not find external window title" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $run Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "running " & $string & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Run ($string)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not find external program" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $aptgetupdate Then

Run(@ScriptDir&"\update.exe")

Exit

Else

If $play Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 11)

Send (@CRLF & "running " & $string & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

SoundPlay ($string)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not find external program" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $delfile Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 11)

Send (@CRLF & "Deleting" & $string & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

FileDelete ($string)

If @error Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 10)

Send (@CRLF & "FATAL ERROR: could not delete file" & "..." & @CRLF & "Shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $soundvol Then

HotKeySet ("{enter}")

$string = StringTrimLeft ($Input, 15)

SoundSetWaveVolume ($string)

Send (@CRLF & "Volume has been set to : " & $string & "%" & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

If $ipconfig Then

HotKeySet ("{enter}")

Send (@CRLF & "Your IP address is :" & @IPAddress1 & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

;~ COPY

If $filecopy Then

$Comm=StringSplit($Input,"+")

MsgBox(0,"",$Comm[0])

If $Comm[0]=3 Then

HotKeySet ("{enter}")

Send (@CRLF & "Copying :" & $Comm[2]&" to: "&$Comm[3] & @CRLF & "shell:")

FileCopy($Comm[2],$Comm[3])

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

HotKeySet ("{enter}")

Send (@CRLF & "Incorrect number of parameters in function call"& @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

;~ COPY#2

Else

If $attribset Then

$Comm=StringSplit($Input,"+")

MsgBox(0,"",$Comm[0])

If $Comm[0]=3 Then

HotKeySet ("{enter}")

Send (@CRLF & "Copying :" & $Comm[2]&" to: "&$Comm[3] & @CRLF & "shell:")

FileSetAttrib($Comm[2],$Comm[3])

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

HotKeySet ("{enter}")

Send (@CRLF & "Incorrect number of parameters in function call"& @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $dircopy Then

$Comm=StringSplit($Input,"+")

MsgBox(0,"",$Comm[0])

If $Comm[0]=3 Then

HotKeySet ("{enter}")

Send (@CRLF & "Copying :" & $Comm[2]&" to: "&$Comm[3] & @CRLF & "shell:")

DirCopy($Comm[2],$Comm[3])

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

HotKeySet ("{enter}")

Send (@CRLF & "Incorrect number of parameters in function call"& @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

Else

If $filemove Then

$Comm=StringSplit($Input,"+")

MsgBox(0,"",$Comm[0])

If $Comm[0]=3 Then

HotKeySet ("{enter}")

Send (@CRLF & "Copying :" & $Comm[2]&" to: "&$Comm[3] & @CRLF & "shell:")

FileMove($Comm[2],$Comm[3])

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

Else

HotKeySet ("{enter}")

Send (@CRLF & "Incorrect number of parameters in function call"& @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

;~ END COPY

Else

HotKeySet ("{enter}")

Send (@CRLF & "'" & $command & "'" & "is not a valid command" & @CRLF & "shell:")

$line = $line + 4

Sleep (100)

HotKeySet ("{enter}", "read_func")

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndIf

EndFunc ;==>read_func

Func sys ()

HotKeySet ("{enter}")

;~ run("notepad")

$VOL = DriveGetLabel ("C:\")

$SERIAL = DriveGetSerial ("C:\")

$TOTAL = DriveSpaceTotal ("C:\")

$FREE = DriveSpaceFree ("C:\")

$FS = DriveGetFileSystem ("C:\")

;~ WinWaitActive("Untitled - Notepad")

;~ WinSetTitle("Untitled - Notepad","","system")

ClipPut (@CRLF & "monitor:")

Send ("^v{enter}")

ClipPut ("Ekraanilaius: " & @DesktopWidth)

Send ("^v{enter}")

ClipPut ("Ekraanik

Link to comment
Share on other sites

Ok, I looked here fast. Didn't see much. Moved on.

To the OP: Try to make a clear and concise topic. You've posted about 20 topics on this same script, all of them similar in title to "Need help NAO!!!! GIVE MEEEee!!!!"

I've given you help once, and you decided to ignore it. Well... I've decided to ignore you because ... frankly your code structure looks like a pile of spaghetti.

Restructure your nested if/thens into a select case. That will make it so much easier to read.

And by the way... FASTER.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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